@@ -154,26 +154,26 @@ const (
154154// NewAlertRule returns an instance of the AlertRule struct
155155//
156156// Basic usage: Initialize a new AlertRule struct, then
157- // use the new instance to do CRUD operations
158157//
159- // client, err := api.NewClient("account")
160- // if err != nil {
161- // return err
162- // }
158+ // use the new instance to do CRUD operations
163159//
164- // alertRule := api.NewAlertRule(
165- // "Foo",
166- // api.AlertRuleConfig{
167- // Description: "My Alert Rule"
168- // Severities: api.AlertRuleSeverities{api.AlertRuleSeverityHigh,
169- // Channels: []string{"TECHALLY_000000000000AAAAAAAAAAAAAAAAAAAA"},
170- // ResourceGroups: []string{"TECHALLY_111111111111AAAAAAAAAAAAAAAAAAAA"}
171- // },
172- // },
173- // )
160+ // client, err := api.NewClient("account")
161+ // if err != nil {
162+ // return err
163+ // }
174164//
175- // client.V2.AlertRules.Create(alertRule)
165+ // alertRule := api.NewAlertRule(
166+ // "Foo",
167+ // api.AlertRuleConfig{
168+ // Description: "My Alert Rule"
169+ // Severities: api.AlertRuleSeverities{api.AlertRuleSeverityHigh,
170+ // Channels: []string{"TECHALLY_000000000000AAAAAAAAAAAAAAAAAAAA"},
171+ // ResourceGroups: []string{"TECHALLY_111111111111AAAAAAAAAAAAAAAAAAAA"}
172+ // },
173+ // },
174+ // )
176175//
176+ // client.V2.AlertRules.Create(alertRule)
177177func NewAlertRule (name string , rule AlertRuleConfig ) AlertRule {
178178 return AlertRule {
179179 Channels : rule .Channels ,
@@ -272,10 +272,10 @@ type AlertRuleFilter struct {
272272 Enabled int `json:"enabled"`
273273 Description string `json:"description,omitempty"`
274274 Severity []int `json:"severity"`
275- ResourceGroups []string `json:"resourceGroups,omitempty "`
276- EventCategories []string `json:"eventCategory,omitempty "`
275+ ResourceGroups []string `json:"resourceGroups"`
276+ EventCategories []string `json:"eventCategory"`
277277 Sources []string `json:"sources,omitempty"`
278- AlertCategories []string `json:"category,omitempty "`
278+ AlertCategories []string `json:"category"`
279279 CreatedOrUpdatedTime string `json:"createdOrUpdatedTime,omitempty"`
280280 CreatedOrUpdatedBy string `json:"createdOrUpdatedBy,omitempty"`
281281}
0 commit comments