From fe666f153556392c0193f46be500231ca756329f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 29 Oct 2026 14:08:13 +0000 Subject: [PATCH] Regenerate client from commit 0b31819 of spec repo --- .generator/schemas/v2/openapi.yaml | 31 ++++++++++++++----- features/scenarios_model_mapping.rb | 2 +- features/v2/cloud_cost_management.feature | 8 +++++ .../v2/api/cloud_cost_management_api.rb | 8 ++++- ...ndations_filter_request_data_attributes.rb | 6 ++-- .../recommendations_filter_request_scope.rb | 3 +- .../models/recommendations_page_meta_page.rb | 8 ++--- 7 files changed, 50 insertions(+), 16 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9e7ffbe910fd..dafd18dde6cc 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -104026,7 +104026,9 @@ components: $ref: "#/components/schemas/RecommendationsFilterRequestSortItems" type: array view: - description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + description: |- + Status view to return: `all`, `active` (not dismissed), `dismissed`, `open`, `in-progress`, + or `completed`. Defaults to `all`, which returns recommendations in every status. type: string type: object RecommendationsFilterRequestDataType: @@ -104039,7 +104041,9 @@ components: x-enum-varnames: - RECOMMENDATIONS_FILTER RecommendationsFilterRequestScope: - description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + description: |- + Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations + or `*` for both. enum: - ccm - experiment @@ -104075,9 +104079,9 @@ components: description: Opaque token used to fetch the next page; absent on the last page. type: string page_size: - description: Number of items returned in this page (1–10000). + description: Number of items returned in this page (1–5000). format: int32 - maximum: 10000 + maximum: 5000 minimum: 1 type: integer page_token: @@ -161181,11 +161185,15 @@ paths: description: List cost recommendations matching a filter, with pagination and sorting. operationId: SearchCostRecommendations parameters: - - description: Number of results per page (1–10000). + - description: Number of results per page, from 1 to 5000. Defaults to 50. in: query name: page[size] schema: - type: string + default: 50 + format: int32 + maximum: 5000 + minimum: 1 + type: integer - description: Pagination token from a previous response. in: query name: page[token] @@ -161232,11 +161240,16 @@ paths: meta: page: filter: "@resource_table:aws_ec2_instance" - next_page_token: "" page_size: 100 schema: $ref: "#/components/schemas/CostRecommendationArray" description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -161247,6 +161260,10 @@ paths: summary: Search cost recommendations tags: - Cloud Cost Management + x-permission: + operator: OR + permissions: + - cloud_cost_management_read x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 667752b60e29..fee26a377f20 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3070,7 +3070,7 @@ "body" => "GCPUsageCostConfigPatchRequest", }, "v2.SearchCostRecommendations" => { - "page_size" => "String", + "page_size" => "Integer", "page_token" => "String", "body" => "RecommendationsFilterRequest", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 1fe10076a24f..ec0defe48d7b 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -1020,6 +1020,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 Successfully reordered rulesets + @generated @skip @team:ddoghq/ccm-optimize + Scenario: Search cost recommendations returns "Bad Request" response + Given operation "SearchCostRecommendations" enabled + And new "SearchCostRecommendations" request + 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 400 Bad Request + @generated @skip @team:ddoghq/ccm-optimize Scenario: Search cost recommendations returns "OK" response Given operation "SearchCostRecommendations" enabled diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 4006f75b4349..86bc9541ae24 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -4492,7 +4492,7 @@ def search_cost_recommendations(body, opts = {}) # # @param body [RecommendationsFilterRequest] # @param opts [Hash] the optional parameters - # @option opts [String] :page_size Number of results per page (1–10000). + # @option opts [Integer] :page_size Number of results per page, from 1 to 5000. Defaults to 50. # @option opts [String] :page_token Pagination token from a previous response. # @return [Array<(CostRecommendationArray, Integer, Hash)>] CostRecommendationArray data, response status code and response headers def search_cost_recommendations_with_http_info(body, opts = {}) @@ -4506,6 +4506,12 @@ def search_cost_recommendations_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.search_cost_recommendations ...' end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 5000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.search_cost_recommendations, must be smaller than or equal to 5000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.search_cost_recommendations, must be greater than or equal to 1.' + end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.search_cost_recommendations" diff --git a/lib/datadog_api_client/v2/models/recommendations_filter_request_data_attributes.rb b/lib/datadog_api_client/v2/models/recommendations_filter_request_data_attributes.rb index 18e2c8f4938b..1f05545e9805 100644 --- a/lib/datadog_api_client/v2/models/recommendations_filter_request_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/recommendations_filter_request_data_attributes.rb @@ -26,13 +26,15 @@ class RecommendationsFilterRequestDataAttributes # is empty, it defaults to `*`. Scope, view, and pagination still apply. attr_accessor :filter - # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations + # or `*` for both. attr_accessor :scope # Ordered list of sort clauses applied to the result set. attr_accessor :sort - # Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + # Status view to return: `all`, `active` (not dismissed), `dismissed`, `open`, `in-progress`, + # or `completed`. Defaults to `all`, which returns recommendations in every status. attr_accessor :view attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/recommendations_filter_request_scope.rb b/lib/datadog_api_client/v2/models/recommendations_filter_request_scope.rb index cd76e0b05234..c59e860a8bd7 100644 --- a/lib/datadog_api_client/v2/models/recommendations_filter_request_scope.rb +++ b/lib/datadog_api_client/v2/models/recommendations_filter_request_scope.rb @@ -17,7 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations + # or `*` for both. class RecommendationsFilterRequestScope include BaseEnumModel diff --git a/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb b/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb index 9fe6c1405669..984b84d18b93 100644 --- a/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb +++ b/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb @@ -27,7 +27,7 @@ class RecommendationsPageMetaPage # Opaque token used to fetch the next page; absent on the last page. attr_accessor :next_page_token - # Number of items returned in this page (1–10000). + # Number of items returned in this page (1–5000). attr_reader :page_size # Pagination token echoed back from the request. @@ -96,7 +96,7 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if !@page_size.nil? && @page_size > 10000 + return false if !@page_size.nil? && @page_size > 5000 return false if !@page_size.nil? && @page_size < 1 true end @@ -105,8 +105,8 @@ def valid? # @param page_size [Object] Object to be assigned # @!visibility private def page_size=(page_size) - if !page_size.nil? && page_size > 10000 - fail ArgumentError, 'invalid value for "page_size", must be smaller than or equal to 10000.' + if !page_size.nil? && page_size > 5000 + fail ArgumentError, 'invalid value for "page_size", must be smaller than or equal to 5000.' end if !page_size.nil? && page_size < 1 fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 1.'