Skip to content

update metrics.yaml for ListMetricAssets #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "214381f",
"generated": "2025-07-17 15:42:35.217"
"spec_repo_commit": "7f27ad2",
"generated": "2025-07-17 18:30:41.344"
}
13 changes: 12 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22346,8 +22346,19 @@ components:
readOnly: true
type: object
MetricAssetAttributes:
description: Assets related to the object, including title and url.
description: Assets related to the object, including title, url, and tags.
properties:
tags:
description: List of tag keys used in the asset.
example:
- env
- service
- host
- datacenter
items:
description: Tag key used in assets.
type: string
type: array
title:
description: Title of the asset.
type: string
Expand Down
19 changes: 18 additions & 1 deletion src/datadogV2/model/model_metric_asset_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Assets related to the object, including title and url.
/// Assets related to the object, including title, url, and tags.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct MetricAssetAttributes {
/// List of tag keys used in the asset.
#[serde(rename = "tags")]
pub tags: Option<Vec<String>>,
/// Title of the asset.
#[serde(rename = "title")]
pub title: Option<String>,
Expand All @@ -27,13 +30,19 @@ pub struct MetricAssetAttributes {
impl MetricAssetAttributes {
pub fn new() -> MetricAssetAttributes {
MetricAssetAttributes {
tags: None,
title: None,
url: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn tags(mut self, value: Vec<String>) -> Self {
self.tags = Some(value);
self
}

pub fn title(mut self, value: String) -> Self {
self.title = Some(value);
self
Expand Down Expand Up @@ -76,6 +85,7 @@ impl<'de> Deserialize<'de> for MetricAssetAttributes {
where
M: MapAccess<'a>,
{
let mut tags: Option<Vec<String>> = None;
let mut title: Option<String> = None;
let mut url: Option<String> = None;
let mut additional_properties: std::collections::BTreeMap<
Expand All @@ -86,6 +96,12 @@ impl<'de> Deserialize<'de> for MetricAssetAttributes {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"tags" => {
if v.is_null() {
continue;
}
tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"title" => {
if v.is_null() {
continue;
Expand All @@ -107,6 +123,7 @@ impl<'de> Deserialize<'de> for MetricAssetAttributes {
}

let content = MetricAssetAttributes {
tags,
title,
url,
additional_properties,
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV2/model/model_metric_monitor_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct MetricMonitorAsset {
/// Assets related to the object, including title and url.
/// Assets related to the object, including title, url, and tags.
#[serde(rename = "attributes")]
pub attributes: Option<crate::datadogV2::model::MetricAssetAttributes>,
/// The related monitor's ID.
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV2/model/model_metric_notebook_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct MetricNotebookAsset {
/// Assets related to the object, including title and url.
/// Assets related to the object, including title, url, and tags.
#[serde(rename = "attributes")]
pub attributes: Option<crate::datadogV2::model::MetricAssetAttributes>,
/// The related notebook's ID.
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV2/model/model_metric_slo_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct MetricSLOAsset {
/// Assets related to the object, including title and url.
/// Assets related to the object, including title, url, and tags.
#[serde(rename = "attributes")]
pub attributes: Option<crate::datadogV2::model::MetricAssetAttributes>,
/// The SLO ID.
Expand Down