diff --git a/.apigentools-info b/.apigentools-info index f7a9889aa..d956f20ba 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-16 14:02:52.161932", - "spec_repo_commit": "966987f5" + "regenerated": "2024-09-18 14:45:11.870692", + "spec_repo_commit": "bae57ce1" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-16 14:02:52.179359", - "spec_repo_commit": "966987f5" + "regenerated": "2024-09-18 14:45:11.890523", + "spec_repo_commit": "bae57ce1" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 56725cba7..1bb007d88 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -16297,6 +16297,18 @@ components: PowerpackTemplateVariable: description: Powerpack template variables. properties: + available_values: + description: The list of values that the template variable drop-down is + limited to. + example: + - my-host + - host1 + - host2 + items: + description: Template variable value. + type: string + nullable: true + type: array defaults: description: One or many template variable default values within the saved view, which are unioned together using `OR` if more than one is specified. @@ -16309,6 +16321,12 @@ components: description: The name of the variable. example: datacenter type: string + prefix: + description: The tag prefix associated with the variable. Only tags with + this prefix appear in the variable drop-down. + example: host + nullable: true + type: string required: - name type: object diff --git a/src/datadogV2/model/model_powerpack_template_variable.rs b/src/datadogV2/model/model_powerpack_template_variable.rs index c042a97ac..1737c9763 100644 --- a/src/datadogV2/model/model_powerpack_template_variable.rs +++ b/src/datadogV2/model/model_powerpack_template_variable.rs @@ -11,12 +11,22 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct PowerpackTemplateVariable { + /// The list of values that the template variable drop-down is limited to. + #[serde( + rename = "available_values", + default, + with = "::serde_with::rust::double_option" + )] + pub available_values: Option>>, /// One or many template variable default values within the saved view, which are unioned together using `OR` if more than one is specified. #[serde(rename = "defaults")] pub defaults: Option>, /// The name of the variable. #[serde(rename = "name")] pub name: String, + /// The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. + #[serde(rename = "prefix", default, with = "::serde_with::rust::double_option")] + pub prefix: Option>, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -27,18 +37,30 @@ pub struct PowerpackTemplateVariable { impl PowerpackTemplateVariable { pub fn new(name: String) -> PowerpackTemplateVariable { PowerpackTemplateVariable { + available_values: None, defaults: None, name, + prefix: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn available_values(mut self, value: Option>) -> Self { + self.available_values = Some(value); + self + } + pub fn defaults(mut self, value: Vec) -> Self { self.defaults = Some(value); self } + pub fn prefix(mut self, value: Option) -> Self { + self.prefix = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -65,8 +87,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable { where M: MapAccess<'a>, { + let mut available_values: Option>> = None; let mut defaults: Option> = None; let mut name: Option = None; + let mut prefix: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -75,6 +99,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { + "available_values" => { + available_values = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "defaults" => { if v.is_null() { continue; @@ -84,6 +112,9 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable { "name" => { name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "prefix" => { + prefix = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { additional_properties.insert(k, value); @@ -94,8 +125,10 @@ impl<'de> Deserialize<'de> for PowerpackTemplateVariable { let name = name.ok_or_else(|| M::Error::missing_field("name"))?; let content = PowerpackTemplateVariable { + available_values, defaults, name, + prefix, additional_properties, _unparsed, };