Skip to content

Commit dae9137

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1ca19669 of spec repo
1 parent 0bc78c3 commit dae9137

24 files changed

+881
-56
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": "2024-07-25 18:59:16.169917",
8-
"spec_repo_commit": "ccf15bee"
7+
"regenerated": "2024-07-26 09:14:28.125755",
8+
"spec_repo_commit": "1ca19669"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-25 18:59:16.187515",
13-
"spec_repo_commit": "ccf15bee"
12+
"regenerated": "2024-07-26 09:14:28.143384",
13+
"spec_repo_commit": "1ca19669"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15113,6 +15113,12 @@ components:
1511315113
description: Unique identifier of the global variable.
1511415114
readOnly: true
1511515115
type: string
15116+
is_fido:
15117+
description: Determines if the global variable is a FIDO variable.
15118+
type: boolean
15119+
is_totp:
15120+
description: Determines if the global variable is a TOTP/MFA variable.
15121+
type: boolean
1511615122
name:
1511715123
description: Name of the global variable. Unique across Synthetic global
1511815124
variables.
@@ -15203,6 +15209,53 @@ components:
1520315209
- JSON_PATH
1520415210
- REGEX
1520515211
- X_PATH
15212+
SyntheticsGlobalVariablePayload:
15213+
description: Details of the global variable to create.
15214+
properties:
15215+
attributes:
15216+
$ref: '#/components/schemas/SyntheticsGlobalVariableAttributes'
15217+
description:
15218+
description: Description of the global variable.
15219+
example: Example description
15220+
type: string
15221+
id:
15222+
description: Unique identifier of the global variable.
15223+
readOnly: true
15224+
type: string
15225+
is_fido:
15226+
description: Determines if the global variable is a FIDO variable.
15227+
type: boolean
15228+
is_totp:
15229+
description: Determines if the global variable is a TOTP/MFA variable.
15230+
type: boolean
15231+
name:
15232+
description: Name of the global variable. Unique across Synthetic global
15233+
variables.
15234+
example: MY_VARIABLE
15235+
type: string
15236+
parse_test_options:
15237+
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions'
15238+
parse_test_public_id:
15239+
description: A Synthetic test ID to use as a test to generate the variable
15240+
value.
15241+
example: abc-def-123
15242+
type: string
15243+
tags:
15244+
description: Tags of the global variable.
15245+
example:
15246+
- team:front
15247+
- test:workflow-1
15248+
items:
15249+
description: Tag name.
15250+
type: string
15251+
type: array
15252+
value:
15253+
$ref: '#/components/schemas/SyntheticsGlobalVariableValue'
15254+
required:
15255+
- description
15256+
- name
15257+
- tags
15258+
type: object
1520615259
SyntheticsGlobalVariableTOTPParameters:
1520715260
description: Parameters for the TOTP/MFA variable
1520815261
properties:
@@ -31070,7 +31123,7 @@ paths:
3107031123
content:
3107131124
application/json:
3107231125
schema:
31073-
$ref: '#/components/schemas/SyntheticsGlobalVariable'
31126+
$ref: '#/components/schemas/SyntheticsGlobalVariablePayload'
3107431127
description: Details of the global variable to create.
3107531128
required: true
3107631129
responses:

examples/v1_synthetics_CreateGlobalVariable.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
// Create a global variable returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4-
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariable;
54
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableAttributes;
65
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptions;
76
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType;
87
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParserType;
8+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariablePayload;
99
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableValue;
1010
use datadog_api_client::datadogV1::model::SyntheticsVariableParser;
1111

1212
#[tokio::main]
1313
async fn main() {
14-
let body = SyntheticsGlobalVariable::new(
14+
let body = SyntheticsGlobalVariablePayload::new(
1515
"Example description".to_string(),
1616
"MY_VARIABLE".to_string(),
1717
vec!["team:front".to_string(), "test:workflow-1".to_string()],
18-
SyntheticsGlobalVariableValue::new()
19-
.secure(true)
20-
.value("value".to_string()),
2118
)
2219
.attributes(
2320
SyntheticsGlobalVariableAttributes::new()
@@ -34,7 +31,12 @@ async fn main() {
3431
.value(".*".to_string()),
3532
),
3633
)
37-
.parse_test_public_id("abc-def-123".to_string());
34+
.parse_test_public_id("abc-def-123".to_string())
35+
.value(
36+
SyntheticsGlobalVariableValue::new()
37+
.secure(true)
38+
.value("value".to_string()),
39+
);
3840
let configuration = datadog::Configuration::new();
3941
let api = SyntheticsAPI::with_config(configuration);
4042
let resp = api.create_global_variable(body).await;

examples/v1_synthetics_CreateGlobalVariable_1068962881.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,33 @@
11
// Create a global variable from test returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4-
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariable;
5-
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableOptions;
64
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptions;
75
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType;
8-
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableTOTPParameters;
6+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariablePayload;
97
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableValue;
108

119
#[tokio::main]
1210
async fn main() {
1311
// there is a valid "synthetics_api_test_multi_step" in the system
1412
let synthetics_api_test_multi_step_public_id =
1513
std::env::var("SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID").unwrap();
16-
let body = SyntheticsGlobalVariable::new(
14+
let body = SyntheticsGlobalVariablePayload::new(
1715
"".to_string(),
18-
"GLOBAL_VARIABLE_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
16+
"GLOBAL_VARIABLE_FROM_TEST_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
1917
vec![],
20-
SyntheticsGlobalVariableValue::new()
21-
.options(
22-
SyntheticsGlobalVariableOptions::new().totp_parameters(
23-
SyntheticsGlobalVariableTOTPParameters::new()
24-
.digits(6)
25-
.refresh_interval(30),
26-
),
27-
)
28-
.secure(false)
29-
.value("".to_string()),
3018
)
3119
.parse_test_options(
3220
SyntheticsGlobalVariableParseTestOptions::new(
3321
SyntheticsGlobalVariableParseTestOptionsType::LOCAL_VARIABLE,
3422
)
3523
.local_variable_name("EXTRACTED_VALUE".to_string()),
3624
)
37-
.parse_test_public_id(synthetics_api_test_multi_step_public_id.clone());
25+
.parse_test_public_id(synthetics_api_test_multi_step_public_id.clone())
26+
.value(
27+
SyntheticsGlobalVariableValue::new()
28+
.secure(false)
29+
.value("".to_string()),
30+
);
3831
let configuration = datadog::Configuration::new();
3932
let api = SyntheticsAPI::with_config(configuration);
4033
let resp = api.create_global_variable(body).await;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Create a FIDO global variable returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariablePayload;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let body = SyntheticsGlobalVariablePayload::new(
9+
"".to_string(),
10+
"GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
11+
vec![],
12+
)
13+
.is_fido(true);
14+
let configuration = datadog::Configuration::new();
15+
let api = SyntheticsAPI::with_config(configuration);
16+
let resp = api.create_global_variable(body).await;
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Create a TOTP global variable returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableOptions;
5+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariablePayload;
6+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableTOTPParameters;
7+
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableValue;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = SyntheticsGlobalVariablePayload::new(
12+
"".to_string(),
13+
"GLOBAL_VARIABLE_TOTP_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
14+
vec![],
15+
)
16+
.is_totp(true)
17+
.value(
18+
SyntheticsGlobalVariableValue::new()
19+
.options(
20+
SyntheticsGlobalVariableOptions::new().totp_parameters(
21+
SyntheticsGlobalVariableTOTPParameters::new()
22+
.digits(6)
23+
.refresh_interval(30),
24+
),
25+
)
26+
.secure(false)
27+
.value("".to_string()),
28+
);
29+
let configuration = datadog::Configuration::new();
30+
let api = SyntheticsAPI::with_config(configuration);
31+
let resp = api.create_global_variable(body).await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}

src/datadogV1/api/api_synthetics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl SyntheticsAPI {
401401
/// Create a Synthetic global variable.
402402
pub async fn create_global_variable(
403403
&self,
404-
body: crate::datadogV1::model::SyntheticsGlobalVariable,
404+
body: crate::datadogV1::model::SyntheticsGlobalVariablePayload,
405405
) -> Result<
406406
crate::datadogV1::model::SyntheticsGlobalVariable,
407407
datadog::Error<CreateGlobalVariableError>,
@@ -423,7 +423,7 @@ impl SyntheticsAPI {
423423
/// Create a Synthetic global variable.
424424
pub async fn create_global_variable_with_http_info(
425425
&self,
426-
body: crate::datadogV1::model::SyntheticsGlobalVariable,
426+
body: crate::datadogV1::model::SyntheticsGlobalVariablePayload,
427427
) -> Result<
428428
datadog::ResponseContent<crate::datadogV1::model::SyntheticsGlobalVariable>,
429429
datadog::Error<CreateGlobalVariableError>,

src/datadogV1/model/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,8 @@ pub mod model_synthetics_global_variable_options;
15161516
pub use self::model_synthetics_global_variable_options::SyntheticsGlobalVariableOptions;
15171517
pub mod model_synthetics_global_variable_totp_parameters;
15181518
pub use self::model_synthetics_global_variable_totp_parameters::SyntheticsGlobalVariableTOTPParameters;
1519+
pub mod model_synthetics_global_variable_payload;
1520+
pub use self::model_synthetics_global_variable_payload::SyntheticsGlobalVariablePayload;
15191521
pub mod model_tag_to_hosts;
15201522
pub use self::model_tag_to_hosts::TagToHosts;
15211523
pub mod model_host_tags;

src/datadogV1/model/model_synthetics_global_variable.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ pub struct SyntheticsGlobalVariable {
2020
/// Unique identifier of the global variable.
2121
#[serde(rename = "id")]
2222
pub id: Option<String>,
23+
/// Determines if the global variable is a FIDO variable.
24+
#[serde(rename = "is_fido")]
25+
pub is_fido: Option<bool>,
26+
/// Determines if the global variable is a TOTP/MFA variable.
27+
#[serde(rename = "is_totp")]
28+
pub is_totp: Option<bool>,
2329
/// Name of the global variable. Unique across Synthetic global variables.
2430
#[serde(rename = "name")]
2531
pub name: String,
@@ -52,6 +58,8 @@ impl SyntheticsGlobalVariable {
5258
attributes: None,
5359
description,
5460
id: None,
61+
is_fido: None,
62+
is_totp: None,
5563
name,
5664
parse_test_options: None,
5765
parse_test_public_id: None,
@@ -74,6 +82,16 @@ impl SyntheticsGlobalVariable {
7482
self
7583
}
7684

85+
pub fn is_fido(mut self, value: bool) -> Self {
86+
self.is_fido = Some(value);
87+
self
88+
}
89+
90+
pub fn is_totp(mut self, value: bool) -> Self {
91+
self.is_totp = Some(value);
92+
self
93+
}
94+
7795
pub fn parse_test_options(
7896
mut self,
7997
value: crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptions,
@@ -110,6 +128,8 @@ impl<'de> Deserialize<'de> for SyntheticsGlobalVariable {
110128
> = None;
111129
let mut description: Option<String> = None;
112130
let mut id: Option<String> = None;
131+
let mut is_fido: Option<bool> = None;
132+
let mut is_totp: Option<bool> = None;
113133
let mut name: Option<String> = None;
114134
let mut parse_test_options: Option<
115135
crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptions,
@@ -138,6 +158,18 @@ impl<'de> Deserialize<'de> for SyntheticsGlobalVariable {
138158
}
139159
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
140160
}
161+
"is_fido" => {
162+
if v.is_null() {
163+
continue;
164+
}
165+
is_fido = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
166+
}
167+
"is_totp" => {
168+
if v.is_null() {
169+
continue;
170+
}
171+
is_totp = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
172+
}
141173
"name" => {
142174
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
143175
}
@@ -174,6 +206,8 @@ impl<'de> Deserialize<'de> for SyntheticsGlobalVariable {
174206
attributes,
175207
description,
176208
id,
209+
is_fido,
210+
is_totp,
177211
name,
178212
parse_test_options,
179213
parse_test_public_id,

0 commit comments

Comments
 (0)