Skip to content

Commit d80424a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fc469c89 of spec repo
1 parent 4bdf72f commit d80424a

8 files changed

+104
-21
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-08-16 13:40:34.967692",
8-
"spec_repo_commit": "1b56c3ba"
7+
"regenerated": "2024-08-16 18:57:12.861262",
8+
"spec_repo_commit": "fc469c89"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-16 13:40:34.985784",
13-
"spec_repo_commit": "1b56c3ba"
12+
"regenerated": "2024-08-16 18:57:12.879640",
13+
"spec_repo_commit": "fc469c89"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15212,17 +15212,18 @@ components:
1521215212
- type
1521315213
type: object
1521415214
SyntheticsGlobalVariableParseTestOptionsType:
15215-
description: Property of the Synthetic Test Response to use for a Synthetic
15216-
global variable.
15215+
description: Type of value to extract from a test for a Synthetic global variable.
1521715216
enum:
1521815217
- http_body
1521915218
- http_header
15219+
- http_status_code
1522015220
- local_variable
1522115221
example: http_body
1522215222
type: string
1522315223
x-enum-varnames:
1522415224
- HTTP_BODY
1522515225
- HTTP_HEADER
15226+
- HTTP_STATUS_CODE
1522615227
- LOCAL_VARIABLE
1522715228
SyntheticsGlobalVariableParserType:
1522815229
description: Type of parser for a Synthetic global variable from a synthetics
@@ -15341,6 +15342,23 @@ components:
1534115342
$ref: '#/components/schemas/SyntheticsTestDetails'
1534215343
type: array
1534315344
type: object
15345+
SyntheticsLocalVariableParsingOptionsType:
15346+
description: Property of the Synthetic Test Response to extract into a local
15347+
variable.
15348+
enum:
15349+
- grpc_message
15350+
- grpc_metadata
15351+
- http_body
15352+
- http_header
15353+
- http_status_code
15354+
example: http_body
15355+
type: string
15356+
x-enum-varnames:
15357+
- GRPC_MESSAGE
15358+
- GRPC_METADATA
15359+
- HTTP_BODY
15360+
- HTTP_HEADER
15361+
- HTTP_STATUS_CODE
1534415362
SyntheticsLocation:
1534515363
description: 'Synthetic location that can be used when creating or editing a
1534615364

@@ -15367,8 +15385,8 @@ components:
1536715385
example: {}
1536815386
properties:
1536915387
field:
15370-
description: When type is `http_header`, name of the header to use to extract
15371-
the value.
15388+
description: When type is `http_header` or `grpc_metadata`, name of the
15389+
header or metadatum to extract.
1537215390
example: content-type
1537315391
type: string
1537415392
name:
@@ -15380,7 +15398,7 @@ components:
1538015398
description: Determines whether or not the extracted value will be obfuscated.
1538115399
type: boolean
1538215400
type:
15383-
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType'
15401+
$ref: '#/components/schemas/SyntheticsLocalVariableParsingOptionsType'
1538415402
type: object
1538515403
SyntheticsPatchTestBody:
1538615404
description: Wrapper around an array of [JSON Patch](https://jsonpatch.com)
@@ -15955,7 +15973,7 @@ components:
1595515973
type: object
1595615974
SyntheticsTestMetadata:
1595715975
additionalProperties:
15958-
description: A single Metadatum.
15976+
description: A single metadatum.
1595915977
type: string
1596015978
description: Metadata to include when performing the gRPC test.
1596115979
type: object

examples/v1_synthetics_CreateSyntheticsAPITest_1279271422.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use datadog_api_client::datadogV1::model::SyntheticsAssertionTarget;
1616
use datadog_api_client::datadogV1::model::SyntheticsAssertionType;
1717
use datadog_api_client::datadogV1::model::SyntheticsConfigVariable;
1818
use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType;
19-
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType;
2019
use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParserType;
20+
use datadog_api_client::datadogV1::model::SyntheticsLocalVariableParsingOptionsType;
2121
use datadog_api_client::datadogV1::model::SyntheticsParsingOptions;
2222
use datadog_api_client::datadogV1::model::SyntheticsTestCallType;
2323
use datadog_api_client::datadogV1::model::SyntheticsTestDetailsSubType;
@@ -77,7 +77,7 @@ async fn main() {
7777
),
7878
)
7979
.secure(true)
80-
.type_(SyntheticsGlobalVariableParseTestOptionsType::HTTP_HEADER)
80+
.type_(SyntheticsLocalVariableParsingOptionsType::HTTP_HEADER)
8181
],
8282
)
8383
.is_critical(true)

src/datadogV1/model/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,8 @@ pub mod model_synthetics_variable_parser;
13941394
pub use self::model_synthetics_variable_parser::SyntheticsVariableParser;
13951395
pub mod model_synthetics_global_variable_parser_type;
13961396
pub use self::model_synthetics_global_variable_parser_type::SyntheticsGlobalVariableParserType;
1397-
pub mod model_synthetics_global_variable_parse_test_options_type;
1398-
pub use self::model_synthetics_global_variable_parse_test_options_type::SyntheticsGlobalVariableParseTestOptionsType;
1397+
pub mod model_synthetics_local_variable_parsing_options_type;
1398+
pub use self::model_synthetics_local_variable_parsing_options_type::SyntheticsLocalVariableParsingOptionsType;
13991399
pub mod model_synthetics_api_test_step_subtype;
14001400
pub use self::model_synthetics_api_test_step_subtype::SyntheticsAPITestStepSubtype;
14011401
pub mod model_synthetics_api_wait_step;
@@ -1510,6 +1510,8 @@ pub mod model_synthetics_global_variable_attributes;
15101510
pub use self::model_synthetics_global_variable_attributes::SyntheticsGlobalVariableAttributes;
15111511
pub mod model_synthetics_global_variable_parse_test_options;
15121512
pub use self::model_synthetics_global_variable_parse_test_options::SyntheticsGlobalVariableParseTestOptions;
1513+
pub mod model_synthetics_global_variable_parse_test_options_type;
1514+
pub use self::model_synthetics_global_variable_parse_test_options_type::SyntheticsGlobalVariableParseTestOptionsType;
15131515
pub mod model_synthetics_global_variable_value;
15141516
pub use self::model_synthetics_global_variable_value::SyntheticsGlobalVariableValue;
15151517
pub mod model_synthetics_global_variable_options;

src/datadogV1/model/model_synthetics_global_variable_parse_test_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct SyntheticsGlobalVariableParseTestOptions {
2020
/// Details of the parser to use for the global variable.
2121
#[serde(rename = "parser")]
2222
pub parser: Option<crate::datadogV1::model::SyntheticsVariableParser>,
23-
/// Property of the Synthetic Test Response to use for a Synthetic global variable.
23+
/// Type of value to extract from a test for a Synthetic global variable.
2424
#[serde(rename = "type")]
2525
pub type_: crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType,
2626
#[serde(skip)]

src/datadogV1/model/model_synthetics_global_variable_parse_test_options_type.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
99
pub enum SyntheticsGlobalVariableParseTestOptionsType {
1010
HTTP_BODY,
1111
HTTP_HEADER,
12+
HTTP_STATUS_CODE,
1213
LOCAL_VARIABLE,
1314
UnparsedObject(crate::datadog::UnparsedObject),
1415
}
@@ -18,6 +19,7 @@ impl ToString for SyntheticsGlobalVariableParseTestOptionsType {
1819
match self {
1920
Self::HTTP_BODY => String::from("http_body"),
2021
Self::HTTP_HEADER => String::from("http_header"),
22+
Self::HTTP_STATUS_CODE => String::from("http_status_code"),
2123
Self::LOCAL_VARIABLE => String::from("local_variable"),
2224
Self::UnparsedObject(v) => v.value.to_string(),
2325
}
@@ -45,6 +47,7 @@ impl<'de> Deserialize<'de> for SyntheticsGlobalVariableParseTestOptionsType {
4547
Ok(match s.as_str() {
4648
"http_body" => Self::HTTP_BODY,
4749
"http_header" => Self::HTTP_HEADER,
50+
"http_status_code" => Self::HTTP_STATUS_CODE,
4851
"local_variable" => Self::LOCAL_VARIABLE,
4952
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
5053
value: serde_json::Value::String(s.into()),
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
use serde::{Deserialize, Deserializer, Serialize, Serializer};
6+
7+
#[non_exhaustive]
8+
#[derive(Clone, Debug, Eq, PartialEq)]
9+
pub enum SyntheticsLocalVariableParsingOptionsType {
10+
GRPC_MESSAGE,
11+
GRPC_METADATA,
12+
HTTP_BODY,
13+
HTTP_HEADER,
14+
HTTP_STATUS_CODE,
15+
UnparsedObject(crate::datadog::UnparsedObject),
16+
}
17+
18+
impl ToString for SyntheticsLocalVariableParsingOptionsType {
19+
fn to_string(&self) -> String {
20+
match self {
21+
Self::GRPC_MESSAGE => String::from("grpc_message"),
22+
Self::GRPC_METADATA => String::from("grpc_metadata"),
23+
Self::HTTP_BODY => String::from("http_body"),
24+
Self::HTTP_HEADER => String::from("http_header"),
25+
Self::HTTP_STATUS_CODE => String::from("http_status_code"),
26+
Self::UnparsedObject(v) => v.value.to_string(),
27+
}
28+
}
29+
}
30+
31+
impl Serialize for SyntheticsLocalVariableParsingOptionsType {
32+
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33+
where
34+
S: Serializer,
35+
{
36+
match self {
37+
Self::UnparsedObject(v) => v.serialize(serializer),
38+
_ => serializer.serialize_str(self.to_string().as_str()),
39+
}
40+
}
41+
}
42+
43+
impl<'de> Deserialize<'de> for SyntheticsLocalVariableParsingOptionsType {
44+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
45+
where
46+
D: Deserializer<'de>,
47+
{
48+
let s: String = String::deserialize(deserializer)?;
49+
Ok(match s.as_str() {
50+
"grpc_message" => Self::GRPC_MESSAGE,
51+
"grpc_metadata" => Self::GRPC_METADATA,
52+
"http_body" => Self::HTTP_BODY,
53+
"http_header" => Self::HTTP_HEADER,
54+
"http_status_code" => Self::HTTP_STATUS_CODE,
55+
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
56+
value: serde_json::Value::String(s.into()),
57+
}),
58+
})
59+
}
60+
}

src/datadogV1/model/model_synthetics_parsing_options.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct SyntheticsParsingOptions {
14-
/// When type is `http_header`, name of the header to use to extract the value.
14+
/// When type is `http_header` or `grpc_metadata`, name of the header or metadatum to extract.
1515
#[serde(rename = "field")]
1616
pub field: Option<String>,
1717
/// Name of the variable to extract.
@@ -23,9 +23,9 @@ pub struct SyntheticsParsingOptions {
2323
/// Determines whether or not the extracted value will be obfuscated.
2424
#[serde(rename = "secure")]
2525
pub secure: Option<bool>,
26-
/// Property of the Synthetic Test Response to use for a Synthetic global variable.
26+
/// Property of the Synthetic Test Response to extract into a local variable.
2727
#[serde(rename = "type")]
28-
pub type_: Option<crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType>,
28+
pub type_: Option<crate::datadogV1::model::SyntheticsLocalVariableParsingOptionsType>,
2929
#[serde(skip)]
3030
#[serde(default)]
3131
pub(crate) _unparsed: bool,
@@ -65,7 +65,7 @@ impl SyntheticsParsingOptions {
6565

6666
pub fn type_(
6767
mut self,
68-
value: crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType,
68+
value: crate::datadogV1::model::SyntheticsLocalVariableParsingOptionsType,
6969
) -> Self {
7070
self.type_ = Some(value);
7171
self
@@ -100,7 +100,7 @@ impl<'de> Deserialize<'de> for SyntheticsParsingOptions {
100100
let mut parser: Option<crate::datadogV1::model::SyntheticsVariableParser> = None;
101101
let mut secure: Option<bool> = None;
102102
let mut type_: Option<
103-
crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType,
103+
crate::datadogV1::model::SyntheticsLocalVariableParsingOptionsType,
104104
> = None;
105105
let mut _unparsed = false;
106106

@@ -137,7 +137,7 @@ impl<'de> Deserialize<'de> for SyntheticsParsingOptions {
137137
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
138138
if let Some(ref _type_) = type_ {
139139
match _type_ {
140-
crate::datadogV1::model::SyntheticsGlobalVariableParseTestOptionsType::UnparsedObject(_type_) => {
140+
crate::datadogV1::model::SyntheticsLocalVariableParsingOptionsType::UnparsedObject(_type_) => {
141141
_unparsed = true;
142142
},
143143
_ => {}

0 commit comments

Comments
 (0)