From 74372b8ba1303eeb259799b3d080c0329fb34253 Mon Sep 17 00:00:00 2001 From: Salim Afiune Maya Date: Mon, 11 Oct 2021 21:26:34 +0200 Subject: [PATCH] refactor(cli): create Microsoft Teams alert channels via APIv2 Signed-off-by: Salim Afiune Maya --- cli/cmd/integration_microsoft_teams.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/cmd/integration_microsoft_teams.go b/cli/cmd/integration_microsoft_teams.go index 84d0450f7..ca3b6507a 100644 --- a/cli/cmd/integration_microsoft_teams.go +++ b/cli/cmd/integration_microsoft_teams.go @@ -50,14 +50,15 @@ func createMicrosoftTeamsChannelIntegration() error { return err } - teams := api.NewMicrosoftTeamsAlertChannel(answers.Name, - api.MicrosoftTeamsChannelData{ - WebhookURL: answers.WebhookUrl, + teams := api.NewAlertChannel(answers.Name, + api.MicrosoftTeamsAlertChannelType, + api.MicrosoftTeamsData{ + TeamsUrl: answers.WebhookUrl, }, ) cli.StartProgress(" Creating integration...") - _, err = cli.LwApi.Integrations.CreateMicrosoftTeamsAlertChannel(teams) + _, err = cli.LwApi.V2.AlertChannels.Create(teams) cli.StopProgress() return err }