Skip to content

Commit e6ba5ef

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8fa8b05 of spec repo
1 parent ae89412 commit e6ba5ef

3 files changed

Lines changed: 130 additions & 7 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17596,6 +17596,18 @@ components:
1759617596
CustomCostListResponseMeta:
1759717597
description: Meta for the response from the List Custom Costs endpoints.
1759817598
properties:
17599+
count_by_status:
17600+
additionalProperties:
17601+
format: int64
17602+
type: integer
17603+
description: Number of Custom Costs files per status.
17604+
type: object
17605+
providers:
17606+
description: List of available providers.
17607+
items:
17608+
description: A provider name.
17609+
type: string
17610+
type: array
1759917611
total_filtered_count:
1760017612
description: Number of Custom Costs files returned by the List Custom Costs endpoint
1760117613
format: int64
@@ -83201,6 +83213,18 @@ paths:
8320183213
name: filter[status]
8320283214
schema:
8320383215
type: string
83216+
- description: Filter files by name with case-insensitive substring matching.
83217+
in: query
83218+
name: filter[name]
83219+
schema:
83220+
type: string
83221+
- description: Filter by provider.
83222+
in: query
83223+
name: filter[provider]
83224+
schema:
83225+
items:
83226+
type: string
83227+
type: array
8320483228
- description: Sort key with optional descending prefix
8320583229
in: query
8320683230
name: sort

api/datadogV2/api_cloud_cost_management.go

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
_context "context"
99
_nethttp "net/http"
1010
_neturl "net/url"
11+
"reflect"
1112

1213
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1314
)
@@ -1836,10 +1837,12 @@ func (a *CloudCostManagementApi) ListCustomAllocationRules(ctx _context.Context)
18361837

18371838
// ListCustomCostsFilesOptionalParameters holds optional parameters for ListCustomCostsFiles.
18381839
type ListCustomCostsFilesOptionalParameters struct {
1839-
PageNumber *int64
1840-
PageSize *int64
1841-
FilterStatus *string
1842-
Sort *string
1840+
PageNumber *int64
1841+
PageSize *int64
1842+
FilterStatus *string
1843+
FilterName *string
1844+
FilterProvider *[]string
1845+
Sort *string
18431846
}
18441847

18451848
// NewListCustomCostsFilesOptionalParameters creates an empty struct for parameters.
@@ -1866,6 +1869,18 @@ func (r *ListCustomCostsFilesOptionalParameters) WithFilterStatus(filterStatus s
18661869
return r
18671870
}
18681871

1872+
// WithFilterName sets the corresponding parameter name and returns the struct.
1873+
func (r *ListCustomCostsFilesOptionalParameters) WithFilterName(filterName string) *ListCustomCostsFilesOptionalParameters {
1874+
r.FilterName = &filterName
1875+
return r
1876+
}
1877+
1878+
// WithFilterProvider sets the corresponding parameter name and returns the struct.
1879+
func (r *ListCustomCostsFilesOptionalParameters) WithFilterProvider(filterProvider []string) *ListCustomCostsFilesOptionalParameters {
1880+
r.FilterProvider = &filterProvider
1881+
return r
1882+
}
1883+
18691884
// WithSort sets the corresponding parameter name and returns the struct.
18701885
func (r *ListCustomCostsFilesOptionalParameters) WithSort(sort string) *ListCustomCostsFilesOptionalParameters {
18711886
r.Sort = &sort
@@ -1908,6 +1923,20 @@ func (a *CloudCostManagementApi) ListCustomCostsFiles(ctx _context.Context, o ..
19081923
if optionalParams.FilterStatus != nil {
19091924
localVarQueryParams.Add("filter[status]", datadog.ParameterToString(*optionalParams.FilterStatus, ""))
19101925
}
1926+
if optionalParams.FilterName != nil {
1927+
localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, ""))
1928+
}
1929+
if optionalParams.FilterProvider != nil {
1930+
t := *optionalParams.FilterProvider
1931+
if reflect.TypeOf(t).Kind() == reflect.Slice {
1932+
s := reflect.ValueOf(t)
1933+
for i := 0; i < s.Len(); i++ {
1934+
localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(s.Index(i), "multi"))
1935+
}
1936+
} else {
1937+
localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(t, "multi"))
1938+
}
1939+
}
19111940
if optionalParams.Sort != nil {
19121941
localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, ""))
19131942
}

api/datadogV2/model_custom_cost_list_response_meta.go

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import (
1010

1111
// CustomCostListResponseMeta Meta for the response from the List Custom Costs endpoints.
1212
type CustomCostListResponseMeta struct {
13+
// Number of Custom Costs files per status.
14+
CountByStatus map[string]int64 `json:"count_by_status,omitempty"`
15+
// List of available providers.
16+
Providers []string `json:"providers,omitempty"`
1317
// Number of Custom Costs files returned by the List Custom Costs endpoint
1418
TotalFilteredCount *int64 `json:"total_filtered_count,omitempty"`
1519
// Version of Custom Costs file
@@ -36,6 +40,62 @@ func NewCustomCostListResponseMetaWithDefaults() *CustomCostListResponseMeta {
3640
return &this
3741
}
3842

43+
// GetCountByStatus returns the CountByStatus field value if set, zero value otherwise.
44+
func (o *CustomCostListResponseMeta) GetCountByStatus() map[string]int64 {
45+
if o == nil || o.CountByStatus == nil {
46+
var ret map[string]int64
47+
return ret
48+
}
49+
return o.CountByStatus
50+
}
51+
52+
// GetCountByStatusOk returns a tuple with the CountByStatus field value if set, nil otherwise
53+
// and a boolean to check if the value has been set.
54+
func (o *CustomCostListResponseMeta) GetCountByStatusOk() (*map[string]int64, bool) {
55+
if o == nil || o.CountByStatus == nil {
56+
return nil, false
57+
}
58+
return &o.CountByStatus, true
59+
}
60+
61+
// HasCountByStatus returns a boolean if a field has been set.
62+
func (o *CustomCostListResponseMeta) HasCountByStatus() bool {
63+
return o != nil && o.CountByStatus != nil
64+
}
65+
66+
// SetCountByStatus gets a reference to the given map[string]int64 and assigns it to the CountByStatus field.
67+
func (o *CustomCostListResponseMeta) SetCountByStatus(v map[string]int64) {
68+
o.CountByStatus = v
69+
}
70+
71+
// GetProviders returns the Providers field value if set, zero value otherwise.
72+
func (o *CustomCostListResponseMeta) GetProviders() []string {
73+
if o == nil || o.Providers == nil {
74+
var ret []string
75+
return ret
76+
}
77+
return o.Providers
78+
}
79+
80+
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
81+
// and a boolean to check if the value has been set.
82+
func (o *CustomCostListResponseMeta) GetProvidersOk() (*[]string, bool) {
83+
if o == nil || o.Providers == nil {
84+
return nil, false
85+
}
86+
return &o.Providers, true
87+
}
88+
89+
// HasProviders returns a boolean if a field has been set.
90+
func (o *CustomCostListResponseMeta) HasProviders() bool {
91+
return o != nil && o.Providers != nil
92+
}
93+
94+
// SetProviders gets a reference to the given []string and assigns it to the Providers field.
95+
func (o *CustomCostListResponseMeta) SetProviders(v []string) {
96+
o.Providers = v
97+
}
98+
3999
// GetTotalFilteredCount returns the TotalFilteredCount field value if set, zero value otherwise.
40100
func (o *CustomCostListResponseMeta) GetTotalFilteredCount() int64 {
41101
if o == nil || o.TotalFilteredCount == nil {
@@ -98,6 +158,12 @@ func (o CustomCostListResponseMeta) MarshalJSON() ([]byte, error) {
98158
if o.UnparsedObject != nil {
99159
return datadog.Marshal(o.UnparsedObject)
100160
}
161+
if o.CountByStatus != nil {
162+
toSerialize["count_by_status"] = o.CountByStatus
163+
}
164+
if o.Providers != nil {
165+
toSerialize["providers"] = o.Providers
166+
}
101167
if o.TotalFilteredCount != nil {
102168
toSerialize["total_filtered_count"] = o.TotalFilteredCount
103169
}
@@ -114,18 +180,22 @@ func (o CustomCostListResponseMeta) MarshalJSON() ([]byte, error) {
114180
// UnmarshalJSON deserializes the given payload.
115181
func (o *CustomCostListResponseMeta) UnmarshalJSON(bytes []byte) (err error) {
116182
all := struct {
117-
TotalFilteredCount *int64 `json:"total_filtered_count,omitempty"`
118-
Version *string `json:"version,omitempty"`
183+
CountByStatus map[string]int64 `json:"count_by_status,omitempty"`
184+
Providers []string `json:"providers,omitempty"`
185+
TotalFilteredCount *int64 `json:"total_filtered_count,omitempty"`
186+
Version *string `json:"version,omitempty"`
119187
}{}
120188
if err = datadog.Unmarshal(bytes, &all); err != nil {
121189
return datadog.Unmarshal(bytes, &o.UnparsedObject)
122190
}
123191
additionalProperties := make(map[string]interface{})
124192
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
125-
datadog.DeleteKeys(additionalProperties, &[]string{"total_filtered_count", "version"})
193+
datadog.DeleteKeys(additionalProperties, &[]string{"count_by_status", "providers", "total_filtered_count", "version"})
126194
} else {
127195
return err
128196
}
197+
o.CountByStatus = all.CountByStatus
198+
o.Providers = all.Providers
129199
o.TotalFilteredCount = all.TotalFilteredCount
130200
o.Version = all.Version
131201

0 commit comments

Comments
 (0)