Skip to content

Commit bcf1047

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing params to ListCustomCostsFiles (DataDog#3950)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 72a47f6 commit bcf1047

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
@@ -17831,6 +17831,18 @@ components:
1783117831
CustomCostListResponseMeta:
1783217832
description: Meta for the response from the List Custom Costs endpoints.
1783317833
properties:
17834+
count_by_status:
17835+
additionalProperties:
17836+
format: int64
17837+
type: integer
17838+
description: Number of Custom Costs files per status.
17839+
type: object
17840+
providers:
17841+
description: List of available providers.
17842+
items:
17843+
description: A provider name.
17844+
type: string
17845+
type: array
1783417846
total_filtered_count:
1783517847
description: Number of Custom Costs files returned by the List Custom Costs endpoint
1783617848
format: int64
@@ -86879,6 +86891,18 @@ paths:
8687986891
name: filter[status]
8688086892
schema:
8688186893
type: string
86894+
- description: Filter files by name with case-insensitive substring matching.
86895+
in: query
86896+
name: filter[name]
86897+
schema:
86898+
type: string
86899+
- description: Filter by provider.
86900+
in: query
86901+
name: filter[provider]
86902+
schema:
86903+
items:
86904+
type: string
86905+
type: array
8688286906
- description: Sort key with optional descending prefix
8688386907
in: query
8688486908
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)