Skip to content

Commit 30f93ef

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add readonly ID of synthetics test steps (#891)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 55f2f00 commit 30f93ef

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14413,6 +14413,11 @@ components:
1441314413
extractedValuesFromScript:
1441414414
description: Generate variables using JavaScript.
1441514415
type: string
14416+
id:
14417+
description: ID of the step.
14418+
example: abc-def-123
14419+
readOnly: true
14420+
type: string
1441614421
isCritical:
1441714422
description: 'Determines whether or not to consider the entire test as failed
1441814423
if this step fails.
@@ -14469,6 +14474,11 @@ components:
1446914474
SyntheticsAPIWaitStep:
1447014475
description: The Wait step used in a Synthetic multi-step API test.
1447114476
properties:
14477+
id:
14478+
description: ID of the step.
14479+
example: abc-def-123
14480+
readOnly: true
14481+
type: string
1447214482
name:
1447314483
description: The name of the step.
1447414484
example: Example step name

src/datadogV1/model/model_synthetics_api_test_step.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ pub struct SyntheticsAPITestStep {
2626
/// Generate variables using JavaScript.
2727
#[serde(rename = "extractedValuesFromScript")]
2828
pub extracted_values_from_script: Option<String>,
29+
/// ID of the step.
30+
#[serde(rename = "id")]
31+
pub id: Option<String>,
2932
/// Determines whether or not to consider the entire test as failed if this step fails.
3033
/// Can be used only if `allowFailure` is `true`.
3134
#[serde(rename = "isCritical")]
@@ -62,6 +65,7 @@ impl SyntheticsAPITestStep {
6265
exit_if_succeed: None,
6366
extracted_values: None,
6467
extracted_values_from_script: None,
68+
id: None,
6569
is_critical: None,
6670
name,
6771
request,
@@ -95,6 +99,11 @@ impl SyntheticsAPITestStep {
9599
self
96100
}
97101

102+
pub fn id(mut self, value: String) -> Self {
103+
self.id = Some(value);
104+
self
105+
}
106+
98107
pub fn is_critical(mut self, value: bool) -> Self {
99108
self.is_critical = Some(value);
100109
self
@@ -139,6 +148,7 @@ impl<'de> Deserialize<'de> for SyntheticsAPITestStep {
139148
Vec<crate::datadogV1::model::SyntheticsParsingOptions>,
140149
> = None;
141150
let mut extracted_values_from_script: Option<String> = None;
151+
let mut id: Option<String> = None;
142152
let mut is_critical: Option<bool> = None;
143153
let mut name: Option<String> = None;
144154
let mut request: Option<crate::datadogV1::model::SyntheticsTestRequest> = None;
@@ -184,6 +194,12 @@ impl<'de> Deserialize<'de> for SyntheticsAPITestStep {
184194
extracted_values_from_script =
185195
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
186196
}
197+
"id" => {
198+
if v.is_null() {
199+
continue;
200+
}
201+
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
202+
}
187203
"isCritical" => {
188204
if v.is_null() {
189205
continue;
@@ -232,6 +248,7 @@ impl<'de> Deserialize<'de> for SyntheticsAPITestStep {
232248
exit_if_succeed,
233249
extracted_values,
234250
extracted_values_from_script,
251+
id,
235252
is_critical,
236253
name,
237254
request,

src/datadogV1/model/model_synthetics_api_wait_step.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct SyntheticsAPIWaitStep {
14+
/// ID of the step.
15+
#[serde(rename = "id")]
16+
pub id: Option<String>,
1417
/// The name of the step.
1518
#[serde(rename = "name")]
1619
pub name: String,
@@ -34,6 +37,7 @@ impl SyntheticsAPIWaitStep {
3437
value: i32,
3538
) -> SyntheticsAPIWaitStep {
3639
SyntheticsAPIWaitStep {
40+
id: None,
3741
name,
3842
subtype,
3943
value,
@@ -42,6 +46,11 @@ impl SyntheticsAPIWaitStep {
4246
}
4347
}
4448

49+
pub fn id(mut self, value: String) -> Self {
50+
self.id = Some(value);
51+
self
52+
}
53+
4554
pub fn additional_properties(
4655
mut self,
4756
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -68,6 +77,7 @@ impl<'de> Deserialize<'de> for SyntheticsAPIWaitStep {
6877
where
6978
M: MapAccess<'a>,
7079
{
80+
let mut id: Option<String> = None;
7181
let mut name: Option<String> = None;
7282
let mut subtype: Option<crate::datadogV1::model::SyntheticsAPIWaitStepSubtype> =
7383
None;
@@ -80,6 +90,12 @@ impl<'de> Deserialize<'de> for SyntheticsAPIWaitStep {
8090

8191
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
8292
match k.as_str() {
93+
"id" => {
94+
if v.is_null() {
95+
continue;
96+
}
97+
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
98+
}
8399
"name" => {
84100
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
85101
}
@@ -109,6 +125,7 @@ impl<'de> Deserialize<'de> for SyntheticsAPIWaitStep {
109125
let value = value.ok_or_else(|| M::Error::missing_field("value"))?;
110126

111127
let content = SyntheticsAPIWaitStep {
128+
id,
112129
name,
113130
subtype,
114131
value,

0 commit comments

Comments
 (0)