From d115d3928cdba8517bf2a45ac4741060dd24080a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernestas=20=C5=A0ostakas?= Date: Thu, 23 Sep 2021 17:21:31 +0300 Subject: [PATCH 1/2] Add json field incidents_responders to Incident struct --- incident.go | 1 + 1 file changed, 1 insertion(+) diff --git a/incident.go b/incident.go index 78b4043a..05ba87fc 100644 --- a/incident.go +++ b/incident.go @@ -89,6 +89,7 @@ type Incident struct { Body IncidentBody `json:"body,omitempty"` IsMergeable bool `json:"is_mergeable,omitempty"` ConferenceBridge *ConferenceBridge `json:"conference_bridge,omitempty"` + IncidentResponders []IncidentResponders `json:"incidents_responders,omitempty"` } // ListIncidentsResponse is the response structure when calling the ListIncident API endpoint. From fab90ea29503ecbe72c1ebbfc4ee5b98525f528e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernestas=20=C5=A0ostakas?= Date: Tue, 28 Sep 2021 17:59:17 +0300 Subject: [PATCH 2/2] Ensure incidents_responders field is being passed within the request body in TestIncident_Get --- incident_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incident_test.go b/incident_test.go index 75294450..8c699da8 100644 --- a/incident_test.go +++ b/incident_test.go @@ -237,7 +237,7 @@ func TestIncident_Get(t *testing.T) { mux.HandleFunc("/incidents/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - _, _ = w.Write([]byte(`{"incident": {"id": "1"}}`)) + _, _ = w.Write([]byte(`{"incident": {"id": "1", "incidents_responders": [{"incident": {"id": "1"}}]}}`)) }) client := defaultTestClient(server.URL, "foo") @@ -245,7 +245,7 @@ func TestIncident_Get(t *testing.T) { id := "1" res, err := client.GetIncident(id) - want := &Incident{Id: "1"} + want := &Incident{Id: "1", IncidentResponders: []IncidentResponders{{Incident: APIObject{ID: "1"}}}} if err != nil { t.Fatal(err)