Skip to content

Commit e73980a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Update On-Call Escalation policies endpoints schemas and description (#620)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f026806 commit e73980a

9 files changed

+79
-87
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-24 04:43:28.634789",
8-
"spec_repo_commit": "ab6a0f8c"
7+
"regenerated": "2025-04-24 13:38:36.780020",
8+
"spec_repo_commit": "4295fd1a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-24 04:43:28.650597",
13-
"spec_repo_commit": "ab6a0f8c"
12+
"regenerated": "2025-04-24 13:38:36.795313",
13+
"spec_repo_commit": "4295fd1a"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -13065,6 +13065,7 @@ components:
1306513065
$ref: '#/components/schemas/EscalationPolicyDataAttributes'
1306613066
id:
1306713067
description: Specifies the unique identifier of the escalation policy.
13068+
example: ab000000-0000-0000-0000-000000000000
1306813069
type: string
1306913070
relationships:
1307013071
$ref: '#/components/schemas/EscalationPolicyDataRelationships'
@@ -28006,6 +28007,7 @@ components:
2800628007
$ref: '#/components/schemas/ScheduleCreateRequestDataType'
2800728008
required:
2800828009
- type
28010+
- attributes
2800928011
type: object
2801028012
ScheduleCreateRequestDataAttributes:
2801128013
description: Describes the main attributes for creating a new schedule, including
@@ -47481,7 +47483,7 @@ paths:
4748147483
- apiKeyAuth: []
4748247484
appKeyAuth: []
4748347485
- AuthZ: []
47484-
summary: Create on call escalation policy
47486+
summary: Create on-call escalation policy
4748547487
tags:
4748647488
- On-Call
4748747489
/api/v2/on-call/escalation-policies/{policy_id}:
@@ -47511,7 +47513,7 @@ paths:
4751147513
- apiKeyAuth: []
4751247514
appKeyAuth: []
4751347515
- AuthZ: []
47514-
summary: Delete on call escalation policy
47516+
summary: Delete on-call escalation policy
4751547517
tags:
4751647518
- On-Call
4751747519
get:
@@ -47552,7 +47554,7 @@ paths:
4755247554
- apiKeyAuth: []
4755347555
appKeyAuth: []
4755447556
- AuthZ: []
47555-
summary: Get on call escalation policy
47557+
summary: Get on-call escalation policy
4755647558
tags:
4755747559
- On-Call
4755847560
put:
@@ -47599,7 +47601,7 @@ paths:
4759947601
- apiKeyAuth: []
4760047602
appKeyAuth: []
4760147603
- AuthZ: []
47602-
summary: Update on call escalation policy
47604+
summary: Update on-call escalation policy
4760347605
tags:
4760447606
- On-Call
4760547607
/api/v2/on-call/schedules:

examples/v2_on-call_CreateOnCallEscalationPolicy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Create on call escalation policy returns "Created" response
1+
// Create on-call escalation policy returns "Created" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_on_call::CreateOnCallEscalationPolicyOptionalParams;
44
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;

examples/v2_on-call_CreateOnCallSchedule.rs

+51-52
Original file line numberDiff line numberDiff line change
@@ -28,66 +28,65 @@ async fn main() {
2828
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
2929
let body =
3030
ScheduleCreateRequest::new(
31-
ScheduleCreateRequestData::new(ScheduleCreateRequestDataType::SCHEDULES)
32-
.attributes(
33-
ScheduleCreateRequestDataAttributes::new(
34-
vec![
35-
ScheduleCreateRequestDataAttributesLayersItems::new(
36-
DateTime::parse_from_rfc3339("2021-11-01T11:11:11+00:00")
31+
ScheduleCreateRequestData::new(
32+
ScheduleCreateRequestDataAttributes::new(
33+
vec![
34+
ScheduleCreateRequestDataAttributesLayersItems::new(
35+
DateTime::parse_from_rfc3339("2021-11-01T11:11:11+00:00")
36+
.expect("Failed to parse datetime")
37+
.with_timezone(&Utc),
38+
ScheduleCreateRequestDataAttributesLayersItemsInterval::new().days(1),
39+
vec![
40+
ScheduleCreateRequestDataAttributesLayersItemsMembersItems
41+
::new().user(
42+
ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser
43+
::new().id(user_data_id.clone()),
44+
)
45+
],
46+
"Layer 1".to_string(),
47+
DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
48+
.expect("Failed to parse datetime")
49+
.with_timezone(&Utc),
50+
)
51+
.end_date(
52+
DateTime::parse_from_rfc3339("2021-11-21T11:11:11+00:00")
3753
.expect("Failed to parse datetime")
3854
.with_timezone(&Utc),
39-
ScheduleCreateRequestDataAttributesLayersItemsInterval::new().days(1),
55+
)
56+
.restrictions(
4057
vec![
41-
ScheduleCreateRequestDataAttributesLayersItemsMembersItems
42-
::new().user(
43-
ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser
44-
::new().id(user_data_id.clone()),
45-
)
58+
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems::new()
59+
.end_day(
60+
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay
61+
::FRIDAY,
62+
)
63+
.end_time("17:00:00".to_string())
64+
.start_day(
65+
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay
66+
::MONDAY,
67+
)
68+
.start_time("09:00:00".to_string())
4669
],
47-
"Layer 1".to_string(),
48-
DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
49-
.expect("Failed to parse datetime")
50-
.with_timezone(&Utc),
5170
)
52-
.end_date(
53-
DateTime::parse_from_rfc3339("2021-11-21T11:11:11+00:00")
54-
.expect("Failed to parse datetime")
55-
.with_timezone(&Utc),
56-
)
57-
.restrictions(
58-
vec![
59-
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems::new()
60-
.end_day(
61-
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay
62-
::FRIDAY,
63-
)
64-
.end_time("17:00:00".to_string())
65-
.start_day(
66-
ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay
67-
::MONDAY,
68-
)
69-
.start_time("09:00:00".to_string())
70-
],
71-
)
71+
],
72+
"Example-On-Call".to_string(),
73+
"America/New_York".to_string(),
74+
).tags(vec!["tag1".to_string(), "tag2".to_string()]),
75+
ScheduleCreateRequestDataType::SCHEDULES,
76+
).relationships(
77+
ScheduleCreateRequestDataRelationships
78+
::new().teams(
79+
ScheduleCreateRequestDataRelationshipsTeams
80+
::new().data(
81+
vec![
82+
ScheduleCreateRequestDataRelationshipsTeamsDataItems::new(
83+
dd_team_data_id.clone(),
84+
ScheduleCreateRequestDataRelationshipsTeamsDataItemsType::TEAMS,
85+
)
7286
],
73-
"Example-On-Call".to_string(),
74-
"America/New_York".to_string(),
75-
).tags(vec!["tag1".to_string(), "tag2".to_string()]),
76-
)
77-
.relationships(
78-
ScheduleCreateRequestDataRelationships
79-
::new().teams(
80-
ScheduleCreateRequestDataRelationshipsTeams
81-
::new().data(
82-
vec![
83-
ScheduleCreateRequestDataRelationshipsTeamsDataItems::new(
84-
dd_team_data_id.clone(),
85-
ScheduleCreateRequestDataRelationshipsTeamsDataItemsType::TEAMS,
86-
)
87-
],
88-
),
8987
),
9088
),
89+
),
9190
);
9291
let configuration = datadog::Configuration::new();
9392
let api = OnCallAPI::with_config(configuration);

examples/v2_on-call_DeleteOnCallEscalationPolicy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Delete on call escalation policy returns "No Content" response
1+
// Delete on-call escalation policy returns "No Content" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;
44

examples/v2_on-call_GetOnCallEscalationPolicy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Get on call escalation policy returns "OK" response
1+
// Get on-call escalation policy returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_on_call::GetOnCallEscalationPolicyOptionalParams;
44
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;

examples/v2_on-call_UpdateOnCallEscalationPolicy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Update on call escalation policy returns "OK" response
1+
// Update on-call escalation policy returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;
44
use datadog_api_client::datadogV2::api_on_call::UpdateOnCallEscalationPolicyOptionalParams;

src/datadogV2/model/model_schedule_create_request_data.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
1313
pub struct ScheduleCreateRequestData {
1414
/// Describes the main attributes for creating a new schedule, including name, layers, time zone, and tags.
1515
#[serde(rename = "attributes")]
16-
pub attributes: Option<crate::datadogV2::model::ScheduleCreateRequestDataAttributes>,
16+
pub attributes: crate::datadogV2::model::ScheduleCreateRequestDataAttributes,
1717
/// Gathers relationship objects for the schedule creation request, including the teams to associate.
1818
#[serde(rename = "relationships")]
1919
pub relationships: Option<crate::datadogV2::model::ScheduleCreateRequestDataRelationships>,
@@ -29,25 +29,18 @@ pub struct ScheduleCreateRequestData {
2929

3030
impl ScheduleCreateRequestData {
3131
pub fn new(
32+
attributes: crate::datadogV2::model::ScheduleCreateRequestDataAttributes,
3233
type_: crate::datadogV2::model::ScheduleCreateRequestDataType,
3334
) -> ScheduleCreateRequestData {
3435
ScheduleCreateRequestData {
35-
attributes: None,
36+
attributes,
3637
relationships: None,
3738
type_,
3839
additional_properties: std::collections::BTreeMap::new(),
3940
_unparsed: false,
4041
}
4142
}
4243

43-
pub fn attributes(
44-
mut self,
45-
value: crate::datadogV2::model::ScheduleCreateRequestDataAttributes,
46-
) -> Self {
47-
self.attributes = Some(value);
48-
self
49-
}
50-
5144
pub fn relationships(
5245
mut self,
5346
value: crate::datadogV2::model::ScheduleCreateRequestDataRelationships,
@@ -99,9 +92,6 @@ impl<'de> Deserialize<'de> for ScheduleCreateRequestData {
9992
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
10093
match k.as_str() {
10194
"attributes" => {
102-
if v.is_null() {
103-
continue;
104-
}
10595
attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
10696
}
10797
"relationships" => {
@@ -129,6 +119,7 @@ impl<'de> Deserialize<'de> for ScheduleCreateRequestData {
129119
}
130120
}
131121
}
122+
let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?;
132123
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
133124

134125
let content = ScheduleCreateRequestData {

tests/scenarios/features/v2/on-call.feature

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Feature: On-Call
1010
And an instance of "On-Call" API
1111

1212
@generated @skip @team:DataDog/bugle
13-
Scenario: Create on call escalation policy returns "Bad Request" response
13+
Scenario: Create on-call escalation policy returns "Bad Request" response
1414
Given new "CreateOnCallEscalationPolicy" request
1515
And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "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"}}
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

1919
@team:DataDog/bugle
20-
Scenario: Create on call escalation policy returns "Created" response
20+
Scenario: Create on-call escalation policy returns "Created" response
2121
Given new "CreateOnCallEscalationPolicy" request
2222
And there is a valid "schedule" in the system
2323
And there is a valid "dd_team" in the system
@@ -43,7 +43,7 @@ Feature: On-Call
4343
Then the response status is 201 Created
4444

4545
@team:DataDog/bugle
46-
Scenario: Delete on call escalation policy returns "No Content" response
46+
Scenario: Delete on-call escalation policy returns "No Content" response
4747
Given new "DeleteOnCallEscalationPolicy" request
4848
And there is a valid "user" in the system
4949
And there is a valid "dd_team" in the system
@@ -54,7 +54,7 @@ Feature: On-Call
5454
Then the response status is 204 No Content
5555

5656
@generated @skip @team:DataDog/bugle
57-
Scenario: Delete on call escalation policy returns "Not Found" response
57+
Scenario: Delete on-call escalation policy returns "Not Found" response
5858
Given new "DeleteOnCallEscalationPolicy" request
5959
And request contains "policy_id" parameter from "REPLACE.ME"
6060
When the request is sent
@@ -76,21 +76,21 @@ Feature: On-Call
7676
Then the response status is 404 Not Found
7777

7878
@generated @skip @team:DataDog/bugle
79-
Scenario: Get on call escalation policy returns "Bad Request" response
79+
Scenario: Get on-call escalation policy returns "Bad Request" response
8080
Given new "GetOnCallEscalationPolicy" request
8181
And request contains "policy_id" parameter from "REPLACE.ME"
8282
When the request is sent
8383
Then the response status is 400 Bad Request
8484

8585
@generated @skip @team:DataDog/bugle
86-
Scenario: Get on call escalation policy returns "Not Found" response
86+
Scenario: Get on-call escalation policy returns "Not Found" response
8787
Given new "GetOnCallEscalationPolicy" request
8888
And request contains "policy_id" parameter from "REPLACE.ME"
8989
When the request is sent
9090
Then the response status is 404 Not Found
9191

9292
@team:DataDog/bugle
93-
Scenario: Get on call escalation policy returns "OK" response
93+
Scenario: Get on-call escalation policy returns "OK" response
9494
Given new "GetOnCallEscalationPolicy" request
9595
And there is a valid "user" in the system
9696
And there is a valid "dd_team" in the system
@@ -116,23 +116,23 @@ Feature: On-Call
116116
Then the response status is 200 OK
117117

118118
@generated @skip @team:DataDog/bugle
119-
Scenario: Update on call escalation policy returns "Bad Request" response
119+
Scenario: Update on-call escalation policy returns "Bad Request" response
120120
Given new "UpdateOnCallEscalationPolicy" request
121121
And request contains "policy_id" parameter from "REPLACE.ME"
122122
And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}}
123123
When the request is sent
124124
Then the response status is 400 Bad Request
125125

126126
@generated @skip @team:DataDog/bugle
127-
Scenario: Update on call escalation policy returns "Not Found" response
127+
Scenario: Update on-call escalation policy returns "Not Found" response
128128
Given new "UpdateOnCallEscalationPolicy" request
129129
And request contains "policy_id" parameter from "REPLACE.ME"
130130
And body with value {"data": {"attributes": {"description": "Escalation Policy 1 description", "name": "Escalation Policy 1", "resolve_page_on_policy_end": false, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "id": "00000000-aba1-0000-0000-000000000000", "targets": [{"id": "00000000-aba1-0000-0000-000000000000", "type": "users"}, {"id": "00000000-aba2-0000-0000-000000000000", "type": "schedules"}]}]}, "id": "a3000000-0000-0000-0000-000000000000", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "policies"}}
131131
When the request is sent
132132
Then the response status is 404 Not Found
133133

134134
@team:DataDog/bugle
135-
Scenario: Update on call escalation policy returns "OK" response
135+
Scenario: Update on-call escalation policy returns "OK" response
136136
Given new "UpdateOnCallEscalationPolicy" request
137137
And there is a valid "user" in the system
138138
And there is a valid "dd_team" in the system

0 commit comments

Comments
 (0)