From 38fd23e6decf0d9b4cd8b628b734ec216fd03f06 Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Tue, 28 Mar 2023 15:51:07 +0800 Subject: [PATCH 1/4] Allow editing team for resources --- escalation_chain.go | 3 ++- integration.go | 7 ++++--- on_call_shift.go | 1 + schedule.go | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/escalation_chain.go b/escalation_chain.go index d93d0e8..7dccabc 100644 --- a/escalation_chain.go +++ b/escalation_chain.go @@ -107,7 +107,8 @@ func (service *EscalationChainService) CreateEscalationChain(opt *CreateEscalati } type UpdateEscalationChainOptions struct { - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` + TeamId string `json:"team_id,omitempty"` } // UpdateEscalationChain updates escalation chain with name. diff --git a/integration.go b/integration.go index a3c05f3..0016e08 100644 --- a/integration.go +++ b/integration.go @@ -130,9 +130,10 @@ func (service *IntegrationService) CreateIntegration(opt *CreateIntegrationOptio } type UpdateIntegrationOptions struct { - Name string `json:"name,omitempty"` - Templates *Templates `json:"templates,omitempty"` - DefaultRoute *DefaultRoute `json:"default_route,omitempty"` + Name string `json:"name,omitempty"` + TeamId string `json:"team_id,omitempty"` + Templates *Templates `json:"templates,omitempty"` + DefaultRoute *DefaultRoute `json:"default_route,omitempty"` } // UpdateIntegration updates integration with new templates, name and default route. diff --git a/on_call_shift.go b/on_call_shift.go index 1ee3799..1e3a9d0 100644 --- a/on_call_shift.go +++ b/on_call_shift.go @@ -139,6 +139,7 @@ func (service *OnCallShiftService) CreateOnCallShift(opt *CreateOnCallShiftOptio type UpdateOnCallShiftOptions struct { Type string `json:"type"` Name string `json:"name"` + TeamId string `json:"team_id,omitempty"` Level *int `json:"level,omitempty"` Start string `json:"start"` Duration int `json:"duration"` diff --git a/schedule.go b/schedule.go index 756717a..d97ada4 100644 --- a/schedule.go +++ b/schedule.go @@ -126,6 +126,7 @@ func (service *ScheduleService) CreateSchedule(opt *CreateScheduleOptions) (*Sch type UpdateScheduleOptions struct { Name string `json:"name,omitempty"` + TeamId string `json:"team_id,omitempty"` ICalUrlPrimary *string `json:"ical_url_primary"` ICalUrlOverrides *string `json:"ical_url_overrides"` TimeZone string `json:"time_zone,omitempty"` From fdb28dedceec74d25aaaa5b00771eccbe258f394 Mon Sep 17 00:00:00 2001 From: Innokentii Konstantinov Date: Wed, 29 Mar 2023 11:59:22 +0800 Subject: [PATCH 2/4] Add TeamID ti UpdateCustomActionOptions --- custom_action.go | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_action.go b/custom_action.go index 4bebcb1..55297ef 100644 --- a/custom_action.go +++ b/custom_action.go @@ -127,6 +127,7 @@ type UpdateCustomActionOptions struct { Password *string `json:"password"` AuthorizationHeader *string `json:"authorization_header"` ForwardWholePayload bool `json:"forward_whole_payload"` + TeamId string `json:"team_id,omitempty"` } // UpdateCustomAction updates custom action From d061b97d90a30a623a3d5a04b866b74c2d83973d Mon Sep 17 00:00:00 2001 From: Innokentii Konstantinov Date: Wed, 29 Mar 2023 13:17:19 +0800 Subject: [PATCH 3/4] Remove "omitempty" for team_id --- custom_action.go | 2 +- escalation_chain.go | 4 ++-- integration.go | 8 ++++---- on_call_shift.go | 2 +- schedule.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/custom_action.go b/custom_action.go index 55297ef..0d029ae 100644 --- a/custom_action.go +++ b/custom_action.go @@ -127,7 +127,7 @@ type UpdateCustomActionOptions struct { Password *string `json:"password"` AuthorizationHeader *string `json:"authorization_header"` ForwardWholePayload bool `json:"forward_whole_payload"` - TeamId string `json:"team_id,omitempty"` + TeamId string `json:"team_id"` } // UpdateCustomAction updates custom action diff --git a/escalation_chain.go b/escalation_chain.go index 7dccabc..96a96fe 100644 --- a/escalation_chain.go +++ b/escalation_chain.go @@ -107,8 +107,8 @@ func (service *EscalationChainService) CreateEscalationChain(opt *CreateEscalati } type UpdateEscalationChainOptions struct { - Name string `json:"name,omitempty"` - TeamId string `json:"team_id,omitempty"` + Name string `json:"name,omitempty"` + TeamId string `json:"team_id"` } // UpdateEscalationChain updates escalation chain with name. diff --git a/integration.go b/integration.go index 1b0c39e..d392c82 100644 --- a/integration.go +++ b/integration.go @@ -158,10 +158,10 @@ func (service *IntegrationService) CreateIntegration(opt *CreateIntegrationOptio } type UpdateIntegrationOptions struct { - Name string `json:"name,omitempty"` - TeamId string `json:"team_id,omitempty"` - Templates *Templates `json:"templates,omitempty"` - DefaultRoute *DefaultRoute `json:"default_route,omitempty"` + Name string `json:"name,omitempty"` + TeamId *string `json:"team_id"` + Templates *Templates `json:"templates,omitempty"` + DefaultRoute *DefaultRoute `json:"default_route,omitempty"` } // UpdateIntegration updates integration with new templates, name and default route. diff --git a/on_call_shift.go b/on_call_shift.go index 1521c85..eb4b0b2 100644 --- a/on_call_shift.go +++ b/on_call_shift.go @@ -139,7 +139,7 @@ func (service *OnCallShiftService) CreateOnCallShift(opt *CreateOnCallShiftOptio type UpdateOnCallShiftOptions struct { Type string `json:"type"` Name string `json:"name"` - TeamId string `json:"team_id,omitempty"` + TeamId string `json:"team_id"` Level *int `json:"level,omitempty"` Start string `json:"start"` Duration int `json:"duration"` diff --git a/schedule.go b/schedule.go index d97ada4..dd984d5 100644 --- a/schedule.go +++ b/schedule.go @@ -126,7 +126,7 @@ func (service *ScheduleService) CreateSchedule(opt *CreateScheduleOptions) (*Sch type UpdateScheduleOptions struct { Name string `json:"name,omitempty"` - TeamId string `json:"team_id,omitempty"` + TeamId string `json:"team_id"` ICalUrlPrimary *string `json:"ical_url_primary"` ICalUrlOverrides *string `json:"ical_url_overrides"` TimeZone string `json:"time_zone,omitempty"` From 19ee45c1de702a7d6fd4e2ec009b01d493fb4778 Mon Sep 17 00:00:00 2001 From: Innokentii Konstantinov Date: Wed, 29 Mar 2023 13:29:30 +0800 Subject: [PATCH 4/4] Fix UpdateIntegrationOptions.TeamId --- integration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration.go b/integration.go index d392c82..8f272cb 100644 --- a/integration.go +++ b/integration.go @@ -159,7 +159,7 @@ func (service *IntegrationService) CreateIntegration(opt *CreateIntegrationOptio type UpdateIntegrationOptions struct { Name string `json:"name,omitempty"` - TeamId *string `json:"team_id"` + TeamId string `json:"team_id"` Templates *Templates `json:"templates,omitempty"` DefaultRoute *DefaultRoute `json:"default_route,omitempty"` }