From 6b509360fde4ff133e22d4b1c378a591bbe03565 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 24 Aug 2026 11:52:37 +0000 Subject: [PATCH] Regenerate client from commit 2356be1 of spec repo --- .generator/schemas/v2/openapi.yaml | 35 +++++ src/datadogV2/model/mod.rs | 2 + .../model/model_device_tags_by_source.rs | 122 ++++++++++++++++++ ...odel_list_tags_response_data_attributes.rs | 17 +++ 4 files changed, 176 insertions(+) create mode 100644 src/datadogV2/model/model_device_tags_by_source.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9b5a962d17..b6f2178784 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -33935,6 +33935,21 @@ components: format: int64 type: integer type: object + DeviceTagsBySource: + description: Tags associated with a device from a specific source. + properties: + source: + description: The source of the tags. + example: user + type: string + tags: + description: The list of tags for the source. + example: ["tag:test", "tag:testbis"] + items: + description: A tag string in `key:value` format. + type: string + type: array + type: object DevicesListData: description: The devices list data properties: @@ -63468,6 +63483,12 @@ components: ListTagsResponseDataAttributes: description: The definition of ListTagsResponseDataAttributes object. properties: + by_source: + description: The list of device tags grouped by source. + items: + $ref: "#/components/schemas/DeviceTagsBySource" + readOnly: true + type: array tags: description: The list of tags example: ["tag:test", "tag:testbis"] @@ -173995,6 +174016,20 @@ paths: content: application/json: examples: + by_source: + value: + data: + attributes: + by_source: + - source: user + tags: + - "tag:test" + - "tag:testbis" + - source: snmp + tags: + - "device_ip:1.2.3.4" + id: foiwf7rgw38fh + type: tags default: value: data: diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index 20f2cecdb6..ecd8df92f7 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -7684,6 +7684,8 @@ pub mod model_list_tags_response_data; pub use self::model_list_tags_response_data::ListTagsResponseData; pub mod model_list_tags_response_data_attributes; pub use self::model_list_tags_response_data_attributes::ListTagsResponseDataAttributes; +pub mod model_device_tags_by_source; +pub use self::model_device_tags_by_source::DeviceTagsBySource; pub mod model_list_interface_tags_response; pub use self::model_list_interface_tags_response::ListInterfaceTagsResponse; pub mod model_list_interface_tags_response_data; diff --git a/src/datadogV2/model/model_device_tags_by_source.rs b/src/datadogV2/model/model_device_tags_by_source.rs new file mode 100644 index 0000000000..54b3783fe3 --- /dev/null +++ b/src/datadogV2/model/model_device_tags_by_source.rs @@ -0,0 +1,122 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Tags associated with a device from a specific source. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct DeviceTagsBySource { + /// The source of the tags. + #[serde(rename = "source")] + pub source: Option, + /// The list of tags for the source. + #[serde(rename = "tags")] + pub tags: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl DeviceTagsBySource { + pub fn new() -> DeviceTagsBySource { + DeviceTagsBySource { + source: None, + tags: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn source(mut self, value: String) -> Self { + self.source = Some(value); + self + } + + pub fn tags(mut self, value: Vec) -> Self { + self.tags = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for DeviceTagsBySource { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for DeviceTagsBySource { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct DeviceTagsBySourceVisitor; + impl<'a> Visitor<'a> for DeviceTagsBySourceVisitor { + type Value = DeviceTagsBySource; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut source: Option = None; + let mut tags: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "source" => { + if v.is_null() { + continue; + } + source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tags" => { + if v.is_null() { + continue; + } + tags = 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); + } + } + } + } + + let content = DeviceTagsBySource { + source, + tags, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(DeviceTagsBySourceVisitor) + } +} diff --git a/src/datadogV2/model/model_list_tags_response_data_attributes.rs b/src/datadogV2/model/model_list_tags_response_data_attributes.rs index 75cbe1574e..990d5c3228 100644 --- a/src/datadogV2/model/model_list_tags_response_data_attributes.rs +++ b/src/datadogV2/model/model_list_tags_response_data_attributes.rs @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct ListTagsResponseDataAttributes { + /// The list of device tags grouped by source. + #[serde(rename = "by_source")] + pub by_source: Option>, /// The list of tags #[serde(rename = "tags")] pub tags: Option>, @@ -24,12 +27,18 @@ pub struct ListTagsResponseDataAttributes { impl ListTagsResponseDataAttributes { pub fn new() -> ListTagsResponseDataAttributes { ListTagsResponseDataAttributes { + by_source: None, tags: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn by_source(mut self, value: Vec) -> Self { + self.by_source = Some(value); + self + } + pub fn tags(mut self, value: Vec) -> Self { self.tags = Some(value); self @@ -67,6 +76,7 @@ impl<'de> Deserialize<'de> for ListTagsResponseDataAttributes { where M: MapAccess<'a>, { + let mut by_source: Option> = None; let mut tags: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -76,6 +86,12 @@ impl<'de> Deserialize<'de> for ListTagsResponseDataAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { + "by_source" => { + if v.is_null() { + continue; + } + by_source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "tags" => { if v.is_null() { continue; @@ -91,6 +107,7 @@ impl<'de> Deserialize<'de> for ListTagsResponseDataAttributes { } let content = ListTagsResponseDataAttributes { + by_source, tags, additional_properties, _unparsed,