Skip to content

Commit

Permalink
style: rename TeamsUrl in favor of TeamsURL
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Oct 11, 2021
1 parent 74372b8 commit bd46e0d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/_examples/microsoft-teams-alert-channel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
myTeamsChannel := api.NewAlertChannel("microsoft-teams-alert-from-golang",
api.MicrosoftTeamsAlertChannelType,
api.MicrosoftTeamsData{
TeamsUrl: "https://outlook.office.com/webhook/api-token",
TeamsURL: "https://outlook.office.com/webhook/api-token",
},
)

Expand Down
2 changes: 1 addition & 1 deletion api/alert_channels_microsoft_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (svc *AlertChannelsService) UpdateMicrosoftTeams(data AlertChannel) (respon
}

type MicrosoftTeamsData struct {
TeamsUrl string `json:"teamsUrl"`
TeamsURL string `json:"teamsUrl"`
}

type MicrosoftTeamsAlertChannelV2 struct {
Expand Down
6 changes: 3 additions & 3 deletions api/alert_channels_microsoft_teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestAlertChannelsGetMicrosoftTeams(t *testing.T) {
assert.Equal(t, intgGUID, response.Data.IntgGuid)
assert.Equal(t, "integration_name", response.Data.Name)
assert.True(t, response.Data.State.Ok)
assert.Contains(t, response.Data.Data.TeamsUrl, "https://example.webhook.office.com/webwook123/abc")
assert.Contains(t, response.Data.Data.TeamsURL, "https://example.webhook.office.com/webwook123/abc")
}

func TestAlertChannelsMicrosoftTeamsUpdate(t *testing.T) {
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestAlertChannelsMicrosoftTeamsUpdate(t *testing.T) {
emailAlertChan := api.NewAlertChannel("integration_name",
api.MicrosoftTeamsAlertChannelType,
api.MicrosoftTeamsData{
TeamsUrl: "https://example.webhook.office.com/webwook123/abc",
TeamsURL: "https://example.webhook.office.com/webwook123/abc",
},
)
assert.Equal(t, "integration_name", emailAlertChan.Name, "MicrosoftTeams cloud account name mismatch")
Expand All @@ -109,7 +109,7 @@ func TestAlertChannelsMicrosoftTeamsUpdate(t *testing.T) {
assert.NotNil(t, response)
assert.Equal(t, intgGUID, response.Data.IntgGuid)
assert.True(t, response.Data.State.Ok)
assert.Contains(t, response.Data.Data.TeamsUrl, "https://example.webhook.office.com/webwook123/abc")
assert.Contains(t, response.Data.Data.TeamsURL, "https://example.webhook.office.com/webwook123/abc")
}

func singleMicrosoftTeamsAlertChannel(id string) string {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/integration_microsoft_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func createMicrosoftTeamsChannelIntegration() error {
teams := api.NewAlertChannel(answers.Name,
api.MicrosoftTeamsAlertChannelType,
api.MicrosoftTeamsData{
TeamsUrl: answers.WebhookUrl,
TeamsURL: answers.WebhookUrl,
},
)

Expand Down

0 comments on commit bd46e0d

Please sign in to comment.