Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 30b5926

Browse files
Add support for location field to mute timings #176
2 parents 5824b5d + 8254bf6 commit 30b5926

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

alerting_mute_timing.go

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type TimeInterval struct {
1919
DaysOfMonth []DayOfMonthRange `json:"days_of_month,omitempty"`
2020
Months []MonthRange `json:"months,omitempty"`
2121
Years []YearRange `json:"years,omitempty"`
22+
Location Location `json:"location,omitempty"`
2223
}
2324

2425
// TimeRange represents a range of minutes within a 1440 minute day, exclusive of the End minute.
@@ -39,6 +40,9 @@ type MonthRange string
3940
// A YearRange is a positive inclusive range of years, e.g. "2030" or "2021:2022".
4041
type YearRange string
4142

43+
// A Location time zone for the time interval in IANA time zone database, e.g. "America/New_York"
44+
type Location string
45+
4246
// MuteTimings fetches all mute timings.
4347
func (c *Client) MuteTimings() ([]MuteTiming, error) {
4448
mts := make([]MuteTiming, 0)

alerting_mute_timing_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ func createMuteTiming() MuteTiming {
100100
Weekdays: []WeekdayRange{"monday", "wednesday"},
101101
Months: []MonthRange{"1:3", "4"},
102102
Years: []YearRange{"2022", "2023"},
103+
Location: "America/New_York",
103104
},
104105
},
105106
}
@@ -122,7 +123,8 @@ const getMuteTimingsJSON = `
122123
],
123124
"months": [
124125
"1"
125-
]
126+
],
127+
"location": "America/New_York"
126128
}
127129
]
128130
},

0 commit comments

Comments
 (0)