From 381da59726786efcc2fddb397e0e67b56a404706 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 1 Oct 2026 18:41:39 +0000 Subject: [PATCH] Regenerate client from commit 0e116ca of spec repo --- .generator/schemas/v2/openapi.yaml | 18 +++++--- ...del_recommendations_filter_request_data.go | 5 ++- ...ndations_filter_request_data_attributes.go | 45 +++++++++++++++++-- ...commendations_filter_request_sort_items.go | 2 +- .../SearchCostRecommendations.go | 2 +- .../features/v2/cloud_cost_management.feature | 2 +- 6 files changed, 60 insertions(+), 14 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 107e8082139..494c29d081e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -93243,7 +93243,7 @@ components: attributes: scope: ccm sort: - - expression: potential_daily_savings.amount + - expression: "@potential_daily_savings" order: DESC id: "@resource_table:aws_ec2_instance" type: recommendations_filter @@ -93262,8 +93262,9 @@ components: $ref: "#/components/schemas/RecommendationsFilterRequestDataAttributes" id: description: |- - Filter expression applied to the recommendations. The server treats an omitted ID as `*` - and returns all recommendations. + Filter expression applied to the recommendations when `attributes.filter` is omitted. + When supplied, `attributes.filter` overrides this value, including when empty. If the + resulting filter is empty, it defaults to `*`. Scope, view, and pagination still apply. type: string type: $ref: "#/components/schemas/RecommendationsFilterRequestDataType" @@ -93273,6 +93274,13 @@ components: RecommendationsFilterRequestDataAttributes: description: Attributes used to filter and sort cost recommendations. properties: + filter: + description: |- + Filter expression applied to the recommendations. When supplied, this attribute overrides + `data.id`, including when empty. When omitted, `data.id` is used. If the resulting filter + is empty, it defaults to `*`. Scope, view, and pagination still apply. + example: "@resource_table:aws_ec2_instance" + type: string scope: $ref: "#/components/schemas/RecommendationsFilterRequestScope" sort: @@ -93308,7 +93316,7 @@ components: description: A single sort clause applied to the cost recommendations result set. properties: expression: - description: Field to sort by (for example, `potential_daily_savings.amount`). + description: Field to sort by (for example, `@potential_daily_savings`). type: string order: description: Sort direction, either `ASC` or `DESC`. @@ -148137,7 +148145,7 @@ paths: attributes: scope: ccm sort: - - expression: potential_daily_savings.amount + - expression: "@potential_daily_savings" order: DESC id: "@resource_table:aws_ec2_instance" type: recommendations_filter diff --git a/api/datadogV2/model_recommendations_filter_request_data.go b/api/datadogV2/model_recommendations_filter_request_data.go index 3673302aa8b..a7f5fcbb55a 100644 --- a/api/datadogV2/model_recommendations_filter_request_data.go +++ b/api/datadogV2/model_recommendations_filter_request_data.go @@ -15,8 +15,9 @@ import ( type RecommendationsFilterRequestData struct { // Attributes used to filter and sort cost recommendations. Attributes *RecommendationsFilterRequestDataAttributes `json:"attributes,omitempty"` - // Filter expression applied to the recommendations. The server treats an omitted ID as `*` - // and returns all recommendations. + // Filter expression applied to the recommendations when `attributes.filter` is omitted. + // When supplied, `attributes.filter` overrides this value, including when empty. If the + // resulting filter is empty, it defaults to `*`. Scope, view, and pagination still apply. Id *string `json:"id,omitempty"` // Legacy JSON:API resource type required by the cost recommendations search decoder. Type RecommendationsFilterRequestDataType `json:"type"` diff --git a/api/datadogV2/model_recommendations_filter_request_data_attributes.go b/api/datadogV2/model_recommendations_filter_request_data_attributes.go index 587d3c414a9..09cd1ee7a72 100644 --- a/api/datadogV2/model_recommendations_filter_request_data_attributes.go +++ b/api/datadogV2/model_recommendations_filter_request_data_attributes.go @@ -10,6 +10,10 @@ import ( // RecommendationsFilterRequestDataAttributes Attributes used to filter and sort cost recommendations. type RecommendationsFilterRequestDataAttributes struct { + // Filter expression applied to the recommendations. When supplied, this attribute overrides + // `data.id`, including when empty. When omitted, `data.id` is used. If the resulting filter + // is empty, it defaults to `*`. Scope, view, and pagination still apply. + Filter *string `json:"filter,omitempty"` // Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. Scope *RecommendationsFilterRequestScope `json:"scope,omitempty"` // Ordered list of sort clauses applied to the result set. @@ -38,6 +42,34 @@ func NewRecommendationsFilterRequestDataAttributesWithDefaults() *Recommendation return &this } +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *RecommendationsFilterRequestDataAttributes) GetFilter() string { + if o == nil || o.Filter == nil { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequestDataAttributes) GetFilterOk() (*string, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *RecommendationsFilterRequestDataAttributes) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *RecommendationsFilterRequestDataAttributes) SetFilter(v string) { + o.Filter = &v +} + // GetScope returns the Scope field value if set, zero value otherwise. func (o *RecommendationsFilterRequestDataAttributes) GetScope() RecommendationsFilterRequestScope { if o == nil || o.Scope == nil { @@ -128,6 +160,9 @@ func (o RecommendationsFilterRequestDataAttributes) MarshalJSON() ([]byte, error if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } if o.Scope != nil { toSerialize["scope"] = o.Scope } @@ -147,21 +182,23 @@ func (o RecommendationsFilterRequestDataAttributes) MarshalJSON() ([]byte, error // UnmarshalJSON deserializes the given payload. func (o *RecommendationsFilterRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Scope *RecommendationsFilterRequestScope `json:"scope,omitempty"` - Sort []RecommendationsFilterRequestSortItems `json:"sort,omitempty"` - View *string `json:"view,omitempty"` + Filter *string `json:"filter,omitempty"` + Scope *RecommendationsFilterRequestScope `json:"scope,omitempty"` + Sort []RecommendationsFilterRequestSortItems `json:"sort,omitempty"` + View *string `json:"view,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"scope", "sort", "view"}) + datadog.DeleteKeys(additionalProperties, &[]string{"filter", "scope", "sort", "view"}) } else { return err } hasInvalidField := false + o.Filter = all.Filter if all.Scope != nil && !all.Scope.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_recommendations_filter_request_sort_items.go b/api/datadogV2/model_recommendations_filter_request_sort_items.go index ad1e5b8bc1d..2b218e63f88 100644 --- a/api/datadogV2/model_recommendations_filter_request_sort_items.go +++ b/api/datadogV2/model_recommendations_filter_request_sort_items.go @@ -10,7 +10,7 @@ import ( // RecommendationsFilterRequestSortItems A single sort clause applied to the cost recommendations result set. type RecommendationsFilterRequestSortItems struct { - // Field to sort by (for example, `potential_daily_savings.amount`). + // Field to sort by (for example, `@potential_daily_savings`). Expression *string `json:"expression,omitempty"` // Sort direction, either `ASC` or `DESC`. Order *string `json:"order,omitempty"` diff --git a/examples/v2/cloud-cost-management/SearchCostRecommendations.go b/examples/v2/cloud-cost-management/SearchCostRecommendations.go index 29b2bef1ced..7c58e8cc17d 100644 --- a/examples/v2/cloud-cost-management/SearchCostRecommendations.go +++ b/examples/v2/cloud-cost-management/SearchCostRecommendations.go @@ -19,7 +19,7 @@ func main() { Scope: datadogV2.RECOMMENDATIONSFILTERREQUESTSCOPE_CCM.Ptr(), Sort: []datadogV2.RecommendationsFilterRequestSortItems{ { - Expression: datadog.PtrString("potential_daily_savings.amount"), + Expression: datadog.PtrString("@potential_daily_savings"), Order: datadog.PtrString("DESC"), }, }, diff --git a/tests/scenarios/features/v2/cloud_cost_management.feature b/tests/scenarios/features/v2/cloud_cost_management.feature index f6298e74f22..be04d5c8e00 100644 --- a/tests/scenarios/features/v2/cloud_cost_management.feature +++ b/tests/scenarios/features/v2/cloud_cost_management.feature @@ -974,7 +974,7 @@ Feature: Cloud Cost Management Scenario: Search cost recommendations returns "OK" response Given operation "SearchCostRecommendations" enabled And new "SearchCostRecommendations" request - And body with value {"data": {"attributes": {"scope": "ccm", "sort": [{"expression": "potential_daily_savings.amount", "order": "DESC"}]}, "id": "@resource_table:aws_ec2_instance", "type": "recommendations_filter"}} + And body with value {"data": {"attributes": {"scope": "ccm", "sort": [{"expression": "@potential_daily_savings", "order": "DESC"}]}, "id": "@resource_table:aws_ec2_instance", "type": "recommendations_filter"}} When the request is sent Then the response status is 200 OK