Skip to content

Commit d8c37a4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
update metrics.yaml for ListMetricAssets (DataDog#3193)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent cedd8d3 commit d8c37a4

6 files changed

Lines changed: 56 additions & 10 deletions

File tree

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "4727afe",
3-
"generated": "2025-07-23 15:38:09.447"
2+
"spec_repo_commit": "c09ac23",
3+
"generated": "2025-07-24 19:59:27.040"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22454,8 +22454,19 @@ components:
2245422454
readOnly: true
2245522455
type: object
2245622456
MetricAssetAttributes:
22457-
description: Assets related to the object, including title and url.
22457+
description: Assets related to the object, including title, url, and tags.
2245822458
properties:
22459+
tags:
22460+
description: List of tag keys used in the asset.
22461+
example:
22462+
- env
22463+
- service
22464+
- host
22465+
- datacenter
22466+
items:
22467+
description: Tag key used in assets.
22468+
type: string
22469+
type: array
2245922470
title:
2246022471
description: Title of the asset.
2246122472
type: string

api/datadogV2/model_metric_asset_attributes.go

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// MetricAssetAttributes Assets related to the object, including title and url.
11+
// MetricAssetAttributes Assets related to the object, including title, url, and tags.
1212
type MetricAssetAttributes struct {
13+
// List of tag keys used in the asset.
14+
Tags []string `json:"tags,omitempty"`
1315
// Title of the asset.
1416
Title *string `json:"title,omitempty"`
1517
// URL path of the asset.
@@ -36,6 +38,34 @@ func NewMetricAssetAttributesWithDefaults() *MetricAssetAttributes {
3638
return &this
3739
}
3840

41+
// GetTags returns the Tags field value if set, zero value otherwise.
42+
func (o *MetricAssetAttributes) GetTags() []string {
43+
if o == nil || o.Tags == nil {
44+
var ret []string
45+
return ret
46+
}
47+
return o.Tags
48+
}
49+
50+
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
51+
// and a boolean to check if the value has been set.
52+
func (o *MetricAssetAttributes) GetTagsOk() (*[]string, bool) {
53+
if o == nil || o.Tags == nil {
54+
return nil, false
55+
}
56+
return &o.Tags, true
57+
}
58+
59+
// HasTags returns a boolean if a field has been set.
60+
func (o *MetricAssetAttributes) HasTags() bool {
61+
return o != nil && o.Tags != nil
62+
}
63+
64+
// SetTags gets a reference to the given []string and assigns it to the Tags field.
65+
func (o *MetricAssetAttributes) SetTags(v []string) {
66+
o.Tags = v
67+
}
68+
3969
// GetTitle returns the Title field value if set, zero value otherwise.
4070
func (o *MetricAssetAttributes) GetTitle() string {
4171
if o == nil || o.Title == nil {
@@ -98,6 +128,9 @@ func (o MetricAssetAttributes) MarshalJSON() ([]byte, error) {
98128
if o.UnparsedObject != nil {
99129
return datadog.Marshal(o.UnparsedObject)
100130
}
131+
if o.Tags != nil {
132+
toSerialize["tags"] = o.Tags
133+
}
101134
if o.Title != nil {
102135
toSerialize["title"] = o.Title
103136
}
@@ -114,18 +147,20 @@ func (o MetricAssetAttributes) MarshalJSON() ([]byte, error) {
114147
// UnmarshalJSON deserializes the given payload.
115148
func (o *MetricAssetAttributes) UnmarshalJSON(bytes []byte) (err error) {
116149
all := struct {
117-
Title *string `json:"title,omitempty"`
118-
Url *string `json:"url,omitempty"`
150+
Tags []string `json:"tags,omitempty"`
151+
Title *string `json:"title,omitempty"`
152+
Url *string `json:"url,omitempty"`
119153
}{}
120154
if err = datadog.Unmarshal(bytes, &all); err != nil {
121155
return datadog.Unmarshal(bytes, &o.UnparsedObject)
122156
}
123157
additionalProperties := make(map[string]interface{})
124158
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
125-
datadog.DeleteKeys(additionalProperties, &[]string{"title", "url"})
159+
datadog.DeleteKeys(additionalProperties, &[]string{"tags", "title", "url"})
126160
} else {
127161
return err
128162
}
163+
o.Tags = all.Tags
129164
o.Title = all.Title
130165
o.Url = all.Url
131166

api/datadogV2/model_metric_monitor_asset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// MetricMonitorAsset A monitor object with title.
1414
type MetricMonitorAsset struct {
15-
// Assets related to the object, including title and url.
15+
// Assets related to the object, including title, url, and tags.
1616
Attributes *MetricAssetAttributes `json:"attributes,omitempty"`
1717
// The related monitor's ID.
1818
Id string `json:"id"`

api/datadogV2/model_metric_notebook_asset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// MetricNotebookAsset A notebook object with title.
1414
type MetricNotebookAsset struct {
15-
// Assets related to the object, including title and url.
15+
// Assets related to the object, including title, url, and tags.
1616
Attributes *MetricAssetAttributes `json:"attributes,omitempty"`
1717
// The related notebook's ID.
1818
Id string `json:"id"`

api/datadogV2/model_metric_slo_asset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// MetricSLOAsset A SLO object with title.
1414
type MetricSLOAsset struct {
15-
// Assets related to the object, including title and url.
15+
// Assets related to the object, including title, url, and tags.
1616
Attributes *MetricAssetAttributes `json:"attributes,omitempty"`
1717
// The SLO ID.
1818
Id string `json:"id"`

0 commit comments

Comments
 (0)