Skip to content

Commit 08164ca

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 622be32 of spec repo
1 parent 2e50124 commit 08164ca

37 files changed

Lines changed: 580 additions & 27 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19897,6 +19897,45 @@ components:
1989719897
x-enum-varnames:
1989819898
- "TRUE"
1989919899
- "FALSE"
19900+
CostTagMetadataMonth:
19901+
description: A month that has Cloud Cost Management tag metadata available for a given provider.
19902+
properties:
19903+
id:
19904+
description: The month, in `YYYY-MM` format.
19905+
example: "2026-04"
19906+
type: string
19907+
type:
19908+
$ref: "#/components/schemas/CostTagMetadataMonthType"
19909+
required:
19910+
- id
19911+
- type
19912+
type: object
19913+
CostTagMetadataMonthType:
19914+
default: cost_tag_metadata_month
19915+
description: Type of the Cloud Cost Management tag metadata month resource.
19916+
enum:
19917+
- cost_tag_metadata_month
19918+
example: cost_tag_metadata_month
19919+
type: string
19920+
x-enum-varnames:
19921+
- COST_TAG_METADATA_MONTH
19922+
CostTagMetadataMonthsResponse:
19923+
description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months.
19924+
example:
19925+
data:
19926+
- id: "2026-04"
19927+
type: cost_tag_metadata_month
19928+
- id: "2026-03"
19929+
type: cost_tag_metadata_month
19930+
properties:
19931+
data:
19932+
description: List of months that have tag metadata available.
19933+
items:
19934+
$ref: "#/components/schemas/CostTagMetadataMonth"
19935+
type: array
19936+
required:
19937+
- data
19938+
type: object
1990019939
CostTagType:
1990119940
default: cost_tag
1990219941
description: Type of the Cloud Cost Management tag resource.
@@ -111135,6 +111174,68 @@ paths:
111135111174
x-unstable: |-
111136111175
**Note**: This endpoint is in preview and is subject to change.
111137111176
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
111177+
/api/v2/cost/tag_metadata/months:
111178+
get:
111179+
description: |-
111180+
List months that have Cloud Cost Management tag metadata for a given provider,
111181+
ordered most-recent first. The response is capped at 36 months.
111182+
operationId: ListCostTagMetadataMonths
111183+
parameters:
111184+
- description: |-
111185+
Provider to scope the query to. Use the value of the `providername` tag in CCM
111186+
(for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`).
111187+
For costs uploaded through the Custom Costs API, use `custom`.
111188+
Values are case-sensitive.
111189+
example: aws
111190+
in: query
111191+
name: filter[provider]
111192+
required: true
111193+
schema:
111194+
type: string
111195+
responses:
111196+
"200":
111197+
content:
111198+
application/json:
111199+
examples:
111200+
default:
111201+
value:
111202+
data:
111203+
- id: "2026-04"
111204+
type: cost_tag_metadata_month
111205+
- id: "2026-03"
111206+
type: cost_tag_metadata_month
111207+
schema:
111208+
$ref: "#/components/schemas/CostTagMetadataMonthsResponse"
111209+
description: OK
111210+
"400":
111211+
content:
111212+
application/json:
111213+
schema:
111214+
$ref: "#/components/schemas/APIErrorResponse"
111215+
description: Bad Request
111216+
"403":
111217+
content:
111218+
application/json:
111219+
schema:
111220+
$ref: "#/components/schemas/APIErrorResponse"
111221+
description: Forbidden
111222+
"429":
111223+
$ref: "#/components/responses/TooManyRequestsResponse"
111224+
security:
111225+
- apiKeyAuth: []
111226+
appKeyAuth: []
111227+
- AuthZ:
111228+
- cloud_cost_management_read
111229+
summary: List Cloud Cost Management tag metadata months
111230+
tags:
111231+
- Cloud Cost Management
111232+
"x-permission":
111233+
operator: OR
111234+
permissions:
111235+
- cloud_cost_management_read
111236+
x-unstable: |-
111237+
**Note**: This endpoint is in preview and is subject to change.
111238+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
111138111239
/api/v2/cost/tag_metadata/orchestrators:
111139111240
get:
111140111241
description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period.

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ func NewConfiguration() *Configuration {
852852
"v2.ListCostTagKeySources": false,
853853
"v2.ListCostTagMetadata": false,
854854
"v2.ListCostTagMetadataMetrics": false,
855+
"v2.ListCostTagMetadataMonths": false,
855856
"v2.ListCostTagMetadataOrchestrators": false,
856857
"v2.SearchCostRecommendations": false,
857858
"v2.CreateDashboardSecureEmbed": false,

api/datadogV2/api_cloud_cost_management.go

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,6 +4026,94 @@ func (a *CloudCostManagementApi) ListCostTagMetadataMetrics(ctx _context.Context
40264026
return localVarReturnValue, localVarHTTPResponse, nil
40274027
}
40284028

4029+
// ListCostTagMetadataMonths List Cloud Cost Management tag metadata months.
4030+
// List months that have Cloud Cost Management tag metadata for a given provider,
4031+
// ordered most-recent first. The response is capped at 36 months.
4032+
func (a *CloudCostManagementApi) ListCostTagMetadataMonths(ctx _context.Context, filterProvider string) (CostTagMetadataMonthsResponse, *_nethttp.Response, error) {
4033+
var (
4034+
localVarHTTPMethod = _nethttp.MethodGet
4035+
localVarPostBody interface{}
4036+
localVarReturnValue CostTagMetadataMonthsResponse
4037+
)
4038+
4039+
operationId := "v2.ListCostTagMetadataMonths"
4040+
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
4041+
if !isOperationEnabled {
4042+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
4043+
}
4044+
if isOperationEnabled && a.Client.Cfg.Debug {
4045+
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
4046+
}
4047+
4048+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagMetadataMonths")
4049+
if err != nil {
4050+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
4051+
}
4052+
4053+
localVarPath := localBasePath + "/api/v2/cost/tag_metadata/months"
4054+
4055+
localVarHeaderParams := make(map[string]string)
4056+
localVarQueryParams := _neturl.Values{}
4057+
localVarFormParams := _neturl.Values{}
4058+
localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(filterProvider, ""))
4059+
localVarHeaderParams["Accept"] = "application/json"
4060+
4061+
if a.Client.Cfg.DelegatedTokenConfig != nil {
4062+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
4063+
if err != nil {
4064+
return localVarReturnValue, nil, err
4065+
}
4066+
} else {
4067+
datadog.SetAuthKeys(
4068+
ctx,
4069+
&localVarHeaderParams,
4070+
[2]string{"apiKeyAuth", "DD-API-KEY"},
4071+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
4072+
)
4073+
}
4074+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
4075+
if err != nil {
4076+
return localVarReturnValue, nil, err
4077+
}
4078+
4079+
localVarHTTPResponse, err := a.Client.CallAPI(req)
4080+
if err != nil || localVarHTTPResponse == nil {
4081+
return localVarReturnValue, localVarHTTPResponse, err
4082+
}
4083+
4084+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
4085+
if err != nil {
4086+
return localVarReturnValue, localVarHTTPResponse, err
4087+
}
4088+
4089+
if localVarHTTPResponse.StatusCode >= 300 {
4090+
newErr := datadog.GenericOpenAPIError{
4091+
ErrorBody: localVarBody,
4092+
ErrorMessage: localVarHTTPResponse.Status,
4093+
}
4094+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
4095+
var v APIErrorResponse
4096+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
4097+
if err != nil {
4098+
return localVarReturnValue, localVarHTTPResponse, newErr
4099+
}
4100+
newErr.ErrorModel = v
4101+
}
4102+
return localVarReturnValue, localVarHTTPResponse, newErr
4103+
}
4104+
4105+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
4106+
if err != nil {
4107+
newErr := datadog.GenericOpenAPIError{
4108+
ErrorBody: localVarBody,
4109+
ErrorMessage: err.Error(),
4110+
}
4111+
return localVarReturnValue, localVarHTTPResponse, newErr
4112+
}
4113+
4114+
return localVarReturnValue, localVarHTTPResponse, nil
4115+
}
4116+
40294117
// ListCostTagMetadataOrchestratorsOptionalParameters holds optional parameters for ListCostTagMetadataOrchestrators.
40304118
type ListCostTagMetadataOrchestratorsOptionalParameters struct {
40314119
FilterProvider *string

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@
270270
// - [CloudCostManagementApi.ListCostTagKeys]
271271
// - [CloudCostManagementApi.ListCostTagMetadata]
272272
// - [CloudCostManagementApi.ListCostTagMetadataMetrics]
273+
// - [CloudCostManagementApi.ListCostTagMetadataMonths]
273274
// - [CloudCostManagementApi.ListCostTagMetadataOrchestrators]
274275
// - [CloudCostManagementApi.ListCostTags]
275276
// - [CloudCostManagementApi.ListCustomAllocationRules]
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// CostTagMetadataMonth A month that has Cloud Cost Management tag metadata available for a given provider.
14+
type CostTagMetadataMonth struct {
15+
// The month, in `YYYY-MM` format.
16+
Id string `json:"id"`
17+
// Type of the Cloud Cost Management tag metadata month resource.
18+
Type CostTagMetadataMonthType `json:"type"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewCostTagMetadataMonth instantiates a new CostTagMetadataMonth object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewCostTagMetadataMonth(id string, typeVar CostTagMetadataMonthType) *CostTagMetadataMonth {
29+
this := CostTagMetadataMonth{}
30+
this.Id = id
31+
this.Type = typeVar
32+
return &this
33+
}
34+
35+
// NewCostTagMetadataMonthWithDefaults instantiates a new CostTagMetadataMonth object.
36+
// This constructor will only assign default values to properties that have it defined,
37+
// but it doesn't guarantee that properties required by API are set.
38+
func NewCostTagMetadataMonthWithDefaults() *CostTagMetadataMonth {
39+
this := CostTagMetadataMonth{}
40+
var typeVar CostTagMetadataMonthType = COSTTAGMETADATAMONTHTYPE_COST_TAG_METADATA_MONTH
41+
this.Type = typeVar
42+
return &this
43+
}
44+
45+
// GetId returns the Id field value.
46+
func (o *CostTagMetadataMonth) GetId() string {
47+
if o == nil {
48+
var ret string
49+
return ret
50+
}
51+
return o.Id
52+
}
53+
54+
// GetIdOk returns a tuple with the Id field value
55+
// and a boolean to check if the value has been set.
56+
func (o *CostTagMetadataMonth) GetIdOk() (*string, bool) {
57+
if o == nil {
58+
return nil, false
59+
}
60+
return &o.Id, true
61+
}
62+
63+
// SetId sets field value.
64+
func (o *CostTagMetadataMonth) SetId(v string) {
65+
o.Id = v
66+
}
67+
68+
// GetType returns the Type field value.
69+
func (o *CostTagMetadataMonth) GetType() CostTagMetadataMonthType {
70+
if o == nil {
71+
var ret CostTagMetadataMonthType
72+
return ret
73+
}
74+
return o.Type
75+
}
76+
77+
// GetTypeOk returns a tuple with the Type field value
78+
// and a boolean to check if the value has been set.
79+
func (o *CostTagMetadataMonth) GetTypeOk() (*CostTagMetadataMonthType, bool) {
80+
if o == nil {
81+
return nil, false
82+
}
83+
return &o.Type, true
84+
}
85+
86+
// SetType sets field value.
87+
func (o *CostTagMetadataMonth) SetType(v CostTagMetadataMonthType) {
88+
o.Type = v
89+
}
90+
91+
// MarshalJSON serializes the struct using spec logic.
92+
func (o CostTagMetadataMonth) MarshalJSON() ([]byte, error) {
93+
toSerialize := map[string]interface{}{}
94+
if o.UnparsedObject != nil {
95+
return datadog.Marshal(o.UnparsedObject)
96+
}
97+
toSerialize["id"] = o.Id
98+
toSerialize["type"] = o.Type
99+
100+
for key, value := range o.AdditionalProperties {
101+
toSerialize[key] = value
102+
}
103+
return datadog.Marshal(toSerialize)
104+
}
105+
106+
// UnmarshalJSON deserializes the given payload.
107+
func (o *CostTagMetadataMonth) UnmarshalJSON(bytes []byte) (err error) {
108+
all := struct {
109+
Id *string `json:"id"`
110+
Type *CostTagMetadataMonthType `json:"type"`
111+
}{}
112+
if err = datadog.Unmarshal(bytes, &all); err != nil {
113+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
114+
}
115+
if all.Id == nil {
116+
return fmt.Errorf("required field id missing")
117+
}
118+
if all.Type == nil {
119+
return fmt.Errorf("required field type missing")
120+
}
121+
additionalProperties := make(map[string]interface{})
122+
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
123+
datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"})
124+
} else {
125+
return err
126+
}
127+
128+
hasInvalidField := false
129+
o.Id = *all.Id
130+
if !all.Type.IsValid() {
131+
hasInvalidField = true
132+
} else {
133+
o.Type = *all.Type
134+
}
135+
136+
if len(additionalProperties) > 0 {
137+
o.AdditionalProperties = additionalProperties
138+
}
139+
140+
if hasInvalidField {
141+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
142+
}
143+
144+
return nil
145+
}

0 commit comments

Comments
 (0)