Skip to content

Commit 8b7a481

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bae57ce1 of spec repo
1 parent aa8df54 commit 8b7a481

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
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": "2024-09-16 14:02:52.161932",
8-
"spec_repo_commit": "966987f5"
7+
"regenerated": "2024-09-18 14:45:11.870692",
8+
"spec_repo_commit": "bae57ce1"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-16 14:02:52.179359",
13-
"spec_repo_commit": "966987f5"
12+
"regenerated": "2024-09-18 14:45:11.890523",
13+
"spec_repo_commit": "bae57ce1"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -16297,6 +16297,18 @@ components:
1629716297
PowerpackTemplateVariable:
1629816298
description: Powerpack template variables.
1629916299
properties:
16300+
available_values:
16301+
description: The list of values that the template variable drop-down is
16302+
limited to.
16303+
example:
16304+
- my-host
16305+
- host1
16306+
- host2
16307+
items:
16308+
description: Template variable value.
16309+
type: string
16310+
nullable: true
16311+
type: array
1630016312
defaults:
1630116313
description: One or many template variable default values within the saved
1630216314
view, which are unioned together using `OR` if more than one is specified.
@@ -16309,6 +16321,12 @@ components:
1630916321
description: The name of the variable.
1631016322
example: datacenter
1631116323
type: string
16324+
prefix:
16325+
description: The tag prefix associated with the variable. Only tags with
16326+
this prefix appear in the variable drop-down.
16327+
example: host
16328+
nullable: true
16329+
type: string
1631216330
required:
1631316331
- name
1631416332
type: object

src/datadogV2/model/model_powerpack_template_variable.rs

+33
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,22 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct PowerpackTemplateVariable {
14+
/// The list of values that the template variable drop-down is limited to.
15+
#[serde(
16+
rename = "available_values",
17+
default,
18+
with = "::serde_with::rust::double_option"
19+
)]
20+
pub available_values: Option<Option<Vec<String>>>,
1421
/// One or many template variable default values within the saved view, which are unioned together using `OR` if more than one is specified.
1522
#[serde(rename = "defaults")]
1623
pub defaults: Option<Vec<String>>,
1724
/// The name of the variable.
1825
#[serde(rename = "name")]
1926
pub name: String,
27+
/// The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
28+
#[serde(rename = "prefix", default, with = "::serde_with::rust::double_option")]
29+
pub prefix: Option<Option<String>>,
2030
#[serde(flatten)]
2131
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
2232
#[serde(skip)]
@@ -27,18 +37,30 @@ pub struct PowerpackTemplateVariable {
2737
impl PowerpackTemplateVariable {
2838
pub fn new(name: String) -> PowerpackTemplateVariable {
2939
PowerpackTemplateVariable {
40+
available_values: None,
3041
defaults: None,
3142
name,
43+
prefix: None,
3244
additional_properties: std::collections::BTreeMap::new(),
3345
_unparsed: false,
3446
}
3547
}
3648

49+
pub fn available_values(mut self, value: Option<Vec<String>>) -> Self {
50+
self.available_values = Some(value);
51+
self
52+
}
53+
3754
pub fn defaults(mut self, value: Vec<String>) -> Self {
3855
self.defaults = Some(value);
3956
self
4057
}
4158

59+
pub fn prefix(mut self, value: Option<String>) -> Self {
60+
self.prefix = Some(value);
61+
self
62+
}
63+
4264
pub fn additional_properties(
4365
mut self,
4466
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -65,8 +87,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable {
6587
where
6688
M: MapAccess<'a>,
6789
{
90+
let mut available_values: Option<Option<Vec<String>>> = None;
6891
let mut defaults: Option<Vec<String>> = None;
6992
let mut name: Option<String> = None;
93+
let mut prefix: Option<Option<String>> = None;
7094
let mut additional_properties: std::collections::BTreeMap<
7195
String,
7296
serde_json::Value,
@@ -75,6 +99,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable {
7599

76100
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
77101
match k.as_str() {
102+
"available_values" => {
103+
available_values =
104+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
105+
}
78106
"defaults" => {
79107
if v.is_null() {
80108
continue;
@@ -84,6 +112,9 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable {
84112
"name" => {
85113
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
86114
}
115+
"prefix" => {
116+
prefix = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
117+
}
87118
&_ => {
88119
if let Ok(value) = serde_json::from_value(v.clone()) {
89120
additional_properties.insert(k, value);
@@ -94,8 +125,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable {
94125
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
95126

96127
let content = PowerpackTemplateVariable {
128+
available_values,
97129
defaults,
98130
name,
131+
prefix,
99132
additional_properties,
100133
_unparsed,
101134
};

0 commit comments

Comments
 (0)