Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 137 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -19260,13 +19330,24 @@ 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
- id: 00000000-aba1-0000-0000-000000000000
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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -19542,15 +19637,29 @@ 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
type: string
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`).
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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`.
Expand Down
12 changes: 12 additions & 0 deletions examples/v2_on-call_CreateOnCallEscalationPolicy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ use datadog_api_client::datadogV2::model::EscalationPolicyCreateRequestDataRelat
use datadog_api_client::datadogV2::model::EscalationPolicyCreateRequestDataType;
use datadog_api_client::datadogV2::model::EscalationPolicyStepAttributesAssignment;
use datadog_api_client::datadogV2::model::EscalationPolicyStepTarget;
use datadog_api_client::datadogV2::model::EscalationPolicyStepTargetConfig;
use datadog_api_client::datadogV2::model::EscalationPolicyStepTargetConfigSchedule;
use datadog_api_client::datadogV2::model::EscalationPolicyStepTargetType;
use datadog_api_client::datadogV2::model::ScheduleTargetPosition;

#[tokio::main]
async fn main() {
Expand All @@ -37,6 +40,15 @@ async fn main() {
EscalationPolicyStepTarget::new()
.id(schedule_data_id.clone())
.type_(EscalationPolicyStepTargetType::SCHEDULES),
EscalationPolicyStepTarget::new()
.config(
EscalationPolicyStepTargetConfig::new().schedule(
EscalationPolicyStepTargetConfigSchedule::new()
.position(ScheduleTargetPosition::PREVIOUS),
),
)
.id(schedule_data_id.clone())
.type_(EscalationPolicyStepTargetType::SCHEDULES),
EscalationPolicyStepTarget::new()
.id(dd_team_data_id.clone())
.type_(EscalationPolicyStepTargetType::TEAMS),
Expand Down
30 changes: 24 additions & 6 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3948,6 +3948,12 @@ pub mod model_escalation_policy_step_attributes_assignment;
pub use self::model_escalation_policy_step_attributes_assignment::EscalationPolicyStepAttributesAssignment;
pub mod model_escalation_policy_step_target;
pub use self::model_escalation_policy_step_target::EscalationPolicyStepTarget;
pub mod model_escalation_policy_step_target_config;
pub use self::model_escalation_policy_step_target_config::EscalationPolicyStepTargetConfig;
pub mod model_escalation_policy_step_target_config_schedule;
pub use self::model_escalation_policy_step_target_config_schedule::EscalationPolicyStepTargetConfigSchedule;
pub mod model_schedule_target_position;
pub use self::model_schedule_target_position::ScheduleTargetPosition;
pub mod model_escalation_policy_step_target_type;
pub use self::model_escalation_policy_step_target_type::EscalationPolicyStepTargetType;
pub mod model_escalation_policy_create_request_data_relationships;
Expand Down Expand Up @@ -3976,12 +3982,6 @@ pub mod model_escalation_policy_data_relationships_steps_data_items_type;
pub use self::model_escalation_policy_data_relationships_steps_data_items_type::EscalationPolicyDataRelationshipsStepsDataItemsType;
pub mod model_escalation_policy_data_type;
pub use self::model_escalation_policy_data_type::EscalationPolicyDataType;
pub mod model_team_reference;
pub use self::model_team_reference::TeamReference;
pub mod model_team_reference_attributes;
pub use self::model_team_reference_attributes::TeamReferenceAttributes;
pub mod model_team_reference_type;
pub use self::model_team_reference_type::TeamReferenceType;
pub mod model_escalation_policy_step;
pub use self::model_escalation_policy_step::EscalationPolicyStep;
pub mod model_escalation_policy_step_attributes;
Expand All @@ -4002,6 +4002,10 @@ pub mod model_schedule_target;
pub use self::model_schedule_target::ScheduleTarget;
pub mod model_schedule_target_type;
pub use self::model_schedule_target_type::ScheduleTargetType;
pub mod model_configured_schedule_target;
pub use self::model_configured_schedule_target::ConfiguredScheduleTarget;
pub mod model_configured_schedule_target_type;
pub use self::model_configured_schedule_target_type::ConfiguredScheduleTargetType;
pub mod model_escalation_target;
pub use self::model_escalation_target::EscalationTarget;
pub mod model_escalation_policy_step_type;
Expand All @@ -4028,6 +4032,20 @@ pub mod model_schedule_data_relationships_layers_data_items_type;
pub use self::model_schedule_data_relationships_layers_data_items_type::ScheduleDataRelationshipsLayersDataItemsType;
pub mod model_schedule_data_type;
pub use self::model_schedule_data_type::ScheduleDataType;
pub mod model_configured_schedule;
pub use self::model_configured_schedule::ConfiguredSchedule;
pub mod model_configured_schedule_target_attributes;
pub use self::model_configured_schedule_target_attributes::ConfiguredScheduleTargetAttributes;
pub mod model_configured_schedule_target_relationships;
pub use self::model_configured_schedule_target_relationships::ConfiguredScheduleTargetRelationships;
pub mod model_configured_schedule_target_relationships_schedule;
pub use self::model_configured_schedule_target_relationships_schedule::ConfiguredScheduleTargetRelationshipsSchedule;
pub mod model_team_reference;
pub use self::model_team_reference::TeamReference;
pub mod model_team_reference_attributes;
pub use self::model_team_reference_attributes::TeamReferenceAttributes;
pub mod model_team_reference_type;
pub use self::model_team_reference_type::TeamReferenceType;
pub mod model_escalation_policy_included;
pub use self::model_escalation_policy_included::EscalationPolicyIncluded;
pub mod model_escalation_policy_update_request;
Expand Down
Loading