Repository: PagerDuty/go-pagerduty
Pull request #414 (2022-01-16 07:00:28)

Second batch of fixes for API incompatibilities
Updates #389


Patch:
diff --git a/extension.go b/extension.go
index 692145b..94c516b 100644
--- a/extension.go
+++ b/extension.go
@@ -12,11 +12,12 @@ import (
 // features to be used as part of the incident management process.
 type Extension struct {
 	APIObject
-	Name             string      `json:"name"`
-	EndpointURL      string      `json:"endpoint_url,omitempty"`
-	ExtensionObjects []APIObject `json:"extension_objects"`
-	ExtensionSchema  APIObject   `json:"extension_schema"`
-	Config           interface{} `json:"config"`
+	Name                string      `json:"name"`
+	EndpointURL         string      `json:"endpoint_url,omitempty"`
+	ExtensionObjects    []APIObject `json:"extension_objects"`
+	ExtensionSchema     APIObject   `json:"extension_schema"`
+	Config              interface{} `json:"config"`
+	TemporarilyDisabled bool        `json:"temporarily_disabled,omitempty"`
 }
 
 // ListExtensionResponse represents the single response from the PagerDuty API
diff --git a/incident.go b/incident.go
index 1431a6b..c8ad47d 100644
--- a/incident.go
+++ b/incident.go
@@ -99,6 +99,7 @@ type Incident struct {
 	AssignedVia          string               `json:"assigned_via,omitempty"`
 	Occurrence           *Occurrence          `json:"occurrence,omitempty"`
 	IncidentResponders   []IncidentResponders `json:"incidents_responders,omitempty"`
+	ResponderRequests    []ResponderRequest   `json:"responder_requests,omitempty"`
 }
 
 // ListIncidentsResponse is the response structure when calling the ListIncident API endpoint.
@@ -659,26 +660,21 @@ type ResponderRequestTarget struct {
 	Responders IncidentResponders `json:"incident_responders"`
 }
 
-// ResponderRequestTargets is a wrapper for a ResponderRequestTarget.
-type ResponderRequestTargets struct {
-	Target ResponderRequestTarget `json:"responder_request_target"`
-}
-
 // ResponderRequestOptions defines the input options for the Create Responder function.
 type ResponderRequestOptions struct {
-	From        string                    `json:"-"`
-	Message     string                    `json:"message"`
-	RequesterID string                    `json:"requester_id"`
-	Targets     []ResponderRequestTargets `json:"responder_request_targets"`
+	From        string                   `json:"-"`
+	Message     string                   `json:"message"`
+	RequesterID string                   `json:"requester_id"`
+	Targets     []ResponderRequestTarget `json:"responder_request_targets"`
 }
 
 // ResponderRequest contains the API structure for an incident responder request.
 type ResponderRequest struct {
-	Incident    Incident                  `json:"incident"`
-	Requester   User                      `json:"requester,omitempty"`
-	RequestedAt string                    `json:"request_at,omitempty"`
-	Message     string                    `json:"message,omitempty"`
-	Targets     []ResponderRequestTargets `json:"responder_request_targets"`
+	Incident    Incident                 `json:"incident"`
+	Requester   User                     `json:"requester,omitempty"`
+	RequestedAt string                   `json:"request_at,omitempty"`
+	Message     string                   `json:"message,omitempty"`
+	Targets     []ResponderRequestTarget `json:"responder_request_targets"`
 }
 
 // ResponderRequest will submit a request to have a responder join an incident.
diff --git a/log_entry.go b/log_entry.go
index ab26fb8..712ebe4 100644
--- a/log_entry.go
+++ b/log_entry.go
@@ -79,6 +79,7 @@ type ListLogEntriesOptions struct {
 	Until      string   `url:"until,omitempty"`
 	IsOverview bool     `url:"is_overview,omitempty"`
 	Includes   []string `url:"include,omitempty,brackets"`
+	TeamIDs    []string `url:"team_ids,omitempty,brackets"`
 }
 
 // ListLogEntries lists all of the incident log entries across the entire
diff --git a/maintenance_window.go b/maintenance_window.go
index d7cc3b4..48b1a9b 100644
--- a/maintenance_window.go
+++ b/maintenance_window.go
@@ -11,13 +11,13 @@ import (
 // MaintenanceWindow is used to temporarily disable one or more services for a set period of time.
 type MaintenanceWindow struct {
 	APIObject
-	SequenceNumber uint            `json:"sequence_number,omitempty"`
-	StartTime      string          `json:"start_time"`
-	EndTime        string          `json:"end_time"`
-	Description    string          `json:"description"`
-	Services       []APIObject     `json:"services"`
-	Teams          []APIListObject `json:"teams"`
-	CreatedBy      APIListObject   `json:"created_by"`
+	SequenceNumber uint        `json:"sequence_number,omitempty"`
+	StartTime      string      `json:"start_time"`
+	EndTime        string      `json:"end_time"`
+	Description    string      `json:"description"`
+	Services       []APIObject `json:"services"`
+	Teams          []APIObject `json:"teams,omitempty"`
+	CreatedBy      *APIObject  `json:"created_by,omitempty"`
 }
 
 // ListMaintenanceWindowsResponse is the data structur returned from calling the ListMaintenanceWindows API endpoint.
diff --git a/notification.go b/notification.go
index 2a79429..431c237 100644
--- a/notification.go
+++ b/notification.go
@@ -8,11 +8,13 @@ import (
 
 // Notification is a message containing the details of the incident.
 type Notification struct {
-	ID        string `json:"id"`
-	Type      string
-	StartedAt string `json:"started_at"`
-	Address   string
-	User      APIObject
+	ID                string    `json:"id"`
+	Type              string    `json:"type"`
+	StartedAt         string    `json:"started_at"`
+	Address           string    `json:"address"`
+	User              APIObject `json:"user"`
+	ConferenceAddress string    `json:"conferenceAddress"`
+	Status            string    `json:"status"`
 }
 
 // ListNotificationOptions is the data structure used when calling the ListNotifications API endpoint.
diff --git a/ruleset.go b/ruleset.go
index 3cc118a..58e7a8a 100644
--- a/ruleset.go
+++ b/ruleset.go
@@ -11,16 +11,20 @@ type Ruleset struct {
 	ID          string         `json:"id,omitempty"`
 	Name        string         `json:"name,omitempty"`
 	Type        string         `json:"type,omitempty"`
+	Self        string         `json:"self,omitempty"`
 	RoutingKeys []string       `json:"routing_keys,omitempty"`
-	Team        *RulesetObject `json:"team,omitempty"`
-	Updater     *RulesetObject `json:"updater,omitempty"`
+	CreatedAt   string         `json:"created_at"`
 	Creator     *RulesetObject `json:"creator,omitempty"`
+	UpdatedAt   string         `json:"updated_at"`
+	Updater     *RulesetObject `json:"updater,omitempty"`
+	Team        *RulesetObject `json:"team,omitempty"`
 }
 
 // RulesetObject represents a generic object that is common within a ruleset object
 type RulesetObject struct {
-	Type string `json:"type,omitempty"`
 	ID   string `json:"id,omitempty"`
+	Type string `json:"type,omitempty"`
+	Self string `json:"self,omitempty"`
 }
 
 // RulesetPayload represents payload with a ruleset object
@@ -40,12 +44,12 @@ type ListRulesetsResponse struct {
 // RulesetRule represents a Ruleset rule
 type RulesetRule struct {
 	ID         string          `json:"id,omitempty"`
+	Self       string          `json:"self,omitempty"`
 	Position   *int            `json:"position,omitempty"`
 	Disabled   bool            `json:"disabled,omitempty"`
 	Conditions *RuleConditions `json:"conditions,omitempty"`
 	Actions    *RuleActions    `json:"actions,omitempty"`
 	Ruleset    *APIObject      `json:"ruleset,omitempty"`
-	Self       string          `json:"self,omitempty"`
 	CatchAll   bool            `json:"catch_all,omitempty"`
 	TimeFrame  *RuleTimeFrame  `json:"time_frame,omitempty"`
 }
@@ -81,16 +85,29 @@ type RuleTimeFrame struct {
 
 // ScheduledWeekly represents a time_frame object for scheduling rules weekly
 type ScheduledWeekly struct {
-	Weekdays  []int  `json:"weekdays,omitempty"`
-	Timezone  string `json:"timezone,omitempty"`
-	StartTime int    `json:"start_time,omitempty"`
-	Duration  int    `json:"duration,omitempty"`
+	// Weekdays is a 0 indexed slice of days, where 0 is Sunday and 6 is
+	// Saturday, when the window is scheduled for.
+	Weekdays []int `json:"weekdays,omitempty"`
+
+	Timezone string `json:"timezone,omitempty"`
+
+	// StartTime is the number of milliseconds into the day at which the window
+	// starts.
+	StartTime int `json:"start_time,omitempty"`
+
+	// Duration is the window duration in milliseconds.
+	Duration int `json:"duration,omitempty"`
 }
 
 // ActiveBetween represents an active_between object for setting a timeline for rules
 type ActiveBetween struct {
+	// StartTime is in the number of milliseconds into the day at which the
+	// window starts.
 	StartTime int `json:"start_time,omitempty"`
-	EndTime   int `json:"end_time,omitempty"`
+
+	// EndTime is the number of milliseconds into the day at which the window
+	// ends.
+	EndTime int `json:"end_time,omitempty"`
 }
 
 // ListRulesetRulesResponse represents a list of rules in a ruleset
@@ -129,7 +146,8 @@ type RuleActionSuppress struct {
 
 // RuleActionSuspend represents a rule suspend action object
 type RuleActionSuspend struct {
-	Value *bool `json:"value,omitempty"`
+	// Value specifies for how long to suspend the alert in seconds.
+	Value int `json:"value,omitempty"`
 }
 
 // RuleActionExtraction represents a rule extraction action object
diff --git a/schedule.go b/schedule.go
index 87d1878..e18b963 100644
--- a/schedule.go
+++ b/schedule.go
@@ -45,7 +45,7 @@ type Schedule struct {
 	Description         string          `json:"description,omitempty"`
 	EscalationPolicies  []APIObject     `json:"escalation_policies,omitempty"`
 	Users               []APIObject     `json:"users,omitempty"`
-	Teams               []APIReference  `json:"teams,omitempty"`
+	Teams               []APIObject     `json:"teams,omitempty"`
 	ScheduleLayers      []ScheduleLayer `json:"schedule_layers,omitempty"`
 	OverrideSubschedule ScheduleLayer   `json:"override_subschedule,omitempty"`
 	FinalSchedule       ScheduleLayer   `json:"final_schedule,omitempty"`
@@ -72,7 +72,8 @@ type ListSchedulesOptions struct {
 	// total count of items in the collection.
 	Total bool `url:"total,omitempty"`
 
-	Query string `url:"query,omitempty"`
+	Query    string   `url:"query,omitempty"`
+	Includes []string `url:"include,omitempty,brackets"`
 }
 
 // ListSchedulesResponse is the data structure returned from calling the ListSchedules API endpoint.
@@ -146,7 +147,9 @@ func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error {
 }
 
 // PreviewScheduleWithContext previews what an on-call schedule would look like
-// without saving it.
+// without saving it. Nothing is returned from this method, because the API
+// should return the Schedule as we posted it. If this method call returns no
+// error, the schedule should be valid and can be updated.
 func (c *Client) PreviewScheduleWithContext(ctx context.Context, s Schedule, o PreviewScheduleOptions) error {
 	v, err := query.Values(o)
 	if err != nil {
@@ -238,10 +241,14 @@ type ListOverridesResponse struct {
 
 // Override are any schedule layers from the override layer.
 type Override struct {
-	ID    string    `json:"id,omitempty"`
-	Start string    `json:"start,omitempty"`
-	End   string    `json:"end,omitempty"`
-	User  APIObject `json:"user,omitempty"`
+	ID      string    `json:"id,omitempty"`
+	Type    string    `json:"type,omitempty"`
+	Summary string    `json:"summary,omitempty"`
+	Self    string    `json:"self,omitempty"`
+	HTMLURL string    `json:"html_url,omitempty"`
+	Start   string    `json:"start,omitempty"`
+	End     string    `json:"end,omitempty"`
+	User    APIObject `json:"user,omitempty"`
 }
 
 // ListOverrides lists overrides for a given time range.
diff --git a/service.go b/service.go
index f231bea..e9c1685 100644
--- a/service.go
+++ b/service.go
@@ -96,6 +96,7 @@ type Service struct {
 	AlertGroupingTimeout    *uint                    `json:"alert_grouping_timeout,omitempty"`
 	AlertGroupingParameters *AlertGroupingParameters `json:"alert_grouping_parameters,omitempty"`
 	ResponsePlay            *APIObject               `json:"response_play,omitempty"`
+	Addons                  []Addon                  `json:"addons,omitempty"`
 }
 
 // AlertGroupingParameters defines how alerts on the servicewill be automatically grouped into incidents
diff --git a/tag.go b/tag.go
index df5ac25..f2d5138 100644
--- a/tag.go
+++ b/tag.go
@@ -151,8 +151,9 @@ func (c *Client) AssignTags(e, eid string, a *TagAssignments) error {
 }
 
 // AssignTagsWithContext adds and removes tag assignments with entities.
-func (c *Client) AssignTagsWithContext(ctx context.Context, e, eid string, a *TagAssignments) error {
-	_, err := c.post(ctx, "/"+e+"/"+eid+"/change_tags", a, nil)
+// Permitted entity types are users, teams, and escalation_policies.
+func (c *Client) AssignTagsWithContext(ctx context.Context, entityType, entityID string, a *TagAssignments) error {
+	_, err := c.post(ctx, "/"+entityType+"/"+entityID+"/change_tags", a, nil)
 	if err != nil {
 		return err
 	}
@@ -178,7 +179,7 @@ func (c *Client) GetUsersByTag(tid string) (*ListUserResponse, error) {
 // GetUsersByTagPaginated gets related user references based on the tag. To get the
 // full info of the user, you will need to iterate over the returned slice
 // and get that user's details.
-func (c *Client) GetUsersByTagPaginated(ctx context.Context, tid string) ([]*APIObject, error) {
+func (c *Client) GetUsersByTagPaginated(ctx context.Context, tagID string) ([]*APIObject, error) {
 	var users []*APIObject
 
 	// Create a handler closure capable of parsing data from the business_services endpoint
@@ -201,7 +202,7 @@ func (c *Client) GetUsersByTagPaginated(ctx context.Context, tid string) ([]*API
 	}
 
 	// Make call to get all pages associated with the base endpoint.
-	if err := c.pagedGet(ctx, "/tags/"+tid+"/users/", responseHandler); err != nil {
+	if err := c.pagedGet(ctx, "/tags/"+tagID+"/users/", responseHandler); err != nil {
 		return nil, err
 	}
 
@@ -226,7 +227,7 @@ func (c *Client) GetTeamsByTag(tid string) (*ListTeamsForTagResponse, error) {
 // GetTeamsByTagPaginated gets related teams based on the tag. To get the full
 // info of the team, you will need to iterate over the returend slice and get
 // that team's details.
-func (c *Client) GetTeamsByTagPaginated(ctx context.Context, tid string) ([]*APIObject, error) {
+func (c *Client) GetTeamsByTagPaginated(ctx context.Context, tagID string) ([]*APIObject, error) {
 	var teams []*APIObject
 
 	// Create a handler closure capable of parsing data from the business_services endpoint
@@ -249,7 +250,7 @@ func (c *Client) GetTeamsByTagPaginated(ctx context.Context, tid string) ([]*API
 	}
 
 	// Make call to get all pages associated with the base endpoint.
-	if err := c.pagedGet(ctx, "/tags/"+tid+"/teams/", responseHandler); err != nil {
+	if err := c.pagedGet(ctx, "/tags/"+tagID+"/teams/", responseHandler); err != nil {
 		return nil, err
 	}
 
@@ -275,7 +276,7 @@ func (c *Client) GetEscalationPoliciesByTag(tid string) (*ListEPResponse, error)
 // GetEscalationPoliciesByTagPaginated gets related escalation policies based on
 // the tag. To get the full info of the EP, you will need to iterate over the
 // returend slice and get that policy's details.
-func (c *Client) GetEscalationPoliciesByTagPaginated(ctx context.Context, tid string) ([]*APIObject, error) {
+func (c *Client) GetEscalationPoliciesByTagPaginated(ctx context.Context, tagID string) ([]*APIObject, error) {
 	var eps []*APIObject
 
 	// Create a handler closure capable of parsing data from the business_services endpoint
@@ -298,7 +299,7 @@ func (c *Client) GetEscalationPoliciesByTagPaginated(ctx context.Context, tid st
 	}
 
 	// Make call to get all pages associated with the base endpoint.
-	if err := c.pagedGet(ctx, "/tags/"+tid+"/escalation_policies/", responseHandler); err != nil {
+	if err := c.pagedGet(ctx, "/tags/"+tagID+"/escalation_policies/", responseHandler); err != nil {
 		return nil, err
 	}
 
diff --git a/team.go b/team.go
index 1f36a4f..852ac6c 100644
--- a/team.go
+++ b/team.go
@@ -11,8 +11,9 @@ import (
 // Team is a collection of users and escalation policies that represent a group of people within an organization.
 type Team struct {
 	APIObject
-	Name        string `json:"name,omitempty"`
-	Description string `json:"description,omitempty"`
+	Name        string     `json:"name,omitempty"`
+	Description string     `json:"description,omitempty"`
+	Parent      *APIObject `json:"parent,omitempty"`
 }
 
 // ListTeamResponse is the structure used when calling the ListTeams API endpoint.
@@ -231,14 +232,12 @@ func getTeamFromResponse(c *Client, resp *http.Response, err error) (*Team, erro
 
 // Member is a team member.
 type Member struct {
-	APIObject struct {
-		APIObject
-	} `json:"user"`
-	Role string `json:"role"`
+	User APIObject `json:"user"`
+	Role string    `json:"role"`
 }
 
-// ListMembersOptions are the optional parameters for a members request.
-type ListMembersOptions struct {
+// ListTeamMembersOptions are the optional parameters for a members request.
+type ListTeamMembersOptions struct {
 	// Limit is the pagination parameter that limits the number of results per
 	// page. PagerDuty defaults this value to 25 if omitted, and sets an upper
 	// bound of 100.
@@ -259,21 +258,40 @@ type ListMembersOptions struct {
 	Total bool `url:"total,omitempty"`
 }
 
-// ListMembersResponse is the response from the members endpoint.
-type ListMembersResponse struct {
+// ListMembersOptions is the original type name and is retained as an alias for
+// API compatibility.
+//
+// Deprecated: Use type ListTeamMembersOptions instead; will be removed in V2
+type ListMembersOptions = ListTeamMembersOptions
+
+// ListTeamMembersResponse is the response from the members endpoint.
+type ListTeamMembersResponse struct {
 	APIListObject
 	Members []Member `json:"members"`
 }
 
-// ListMembers gets the first page of users associated with the specified team.
+// ListMembersResponse is the original type name and is retained as an alias for
+// API compatibility.
+//
+// Deprecated: Use type ListTeamMembersResponse instead; will be removed in V2
+type ListMembersResponse = ListTeamMembersResponse
+
+// ListMembers gets a page of users associated with the specified team.
 //
-// Deprecated: Use ListMembersWithContext instead.
-func (c *Client) ListMembers(teamID string, o ListMembersOptions) (*ListMembersResponse, error) {
-	return c.ListMembersWithContext(context.Background(), teamID, o)
+// Deprecated: Use ListTeamMembers instead.
+func (c *Client) ListMembers(teamID string, o ListTeamMembersOptions) (*ListTeamMembersResponse, error) {
+	return c.ListTeamMembers(context.Background(), teamID, o)
 }
 
-// ListMembersWithContext gets the first page of users associated with the specified team.
-func (c *Client) ListMembersWithContext(ctx context.Context, teamID string, o ListMembersOptions) (*ListMembersResponse, error) {
+// ListMembersWithContext gets a page of users associated with the specified team.
+//
+// Deprecated: Use ListTeamMembers instead.
+func (c *Client) ListMembersWithContext(ctx context.Context, teamID string, o ListTeamMembersOptions) (*ListTeamMembersResponse, error) {
+	return c.ListTeamMembers(ctx, teamID, o)
+}
+
+// ListTeamMembers gets a page of users associated with the specified team.
+func (c *Client) ListTeamMembers(ctx context.Context, teamID string, o ListTeamMembersOptions) (*ListTeamMembersResponse, error) {
 	v, err := query.Values(o)
 	if err != nil {
 		return nil, err
@@ -284,7 +302,7 @@ func (c *Client) ListMembersWithContext(ctx context.Context, teamID string, o Li
 		return nil, err
 	}
 
-	var result ListMembersResponse
+	var result ListTeamMembersResponse
 	if err = c.decodeJSON(resp, &result); err != nil {
 		return nil, err
 	}
@@ -292,20 +310,28 @@ func (c *Client) ListMembersWithContext(ctx context.Context, teamID string, o Li
 	return &result, nil
 }
 
-// ListAllMembers gets all members associated with the specified team. It's
-// recommended to use ListMembersPaginated instead.
+// ListAllMembers gets all members associated with the specified team.
+//
+// Deprecated: Use ListTeamMembersPaginated instead.
 func (c *Client) ListAllMembers(teamID string) ([]Member, error) {
-	return c.ListMembersPaginated(context.Background(), teamID)
+	return c.ListTeamMembersPaginated(context.Background(), teamID)
 }
 
 // ListMembersPaginated gets all members associated with the specified team.
+//
+// Deprecated: Use ListTeamMembersPaginated instead.
 func (c *Client) ListMembersPaginated(ctx context.Context, teamID string) ([]Member, error) {
+	return c.ListTeamMembersPaginated(ctx, teamID)
+}
+
+// ListTeamMembersPaginated gets all members associated with the specified team.
+func (c *Client) ListTeamMembersPaginated(ctx context.Context, teamID string) ([]Member, error) {
 	var members []Member
 
 	// Create a handler closure capable of parsing data from the members endpoint
 	// and appending resultant members to the return slice.
 	responseHandler := func(response *http.Response) (APIListObject, error) {
-		var result ListMembersResponse
+		var result ListTeamMembersResponse
 		if err := c.decodeJSON(response, &result); err != nil {
 			return APIListObject{}, err
 		}
diff --git a/user.go b/user.go
index dfc18a5..72ea490 100644
--- a/user.go
+++ b/user.go
@@ -10,19 +10,21 @@ import (
 
 // NotificationRule is a rule for notifying the user.
 type NotificationRule struct {
-	ID                  string        `json:"id"`
+	ID                  string        `json:"id,omitempty"`
+	Type                string        `json:"type,omitempty"`
+	Summary             string        `json:"summary,omitempty"`
+	Self                string        `json:"self,omitempty"`
+	HTMLURL             string        `json:"html_url,omitempty"`
 	StartDelayInMinutes uint          `json:"start_delay_in_minutes"`
 	CreatedAt           string        `json:"created_at"`
 	ContactMethod       ContactMethod `json:"contact_method"`
 	Urgency             string        `json:"urgency"`
-	Type                string        `json:"type"`
 }
 
 // User is a member of a PagerDuty account that has the ability to interact with incidents and other data on the account.
 type User struct {
 	APIObject
 	Name              string             `json:"name"`
-	Summary           string             `json:"summary"`
 	Email             string             `json:"email"`
 	Timezone          string             `json:"time_zone,omitempty"`
 	Color             string             `json:"color,omitempty"`
@@ -38,10 +40,11 @@ type User struct {
 
 // ContactMethod is a way of contacting the user.
 type ContactMethod struct {
-	ID             string `json:"id"`
-	Type           string `json:"type"`
-	Summary        string `json:"summary"`
-	Self           string `json:"self"`
+	ID             string `json:"id,omitempty"`
+	Type           string `json:"type,omitempty"`
+	Summary        string `json:"summary,omitempty"`
+	Self           string `json:"self,omitempty"`
+	HTMLURL        string `json:"html_url,omitempty"`
 	Label          string `json:"label"`
 	Address        string `json:"address"`
 	SendShortEmail bool   `json:"send_short_email,omitempty"`
@@ -49,7 +52,6 @@ type ContactMethod struct {
 	Blacklisted    bool   `json:"blacklisted,omitempty"`
 	CountryCode    int    `json:"country_code,omitempty"`
 	Enabled        bool   `json:"enabled,omitempty"`
-	HTMLUrl        string `json:"html_url"`
 }
 
 // ListUsersResponse is the data structure returned from calling the ListUsers API endpoint.


Test patch:
diff --git a/client_test.go b/client_test.go
index 6ba0b30..512d9ef 100644
--- a/client_test.go
+++ b/client_test.go
@@ -458,7 +458,7 @@ func TestClient_LastAPIRequest(t *testing.T) {
 	})
 
 	t.Run("integration", func(t *testing.T) {
-		const requestBody = `{"user":{"id":"1","name":"","summary":"","email":"foo@bar.com"}}`
+		const requestBody = `{"user":{"id":"1","name":"","email":"foo@bar.com"}}`
 
 		setup()
 		defer teardown()
diff --git a/incident_test.go b/incident_test.go
index 9f9e911..7788cc7 100644
--- a/incident_test.go
+++ b/incident_test.go
@@ -808,14 +808,12 @@ func TestIncident_ResponderRequest(t *testing.T) {
 		},
 		"message": "Help",
 		"responder_request_targets": [{
-			"responder_request_target": {
-				"id": "PJ25ZYX",
-				"type": "user_reference",
-				"incident_responders": {
-					"state": "pending",
-					"user": {
-						"id": "PJ25ZYX"
-					}
+			"id": "PJ25ZYX",
+			"type": "user_reference",
+			"incident_responders": {
+				"state": "pending",
+				"user": {
+					"id": "PJ25ZYX"
 				}
 			}
 		}]
@@ -829,9 +827,7 @@ func TestIncident_ResponderRequest(t *testing.T) {
 	r.ID = "PJ25ZYX"
 	r.Type = "user_reference"
 
-	targets := []ResponderRequestTargets{
-		ResponderRequestTargets{Target: r},
-	}
+	targets := []ResponderRequestTarget{r}
 
 	input := ResponderRequestOptions{
 		From:        from,
@@ -850,9 +846,7 @@ func TestIncident_ResponderRequest(t *testing.T) {
 	target.Responders.State = "pending"
 	target.Responders.User.ID = "PJ25ZYX"
 
-	targets = []ResponderRequestTargets{
-		ResponderRequestTargets{Target: target},
-	}
+	targets = []ResponderRequestTarget{target}
 
 	want := &ResponderRequestResponse{
 		ResponderRequest: ResponderRequest{