Skip to content

Commit 0a2d8b3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 88697ae of spec repo
1 parent b3ad3a9 commit 0a2d8b3

10 files changed

Lines changed: 553 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18525,6 +18525,45 @@ components:
1852518525
x-enum-varnames:
1852618526
- "TRUE"
1852718527
- "FALSE"
18528+
CostTagMetadataMonth:
18529+
description: A month that has Cloud Cost Management tag metadata available for a given provider.
18530+
properties:
18531+
id:
18532+
description: The month, in `YYYY-MM` format.
18533+
example: "2026-04"
18534+
type: string
18535+
type:
18536+
$ref: "#/components/schemas/CostTagMetadataMonthType"
18537+
required:
18538+
- id
18539+
- type
18540+
type: object
18541+
CostTagMetadataMonthType:
18542+
default: cost_tag_metadata_month
18543+
description: Type of the Cloud Cost Management tag metadata month resource.
18544+
enum:
18545+
- cost_tag_metadata_month
18546+
example: cost_tag_metadata_month
18547+
type: string
18548+
x-enum-varnames:
18549+
- COST_TAG_METADATA_MONTH
18550+
CostTagMetadataMonthsResponse:
18551+
description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months.
18552+
example:
18553+
data:
18554+
- id: "2026-04"
18555+
type: cost_tag_metadata_month
18556+
- id: "2026-03"
18557+
type: cost_tag_metadata_month
18558+
properties:
18559+
data:
18560+
description: List of months that have tag metadata available.
18561+
items:
18562+
$ref: "#/components/schemas/CostTagMetadataMonth"
18563+
type: array
18564+
required:
18565+
- data
18566+
type: object
1852818567
CostTagType:
1852918568
default: cost_tag
1853018569
description: Type of the Cloud Cost Management tag resource.
@@ -108886,6 +108925,68 @@ paths:
108886108925
x-unstable: |-
108887108926
**Note**: This endpoint is in preview and is subject to change.
108888108927
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
108928+
/api/v2/cost/tag_metadata/months:
108929+
get:
108930+
description: |-
108931+
List months that have Cloud Cost Management tag metadata for a given provider,
108932+
ordered most-recent first. The response is capped at 36 months.
108933+
operationId: ListCostTagMetadataMonths
108934+
parameters:
108935+
- description: |-
108936+
Provider to scope the query to. Use the value of the `providername` tag in CCM
108937+
(for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`).
108938+
For costs uploaded through the Custom Costs API, use `custom`.
108939+
Values are case-sensitive.
108940+
example: aws
108941+
in: query
108942+
name: filter[provider]
108943+
required: true
108944+
schema:
108945+
type: string
108946+
responses:
108947+
"200":
108948+
content:
108949+
application/json:
108950+
examples:
108951+
default:
108952+
value:
108953+
data:
108954+
- id: "2026-04"
108955+
type: cost_tag_metadata_month
108956+
- id: "2026-03"
108957+
type: cost_tag_metadata_month
108958+
schema:
108959+
$ref: "#/components/schemas/CostTagMetadataMonthsResponse"
108960+
description: OK
108961+
"400":
108962+
content:
108963+
application/json:
108964+
schema:
108965+
$ref: "#/components/schemas/APIErrorResponse"
108966+
description: Bad Request
108967+
"403":
108968+
content:
108969+
application/json:
108970+
schema:
108971+
$ref: "#/components/schemas/APIErrorResponse"
108972+
description: Forbidden
108973+
"429":
108974+
$ref: "#/components/responses/TooManyRequestsResponse"
108975+
security:
108976+
- apiKeyAuth: []
108977+
appKeyAuth: []
108978+
- AuthZ:
108979+
- cloud_cost_management_read
108980+
summary: List Cloud Cost Management tag metadata months
108981+
tags:
108982+
- Cloud Cost Management
108983+
"x-permission":
108984+
operator: OR
108985+
permissions:
108986+
- cloud_cost_management_read
108987+
x-unstable: |-
108988+
**Note**: This endpoint is in preview and is subject to change.
108989+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
108889108990
/api/v2/cost/tag_metadata/orchestrators:
108890108991
get:
108891108992
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
@@ -833,6 +833,7 @@ func NewConfiguration() *Configuration {
833833
"v2.ListCostTagKeySources": false,
834834
"v2.ListCostTagMetadata": false,
835835
"v2.ListCostTagMetadataMetrics": false,
836+
"v2.ListCostTagMetadataMonths": false,
836837
"v2.ListCostTagMetadataOrchestrators": false,
837838
"v2.SearchCostRecommendations": false,
838839
"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
@@ -265,6 +265,7 @@
265265
// - [CloudCostManagementApi.ListCostTagKeys]
266266
// - [CloudCostManagementApi.ListCostTagMetadata]
267267
// - [CloudCostManagementApi.ListCostTagMetadataMetrics]
268+
// - [CloudCostManagementApi.ListCostTagMetadataMonths]
268269
// - [CloudCostManagementApi.ListCostTagMetadataOrchestrators]
269270
// - [CloudCostManagementApi.ListCostTags]
270271
// - [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.Unmarshal(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)