diff --git a/alerting_mute_timing.go b/alerting_mute_timing.go index b6d79bb6..80f813da 100644 --- a/alerting_mute_timing.go +++ b/alerting_mute_timing.go @@ -19,6 +19,7 @@ type TimeInterval struct { DaysOfMonth []DayOfMonthRange `json:"days_of_month,omitempty"` Months []MonthRange `json:"months,omitempty"` Years []YearRange `json:"years,omitempty"` + Location Location `json:"location,omitempty"` } // TimeRange represents a range of minutes within a 1440 minute day, exclusive of the End minute. @@ -39,6 +40,9 @@ type MonthRange string // A YearRange is a positive inclusive range of years, e.g. "2030" or "2021:2022". type YearRange string +// A Location time zone for the time interval in IANA time zone database, e.g. "America/New_York" +type Location string + // MuteTimings fetches all mute timings. func (c *Client) MuteTimings() ([]MuteTiming, error) { mts := make([]MuteTiming, 0) diff --git a/alerting_mute_timing_test.go b/alerting_mute_timing_test.go index b3b7111c..758b9a95 100644 --- a/alerting_mute_timing_test.go +++ b/alerting_mute_timing_test.go @@ -100,6 +100,7 @@ func createMuteTiming() MuteTiming { Weekdays: []WeekdayRange{"monday", "wednesday"}, Months: []MonthRange{"1:3", "4"}, Years: []YearRange{"2022", "2023"}, + Location: "America/New_York", }, }, } @@ -122,7 +123,8 @@ const getMuteTimingsJSON = ` ], "months": [ "1" - ] + ], + "location": "America/New_York" } ] },