Skip to content

Commit 53b8035

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update Incident API specs to include is_test in POST /incidents and incidents response (#744)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 36a6215 commit 53b8035

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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-06-25 17:36:53.162860",
8-
"spec_repo_commit": "51c17453"
7+
"regenerated": "2025-06-25 21:28:44.094918",
8+
"spec_repo_commit": "31044eb9"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-25 17:36:53.178661",
13-
"spec_repo_commit": "51c17453"
12+
"regenerated": "2025-06-25 21:28:44.111040",
13+
"spec_repo_commit": "31044eb9"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17419,6 +17419,10 @@ components:
1741917419
items:
1742017420
$ref: '#/components/schemas/IncidentTimelineCellCreateAttributes'
1742117421
type: array
17422+
is_test:
17423+
description: A flag indicating whether the incident is a test incident.
17424+
example: false
17425+
type: boolean
1742217426
notification_handles:
1742317427
description: Notification handles that will be notified of the incident
1742417428
at creation.
@@ -17824,6 +17828,10 @@ components:
1782417828
description: A unique identifier that represents an incident type.
1782517829
example: 00000000-0000-0000-0000-000000000000
1782617830
type: string
17831+
is_test:
17832+
description: A flag indicating whether the incident is a test incident.
17833+
example: false
17834+
type: boolean
1782717835
modified:
1782817836
description: Timestamp when the incident was last modified.
1782917837
format: date-time

src/datadogV2/model/model_incident_create_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ pub struct IncidentCreateAttributes {
2828
/// An array of initial timeline cells to be placed at the beginning of the incident timeline.
2929
#[serde(rename = "initial_cells")]
3030
pub initial_cells: Option<Vec<crate::datadogV2::model::IncidentTimelineCellCreateAttributes>>,
31+
/// A flag indicating whether the incident is a test incident.
32+
#[serde(rename = "is_test")]
33+
pub is_test: Option<bool>,
3134
/// Notification handles that will be notified of the incident at creation.
3235
#[serde(rename = "notification_handles")]
3336
pub notification_handles: Option<Vec<crate::datadogV2::model::IncidentNotificationHandle>>,
@@ -49,6 +52,7 @@ impl IncidentCreateAttributes {
4952
fields: None,
5053
incident_type_uuid: None,
5154
initial_cells: None,
55+
is_test: None,
5256
notification_handles: None,
5357
title,
5458
additional_properties: std::collections::BTreeMap::new(),
@@ -82,6 +86,11 @@ impl IncidentCreateAttributes {
8286
self
8387
}
8488

89+
pub fn is_test(mut self, value: bool) -> Self {
90+
self.is_test = Some(value);
91+
self
92+
}
93+
8594
pub fn notification_handles(
8695
mut self,
8796
value: Vec<crate::datadogV2::model::IncidentNotificationHandle>,
@@ -128,6 +137,7 @@ impl<'de> Deserialize<'de> for IncidentCreateAttributes {
128137
let mut initial_cells: Option<
129138
Vec<crate::datadogV2::model::IncidentTimelineCellCreateAttributes>,
130139
> = None;
140+
let mut is_test: Option<bool> = None;
131141
let mut notification_handles: Option<
132142
Vec<crate::datadogV2::model::IncidentNotificationHandle>,
133143
> = None;
@@ -171,6 +181,12 @@ impl<'de> Deserialize<'de> for IncidentCreateAttributes {
171181
initial_cells =
172182
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
173183
}
184+
"is_test" => {
185+
if v.is_null() {
186+
continue;
187+
}
188+
is_test = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
189+
}
174190
"notification_handles" => {
175191
if v.is_null() {
176192
continue;
@@ -198,6 +214,7 @@ impl<'de> Deserialize<'de> for IncidentCreateAttributes {
198214
fields,
199215
incident_type_uuid,
200216
initial_cells,
217+
is_test,
201218
notification_handles,
202219
title,
203220
additional_properties,

src/datadogV2/model/model_incident_response_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ pub struct IncidentResponseAttributes {
7171
/// A unique identifier that represents an incident type.
7272
#[serde(rename = "incident_type_uuid")]
7373
pub incident_type_uuid: Option<String>,
74+
/// A flag indicating whether the incident is a test incident.
75+
#[serde(rename = "is_test")]
76+
pub is_test: Option<bool>,
7477
/// Timestamp when the incident was last modified.
7578
#[serde(rename = "modified")]
7679
pub modified: Option<chrono::DateTime<chrono::Utc>>,
@@ -149,6 +152,7 @@ impl IncidentResponseAttributes {
149152
detected: None,
150153
fields: None,
151154
incident_type_uuid: None,
155+
is_test: None,
152156
modified: None,
153157
non_datadog_creator: None,
154158
notification_handles: None,
@@ -225,6 +229,11 @@ impl IncidentResponseAttributes {
225229
self
226230
}
227231

232+
pub fn is_test(mut self, value: bool) -> Self {
233+
self.is_test = Some(value);
234+
self
235+
}
236+
228237
pub fn modified(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
229238
self.modified = Some(value);
230239
self
@@ -333,6 +342,7 @@ impl<'de> Deserialize<'de> for IncidentResponseAttributes {
333342
>,
334343
> = None;
335344
let mut incident_type_uuid: Option<String> = None;
345+
let mut is_test: Option<bool> = None;
336346
let mut modified: Option<chrono::DateTime<chrono::Utc>> = None;
337347
let mut non_datadog_creator: Option<
338348
Option<crate::datadogV2::model::IncidentNonDatadogCreator>,
@@ -412,6 +422,12 @@ impl<'de> Deserialize<'de> for IncidentResponseAttributes {
412422
incident_type_uuid =
413423
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
414424
}
425+
"is_test" => {
426+
if v.is_null() {
427+
continue;
428+
}
429+
is_test = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
430+
}
415431
"modified" => {
416432
if v.is_null() {
417433
continue;
@@ -509,6 +525,7 @@ impl<'de> Deserialize<'de> for IncidentResponseAttributes {
509525
detected,
510526
fields,
511527
incident_type_uuid,
528+
is_test,
512529
modified,
513530
non_datadog_creator,
514531
notification_handles,

tests/scenarios/features/v2/incidents.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Feature: Incidents
7070
Scenario: Create an incident returns "Bad Request" response
7171
Given operation "CreateIncident" enabled
7272
And new "CreateIncident" request
73-
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
73+
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "is_test": false, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
7474
When the request is sent
7575
Then the response status is 400 Bad Request
7676

@@ -89,7 +89,7 @@ Feature: Incidents
8989
Scenario: Create an incident returns "Not Found" response
9090
Given operation "CreateIncident" enabled
9191
And new "CreateIncident" request
92-
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
92+
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "is_test": false, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
9393
When the request is sent
9494
Then the response status is 404 Not Found
9595

0 commit comments

Comments
 (0)