From 4855ed1a22332bec84a967de37b43e40e4e2ed50 Mon Sep 17 00:00:00 2001 From: Javier ORTIZ Date: Fri, 8 Dec 2023 11:24:22 +0100 Subject: [PATCH] Bugfix: Adding `type` request param to Maintenance ListRequest This is needed to align with [API docs](https://docs.opsgenie.com/docs/maintenance-api#list-maintenance) where we are able to list only a type of windows. Signed-off-by: Javier ORTIZ --- maintenance/request.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maintenance/request.go b/maintenance/request.go index 7b14341..293c074 100644 --- a/maintenance/request.go +++ b/maintenance/request.go @@ -157,6 +157,15 @@ func (r *ListRequest) Method() string { return http.MethodGet } +func (r *ListRequest) RequestParams() map[string]string { + if r.Type == "" { + return nil + } + params := make(map[string]string) + params["type"] = string(r.Type) + return params +} + type CancelRequest struct { client.BaseRequest Id string