From a21663390b5aaa908a2311267eda6c8467527b49 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 3 Dec 2025 15:30:56 +0000 Subject: [PATCH] Regenerate client from commit df7e797 of spec repo --- .generator/schemas/v2/openapi.yaml | 143 +++++++++++- api/datadogV2/model_configured_schedule.go | 215 ++++++++++++++++++ .../model_configured_schedule_target.go | 145 ++++++++++++ ...l_configured_schedule_target_attributes.go | 111 +++++++++ ...onfigured_schedule_target_relationships.go | 110 +++++++++ ..._schedule_target_relationships_schedule.go | 110 +++++++++ .../model_configured_schedule_target_type.go | 64 ++++++ .../model_escalation_policy_included.go | 96 +++++--- .../model_escalation_policy_step_target.go | 46 +++- ...el_escalation_policy_step_target_config.go | 111 +++++++++ ...tion_policy_step_target_config_schedule.go | 112 +++++++++ api/datadogV2/model_escalation_target.go | 40 +++- api/datadogV2/model_schedule_target.go | 2 +- .../model_schedule_target_position.go | 68 ++++++ .../on-call/CreateOnCallEscalationPolicy.go | 9 + ...ion_policy_returns_Created_response.freeze | 2 +- ...ation_policy_returns_Created_response.yaml | 30 ++- ...l_schedule_returns_Created_response.freeze | 2 +- ...all_schedule_returns_Created_response.yaml | 24 +- ..._policy_returns_No_Content_response.freeze | 2 +- ...on_policy_returns_No_Content_response.yaml | 34 ++- ...chedule_returns_No_Content_response.freeze | 2 +- ..._schedule_returns_No_Content_response.yaml | 18 +- ...calation_policy_returns_OK_response.freeze | 2 +- ...escalation_policy_returns_OK_response.yaml | 34 ++- ...n-Call_schedule_returns_OK_response.freeze | 2 +- ..._On-Call_schedule_returns_OK_response.yaml | 18 +- ...m_on-call_users_returns_OK_response.freeze | 2 +- ...eam_on-call_users_returns_OK_response.yaml | 40 ++-- ...le_on-call_user_returns_OK_response.freeze | 2 +- ...dule_on-call_user_returns_OK_response.yaml | 18 +- ...m_routing_rules_returns_OK_response.freeze | 2 +- ...eam_routing_rules_returns_OK_response.yaml | 36 +-- ...calation_policy_returns_OK_response.freeze | 2 +- ...escalation_policy_returns_OK_response.yaml | 36 ++- ...n-Call_schedule_returns_OK_response.freeze | 2 +- ..._On-Call_schedule_returns_OK_response.yaml | 30 ++- tests/scenarios/features/v2/given.json | 2 +- tests/scenarios/features/v2/on-call.feature | 4 +- 39 files changed, 1502 insertions(+), 226 deletions(-) create mode 100644 api/datadogV2/model_configured_schedule.go create mode 100644 api/datadogV2/model_configured_schedule_target.go create mode 100644 api/datadogV2/model_configured_schedule_target_attributes.go create mode 100644 api/datadogV2/model_configured_schedule_target_relationships.go create mode 100644 api/datadogV2/model_configured_schedule_target_relationships_schedule.go create mode 100644 api/datadogV2/model_configured_schedule_target_type.go create mode 100644 api/datadogV2/model_escalation_policy_step_target_config.go create mode 100644 api/datadogV2/model_escalation_policy_step_target_config_schedule.go create mode 100644 api/datadogV2/model_schedule_target_position.go diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 05ce562f5e2..bc03f526753 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11377,6 +11377,76 @@ components: required: - type type: object + ConfiguredSchedule: + description: Full resource representation of a configured schedule target with + position (previous, current, or next). + properties: + attributes: + $ref: '#/components/schemas/ConfiguredScheduleTargetAttributes' + id: + description: Specifies the unique identifier of the configured schedule + target. + example: 00000000-aba1-0000-0000-000000000000_previous + type: string + relationships: + $ref: '#/components/schemas/ConfiguredScheduleTargetRelationships' + type: + $ref: '#/components/schemas/ConfiguredScheduleTargetType' + required: + - type + - id + - attributes + - relationships + type: object + ConfiguredScheduleTarget: + description: Relationship reference to a configured schedule target. + properties: + id: + description: Specifies the unique identifier of the configured schedule + target. + example: 00000000-aba1-0000-0000-000000000000_previous + type: string + type: + $ref: '#/components/schemas/ConfiguredScheduleTargetType' + required: + - type + - id + type: object + ConfiguredScheduleTargetAttributes: + description: Attributes for a configured schedule target, including position. + example: + position: previous + properties: + position: + $ref: '#/components/schemas/ScheduleTargetPosition' + required: + - position + type: object + ConfiguredScheduleTargetRelationships: + description: Represents the relationships of a configured schedule target. + properties: + schedule: + $ref: '#/components/schemas/ConfiguredScheduleTargetRelationshipsSchedule' + required: + - schedule + type: object + ConfiguredScheduleTargetRelationshipsSchedule: + description: Holds the schedule reference for a configured schedule target. + properties: + data: + $ref: '#/components/schemas/ScheduleTarget' + required: + - data + type: object + ConfiguredScheduleTargetType: + default: schedule_target + description: Indicates that the resource is of type `schedule_target`. + enum: + - schedule_target + example: schedule_target + type: string + x-enum-varnames: + - SCHEDULE_TARGET ConfluentAccountCreateRequest: description: Payload schema when adding a Confluent account. properties: @@ -19260,6 +19330,8 @@ components: type: users - id: 00000000-aba2-0000-0000-000000000000 type: schedules + - id: 00000000-aba2-0000-0000-000000000000_previous + type: schedule_target - id: 00000000-aba3-0000-0000-000000000000 type: teams type: steps @@ -19267,6 +19339,15 @@ components: type: users - id: 00000000-aba2-0000-0000-000000000000 type: schedules + - attributes: + position: previous + id: 00000000-aba2-0000-0000-000000000000_previous + relationships: + schedule: + data: + id: 00000000-aba2-0000-0000-000000000000 + type: schedules + type: schedule_target - id: 00000000-aba3-0000-0000-000000000000 type: teams properties: @@ -19294,7 +19375,10 @@ components: targets: - id: 00000000-aba1-0000-0000-000000000000 type: users - - id: 00000000-aba2-0000-0000-000000000000 + - config: + schedule: + position: previous + id: 00000000-aba2-0000-0000-000000000000 type: schedules - id: 00000000-aba3-0000-0000-000000000000 type: teams @@ -19338,6 +19422,7 @@ components: name: description: Specifies the name for the new escalation policy. example: On-Call Escalation Policy + minLength: 1 type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -19347,12 +19432,16 @@ components: description: Specifies how many times the escalation sequence is retried if there is no response. format: int64 + maximum: 10 + minimum: 0 type: integer steps: description: A list of escalation steps, each defining assignment, escalation timeout, and targets for the new policy. items: $ref: '#/components/schemas/EscalationPolicyCreateRequestDataAttributesStepsItems' + maxItems: 10 + minItems: 1 type: array required: - name @@ -19369,6 +19458,8 @@ components: step. example: 3600 format: int64 + maximum: 36000 + minimum: 60 type: integer targets: description: Specifies the collection of escalation targets for this step. @@ -19420,6 +19511,7 @@ components: name: description: Specifies the name of the escalation policy. example: On-Call Escalation Policy + minLength: 1 type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -19429,6 +19521,8 @@ components: description: Specifies how many times the escalation sequence is retried if there is no response. format: int64 + maximum: 10 + minimum: 0 type: integer required: - name @@ -19491,10 +19585,11 @@ components: description: Represents included related resources when retrieving an escalation policy, such as teams, steps, or targets. oneOf: - - $ref: '#/components/schemas/TeamReference' - $ref: '#/components/schemas/EscalationPolicyStep' - $ref: '#/components/schemas/EscalationPolicyUser' - $ref: '#/components/schemas/ScheduleData' + - $ref: '#/components/schemas/ConfiguredSchedule' + - $ref: '#/components/schemas/TeamReference' EscalationPolicyStep: description: Represents a single step in an escalation policy, including its attributes, relationships, and resource type. @@ -19542,8 +19637,10 @@ components: type: object EscalationPolicyStepTarget: description: Defines a single escalation target within a step for an escalation - policy creation request. Contains `id` and `type`. + policy creation request. Contains `id`, `type`, and optional `config`. properties: + config: + $ref: '#/components/schemas/EscalationPolicyStepTargetConfig' id: description: Specifies the unique identifier for this target. example: 00000000-aba1-0000-0000-000000000000 @@ -19551,6 +19648,18 @@ components: type: $ref: '#/components/schemas/EscalationPolicyStepTargetType' type: object + EscalationPolicyStepTargetConfig: + description: Configuration for an escalation target, such as schedule position. + properties: + schedule: + $ref: '#/components/schemas/EscalationPolicyStepTargetConfigSchedule' + type: object + EscalationPolicyStepTargetConfigSchedule: + description: Schedule-specific configuration for an escalation target. + properties: + position: + $ref: '#/components/schemas/ScheduleTargetPosition' + type: object EscalationPolicyStepTargetType: description: Specifies the type of escalation target (example `users`, `schedules`, or `teams`). @@ -19631,6 +19740,7 @@ components: name: description: Specifies the name of the escalation policy. example: On-Call Escalation Policy + minLength: 1 type: string resolve_page_on_policy_end: description: Indicates whether the page is automatically resolved when the @@ -19640,12 +19750,16 @@ components: description: Specifies how many times the escalation sequence is retried if there is no response. format: int64 + maximum: 10 + minimum: 0 type: integer steps: description: A list of escalation steps, each defining assignment, escalation timeout, and targets. items: $ref: '#/components/schemas/EscalationPolicyUpdateRequestDataAttributesStepsItems' + maxItems: 10 + minItems: 1 type: array required: - name @@ -19663,6 +19777,8 @@ components: step. example: 3600 format: int64 + maximum: 36000 + minimum: 60 type: integer id: description: Specifies the unique identifier of this step. @@ -19771,12 +19887,13 @@ components: x-enum-varnames: - USERS EscalationTarget: - description: Represents an escalation target, which can be a team, user, or - schedule. + description: Represents an escalation target, which can be a team, user, schedule, + or configured schedule target. oneOf: - $ref: '#/components/schemas/TeamTarget' - $ref: '#/components/schemas/UserTarget' - $ref: '#/components/schemas/ScheduleTarget' + - $ref: '#/components/schemas/ConfiguredScheduleTarget' EscalationTargets: description: A list of escalation targets for a step properties: @@ -45636,7 +45753,8 @@ components: type: object ScheduleTarget: description: Represents a schedule target for an escalation policy step, including - its ID and resource type. + its ID and resource type. This is a shortcut for a configured schedule target + with position set to 'current'. properties: id: description: Specifies the unique identifier of the schedule resource. @@ -45648,6 +45766,19 @@ components: - type - id type: object + ScheduleTargetPosition: + description: Specifies the position of a schedule target (example `previous`, + `current`, or `next`). + enum: + - previous + - current + - next + example: previous + type: string + x-enum-varnames: + - PREVIOUS + - CURRENT + - NEXT ScheduleTargetType: default: schedules description: Indicates that the resource is of type `schedules`. diff --git a/api/datadogV2/model_configured_schedule.go b/api/datadogV2/model_configured_schedule.go new file mode 100644 index 00000000000..eebcf8f04b2 --- /dev/null +++ b/api/datadogV2/model_configured_schedule.go @@ -0,0 +1,215 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredSchedule Full resource representation of a configured schedule target with position (previous, current, or next). +type ConfiguredSchedule struct { + // Attributes for a configured schedule target, including position. + Attributes ConfiguredScheduleTargetAttributes `json:"attributes"` + // Specifies the unique identifier of the configured schedule target. + Id string `json:"id"` + // Represents the relationships of a configured schedule target. + Relationships ConfiguredScheduleTargetRelationships `json:"relationships"` + // Indicates that the resource is of type `schedule_target`. + Type ConfiguredScheduleTargetType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewConfiguredSchedule instantiates a new ConfiguredSchedule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewConfiguredSchedule(attributes ConfiguredScheduleTargetAttributes, id string, relationships ConfiguredScheduleTargetRelationships, typeVar ConfiguredScheduleTargetType) *ConfiguredSchedule { + this := ConfiguredSchedule{} + this.Attributes = attributes + this.Id = id + this.Relationships = relationships + this.Type = typeVar + return &this +} + +// NewConfiguredScheduleWithDefaults instantiates a new ConfiguredSchedule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewConfiguredScheduleWithDefaults() *ConfiguredSchedule { + this := ConfiguredSchedule{} + var typeVar ConfiguredScheduleTargetType = CONFIGUREDSCHEDULETARGETTYPE_SCHEDULE_TARGET + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ConfiguredSchedule) GetAttributes() ConfiguredScheduleTargetAttributes { + if o == nil { + var ret ConfiguredScheduleTargetAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ConfiguredSchedule) GetAttributesOk() (*ConfiguredScheduleTargetAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ConfiguredSchedule) SetAttributes(v ConfiguredScheduleTargetAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ConfiguredSchedule) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConfiguredSchedule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ConfiguredSchedule) SetId(v string) { + o.Id = v +} + +// GetRelationships returns the Relationships field value. +func (o *ConfiguredSchedule) GetRelationships() ConfiguredScheduleTargetRelationships { + if o == nil { + var ret ConfiguredScheduleTargetRelationships + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value +// and a boolean to check if the value has been set. +func (o *ConfiguredSchedule) GetRelationshipsOk() (*ConfiguredScheduleTargetRelationships, bool) { + if o == nil { + return nil, false + } + return &o.Relationships, true +} + +// SetRelationships sets field value. +func (o *ConfiguredSchedule) SetRelationships(v ConfiguredScheduleTargetRelationships) { + o.Relationships = v +} + +// GetType returns the Type field value. +func (o *ConfiguredSchedule) GetType() ConfiguredScheduleTargetType { + if o == nil { + var ret ConfiguredScheduleTargetType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ConfiguredSchedule) GetTypeOk() (*ConfiguredScheduleTargetType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ConfiguredSchedule) SetType(v ConfiguredScheduleTargetType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ConfiguredSchedule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["relationships"] = o.Relationships + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ConfiguredSchedule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ConfiguredScheduleTargetAttributes `json:"attributes"` + Id *string `json:"id"` + Relationships *ConfiguredScheduleTargetRelationships `json:"relationships"` + Type *ConfiguredScheduleTargetType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Relationships == nil { + return fmt.Errorf("required field relationships missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = *all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_configured_schedule_target.go b/api/datadogV2/model_configured_schedule_target.go new file mode 100644 index 00000000000..7a125b600fd --- /dev/null +++ b/api/datadogV2/model_configured_schedule_target.go @@ -0,0 +1,145 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredScheduleTarget Relationship reference to a configured schedule target. +type ConfiguredScheduleTarget struct { + // Specifies the unique identifier of the configured schedule target. + Id string `json:"id"` + // Indicates that the resource is of type `schedule_target`. + Type ConfiguredScheduleTargetType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewConfiguredScheduleTarget instantiates a new ConfiguredScheduleTarget object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewConfiguredScheduleTarget(id string, typeVar ConfiguredScheduleTargetType) *ConfiguredScheduleTarget { + this := ConfiguredScheduleTarget{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewConfiguredScheduleTargetWithDefaults instantiates a new ConfiguredScheduleTarget object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewConfiguredScheduleTargetWithDefaults() *ConfiguredScheduleTarget { + this := ConfiguredScheduleTarget{} + var typeVar ConfiguredScheduleTargetType = CONFIGUREDSCHEDULETARGETTYPE_SCHEDULE_TARGET + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *ConfiguredScheduleTarget) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConfiguredScheduleTarget) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ConfiguredScheduleTarget) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ConfiguredScheduleTarget) GetType() ConfiguredScheduleTargetType { + if o == nil { + var ret ConfiguredScheduleTargetType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ConfiguredScheduleTarget) GetTypeOk() (*ConfiguredScheduleTargetType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ConfiguredScheduleTarget) SetType(v ConfiguredScheduleTargetType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ConfiguredScheduleTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ConfiguredScheduleTarget) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *ConfiguredScheduleTargetType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_configured_schedule_target_attributes.go b/api/datadogV2/model_configured_schedule_target_attributes.go new file mode 100644 index 00000000000..86eecdd95b1 --- /dev/null +++ b/api/datadogV2/model_configured_schedule_target_attributes.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredScheduleTargetAttributes Attributes for a configured schedule target, including position. +type ConfiguredScheduleTargetAttributes struct { + // Specifies the position of a schedule target (example `previous`, `current`, or `next`). + Position ScheduleTargetPosition `json:"position"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewConfiguredScheduleTargetAttributes instantiates a new ConfiguredScheduleTargetAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewConfiguredScheduleTargetAttributes(position ScheduleTargetPosition) *ConfiguredScheduleTargetAttributes { + this := ConfiguredScheduleTargetAttributes{} + this.Position = position + return &this +} + +// NewConfiguredScheduleTargetAttributesWithDefaults instantiates a new ConfiguredScheduleTargetAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewConfiguredScheduleTargetAttributesWithDefaults() *ConfiguredScheduleTargetAttributes { + this := ConfiguredScheduleTargetAttributes{} + return &this +} + +// GetPosition returns the Position field value. +func (o *ConfiguredScheduleTargetAttributes) GetPosition() ScheduleTargetPosition { + if o == nil { + var ret ScheduleTargetPosition + return ret + } + return o.Position +} + +// GetPositionOk returns a tuple with the Position field value +// and a boolean to check if the value has been set. +func (o *ConfiguredScheduleTargetAttributes) GetPositionOk() (*ScheduleTargetPosition, bool) { + if o == nil { + return nil, false + } + return &o.Position, true +} + +// SetPosition sets field value. +func (o *ConfiguredScheduleTargetAttributes) SetPosition(v ScheduleTargetPosition) { + o.Position = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ConfiguredScheduleTargetAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["position"] = o.Position + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ConfiguredScheduleTargetAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Position *ScheduleTargetPosition `json:"position"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Position == nil { + return fmt.Errorf("required field position missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"position"}) + } else { + return err + } + + hasInvalidField := false + if !all.Position.IsValid() { + hasInvalidField = true + } else { + o.Position = *all.Position + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_configured_schedule_target_relationships.go b/api/datadogV2/model_configured_schedule_target_relationships.go new file mode 100644 index 00000000000..55a18a81ea7 --- /dev/null +++ b/api/datadogV2/model_configured_schedule_target_relationships.go @@ -0,0 +1,110 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredScheduleTargetRelationships Represents the relationships of a configured schedule target. +type ConfiguredScheduleTargetRelationships struct { + // Holds the schedule reference for a configured schedule target. + Schedule ConfiguredScheduleTargetRelationshipsSchedule `json:"schedule"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewConfiguredScheduleTargetRelationships instantiates a new ConfiguredScheduleTargetRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewConfiguredScheduleTargetRelationships(schedule ConfiguredScheduleTargetRelationshipsSchedule) *ConfiguredScheduleTargetRelationships { + this := ConfiguredScheduleTargetRelationships{} + this.Schedule = schedule + return &this +} + +// NewConfiguredScheduleTargetRelationshipsWithDefaults instantiates a new ConfiguredScheduleTargetRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewConfiguredScheduleTargetRelationshipsWithDefaults() *ConfiguredScheduleTargetRelationships { + this := ConfiguredScheduleTargetRelationships{} + return &this +} + +// GetSchedule returns the Schedule field value. +func (o *ConfiguredScheduleTargetRelationships) GetSchedule() ConfiguredScheduleTargetRelationshipsSchedule { + if o == nil { + var ret ConfiguredScheduleTargetRelationshipsSchedule + return ret + } + return o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *ConfiguredScheduleTargetRelationships) GetScheduleOk() (*ConfiguredScheduleTargetRelationshipsSchedule, bool) { + if o == nil { + return nil, false + } + return &o.Schedule, true +} + +// SetSchedule sets field value. +func (o *ConfiguredScheduleTargetRelationships) SetSchedule(v ConfiguredScheduleTargetRelationshipsSchedule) { + o.Schedule = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ConfiguredScheduleTargetRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["schedule"] = o.Schedule + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ConfiguredScheduleTargetRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Schedule *ConfiguredScheduleTargetRelationshipsSchedule `json:"schedule"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Schedule == nil { + return fmt.Errorf("required field schedule missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"schedule"}) + } else { + return err + } + + hasInvalidField := false + if all.Schedule.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Schedule = *all.Schedule + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_configured_schedule_target_relationships_schedule.go b/api/datadogV2/model_configured_schedule_target_relationships_schedule.go new file mode 100644 index 00000000000..8de99d112cc --- /dev/null +++ b/api/datadogV2/model_configured_schedule_target_relationships_schedule.go @@ -0,0 +1,110 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredScheduleTargetRelationshipsSchedule Holds the schedule reference for a configured schedule target. +type ConfiguredScheduleTargetRelationshipsSchedule struct { + // Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'. + Data ScheduleTarget `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewConfiguredScheduleTargetRelationshipsSchedule instantiates a new ConfiguredScheduleTargetRelationshipsSchedule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewConfiguredScheduleTargetRelationshipsSchedule(data ScheduleTarget) *ConfiguredScheduleTargetRelationshipsSchedule { + this := ConfiguredScheduleTargetRelationshipsSchedule{} + this.Data = data + return &this +} + +// NewConfiguredScheduleTargetRelationshipsScheduleWithDefaults instantiates a new ConfiguredScheduleTargetRelationshipsSchedule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewConfiguredScheduleTargetRelationshipsScheduleWithDefaults() *ConfiguredScheduleTargetRelationshipsSchedule { + this := ConfiguredScheduleTargetRelationshipsSchedule{} + return &this +} + +// GetData returns the Data field value. +func (o *ConfiguredScheduleTargetRelationshipsSchedule) GetData() ScheduleTarget { + if o == nil { + var ret ScheduleTarget + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ConfiguredScheduleTargetRelationshipsSchedule) GetDataOk() (*ScheduleTarget, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ConfiguredScheduleTargetRelationshipsSchedule) SetData(v ScheduleTarget) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ConfiguredScheduleTargetRelationshipsSchedule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ConfiguredScheduleTargetRelationshipsSchedule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ScheduleTarget `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_configured_schedule_target_type.go b/api/datadogV2/model_configured_schedule_target_type.go new file mode 100644 index 00000000000..e9eb1c065cd --- /dev/null +++ b/api/datadogV2/model_configured_schedule_target_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ConfiguredScheduleTargetType Indicates that the resource is of type `schedule_target`. +type ConfiguredScheduleTargetType string + +// List of ConfiguredScheduleTargetType. +const ( + CONFIGUREDSCHEDULETARGETTYPE_SCHEDULE_TARGET ConfiguredScheduleTargetType = "schedule_target" +) + +var allowedConfiguredScheduleTargetTypeEnumValues = []ConfiguredScheduleTargetType{ + CONFIGUREDSCHEDULETARGETTYPE_SCHEDULE_TARGET, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ConfiguredScheduleTargetType) GetAllowedValues() []ConfiguredScheduleTargetType { + return allowedConfiguredScheduleTargetTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ConfiguredScheduleTargetType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ConfiguredScheduleTargetType(value) + return nil +} + +// NewConfiguredScheduleTargetTypeFromValue returns a pointer to a valid ConfiguredScheduleTargetType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewConfiguredScheduleTargetTypeFromValue(v string) (*ConfiguredScheduleTargetType, error) { + ev := ConfiguredScheduleTargetType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ConfiguredScheduleTargetType: valid values are %v", v, allowedConfiguredScheduleTargetTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ConfiguredScheduleTargetType) IsValid() bool { + for _, existing := range allowedConfiguredScheduleTargetTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConfiguredScheduleTargetType value. +func (v ConfiguredScheduleTargetType) Ptr() *ConfiguredScheduleTargetType { + return &v +} diff --git a/api/datadogV2/model_escalation_policy_included.go b/api/datadogV2/model_escalation_policy_included.go index 838f699f040..1ac3b8237d8 100644 --- a/api/datadogV2/model_escalation_policy_included.go +++ b/api/datadogV2/model_escalation_policy_included.go @@ -10,20 +10,16 @@ import ( // EscalationPolicyIncluded - Represents included related resources when retrieving an escalation policy, such as teams, steps, or targets. type EscalationPolicyIncluded struct { - TeamReference *TeamReference EscalationPolicyStep *EscalationPolicyStep EscalationPolicyUser *EscalationPolicyUser ScheduleData *ScheduleData + ConfiguredSchedule *ConfiguredSchedule + TeamReference *TeamReference // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} } -// TeamReferenceAsEscalationPolicyIncluded is a convenience function that returns TeamReference wrapped in EscalationPolicyIncluded. -func TeamReferenceAsEscalationPolicyIncluded(v *TeamReference) EscalationPolicyIncluded { - return EscalationPolicyIncluded{TeamReference: v} -} - // EscalationPolicyStepAsEscalationPolicyIncluded is a convenience function that returns EscalationPolicyStep wrapped in EscalationPolicyIncluded. func EscalationPolicyStepAsEscalationPolicyIncluded(v *EscalationPolicyStep) EscalationPolicyIncluded { return EscalationPolicyIncluded{EscalationPolicyStep: v} @@ -39,27 +35,20 @@ func ScheduleDataAsEscalationPolicyIncluded(v *ScheduleData) EscalationPolicyInc return EscalationPolicyIncluded{ScheduleData: v} } +// ConfiguredScheduleAsEscalationPolicyIncluded is a convenience function that returns ConfiguredSchedule wrapped in EscalationPolicyIncluded. +func ConfiguredScheduleAsEscalationPolicyIncluded(v *ConfiguredSchedule) EscalationPolicyIncluded { + return EscalationPolicyIncluded{ConfiguredSchedule: v} +} + +// TeamReferenceAsEscalationPolicyIncluded is a convenience function that returns TeamReference wrapped in EscalationPolicyIncluded. +func TeamReferenceAsEscalationPolicyIncluded(v *TeamReference) EscalationPolicyIncluded { + return EscalationPolicyIncluded{TeamReference: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *EscalationPolicyIncluded) UnmarshalJSON(data []byte) error { var err error match := 0 - // try to unmarshal data into TeamReference - err = datadog.Unmarshal(data, &obj.TeamReference) - if err == nil { - if obj.TeamReference != nil && obj.TeamReference.UnparsedObject == nil { - jsonTeamReference, _ := datadog.Marshal(obj.TeamReference) - if string(jsonTeamReference) == "{}" { // empty struct - obj.TeamReference = nil - } else { - match++ - } - } else { - obj.TeamReference = nil - } - } else { - obj.TeamReference = nil - } - // try to unmarshal data into EscalationPolicyStep err = datadog.Unmarshal(data, &obj.EscalationPolicyStep) if err == nil { @@ -111,12 +100,47 @@ func (obj *EscalationPolicyIncluded) UnmarshalJSON(data []byte) error { obj.ScheduleData = nil } + // try to unmarshal data into ConfiguredSchedule + err = datadog.Unmarshal(data, &obj.ConfiguredSchedule) + if err == nil { + if obj.ConfiguredSchedule != nil && obj.ConfiguredSchedule.UnparsedObject == nil { + jsonConfiguredSchedule, _ := datadog.Marshal(obj.ConfiguredSchedule) + if string(jsonConfiguredSchedule) == "{}" { // empty struct + obj.ConfiguredSchedule = nil + } else { + match++ + } + } else { + obj.ConfiguredSchedule = nil + } + } else { + obj.ConfiguredSchedule = nil + } + + // try to unmarshal data into TeamReference + err = datadog.Unmarshal(data, &obj.TeamReference) + if err == nil { + if obj.TeamReference != nil && obj.TeamReference.UnparsedObject == nil { + jsonTeamReference, _ := datadog.Marshal(obj.TeamReference) + if string(jsonTeamReference) == "{}" { // empty struct + obj.TeamReference = nil + } else { + match++ + } + } else { + obj.TeamReference = nil + } + } else { + obj.TeamReference = nil + } + if match != 1 { // more than 1 match // reset to nil - obj.TeamReference = nil obj.EscalationPolicyStep = nil obj.EscalationPolicyUser = nil obj.ScheduleData = nil + obj.ConfiguredSchedule = nil + obj.TeamReference = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -124,10 +148,6 @@ func (obj *EscalationPolicyIncluded) UnmarshalJSON(data []byte) error { // MarshalJSON turns data from the first non-nil pointers in the struct to JSON. func (obj EscalationPolicyIncluded) MarshalJSON() ([]byte, error) { - if obj.TeamReference != nil { - return datadog.Marshal(&obj.TeamReference) - } - if obj.EscalationPolicyStep != nil { return datadog.Marshal(&obj.EscalationPolicyStep) } @@ -140,6 +160,14 @@ func (obj EscalationPolicyIncluded) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.ScheduleData) } + if obj.ConfiguredSchedule != nil { + return datadog.Marshal(&obj.ConfiguredSchedule) + } + + if obj.TeamReference != nil { + return datadog.Marshal(&obj.TeamReference) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -148,10 +176,6 @@ func (obj EscalationPolicyIncluded) MarshalJSON() ([]byte, error) { // GetActualInstance returns the actual instance. func (obj *EscalationPolicyIncluded) GetActualInstance() interface{} { - if obj.TeamReference != nil { - return obj.TeamReference - } - if obj.EscalationPolicyStep != nil { return obj.EscalationPolicyStep } @@ -164,6 +188,14 @@ func (obj *EscalationPolicyIncluded) GetActualInstance() interface{} { return obj.ScheduleData } + if obj.ConfiguredSchedule != nil { + return obj.ConfiguredSchedule + } + + if obj.TeamReference != nil { + return obj.TeamReference + } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_escalation_policy_step_target.go b/api/datadogV2/model_escalation_policy_step_target.go index babc883930a..f0b87841f36 100644 --- a/api/datadogV2/model_escalation_policy_step_target.go +++ b/api/datadogV2/model_escalation_policy_step_target.go @@ -8,8 +8,10 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EscalationPolicyStepTarget Defines a single escalation target within a step for an escalation policy creation request. Contains `id` and `type`. +// EscalationPolicyStepTarget Defines a single escalation target within a step for an escalation policy creation request. Contains `id`, `type`, and optional `config`. type EscalationPolicyStepTarget struct { + // Configuration for an escalation target, such as schedule position. + Config *EscalationPolicyStepTargetConfig `json:"config,omitempty"` // Specifies the unique identifier for this target. Id *string `json:"id,omitempty"` // Specifies the type of escalation target (example `users`, `schedules`, or `teams`). @@ -36,6 +38,34 @@ func NewEscalationPolicyStepTargetWithDefaults() *EscalationPolicyStepTarget { return &this } +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *EscalationPolicyStepTarget) GetConfig() EscalationPolicyStepTargetConfig { + if o == nil || o.Config == nil { + var ret EscalationPolicyStepTargetConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EscalationPolicyStepTarget) GetConfigOk() (*EscalationPolicyStepTargetConfig, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *EscalationPolicyStepTarget) HasConfig() bool { + return o != nil && o.Config != nil +} + +// SetConfig gets a reference to the given EscalationPolicyStepTargetConfig and assigns it to the Config field. +func (o *EscalationPolicyStepTarget) SetConfig(v EscalationPolicyStepTargetConfig) { + o.Config = &v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *EscalationPolicyStepTarget) GetId() string { if o == nil || o.Id == nil { @@ -98,6 +128,9 @@ func (o EscalationPolicyStepTarget) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Config != nil { + toSerialize["config"] = o.Config + } if o.Id != nil { toSerialize["id"] = o.Id } @@ -114,20 +147,25 @@ func (o EscalationPolicyStepTarget) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EscalationPolicyStepTarget) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Type *EscalationPolicyStepTargetType `json:"type,omitempty"` + Config *EscalationPolicyStepTargetConfig `json:"config,omitempty"` + Id *string `json:"id,omitempty"` + Type *EscalationPolicyStepTargetType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"config", "id", "type"}) } else { return err } hasInvalidField := false + if all.Config != nil && all.Config.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Config = all.Config o.Id = all.Id if all.Type != nil && !all.Type.IsValid() { hasInvalidField = true diff --git a/api/datadogV2/model_escalation_policy_step_target_config.go b/api/datadogV2/model_escalation_policy_step_target_config.go new file mode 100644 index 00000000000..488199ba923 --- /dev/null +++ b/api/datadogV2/model_escalation_policy_step_target_config.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EscalationPolicyStepTargetConfig Configuration for an escalation target, such as schedule position. +type EscalationPolicyStepTargetConfig struct { + // Schedule-specific configuration for an escalation target. + Schedule *EscalationPolicyStepTargetConfigSchedule `json:"schedule,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEscalationPolicyStepTargetConfig instantiates a new EscalationPolicyStepTargetConfig object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEscalationPolicyStepTargetConfig() *EscalationPolicyStepTargetConfig { + this := EscalationPolicyStepTargetConfig{} + return &this +} + +// NewEscalationPolicyStepTargetConfigWithDefaults instantiates a new EscalationPolicyStepTargetConfig object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEscalationPolicyStepTargetConfigWithDefaults() *EscalationPolicyStepTargetConfig { + this := EscalationPolicyStepTargetConfig{} + return &this +} + +// GetSchedule returns the Schedule field value if set, zero value otherwise. +func (o *EscalationPolicyStepTargetConfig) GetSchedule() EscalationPolicyStepTargetConfigSchedule { + if o == nil || o.Schedule == nil { + var ret EscalationPolicyStepTargetConfigSchedule + return ret + } + return *o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EscalationPolicyStepTargetConfig) GetScheduleOk() (*EscalationPolicyStepTargetConfigSchedule, bool) { + if o == nil || o.Schedule == nil { + return nil, false + } + return o.Schedule, true +} + +// HasSchedule returns a boolean if a field has been set. +func (o *EscalationPolicyStepTargetConfig) HasSchedule() bool { + return o != nil && o.Schedule != nil +} + +// SetSchedule gets a reference to the given EscalationPolicyStepTargetConfigSchedule and assigns it to the Schedule field. +func (o *EscalationPolicyStepTargetConfig) SetSchedule(v EscalationPolicyStepTargetConfigSchedule) { + o.Schedule = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EscalationPolicyStepTargetConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Schedule != nil { + toSerialize["schedule"] = o.Schedule + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EscalationPolicyStepTargetConfig) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Schedule *EscalationPolicyStepTargetConfigSchedule `json:"schedule,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"schedule"}) + } else { + return err + } + + hasInvalidField := false + if all.Schedule != nil && all.Schedule.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Schedule = all.Schedule + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_escalation_policy_step_target_config_schedule.go b/api/datadogV2/model_escalation_policy_step_target_config_schedule.go new file mode 100644 index 00000000000..a1e4535166a --- /dev/null +++ b/api/datadogV2/model_escalation_policy_step_target_config_schedule.go @@ -0,0 +1,112 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EscalationPolicyStepTargetConfigSchedule Schedule-specific configuration for an escalation target. +type EscalationPolicyStepTargetConfigSchedule struct { + // Specifies the position of a schedule target (example `previous`, `current`, or `next`). + Position *ScheduleTargetPosition `json:"position,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEscalationPolicyStepTargetConfigSchedule instantiates a new EscalationPolicyStepTargetConfigSchedule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEscalationPolicyStepTargetConfigSchedule() *EscalationPolicyStepTargetConfigSchedule { + this := EscalationPolicyStepTargetConfigSchedule{} + return &this +} + +// NewEscalationPolicyStepTargetConfigScheduleWithDefaults instantiates a new EscalationPolicyStepTargetConfigSchedule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEscalationPolicyStepTargetConfigScheduleWithDefaults() *EscalationPolicyStepTargetConfigSchedule { + this := EscalationPolicyStepTargetConfigSchedule{} + return &this +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *EscalationPolicyStepTargetConfigSchedule) GetPosition() ScheduleTargetPosition { + if o == nil || o.Position == nil { + var ret ScheduleTargetPosition + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EscalationPolicyStepTargetConfigSchedule) GetPositionOk() (*ScheduleTargetPosition, bool) { + if o == nil || o.Position == nil { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *EscalationPolicyStepTargetConfigSchedule) HasPosition() bool { + return o != nil && o.Position != nil +} + +// SetPosition gets a reference to the given ScheduleTargetPosition and assigns it to the Position field. +func (o *EscalationPolicyStepTargetConfigSchedule) SetPosition(v ScheduleTargetPosition) { + o.Position = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EscalationPolicyStepTargetConfigSchedule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Position != nil { + toSerialize["position"] = o.Position + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EscalationPolicyStepTargetConfigSchedule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Position *ScheduleTargetPosition `json:"position,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"position"}) + } else { + return err + } + + hasInvalidField := false + if all.Position != nil && !all.Position.IsValid() { + hasInvalidField = true + } else { + o.Position = all.Position + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_escalation_target.go b/api/datadogV2/model_escalation_target.go index cb75a97da2e..aad97f18f6e 100644 --- a/api/datadogV2/model_escalation_target.go +++ b/api/datadogV2/model_escalation_target.go @@ -8,11 +8,12 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EscalationTarget - Represents an escalation target, which can be a team, user, or schedule. +// EscalationTarget - Represents an escalation target, which can be a team, user, schedule, or configured schedule target. type EscalationTarget struct { - TeamTarget *TeamTarget - UserTarget *UserTarget - ScheduleTarget *ScheduleTarget + TeamTarget *TeamTarget + UserTarget *UserTarget + ScheduleTarget *ScheduleTarget + ConfiguredScheduleTarget *ConfiguredScheduleTarget // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -33,6 +34,11 @@ func ScheduleTargetAsEscalationTarget(v *ScheduleTarget) EscalationTarget { return EscalationTarget{ScheduleTarget: v} } +// ConfiguredScheduleTargetAsEscalationTarget is a convenience function that returns ConfiguredScheduleTarget wrapped in EscalationTarget. +func ConfiguredScheduleTargetAsEscalationTarget(v *ConfiguredScheduleTarget) EscalationTarget { + return EscalationTarget{ConfiguredScheduleTarget: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *EscalationTarget) UnmarshalJSON(data []byte) error { var err error @@ -88,11 +94,29 @@ func (obj *EscalationTarget) UnmarshalJSON(data []byte) error { obj.ScheduleTarget = nil } + // try to unmarshal data into ConfiguredScheduleTarget + err = datadog.Unmarshal(data, &obj.ConfiguredScheduleTarget) + if err == nil { + if obj.ConfiguredScheduleTarget != nil && obj.ConfiguredScheduleTarget.UnparsedObject == nil { + jsonConfiguredScheduleTarget, _ := datadog.Marshal(obj.ConfiguredScheduleTarget) + if string(jsonConfiguredScheduleTarget) == "{}" { // empty struct + obj.ConfiguredScheduleTarget = nil + } else { + match++ + } + } else { + obj.ConfiguredScheduleTarget = nil + } + } else { + obj.ConfiguredScheduleTarget = nil + } + if match != 1 { // more than 1 match // reset to nil obj.TeamTarget = nil obj.UserTarget = nil obj.ScheduleTarget = nil + obj.ConfiguredScheduleTarget = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -112,6 +136,10 @@ func (obj EscalationTarget) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.ScheduleTarget) } + if obj.ConfiguredScheduleTarget != nil { + return datadog.Marshal(&obj.ConfiguredScheduleTarget) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -132,6 +160,10 @@ func (obj *EscalationTarget) GetActualInstance() interface{} { return obj.ScheduleTarget } + if obj.ConfiguredScheduleTarget != nil { + return obj.ConfiguredScheduleTarget + } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_schedule_target.go b/api/datadogV2/model_schedule_target.go index 2edf9bf9c06..1ffdbd3eab4 100644 --- a/api/datadogV2/model_schedule_target.go +++ b/api/datadogV2/model_schedule_target.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ScheduleTarget Represents a schedule target for an escalation policy step, including its ID and resource type. +// ScheduleTarget Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'. type ScheduleTarget struct { // Specifies the unique identifier of the schedule resource. Id string `json:"id"` diff --git a/api/datadogV2/model_schedule_target_position.go b/api/datadogV2/model_schedule_target_position.go new file mode 100644 index 00000000000..bd648805391 --- /dev/null +++ b/api/datadogV2/model_schedule_target_position.go @@ -0,0 +1,68 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScheduleTargetPosition Specifies the position of a schedule target (example `previous`, `current`, or `next`). +type ScheduleTargetPosition string + +// List of ScheduleTargetPosition. +const ( + SCHEDULETARGETPOSITION_PREVIOUS ScheduleTargetPosition = "previous" + SCHEDULETARGETPOSITION_CURRENT ScheduleTargetPosition = "current" + SCHEDULETARGETPOSITION_NEXT ScheduleTargetPosition = "next" +) + +var allowedScheduleTargetPositionEnumValues = []ScheduleTargetPosition{ + SCHEDULETARGETPOSITION_PREVIOUS, + SCHEDULETARGETPOSITION_CURRENT, + SCHEDULETARGETPOSITION_NEXT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ScheduleTargetPosition) GetAllowedValues() []ScheduleTargetPosition { + return allowedScheduleTargetPositionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ScheduleTargetPosition) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ScheduleTargetPosition(value) + return nil +} + +// NewScheduleTargetPositionFromValue returns a pointer to a valid ScheduleTargetPosition +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewScheduleTargetPositionFromValue(v string) (*ScheduleTargetPosition, error) { + ev := ScheduleTargetPosition(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ScheduleTargetPosition: valid values are %v", v, allowedScheduleTargetPositionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ScheduleTargetPosition) IsValid() bool { + for _, existing := range allowedScheduleTargetPositionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ScheduleTargetPosition value. +func (v ScheduleTargetPosition) Ptr() *ScheduleTargetPosition { + return &v +} diff --git a/examples/v2/on-call/CreateOnCallEscalationPolicy.go b/examples/v2/on-call/CreateOnCallEscalationPolicy.go index c0b65db2168..6039eb0e067 100644 --- a/examples/v2/on-call/CreateOnCallEscalationPolicy.go +++ b/examples/v2/on-call/CreateOnCallEscalationPolicy.go @@ -41,6 +41,15 @@ func main() { Id: datadog.PtrString(ScheduleDataID), Type: datadogV2.ESCALATIONPOLICYSTEPTARGETTYPE_SCHEDULES.Ptr(), }, + { + Config: &datadogV2.EscalationPolicyStepTargetConfig{ + Schedule: &datadogV2.EscalationPolicyStepTargetConfigSchedule{ + Position: datadogV2.SCHEDULETARGETPOSITION_PREVIOUS.Ptr(), + }, + }, + Id: datadog.PtrString(ScheduleDataID), + Type: datadogV2.ESCALATIONPOLICYSTEPTARGETTYPE_SCHEDULES.Ptr(), + }, { Id: datadog.PtrString(DdTeamDataID), Type: datadogV2.ESCALATIONPOLICYSTEPTARGETTYPE_TEAMS.Ptr(), diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.freeze index b8ab6c2926a..d47e0da1fab 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:30.847Z \ No newline at end of file +2025-11-28T12:58:56.434Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.yaml index e8e5c00e81e..fd312e6b63a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_escalation_policy_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"de86b01f-3c48-11f0-927d-aedf77869272","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com","created_at":"2025-05-29T04:53:31.716641+00:00","modified_at":"2025-05-29T04:53:31.716641+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com","icon":"https://secure.gravatar.com/avatar/bd817280fe52b9652bd2877bf9041f78?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"005f5c53-cc5a-11f0-84fc-d6e063989c3f","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1764334736@datadoghq.com","created_at":"2025-11-28T12:58:57.385841+00:00","modified_at":"2025-11-28T12:58:57.385841+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1764334736@datadoghq.com","icon":"https://secure.gravatar.com/avatar/990f6066d8c3647475a637255f95cc7f?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:30.847Z","end_date":"2025-06-08T04:53:30.847Z","interval":{"days":1},"members":[{"user":{"id":"de86b01f-3c48-11f0-927d-aedf77869272"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:30.847Z"}],"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-18T12:58:56.434Z","end_date":"2025-12-08T12:58:56.434Z","interval":{"days":1},"members":[{"user":{"id":"005f5c53-cc5a-11f0-84fc-d6e063989c3f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-23T12:58:56.434Z"}],"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"2e70ff45-cb63-4609-900b-cc9fe95e063b","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"f1949bc4-1f01-4081-8002-d6029ace0bc9","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"928407db-da13-4516-bd6a-3b92e3095b56","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-cfbc9f18713005c6","name":"test-name-cfbc9f18713005c6"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-24ceda96b794cbdd","name":"test-name-24ceda96b794cbdd"},"type":"team"}} form: {} headers: Accept: @@ -55,18 +55,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","attributes":{"name":"test-name-cfbc9f18713005c6","handle":"test-handle-cfbc9f18713005c6","summary":null,"description":null,"avatar":null,"banner":14,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-29T04:53:32.646359+00:00","modified_at":"2025-05-29T04:53:32.646369+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259/permission-settings"}}}}} - - ' + body: '{"data":{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"team","attributes":{"avatar":null,"banner":1,"created_at":"2025-11-28T12:58:58.058854+00:00","description":null,"handle":"test-handle-24ceda96b794cbdd","hidden_modules":[],"link_count":0,"modified_at":"2025-11-28T12:58:58.058854+00:00","name":"test-name-24ceda96b794cbdd","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/e5057194-b5fd-4ff5-b9d3-6977d8bbd774/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/e5057194-b5fd-4ff5-b9d3-6977d8bbd774/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"de86b01f-3c48-11f0-927d-aedf77869272","type":"users"},{"id":"2e70ff45-cb63-4609-900b-cc9fe95e063b","type":"schedules"},{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"005f5c53-cc5a-11f0-84fc-d6e063989c3f","type":"users"},{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules"},{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -77,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies?include=steps.targets response: - body: '{"data":{"id":"cf3a523c-3ca3-4ac4-aee2-7afaac13c6f7","type":"policies","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"ba22e9ae-1740-4522-b95c-26f601a37484","type":"steps"},{"id":"335dc81f-929a-47e1-a8f8-cc7830c2d272","type":"steps"}]},"teams":{"data":[{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]}}},"included":[{"id":"ba22e9ae-1740-4522-b95c-26f601a37484","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"de86b01f-3c48-11f0-927d-aedf77869272","type":"users"},{"id":"2e70ff45-cb63-4609-900b-cc9fe95e063b","type":"schedules"},{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]}}},{"id":"335dc81f-929a-47e1-a8f8-cc7830c2d272","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams"}]}}},{"id":"de86b01f-3c48-11f0-927d-aedf77869272","type":"users","attributes":{"email":"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com","name":"","status":"pending"}},{"id":"2e70ff45-cb63-4609-900b-cc9fe95e063b","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"f1949bc4-1f01-4081-8002-d6029ace0bc9","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"fa4d082c-6733-4bd0-9083-f7bf2f8d4259","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-cfbc9f18713005c6","name":"test-name-cfbc9f18713005c6"}}]}' + body: '{"data":{"id":"84f3ac2b-77da-42f2-a2bb-cb9a5ea9cf55","type":"policies","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"055817d0-41cb-402f-bb93-0d5989083cd1","type":"steps"},{"id":"ddab41bb-c15d-4ad8-bf29-8d0ddcbb2df1","type":"steps"}]},"teams":{"data":[{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]}}},"included":[{"id":"055817d0-41cb-402f-bb93-0d5989083cd1","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"005f5c53-cc5a-11f0-84fc-d6e063989c3f","type":"users"},{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules"},{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11_previous","type":"schedule_target"},{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]}}},{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11_previous","type":"schedule_target","attributes":{"position":"previous"},"relationships":{"schedule":{"data":{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules"}}}},{"id":"ddab41bb-c15d-4ad8-bf29-8d0ddcbb2df1","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams"}]}}},{"id":"005f5c53-cc5a-11f0-84fc-d6e063989c3f","type":"users","attributes":{"email":"test-create_on_call_escalation_policy_returns_created_response-1764334736@datadoghq.com","name":"","status":"pending"}},{"id":"c6a8f167-908f-4ca5-ba30-a33a00adfe11","type":"schedules","attributes":{"name":"Test-Create_On_Call_escalation_policy_returns_Created_response-1764334736","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"928407db-da13-4516-bd6a-3b92e3095b56","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"e5057194-b5fd-4ff5-b9d3-6977d8bbd774","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-24ceda96b794cbdd","name":"test-name-24ceda96b794cbdd"}}]}' code: 201 duration: 0ms headers: @@ -92,7 +90,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/cf3a523c-3ca3-4ac4-aee2-7afaac13c6f7 + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/84f3ac2b-77da-42f2-a2bb-cb9a5ea9cf55 response: body: '' code: 204 @@ -107,7 +105,7 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259 + url: https://api.datadoghq.com/api/v2/team/e5057194-b5fd-4ff5-b9d3-6977d8bbd774 response: body: '' code: 204 @@ -122,7 +120,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/2e70ff45-cb63-4609-900b-cc9fe95e063b + url: https://api.datadoghq.com/api/v2/on-call/schedules/c6a8f167-908f-4ca5-ba30-a33a00adfe11 response: body: '' code: 204 @@ -137,7 +135,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/users/de86b01f-3c48-11f0-927d-aedf77869272 + url: https://api.datadoghq.com/api/v2/users/005f5c53-cc5a-11f0-84fc-d6e063989c3f response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.freeze index 47ee6d1da6f..59b299377cf 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:37.175Z \ No newline at end of file +2025-11-27T14:11:22.484Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.yaml index 2a38c5cd14e..693f251adf0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Create_On-Call_schedule_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Create_On_Call_schedule_returns_Created_response-1748494417@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Create_On_Call_schedule_returns_Created_response-1764252682@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"e2438320-3c48-11f0-b6eb-6e406f40657f","attributes":{"name":null,"handle":"test-create_on_call_schedule_returns_created_response-1748494417@datadoghq.com","created_at":"2025-05-29T04:53:37.987288+00:00","modified_at":"2025-05-29T04:53:37.987288+00:00","email":"test-create_on_call_schedule_returns_created_response-1748494417@datadoghq.com","icon":"https://secure.gravatar.com/avatar/61f85c2f88e7f4fa078405eae231fb73?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"f4106d12-cb9a-11f0-a56e-4e680b759023","attributes":{"name":null,"handle":"test-create_on_call_schedule_returns_created_response-1764252682@datadoghq.com","created_at":"2025-11-27T14:11:22.860522+00:00","modified_at":"2025-11-27T14:11:22.860522+00:00","email":"test-create_on_call_schedule_returns_created_response-1764252682@datadoghq.com","icon":"https://secure.gravatar.com/avatar/97f54253d0353bf6811320274d5cf8eb?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-0ed4255faa1a4de8","name":"test-name-0ed4255faa1a4de8"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-a115b862e893678b","name":"test-name-a115b862e893678b"},"type":"team"}} form: {} headers: Accept: @@ -35,18 +35,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153","attributes":{"name":"test-name-0ed4255faa1a4de8","handle":"test-handle-0ed4255faa1a4de8","summary":null,"description":null,"avatar":null,"banner":5,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-29T04:53:38.641602+00:00","modified_at":"2025-05-29T04:53:38.641612+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153/permission-settings"}}}}} - - ' + body: '{"data":{"id":"8802359f-5663-4ed4-b3c8-06d5618def25","type":"team","attributes":{"avatar":null,"banner":2,"created_at":"2025-11-27T14:11:23.389409+00:00","description":null,"handle":"test-handle-a115b862e893678b","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:23.389409+00:00","name":"test-name-a115b862e893678b","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/8802359f-5663-4ed4-b3c8-06d5618def25/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/8802359f-5663-4ed4-b3c8-06d5618def25/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:37.175Z","end_date":"2025-06-08T04:53:37.175Z","interval":{"days":1},"members":[{"user":{"id":"e2438320-3c48-11f0-b6eb-6e406f40657f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:37.175Z"}],"name":"Test-Create_On_Call_schedule_returns_Created_response-1748494417","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:22.484Z","end_date":"2025-12-07T14:11:22.484Z","interval":{"days":1},"members":[{"user":{"id":"f4106d12-cb9a-11f0-a56e-4e680b759023"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:22.484Z"}],"name":"Test-Create_On_Call_schedule_returns_Created_response-1764252682","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"8802359f-5663-4ed4-b3c8-06d5618def25","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -57,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"e57f69cc-5f56-41bf-abd2-69196d0b4b41","type":"schedules","attributes":{"name":"Test-Create_On_Call_schedule_returns_Created_response-1748494417","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"7cb8837f-5ebd-46c7-914d-d017eae7f3fc","type":"layers"}]},"teams":{"data":[{"id":"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153","type":"teams"}]}}}}' + body: '{"data":{"id":"f56173aa-b72e-4a29-a9dd-e8a4fe57f47a","type":"schedules","attributes":{"name":"Test-Create_On_Call_schedule_returns_Created_response-1764252682","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"886b9854-9487-4b13-a4a1-955922ced1cf","type":"layers"}]},"teams":{"data":[{"id":"8802359f-5663-4ed4-b3c8-06d5618def25","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -72,7 +70,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/e57f69cc-5f56-41bf-abd2-69196d0b4b41 + url: https://api.datadoghq.com/api/v2/on-call/schedules/f56173aa-b72e-4a29-a9dd-e8a4fe57f47a response: body: '' code: 204 @@ -87,7 +85,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153 + url: https://api.datadoghq.com/api/v2/team/8802359f-5663-4ed4-b3c8-06d5618def25 response: body: '' code: 204 @@ -102,7 +100,7 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/users/e2438320-3c48-11f0-b6eb-6e406f40657f + url: https://api.datadoghq.com/api/v2/users/f4106d12-cb9a-11f0-a56e-4e680b759023 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.freeze index c28891b940d..214a0e6a9b0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:42.215Z \ No newline at end of file +2025-11-27T14:11:25.538Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.yaml index aa3ef416f9c..ac2766e8f84 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_escalation_policy_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1764252685@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"e524a559-3c48-11f0-b6eb-6e406f40657f","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1748494422@datadoghq.com","created_at":"2025-05-29T04:53:42.818165+00:00","modified_at":"2025-05-29T04:53:42.818165+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1748494422@datadoghq.com","icon":"https://secure.gravatar.com/avatar/89925b9919d7e93a599c4d49d51b35ee?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"f5e7c666-cb9a-11f0-ae87-2a5e5028fcef","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1764252685@datadoghq.com","created_at":"2025-11-27T14:11:25.949558+00:00","modified_at":"2025-11-27T14:11:25.949558+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1764252685@datadoghq.com","icon":"https://secure.gravatar.com/avatar/92ce6e94a63e99ed9306c4b09eb69918?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-7311534a0fd625d8","name":"test-name-7311534a0fd625d8"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-5d85b5aacd02cab9","name":"test-name-5d85b5aacd02cab9"},"type":"team"}} form: {} headers: Accept: @@ -35,18 +35,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"5007e30b-5736-4abe-be9c-51cf508c9554","attributes":{"name":"test-name-7311534a0fd625d8","handle":"test-handle-7311534a0fd625d8","summary":null,"description":null,"avatar":null,"banner":10,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-29T04:53:43.705893+00:00","modified_at":"2025-05-29T04:53:43.705903+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554/permission-settings"}}}}} - - ' + body: '{"data":{"id":"a42481db-6918-45ef-a923-5548004f044a","type":"team","attributes":{"avatar":null,"banner":9,"created_at":"2025-11-27T14:11:26.456007+00:00","description":null,"handle":"test-handle-5d85b5aacd02cab9","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:26.456008+00:00","name":"test-name-5d85b5aacd02cab9","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/a42481db-6918-45ef-a923-5548004f044a/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/a42481db-6918-45ef-a923-5548004f044a/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:42.215Z","end_date":"2025-06-08T04:53:42.215Z","interval":{"days":1},"members":[{"user":{"id":"e524a559-3c48-11f0-b6eb-6e406f40657f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:42.215Z"}],"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:25.538Z","end_date":"2025-12-07T14:11:25.538Z","interval":{"days":1},"members":[{"user":{"id":"f5e7c666-cb9a-11f0-ae87-2a5e5028fcef"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:25.538Z"}],"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1764252685","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -57,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"5bedf04a-b064-4748-861d-2f32970de31e","type":"schedules","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"242425ed-6c98-4bda-b0eb-8eb0d66fc40f","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"cf196f34-3ce0-4cff-a27e-ed5035db9442","type":"schedules","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1764252685","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"2f2ea0a9-a33e-4d2f-9a0b-5cbfb0bed071","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -66,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"5007e30b-5736-4abe-be9c-51cf508c9554","type":"teams"},{"id":"5bedf04a-b064-4748-861d-2f32970de31e","type":"schedules"},{"id":"e524a559-3c48-11f0-b6eb-6e406f40657f","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"5007e30b-5736-4abe-be9c-51cf508c9554","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"5007e30b-5736-4abe-be9c-51cf508c9554","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1764252685","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"a42481db-6918-45ef-a923-5548004f044a","type":"teams"},{"id":"cf196f34-3ce0-4cff-a27e-ed5035db9442","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"cf196f34-3ce0-4cff-a27e-ed5035db9442","type":"schedules"},{"id":"f5e7c666-cb9a-11f0-ae87-2a5e5028fcef","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"a42481db-6918-45ef-a923-5548004f044a","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"a42481db-6918-45ef-a923-5548004f044a","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -77,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"897cc698-80ee-47cf-b59a-130323f2d483","type":"policies","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"70f924ad-d57b-4b37-92b1-adc275a37923","type":"steps"},{"id":"06639547-3fbf-431c-9719-c7211a3d34aa","type":"steps"}]},"teams":{"data":[{"id":"5007e30b-5736-4abe-be9c-51cf508c9554","type":"teams"}]}}}}' + body: '{"data":{"id":"c25d7cd6-d2bc-4d84-801b-3a09d62e29bc","type":"policies","attributes":{"name":"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1764252685","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"b445f325-7fca-44d5-a7e2-2a16e8bc2837","type":"steps"},{"id":"b9c6527e-9c8d-4c93-92cf-100b5c180a1e","type":"steps"}]},"teams":{"data":[{"id":"a42481db-6918-45ef-a923-5548004f044a","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -92,7 +90,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/897cc698-80ee-47cf-b59a-130323f2d483 + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/c25d7cd6-d2bc-4d84-801b-3a09d62e29bc response: body: '' code: 204 @@ -107,9 +105,9 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/897cc698-80ee-47cf-b59a-130323f2d483 + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/c25d7cd6-d2bc-4d84-801b-3a09d62e29bc response: - body: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[897cc698-80ee-47cf-b59a-130323f2d483] + body: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[c25d7cd6-d2bc-4d84-801b-3a09d62e29bc] not found"}]}' code: 404 duration: 0ms @@ -125,7 +123,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/5bedf04a-b064-4748-861d-2f32970de31e + url: https://api.datadoghq.com/api/v2/on-call/schedules/cf196f34-3ce0-4cff-a27e-ed5035db9442 response: body: '' code: 204 @@ -140,7 +138,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554 + url: https://api.datadoghq.com/api/v2/team/a42481db-6918-45ef-a923-5548004f044a response: body: '' code: 204 @@ -155,7 +153,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/users/e524a559-3c48-11f0-b6eb-6e406f40657f + url: https://api.datadoghq.com/api/v2/users/f5e7c666-cb9a-11f0-ae87-2a5e5028fcef response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.freeze index faf03500664..41f78537845 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:48.818Z \ No newline at end of file +2025-11-27T14:11:30.983Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.yaml index 655d12539c6..052a64e14ac 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Delete_On-Call_schedule_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Delete_On_Call_schedule_returns_No_Content_response-1764252690@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"e913c34d-3c48-11f0-b10e-2e2b611e1022","attributes":{"name":null,"handle":"test-delete_on_call_schedule_returns_no_content_response-1748494428@datadoghq.com","created_at":"2025-05-29T04:53:49.418406+00:00","modified_at":"2025-05-29T04:53:49.418406+00:00","email":"test-delete_on_call_schedule_returns_no_content_response-1748494428@datadoghq.com","icon":"https://secure.gravatar.com/avatar/97e38917640a0eb3c61f6e1219165929?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"f9249a49-cb9a-11f0-a56e-4e680b759023","attributes":{"name":null,"handle":"test-delete_on_call_schedule_returns_no_content_response-1764252690@datadoghq.com","created_at":"2025-11-27T14:11:31.381378+00:00","modified_at":"2025-11-27T14:11:31.381378+00:00","email":"test-delete_on_call_schedule_returns_no_content_response-1764252690@datadoghq.com","icon":"https://secure.gravatar.com/avatar/4d40d1e80a1a87fede5c7a11db2bf7f2?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:48.818Z","end_date":"2025-06-08T04:53:48.818Z","interval":{"days":1},"members":[{"user":{"id":"e913c34d-3c48-11f0-b10e-2e2b611e1022"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:48.818Z"}],"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:30.983Z","end_date":"2025-12-07T14:11:30.983Z","interval":{"days":1},"members":[{"user":{"id":"f9249a49-cb9a-11f0-a56e-4e680b759023"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:30.983Z"}],"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1764252690","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"4068aec3-24f3-41c6-8778-72f8754684c3","type":"schedules","attributes":{"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"671b7e9e-1bcf-4e7a-817e-3b825b7dd3e6","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"10acf747-60a0-4bdf-a0df-196e9f9291e2","type":"schedules","attributes":{"name":"Test-Delete_On_Call_schedule_returns_No_Content_response-1764252690","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"806b7079-20af-41d1-9f50-badf49b324f5","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/4068aec3-24f3-41c6-8778-72f8754684c3 + url: https://api.datadoghq.com/api/v2/on-call/schedules/10acf747-60a0-4bdf-a0df-196e9f9291e2 response: body: '' code: 204 @@ -65,9 +65,9 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/4068aec3-24f3-41c6-8778-72f8754684c3 + url: https://api.datadoghq.com/api/v2/on-call/schedules/10acf747-60a0-4bdf-a0df-196e9f9291e2 response: - body: '{"errors":[{"title":"Generic Error","detail":"schedule[4068aec3-24f3-41c6-8778-72f8754684c3] + body: '{"errors":[{"title":"Generic Error","detail":"schedule[10acf747-60a0-4bdf-a0df-196e9f9291e2] not found"}]}' code: 404 duration: 0ms @@ -83,7 +83,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/e913c34d-3c48-11f0-b10e-2e2b611e1022 + url: https://api.datadoghq.com/api/v2/users/f9249a49-cb9a-11f0-a56e-4e680b759023 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.freeze index b08c0417dca..e08e7183ed1 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:52.267Z \ No newline at end of file +2025-11-27T14:11:33.368Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.yaml index df82fe75b65..c22cec31422 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_escalation_policy_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"eb22c300-3c48-11f0-b6eb-6e406f40657f","attributes":{"name":null,"handle":"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com","created_at":"2025-05-29T04:53:52.872150+00:00","modified_at":"2025-05-29T04:53:52.872150+00:00","email":"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28954a95ef3e23c51599bc32b67118de?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"fa8dbd27-cb9a-11f0-84fc-d6e063989c3f","attributes":{"name":null,"handle":"test-get_on_call_escalation_policy_returns_ok_response-1764252693@datadoghq.com","created_at":"2025-11-27T14:11:33.748105+00:00","modified_at":"2025-11-27T14:11:33.748105+00:00","email":"test-get_on_call_escalation_policy_returns_ok_response-1764252693@datadoghq.com","icon":"https://secure.gravatar.com/avatar/3b312cc1a86be5f85aab5fada68c24c4?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-bbce2cc58d5af798","name":"test-name-bbce2cc58d5af798"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-9b417dea223136e8","name":"test-name-9b417dea223136e8"},"type":"team"}} form: {} headers: Accept: @@ -35,18 +35,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","attributes":{"name":"test-name-bbce2cc58d5af798","handle":"test-handle-bbce2cc58d5af798","summary":null,"description":null,"avatar":null,"banner":9,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-29T04:53:53.543425+00:00","modified_at":"2025-05-29T04:53:53.543434+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e/permission-settings"}}}}} - - ' + body: '{"data":{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"team","attributes":{"avatar":null,"banner":8,"created_at":"2025-11-27T14:11:34.252521+00:00","description":null,"handle":"test-handle-9b417dea223136e8","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:34.252521+00:00","name":"test-name-9b417dea223136e8","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/bf2fad34-c495-4de0-b1ec-c5727a2ae216/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/bf2fad34-c495-4de0-b1ec-c5727a2ae216/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:52.267Z","end_date":"2025-06-08T04:53:52.267Z","interval":{"days":1},"members":[{"user":{"id":"eb22c300-3c48-11f0-b6eb-6e406f40657f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:52.267Z"}],"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:33.368Z","end_date":"2025-12-07T14:11:33.368Z","interval":{"days":1},"members":[{"user":{"id":"fa8dbd27-cb9a-11f0-84fc-d6e063989c3f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:33.368Z"}],"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -57,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"996bb88f-ddaf-491b-84df-b8c60c9c358a","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"016cfd54-38ec-4d23-938b-f07e8643a3f7","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"8d44f496-4fe0-4cc9-b3d7-81bbc3e68464","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -66,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"},{"id":"996bb88f-ddaf-491b-84df-b8c60c9c358a","type":"schedules"},{"id":"eb22c300-3c48-11f0-b6eb-6e406f40657f","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"},{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules"},{"id":"fa8dbd27-cb9a-11f0-84fc-d6e063989c3f","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -77,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"e75b436d-cbb7-44d6-bf87-4f53073a5bb5","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b","type":"steps"},{"id":"f11818e3-db9e-4601-b1e1-391fa54b6087","type":"steps"}]},"teams":{"data":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"}]}}}}' + body: '{"data":{"id":"7e36daf1-25ef-46af-ba33-23aac9271dc5","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"e4f3f753-15bd-4649-bdeb-70011094d294","type":"steps"},{"id":"984250f3-e780-4aae-80c1-143859d0f14b","type":"steps"}]},"teams":{"data":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -92,9 +90,9 @@ interactions: - application/json id: 4 method: GET - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/e75b436d-cbb7-44d6-bf87-4f53073a5bb5?include=steps.targets + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7e36daf1-25ef-46af-ba33-23aac9271dc5?include=steps.targets response: - body: '{"data":{"id":"e75b436d-cbb7-44d6-bf87-4f53073a5bb5","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b","type":"steps"},{"id":"f11818e3-db9e-4601-b1e1-391fa54b6087","type":"steps"}]},"teams":{"data":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"}]}}},"included":[{"id":"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"},{"id":"996bb88f-ddaf-491b-84df-b8c60c9c358a","type":"schedules"},{"id":"eb22c300-3c48-11f0-b6eb-6e406f40657f","type":"users"}]}}},{"id":"f11818e3-db9e-4601-b1e1-391fa54b6087","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams"}]}}},{"id":"996bb88f-ddaf-491b-84df-b8c60c9c358a","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"016cfd54-38ec-4d23-938b-f07e8643a3f7","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"eb22c300-3c48-11f0-b6eb-6e406f40657f","type":"users","attributes":{"email":"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com","name":"","status":"pending"}},{"id":"dba59993-2c99-46f0-b91b-9e7936a4a78e","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-bbce2cc58d5af798","name":"test-name-bbce2cc58d5af798"}}]}' + body: '{"data":{"id":"7e36daf1-25ef-46af-ba33-23aac9271dc5","type":"policies","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"e4f3f753-15bd-4649-bdeb-70011094d294","type":"steps"},{"id":"984250f3-e780-4aae-80c1-143859d0f14b","type":"steps"}]},"teams":{"data":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"}]}}},"included":[{"id":"e4f3f753-15bd-4649-bdeb-70011094d294","type":"steps","attributes":{"assignment":"default","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"},{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules"},{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3_previous","type":"schedule_target"},{"id":"fa8dbd27-cb9a-11f0-84fc-d6e063989c3f","type":"users"}]}}},{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3_previous","type":"schedule_target","attributes":{"position":"previous"},"relationships":{"schedule":{"data":{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules"}}}},{"id":"984250f3-e780-4aae-80c1-143859d0f14b","type":"steps","attributes":{"assignment":"round-robin","escalate_after_seconds":3600},"relationships":{"targets":{"data":[{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams"}]}}},{"id":"bf2fad34-c495-4de0-b1ec-c5727a2ae216","type":"teams","attributes":{"avatar":"","description":"","handle":"test-handle-9b417dea223136e8","name":"test-name-9b417dea223136e8"}},{"id":"d8834350-ae3c-45eb-ad84-9f9a3cef46f3","type":"schedules","attributes":{"name":"Test-Get_On_Call_escalation_policy_returns_OK_response-1764252693","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"8d44f496-4fe0-4cc9-b3d7-81bbc3e68464","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}},{"id":"fa8dbd27-cb9a-11f0-84fc-d6e063989c3f","type":"users","attributes":{"email":"test-get_on_call_escalation_policy_returns_ok_response-1764252693@datadoghq.com","name":"","status":"pending"}}]}' code: 200 duration: 0ms headers: @@ -109,7 +107,7 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/e75b436d-cbb7-44d6-bf87-4f53073a5bb5 + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7e36daf1-25ef-46af-ba33-23aac9271dc5 response: body: '' code: 204 @@ -124,7 +122,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/996bb88f-ddaf-491b-84df-b8c60c9c358a + url: https://api.datadoghq.com/api/v2/on-call/schedules/d8834350-ae3c-45eb-ad84-9f9a3cef46f3 response: body: '' code: 204 @@ -139,7 +137,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e + url: https://api.datadoghq.com/api/v2/team/bf2fad34-c495-4de0-b1ec-c5727a2ae216 response: body: '' code: 204 @@ -154,7 +152,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/users/eb22c300-3c48-11f0-b6eb-6e406f40657f + url: https://api.datadoghq.com/api/v2/users/fa8dbd27-cb9a-11f0-84fc-d6e063989c3f response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.freeze index 0279e1e8caf..e4e809a1e35 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-29T04:53:58.508Z \ No newline at end of file +2025-11-27T14:11:37.612Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.yaml index 0108c81539f..65753822096 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_On-Call_schedule_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_On_Call_schedule_returns_OK_response-1748494438@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Get_On_Call_schedule_returns_OK_response-1764252697@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"eedd114a-3c48-11f0-927d-aedf77869272","attributes":{"name":null,"handle":"test-get_on_call_schedule_returns_ok_response-1748494438@datadoghq.com","created_at":"2025-05-29T04:53:59.126285+00:00","modified_at":"2025-05-29T04:53:59.126285+00:00","email":"test-get_on_call_schedule_returns_ok_response-1748494438@datadoghq.com","icon":"https://secure.gravatar.com/avatar/0accc7b5a2e934dd438cd3b30841dcad?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"fd12eb55-cb9a-11f0-8fcd-5ac0b02adf59","attributes":{"name":null,"handle":"test-get_on_call_schedule_returns_ok_response-1764252697@datadoghq.com","created_at":"2025-11-27T14:11:37.976362+00:00","modified_at":"2025-11-27T14:11:37.976362+00:00","email":"test-get_on_call_schedule_returns_ok_response-1764252697@datadoghq.com","icon":"https://secure.gravatar.com/avatar/56aea300d0912ed694b8ff04cfcc86aa?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:53:58.508Z","end_date":"2025-06-08T04:53:58.508Z","interval":{"days":1},"members":[{"user":{"id":"eedd114a-3c48-11f0-927d-aedf77869272"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:53:58.508Z"}],"name":"Test-Get_On_Call_schedule_returns_OK_response-1748494438","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:37.612Z","end_date":"2025-12-07T14:11:37.612Z","interval":{"days":1},"members":[{"user":{"id":"fd12eb55-cb9a-11f0-8fcd-5ac0b02adf59"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:37.612Z"}],"name":"Test-Get_On_Call_schedule_returns_OK_response-1764252697","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"cec4edfd-3f99-4da9-bd71-75c80c5629f8","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1748494438","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9f5d591e-e81b-4262-b0cd-145b52b9f23f","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"ba513209-ef94-4826-8511-1c5ccb912070","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1764252697","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9bb587a7-8302-49f3-8130-cb417de4ecd5","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -50,9 +50,9 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/on-call/schedules/cec4edfd-3f99-4da9-bd71-75c80c5629f8 + url: https://api.datadoghq.com/api/v2/on-call/schedules/ba513209-ef94-4826-8511-1c5ccb912070 response: - body: '{"data":{"id":"cec4edfd-3f99-4da9-bd71-75c80c5629f8","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1748494438","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9f5d591e-e81b-4262-b0cd-145b52b9f23f","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"ba513209-ef94-4826-8511-1c5ccb912070","type":"schedules","attributes":{"name":"Test-Get_On_Call_schedule_returns_OK_response-1764252697","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9bb587a7-8302-49f3-8130-cb417de4ecd5","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 200 duration: 0ms headers: @@ -67,7 +67,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/cec4edfd-3f99-4da9-bd71-75c80c5629f8 + url: https://api.datadoghq.com/api/v2/on-call/schedules/ba513209-ef94-4826-8511-1c5ccb912070 response: body: '' code: 204 @@ -82,7 +82,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/eedd114a-3c48-11f0-927d-aedf77869272 + url: https://api.datadoghq.com/api/v2/users/fd12eb55-cb9a-11f0-8fcd-5ac0b02adf59 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.freeze index a02b74ff966..899352609f4 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-18T12:44:29.751Z \ No newline at end of file +2025-11-27T14:11:42.299Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.yaml index a1838f88161..77ad9c04169 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_team_on-call_users_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_team_on_call_users_returns_OK_response-1763469869@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Get_team_on_call_users_returns_OK_response-1764252702@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"537c2919-c47c-11f0-9b08-ce88c9776d95","attributes":{"name":null,"handle":"test-get_team_on_call_users_returns_ok_response-1763469869@datadoghq.com","created_at":"2025-11-18T12:44:30.412060+00:00","modified_at":"2025-11-18T12:44:30.412060+00:00","email":"test-get_team_on_call_users_returns_ok_response-1763469869@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e1a08271c5b3a54aaa074185b1550add?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"ffde914a-cb9a-11f0-ae87-2a5e5028fcef","attributes":{"name":null,"handle":"test-get_team_on_call_users_returns_ok_response-1764252702@datadoghq.com","created_at":"2025-11-27T14:11:42.666467+00:00","modified_at":"2025-11-27T14:11:42.666467+00:00","email":"test-get_team_on_call_users_returns_ok_response-1764252702@datadoghq.com","icon":"https://secure.gravatar.com/avatar/0bc277f36ed2ab487375205fafaaebc7?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-b0479fe6a2cd9873","name":"test-name-b0479fe6a2cd9873"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-ecfc4ff61997ed40","name":"test-name-ecfc4ff61997ed40"},"type":"team"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"team","attributes":{"avatar":null,"banner":15,"created_at":"2025-11-18T12:44:31.250613+00:00","description":null,"handle":"test-handle-b0479fe6a2cd9873","hidden_modules":[],"link_count":0,"modified_at":"2025-11-18T12:44:31.250613+00:00","name":"test-name-b0479fe6a2cd9873","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/11ba6480-761b-4dbd-b4a0-c77a9df6740c/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/11ba6480-761b-4dbd-b4a0-c77a9df6740c/permission-settings"}}}}}' + body: '{"data":{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-27T14:11:43.090563+00:00","description":null,"handle":"test-handle-ecfc4ff61997ed40","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:43.090563+00:00","name":"test-name-ecfc4ff61997ed40","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/fc8f8844-54c3-4898-aabc-68d6fccbe20e/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/fc8f8844-54c3-4898-aabc-68d6fccbe20e/permission-settings"}}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-11-08T12:44:29.751Z","end_date":"2025-11-28T12:44:29.751Z","interval":{"days":1},"members":[{"user":{"id":"537c2919-c47c-11f0-9b08-ce88c9776d95"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-13T12:44:29.751Z"}],"name":"Test-Get_team_on_call_users_returns_OK_response-1763469869","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:42.299Z","end_date":"2025-12-07T14:11:42.299Z","interval":{"days":1},"members":[{"user":{"id":"ffde914a-cb9a-11f0-ae87-2a5e5028fcef"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:42.299Z"}],"name":"Test-Get_team_on_call_users_returns_OK_response-1764252702","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -55,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"3be141a8-848d-4af1-86de-e5d76cd6e4fc","type":"schedules","attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1763469869","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"0c2a552f-a2e0-47ca-ad8b-4407608b3f67","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"4325ddef-dc72-4609-90c2-01167759f277","type":"schedules","attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1764252702","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"86d3719a-7516-46f0-bfc4-2bd40ad1b855","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -64,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1763469869","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"teams"},{"id":"3be141a8-848d-4af1-86de-e5d76cd6e4fc","type":"schedules"},{"id":"537c2919-c47c-11f0-9b08-ce88c9776d95","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1764252702","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"teams"},{"id":"4325ddef-dc72-4609-90c2-01167759f277","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"4325ddef-dc72-4609-90c2-01167759f277","type":"schedules"},{"id":"ffde914a-cb9a-11f0-ae87-2a5e5028fcef","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -75,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"5fe7a7c8-a2c1-4f07-9510-a5d483df5ae7","type":"policies","attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1763469869","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"11f436b4-85bf-47c8-ab21-e851974ccf60","type":"steps"},{"id":"6f0da5a9-4b7d-4d12-a859-4799599f074d","type":"steps"}]},"teams":{"data":[{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"teams"}]}}}}' + body: '{"data":{"id":"5a7ecb26-4ebe-4496-bcfb-ff30c655a1a9","type":"policies","attributes":{"name":"Test-Get_team_on_call_users_returns_OK_response-1764252702","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"2694ac87-8900-4b0f-a108-fb8961c7ef89","type":"steps"},{"id":"e41057da-895e-4a23-81f2-617f61c53a84","type":"steps"}]},"teams":{"data":[{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -84,7 +84,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rules":[{"actions":[],"policy_id":"5fe7a7c8-a2c1-4f07-9510-a5d483df5ae7","query":"","urgency":"low"}]},"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[{"actions":[],"policy_id":"5a7ecb26-4ebe-4496-bcfb-ff30c655a1a9","query":"","urgency":"low"}]},"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"team_routing_rules"}} form: {} headers: Accept: @@ -93,9 +93,9 @@ interactions: - application/json id: 4 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/11ba6480-761b-4dbd-b4a0-c77a9df6740c/routing-rules + url: https://api.datadoghq.com/api/v2/on-call/teams/fc8f8844-54c3-4898-aabc-68d6fccbe20e/routing-rules response: - body: '{"data":{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-11ba6480-761b-4dbd-b4a0-c77a9df6740c-rule-0","type":"team_routing_rules"}]}}}}' + body: '{"data":{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-fc8f8844-54c3-4898-aabc-68d6fccbe20e-rule-0","type":"team_routing_rules"}]}}}}' code: 200 duration: 0ms headers: @@ -110,9 +110,9 @@ interactions: - application/json id: 5 method: GET - url: https://api.datadoghq.com/api/v2/on-call/teams/11ba6480-761b-4dbd-b4a0-c77a9df6740c/on-call?include=responders%2Cescalations.responders + url: https://api.datadoghq.com/api/v2/on-call/teams/fc8f8844-54c3-4898-aabc-68d6fccbe20e/on-call?include=responders%2Cescalations.responders response: - body: '{"data":{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c-1763469873","type":"team_oncall_responders","relationships":{"escalations":{"data":[]},"responders":{"data":[{"id":"537c2919-c47c-11f0-9b08-ce88c9776d95","type":"users"}]}}},"included":[{"id":"537c2919-c47c-11f0-9b08-ce88c9776d95","type":"users","attributes":{"email":"test-get_team_on_call_users_returns_ok_response-1763469869@datadoghq.com","name":"","status":"pending"}}]}' + body: '{"data":{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e-1764252704","type":"team_oncall_responders","relationships":{"escalations":{"data":[]},"responders":{"data":[{"id":"ffde914a-cb9a-11f0-ae87-2a5e5028fcef","type":"users"}]}}},"included":[{"id":"ffde914a-cb9a-11f0-ae87-2a5e5028fcef","type":"users","attributes":{"email":"test-get_team_on_call_users_returns_ok_response-1764252702@datadoghq.com","name":"","status":"pending"}}]}' code: 200 duration: 0ms headers: @@ -121,7 +121,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"rules":[]},"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[]},"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"team_routing_rules"}} form: {} headers: Accept: @@ -130,9 +130,9 @@ interactions: - application/json id: 6 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/11ba6480-761b-4dbd-b4a0-c77a9df6740c/routing-rules + url: https://api.datadoghq.com/api/v2/on-call/teams/fc8f8844-54c3-4898-aabc-68d6fccbe20e/routing-rules response: - body: '{"data":{"id":"11ba6480-761b-4dbd-b4a0-c77a9df6740c","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' + body: '{"data":{"id":"fc8f8844-54c3-4898-aabc-68d6fccbe20e","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' code: 200 duration: 0ms headers: @@ -147,7 +147,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/5fe7a7c8-a2c1-4f07-9510-a5d483df5ae7 + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/5a7ecb26-4ebe-4496-bcfb-ff30c655a1a9 response: body: '' code: 204 @@ -162,7 +162,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/3be141a8-848d-4af1-86de-e5d76cd6e4fc + url: https://api.datadoghq.com/api/v2/on-call/schedules/4325ddef-dc72-4609-90c2-01167759f277 response: body: '' code: 204 @@ -177,7 +177,7 @@ interactions: - '*/*' id: 9 method: DELETE - url: https://api.datadoghq.com/api/v2/team/11ba6480-761b-4dbd-b4a0-c77a9df6740c + url: https://api.datadoghq.com/api/v2/team/fc8f8844-54c3-4898-aabc-68d6fccbe20e response: body: '' code: 204 @@ -192,7 +192,7 @@ interactions: - '*/*' id: 10 method: DELETE - url: https://api.datadoghq.com/api/v2/users/537c2919-c47c-11f0-9b08-ce88c9776d95 + url: https://api.datadoghq.com/api/v2/users/ffde914a-cb9a-11f0-ae87-2a5e5028fcef response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.freeze index 1a1c3b8e706..baa8f4a5897 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-29T04:54:08.864Z \ No newline at end of file +2025-11-27T14:11:47.631Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.yaml index c971e60991f..61a50cbfa4c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Get_the_schedule_on-call_user_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Get_the_schedule_on_call_user_returns_OK_response-1764252707@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"f506d945-3c48-11f0-b6eb-6e406f40657f","attributes":{"name":null,"handle":"test-get_the_schedule_on_call_user_returns_ok_response-1748494448@datadoghq.com","created_at":"2025-05-29T04:54:09.466437+00:00","modified_at":"2025-05-29T04:54:09.466437+00:00","email":"test-get_the_schedule_on_call_user_returns_ok_response-1748494448@datadoghq.com","icon":"https://secure.gravatar.com/avatar/6c6e9988bfb6ab3c5c5ae2111d47fc54?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"030e767a-cb9b-11f0-8fcd-5ac0b02adf59","attributes":{"name":null,"handle":"test-get_the_schedule_on_call_user_returns_ok_response-1764252707@datadoghq.com","created_at":"2025-11-27T14:11:48.013486+00:00","modified_at":"2025-11-27T14:11:48.013486+00:00","email":"test-get_the_schedule_on_call_user_returns_ok_response-1764252707@datadoghq.com","icon":"https://secure.gravatar.com/avatar/a9e8940d153698e24c0b29024875d46f?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:54:08.864Z","end_date":"2025-06-08T04:54:08.864Z","interval":{"days":1},"members":[{"user":{"id":"f506d945-3c48-11f0-b6eb-6e406f40657f"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:54:08.864Z"}],"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:47.631Z","end_date":"2025-12-07T14:11:47.631Z","interval":{"days":1},"members":[{"user":{"id":"030e767a-cb9b-11f0-8fcd-5ac0b02adf59"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:47.631Z"}],"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1764252707","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"3e8644f0-f579-4459-8cb3-e585cd817db1","type":"schedules","attributes":{"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"00847dac-89e7-4a60-8e72-9a5897a3a1e5","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"93a33505-71dc-4be4-a55d-95eb23b6b400","type":"schedules","attributes":{"name":"Test-Get_the_schedule_on_call_user_returns_OK_response-1764252707","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"c9addf6a-059c-4b07-aced-a2c287fd969f","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -50,9 +50,9 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/on-call/schedules/3e8644f0-f579-4459-8cb3-e585cd817db1/on-call + url: https://api.datadoghq.com/api/v2/on-call/schedules/93a33505-71dc-4be4-a55d-95eb23b6b400/on-call response: - body: '{"data":{"id":"f506d945-3c48-11f0-b6eb-6e406f40657f-2025-05-29T00:54:10-04:00-2025-05-30T00:54:08-04:00","type":"shifts","attributes":{"end":"2025-05-30T00:54:08-04:00","start":"2025-05-29T00:54:10.138754-04:00"},"relationships":{"user":{"data":{"id":"f506d945-3c48-11f0-b6eb-6e406f40657f","type":"users"}}}}}' + body: '{"data":{"id":"030e767a-cb9b-11f0-8fcd-5ac0b02adf59-2025-11-27T09:11:48-05:00-2025-11-28T09:11:47-05:00","type":"shifts","attributes":{"end":"2025-11-28T09:11:47-05:00","start":"2025-11-27T09:11:48.47496-05:00"},"relationships":{"user":{"data":{"id":"030e767a-cb9b-11f0-8fcd-5ac0b02adf59","type":"users"}}}}}' code: 200 duration: 0ms headers: @@ -67,7 +67,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/3e8644f0-f579-4459-8cb3-e585cd817db1 + url: https://api.datadoghq.com/api/v2/on-call/schedules/93a33505-71dc-4be4-a55d-95eb23b6b400 response: body: '' code: 204 @@ -82,7 +82,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/f506d945-3c48-11f0-b6eb-6e406f40657f + url: https://api.datadoghq.com/api/v2/users/030e767a-cb9b-11f0-8fcd-5ac0b02adf59 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze index 2cf614d8066..7a29240030e 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-18T13:04:14.085Z \ No newline at end of file +2025-11-27T14:11:49.966Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml index 32a80fe4549..2772f0617fa 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1763471054@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"15c47aed-c47f-11f0-9f0b-be6d33dcd787","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1763471054@datadoghq.com","created_at":"2025-11-18T13:04:15.357470+00:00","modified_at":"2025-11-18T13:04:15.357470+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1763471054@datadoghq.com","icon":"https://secure.gravatar.com/avatar/958eeb5c5b80b7b5b4ec2f1794031763?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","created_at":"2025-11-27T14:11:50.355271+00:00","modified_at":"2025-11-27T14:11:50.355271+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ad92f892fdf302962d879c0d02664d8e?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-f77a37b001e848f1","name":"test-name-f77a37b001e848f1"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-a7692378c203a880","name":"test-name-a7692378c203a880"},"type":"team"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"team","attributes":{"avatar":null,"banner":6,"created_at":"2025-11-18T13:04:15.712638+00:00","description":null,"handle":"test-handle-f77a37b001e848f1","hidden_modules":[],"link_count":0,"modified_at":"2025-11-18T13:04:15.712638+00:00","name":"test-name-f77a37b001e848f1","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/8ab3f777-435e-42b6-8511-0c9020365b8d/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/8ab3f777-435e-42b6-8511-0c9020365b8d/permission-settings"}}}}}' + body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team","attributes":{"avatar":null,"banner":14,"created_at":"2025-11-27T14:11:50.842947+00:00","description":null,"handle":"test-handle-a7692378c203a880","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:50.842947+00:00","name":"test-name-a7692378c203a880","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/permission-settings"}}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-11-08T13:04:14.085Z","end_date":"2025-11-28T13:04:14.085Z","interval":{"days":1},"members":[{"user":{"id":"15c47aed-c47f-11f0-9f0b-be6d33dcd787"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-13T13:04:14.085Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1763471054","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:49.966Z","end_date":"2025-12-07T14:11:49.966Z","interval":{"days":1},"members":[{"user":{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:49.966Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -55,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"10ab1649-e333-41ac-9271-3484b87939a7","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1763471054","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"f0e28d78-8563-4d83-8d67-0b079bd7fab7","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"0eecb6fe-83c6-48c9-9e0e-82379498f733","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -64,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1763471054","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"teams"},{"id":"10ab1649-e333-41ac-9271-3484b87939a7","type":"schedules"},{"id":"15c47aed-c47f-11f0-9f0b-be6d33dcd787","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"},{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -75,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"ad66e3aa-4df4-4ab0-b928-03abd68cc44e","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1763471054","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"975ba331-0aaa-4878-9660-c1f580b01711","type":"steps"},{"id":"4b342992-de9c-4163-9360-ee63a115519a","type":"steps"}]},"teams":{"data":[{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"teams"}]}}}}' + body: '{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"533f661e-6a1f-4327-8d3f-035add94cff8","type":"steps"},{"id":"b8948730-6aec-4a51-8662-cce4026b94dc","type":"steps"}]},"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -84,7 +84,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rules":[{"actions":[{"channel":"channel","type":"send_slack_message","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"restrictions":[{"end_day":"monday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"},{"end_day":"tuesday","end_time":"17:00:00","start_day":"tuesday","start_time":"09:00:00"}],"time_zone":"Europe/Paris"}},{"policy_id":"ad66e3aa-4df4-4ab0-b928-03abd68cc44e","query":"","urgency":"low"}]},"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[{"actions":[{"channel":"channel","type":"send_slack_message","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"restrictions":[{"end_day":"monday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"},{"end_day":"tuesday","end_time":"17:00:00","start_day":"tuesday","start_time":"09:00:00"}],"time_zone":"Europe/Paris"}},{"policy_id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","query":"","urgency":"low"}]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}} form: {} headers: Accept: @@ -93,9 +93,9 @@ interactions: - application/json id: 4 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/8ab3f777-435e-42b6-8511-0c9020365b8d/routing-rules?include=rules + url: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules?include=rules response: - body: '{"data":{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-8ab3f777-435e-42b6-8511-0c9020365b8d-rule-0","type":"team_routing_rules"},{"id":"virtual-8ab3f777-435e-42b6-8511-0c9020365b8d-rule-1","type":"team_routing_rules"}]}}},"included":[{"id":"virtual-8ab3f777-435e-42b6-8511-0c9020365b8d-rule-0","type":"team_routing_rules","attributes":{"actions":[{"type":"send_slack_message","channel":"channel","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]}},"relationships":{"policy":{"data":null}}},{"id":"virtual-8ab3f777-435e-42b6-8511-0c9020365b8d-rule-1","type":"team_routing_rules","attributes":{"actions":[],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"ad66e3aa-4df4-4ab0-b928-03abd68cc44e","type":"policies"}}}}]}' + body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules"},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules"}]}}},"included":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules","attributes":{"actions":[{"type":"send_slack_message","channel":"channel","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]}},"relationships":{"policy":{"data":null}}},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules","attributes":{"actions":[],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies"}}}}]}' code: 200 duration: 0ms headers: @@ -104,7 +104,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"rules":[]},"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}} form: {} headers: Accept: @@ -113,9 +113,9 @@ interactions: - application/json id: 5 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/8ab3f777-435e-42b6-8511-0c9020365b8d/routing-rules + url: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules response: - body: '{"data":{"id":"8ab3f777-435e-42b6-8511-0c9020365b8d","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' + body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' code: 200 duration: 0ms headers: @@ -130,7 +130,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/ad66e3aa-4df4-4ab0-b928-03abd68cc44e + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/66f0e922-2834-4d68-aa0b-98cc81fc2a9d response: body: '' code: 204 @@ -145,7 +145,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/10ab1649-e333-41ac-9271-3484b87939a7 + url: https://api.datadoghq.com/api/v2/on-call/schedules/1f9b0595-17a3-4d95-9b2e-edcea3b6e737 response: body: '' code: 204 @@ -160,7 +160,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/team/8ab3f777-435e-42b6-8511-0c9020365b8d + url: https://api.datadoghq.com/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8 response: body: '' code: 204 @@ -175,7 +175,7 @@ interactions: - '*/*' id: 9 method: DELETE - url: https://api.datadoghq.com/api/v2/users/15c47aed-c47f-11f0-9f0b-be6d33dcd787 + url: https://api.datadoghq.com/api/v2/users/0473ca92-cb9b-11f0-85f9-9a82ffe01443 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.freeze index dcfe9e95351..d64fddeda72 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-29T04:54:18.437Z \ No newline at end of file +2025-11-27T14:11:54.763Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.yaml index 65ba3713a33..722080823ad 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_escalation_policy_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"fabd9ae0-3c48-11f0-b407-16d8dc894a02","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1748494458@datadoghq.com","created_at":"2025-05-29T04:54:19.052756+00:00","modified_at":"2025-05-29T04:54:19.052756+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1748494458@datadoghq.com","icon":"https://secure.gravatar.com/avatar/cf87c53bf68b572610145962e6965e0c?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"074d412b-cb9b-11f0-85f9-9a82ffe01443","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1764252714@datadoghq.com","created_at":"2025-11-27T14:11:55.135880+00:00","modified_at":"2025-11-27T14:11:55.135880+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1764252714@datadoghq.com","icon":"https://secure.gravatar.com/avatar/56710b9d4c6476f7e9cb32cf32f2d8fa?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-e987bfc60cf27d84","name":"test-name-e987bfc60cf27d84"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-87ae65b051bd37ef","name":"test-name-87ae65b051bd37ef"},"type":"team"}} form: {} headers: Accept: @@ -35,18 +35,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","attributes":{"name":"test-name-e987bfc60cf27d84","handle":"test-handle-e987bfc60cf27d84","summary":null,"description":null,"avatar":null,"banner":3,"visible_modules":[],"hidden_modules":[],"created_at":"2025-05-29T04:54:19.729870+00:00","modified_at":"2025-05-29T04:54:19.729879+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6/permission-settings"}}}}} - - ' + body: '{"data":{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-27T14:11:55.632151+00:00","description":null,"handle":"test-handle-87ae65b051bd37ef","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:55.632152+00:00","name":"test-name-87ae65b051bd37ef","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/f38d82f9-3de9-4a4a-8a48-650c0b19151f/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/f38d82f9-3de9-4a4a-8a48-650c0b19151f/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-05-19T04:54:18.437Z","end_date":"2025-06-08T04:54:18.437Z","interval":{"days":1},"members":[{"user":{"id":"fabd9ae0-3c48-11f0-b407-16d8dc894a02"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-05-24T04:54:18.437Z"}],"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:54.763Z","end_date":"2025-12-07T14:11:54.763Z","interval":{"days":1},"members":[{"user":{"id":"074d412b-cb9b-11f0-85f9-9a82ffe01443"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:54.763Z"}],"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -57,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"f8a9543a-dc0f-4d81-bb16-7054201fa099","type":"schedules","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"f2cc2a31-c4f9-40bf-9820-93af15c77625","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"1ab20921-4556-4f30-80df-e1ce748c3fc1","type":"schedules","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"94644551-c1bd-4b16-8774-ddbf0b6ce12c","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -66,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"},{"id":"f8a9543a-dc0f-4d81-bb16-7054201fa099","type":"schedules"},{"id":"fabd9ae0-3c48-11f0-b407-16d8dc894a02","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"},{"id":"1ab20921-4556-4f30-80df-e1ce748c3fc1","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"1ab20921-4556-4f30-80df-e1ce748c3fc1","type":"schedules"},{"id":"074d412b-cb9b-11f0-85f9-9a82ffe01443","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -77,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"05ee91ac-c049-4e7c-b43b-3f673a7ce96d","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"6a0d2106-0430-4211-af70-54ea18031d0d","type":"steps"},{"id":"f4c4d70e-72e5-4f5c-89fb-bf7aea612c1b","type":"steps"}]},"teams":{"data":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"}]}}}}' + body: '{"data":{"id":"b20fdf89-f87f-4237-8f19-ed8c9c57cf5c","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"6d4b5398-50bf-425d-93b8-3eae379ff8a0","type":"steps"},{"id":"b3f4a0dd-337f-42b7-9fda-b2f4486e700f","type":"steps"}]},"teams":{"data":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -86,7 +84,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"6a0d2106-0430-4211-af70-54ea18031d0d","targets":[{"id":"fabd9ae0-3c48-11f0-b407-16d8dc894a02","type":"users"}]}]},"id":"05ee91ac-c049-4e7c-b43b-3f673a7ce96d","relationships":{"teams":{"data":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"6d4b5398-50bf-425d-93b8-3eae379ff8a0","targets":[{"id":"074d412b-cb9b-11f0-85f9-9a82ffe01443","type":"users"}]}]},"id":"b20fdf89-f87f-4237-8f19-ed8c9c57cf5c","relationships":{"teams":{"data":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -95,9 +93,9 @@ interactions: - application/json id: 4 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/05ee91ac-c049-4e7c-b43b-3f673a7ce96d + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b20fdf89-f87f-4237-8f19-ed8c9c57cf5c response: - body: '{"data":{"id":"05ee91ac-c049-4e7c-b43b-3f673a7ce96d","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"6a0d2106-0430-4211-af70-54ea18031d0d","type":"steps"}]},"teams":{"data":[{"id":"37ea8c60-77bd-4154-ba2e-ac59d25541c6","type":"teams"}]}}}}' + body: '{"data":{"id":"b20fdf89-f87f-4237-8f19-ed8c9c57cf5c","type":"policies","attributes":{"name":"Test-Update_On_Call_escalation_policy_returns_OK_response-1764252714-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"6d4b5398-50bf-425d-93b8-3eae379ff8a0","type":"steps"}]},"teams":{"data":[{"id":"f38d82f9-3de9-4a4a-8a48-650c0b19151f","type":"teams"}]}}}}' code: 200 duration: 0ms headers: @@ -112,7 +110,7 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/05ee91ac-c049-4e7c-b43b-3f673a7ce96d + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b20fdf89-f87f-4237-8f19-ed8c9c57cf5c response: body: '' code: 204 @@ -127,7 +125,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/f8a9543a-dc0f-4d81-bb16-7054201fa099 + url: https://api.datadoghq.com/api/v2/on-call/schedules/1ab20921-4556-4f30-80df-e1ce748c3fc1 response: body: '' code: 204 @@ -142,7 +140,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6 + url: https://api.datadoghq.com/api/v2/team/f38d82f9-3de9-4a4a-8a48-650c0b19151f response: body: '' code: 204 @@ -157,7 +155,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/users/fabd9ae0-3c48-11f0-b407-16d8dc894a02 + url: https://api.datadoghq.com/api/v2/users/074d412b-cb9b-11f0-85f9-9a82ffe01443 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.freeze index 2f290d18c09..9c277407503 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.freeze @@ -1 +1 @@ -2025-07-03T14:30:45.232Z \ No newline at end of file +2025-11-27T14:11:59.069Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.yaml index be6033207f2..e7c08d9bc6a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Update_On-Call_schedule_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Update_On_Call_schedule_returns_OK_response-1751553045@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Update_On_Call_schedule_returns_OK_response-1764252719@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"4ea279a2-581a-11f0-bb4d-bed6e06a25e4","attributes":{"name":null,"handle":"test-update_on_call_schedule_returns_ok_response-1751553045@datadoghq.com","created_at":"2025-07-03T14:30:46.015046+00:00","modified_at":"2025-07-03T14:30:46.015046+00:00","email":"test-update_on_call_schedule_returns_ok_response-1751553045@datadoghq.com","icon":"https://secure.gravatar.com/avatar/8c4a38455f71bb12d82add5157f105a0?s=48&d=retro","title":"user - title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + body: '{"data":{"type":"users","id":"09e2b0f4-cb9b-11f0-a56e-4e680b759023","attributes":{"name":null,"handle":"test-update_on_call_schedule_returns_ok_response-1764252719@datadoghq.com","created_at":"2025-11-27T14:11:59.470672+00:00","modified_at":"2025-11-27T14:11:59.470672+00:00","email":"test-update_on_call_schedule_returns_ok_response-1764252719@datadoghq.com","icon":"https://secure.gravatar.com/avatar/62638e49f4a83e63caabec2a6ab50bba?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' code: 201 @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-06-23T14:30:45.232Z","end_date":"2025-07-13T14:30:45.232Z","interval":{"days":1},"members":[{"user":{"id":"4ea279a2-581a-11f0-bb4d-bed6e06a25e4"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-06-28T14:30:45.232Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1751553045","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:59.069Z","end_date":"2025-12-07T14:11:59.069Z","interval":{"days":1},"members":[{"user":{"id":"09e2b0f4-cb9b-11f0-a56e-4e680b759023"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:59.069Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1764252719","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"3cb80fa4-f506-4b2f-9187-2af6c2253698","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1751553045","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"70f75d0e-19d0-46a1-9c1c-19d2de171744","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"0e2c2b38-3f21-4216-aeb7-49eb8b371c09","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1764252719","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"140f452a-0ecf-48ab-b7e9-e358a2cf925b","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-001d7ca9284aa632","name":"test-name-001d7ca9284aa632"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-0db1ad1d49052f19","name":"test-name-0db1ad1d49052f19"},"type":"team"}} form: {} headers: Accept: @@ -55,18 +55,16 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"type":"team","id":"9ca20f11-ede5-4147-addb-25b7f91ce508","attributes":{"name":"test-name-001d7ca9284aa632","handle":"test-handle-001d7ca9284aa632","summary":null,"description":null,"avatar":null,"banner":13,"visible_modules":[],"hidden_modules":[],"created_at":"2025-07-03T14:30:46.275583+00:00","modified_at":"2025-07-03T14:30:46.275594+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/9ca20f11-ede5-4147-addb-25b7f91ce508/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/9ca20f11-ede5-4147-addb-25b7f91ce508/permission-settings"}}}}} - - ' + body: '{"data":{"id":"500acba0-bf4f-4f5c-83be-d0de24c5739c","type":"team","attributes":{"avatar":null,"banner":8,"created_at":"2025-11-27T14:12:00.429799+00:00","description":null,"handle":"test-handle-0db1ad1d49052f19","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:12:00.429799+00:00","name":"test-name-0db1ad1d49052f19","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/500acba0-bf4f-4f5c-83be-d0de24c5739c/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/500acba0-bf4f-4f5c-83be-d0de24c5739c/permission-settings"}}}}}' code: 201 duration: 0ms headers: Content-Type: - - application/json + - application/vnd.api+json status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-06-23T14:30:45.232Z","end_date":"2025-07-13T14:30:45.232Z","id":"70f75d0e-19d0-46a1-9c1c-19d2de171744","interval":{"seconds":3600},"members":[{"user":{"id":"4ea279a2-581a-11f0-bb4d-bed6e06a25e4"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-06-28T14:30:45.232Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1751553045","time_zone":"America/New_York"},"id":"3cb80fa4-f506-4b2f-9187-2af6c2253698","relationships":{"teams":{"data":[{"id":"9ca20f11-ede5-4147-addb-25b7f91ce508","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:59.069Z","end_date":"2025-12-07T14:11:59.069Z","id":"140f452a-0ecf-48ab-b7e9-e358a2cf925b","interval":{"seconds":3600},"members":[{"user":{"id":"09e2b0f4-cb9b-11f0-a56e-4e680b759023"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:59.069Z"}],"name":"Test-Update_On_Call_schedule_returns_OK_response-1764252719","time_zone":"America/New_York"},"id":"0e2c2b38-3f21-4216-aeb7-49eb8b371c09","relationships":{"teams":{"data":[{"id":"500acba0-bf4f-4f5c-83be-d0de24c5739c","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -75,9 +73,9 @@ interactions: - application/json id: 3 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/schedules/3cb80fa4-f506-4b2f-9187-2af6c2253698 + url: https://api.datadoghq.com/api/v2/on-call/schedules/0e2c2b38-3f21-4216-aeb7-49eb8b371c09 response: - body: '{"data":{"id":"3cb80fa4-f506-4b2f-9187-2af6c2253698","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1751553045","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"70f75d0e-19d0-46a1-9c1c-19d2de171744","type":"layers"}]},"teams":{"data":[{"id":"9ca20f11-ede5-4147-addb-25b7f91ce508","type":"teams"}]}}}}' + body: '{"data":{"id":"0e2c2b38-3f21-4216-aeb7-49eb8b371c09","type":"schedules","attributes":{"name":"Test-Update_On_Call_schedule_returns_OK_response-1764252719","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"140f452a-0ecf-48ab-b7e9-e358a2cf925b","type":"layers"}]},"teams":{"data":[{"id":"500acba0-bf4f-4f5c-83be-d0de24c5739c","type":"teams"}]}}}}' code: 200 duration: 0ms headers: @@ -92,7 +90,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/team/9ca20f11-ede5-4147-addb-25b7f91ce508 + url: https://api.datadoghq.com/api/v2/team/500acba0-bf4f-4f5c-83be-d0de24c5739c response: body: '' code: 204 @@ -107,7 +105,7 @@ interactions: - '*/*' id: 5 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/3cb80fa4-f506-4b2f-9187-2af6c2253698 + url: https://api.datadoghq.com/api/v2/on-call/schedules/0e2c2b38-3f21-4216-aeb7-49eb8b371c09 response: body: '' code: 204 @@ -122,7 +120,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/users/4ea279a2-581a-11f0-bb4d-bed6e06a25e4 + url: https://api.datadoghq.com/api/v2/users/09e2b0f4-cb9b-11f0-a56e-4e680b759023 response: body: '' code: 204 diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 6c6d3bf98f4..2dd671379ad 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -747,7 +747,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"resolve_page_on_policy_end\": true,\n \"retries\": 2,\n \"steps\": [\n {\n \"assignment\": \"default\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n },\n {\n \"id\": \"{{ schedule.data.id }}\",\n \"type\": \"schedules\"\n },\n {\n \"id\": \"{{ user.data.id }}\",\n \"type\": \"users\"\n }\n ]\n },\n {\n \"assignment\": \"round-robin\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n ]\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"policies\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"resolve_page_on_policy_end\": true,\n \"retries\": 2,\n \"steps\": [\n {\n \"assignment\": \"default\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n },\n {\n \"id\": \"{{ schedule.data.id }}\",\n \"type\": \"schedules\"\n },\n {\n \"id\": \"{{ schedule.data.id }}\",\n \"type\": \"schedules\",\n \"config\": {\n \"schedule\": {\n \"position\": \"previous\"\n }\n }\n },\n {\n \"id\": \"{{ user.data.id }}\",\n \"type\": \"users\"\n }\n ]\n },\n {\n \"assignment\": \"round-robin\",\n \"escalate_after_seconds\": 3600,\n \"targets\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n ]\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"policies\"\n }\n}" } ], "step": "there is a valid \"escalation_policy\" in the system", diff --git a/tests/scenarios/features/v2/on-call.feature b/tests/scenarios/features/v2/on-call.feature index 39640938e4a..7bcd1d00e1b 100644 --- a/tests/scenarios/features/v2/on-call.feature +++ b/tests/scenarios/features/v2/on-call.feature @@ -12,7 +12,7 @@ Feature: On-Call @generated @skip @team:DataDog/on-call Scenario: Create On-Call escalation policy returns "Bad Request" response Given new "CreateOnCallEscalationPolicy" request - And body with value {"data": {"attributes": {"name": "Escalation Policy 1", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}, {"id": "00000000-aba3-0000-0000-000000000000", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-abb1-0000-0000-000000000000", "type": "users"}]}]}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "Escalation Policy 1", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"config": {"schedule": {"position": "previous"}}, "id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}, {"id": "00000000-aba3-0000-0000-000000000000", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-abb1-0000-0000-000000000000", "type": "users"}]}]}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}} When the request is sent Then the response status is 400 Bad Request @@ -22,7 +22,7 @@ Feature: On-Call And there is a valid "user" in the system And there is a valid "schedule" in the system And there is a valid "dd_team" in the system - And body with value {"data": {"attributes": {"name": "{{ unique }}", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "{{ user.data.id }}", "type": "users"}, {"id": "{{ schedule.data.id }}", "type": "schedules"}, {"id": "{{ dd_team.data.id }}", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}]}, "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} + And body with value {"data": {"attributes": {"name": "{{ unique }}", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "{{ user.data.id }}", "type": "users"}, {"id": "{{ schedule.data.id }}", "type": "schedules"}, {"config": {"schedule": {"position": "previous"}}, "id": "{{ schedule.data.id }}", "type": "schedules"}, {"id": "{{ dd_team.data.id }}", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}]}, "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} And request contains "include" parameter with value "steps.targets" When the request is sent Then the response status is 201 Created