From d6866c3745eea6678b5f5d194253510faaa91b22 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 20 Nov 2026 18:14:53 +0000 Subject: [PATCH] Regenerate client from commit a135a12 of spec repo --- .generator/schemas/v1/openapi.yaml | 21 ------- .generator/schemas/v2/openapi.yaml | 61 ++++++++++++------- .../SearchCostRecommendations.py | 3 + .../cost_recommendation_data_attributes.py | 10 +++ .../model/cost_recommendation_extra_field.py | 55 +++++++++++++++++ ...ndations_filter_request_data_attributes.py | 17 ++++++ src/datadog_api_client/v2/models/__init__.py | 2 + .../v2/features/cloud_cost_management.feature | 4 +- 8 files changed, 129 insertions(+), 44 deletions(-) create mode 100644 src/datadog_api_client/v2/model/cost_recommendation_extra_field.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 547714cd1e..5157c5c491 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -33,27 +33,6 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Too many requests - headers: - X-RateLimit-Limit: - description: Number of requests allowed in the rate-limit period. - schema: - format: int64 - type: integer - X-RateLimit-Period: - description: Length of the rate-limit period in seconds. - schema: - format: int64 - type: integer - X-RateLimit-Remaining: - description: Number of requests remaining in the current rate-limit period. - schema: - format: int64 - type: integer - X-RateLimit-Reset: - description: Number of seconds until the current rate-limit period resets. - schema: - format: int64 - type: integer schemas: APIErrorResponse: description: Error response object. diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 326413b32e..683c9def9a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3142,27 +3142,6 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Too many requests - headers: - X-RateLimit-Limit: - description: Number of requests allowed in the rate-limit period. - schema: - format: int64 - type: integer - X-RateLimit-Period: - description: Length of the rate-limit period in seconds. - schema: - format: int64 - type: integer - X-RateLimit-Remaining: - description: Number of requests remaining in the current rate-limit period. - schema: - format: int64 - type: integer - X-RateLimit-Reset: - description: Number of seconds until the current rate-limit period resets. - schema: - format: int64 - type: integer UnauthorizedResponse: content: application/json: @@ -31732,6 +31711,11 @@ components: dd_resource_key: description: Datadog resource key identifying the recommended resource. type: string + extra_fields: + description: Selected recommendation fields. Omitted when no requested fields match. + items: + $ref: "#/components/schemas/CostRecommendationExtraField" + type: array potential_daily_savings: $ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings" recommendation_type: @@ -31775,6 +31759,20 @@ components: type: string x-enum-varnames: - RECOMMENDATION + CostRecommendationExtraField: + description: A recommendation field selected by the request's `extra_fields` patterns. + properties: + path: + description: Dotted path of the matched field in the recommendation event's custom attributes. + example: tags.env + type: string + value: + description: Matched JSON value. Paths through arrays return the matched values as an array. + example: prod + required: + - path + - value + type: object CostTag: description: A Cloud Cost Management tag. properties: @@ -118145,6 +118143,8 @@ components: example: data: attributes: + extra_fields: + - tags.env scope: ccm sort: - expression: "@potential_daily_savings" @@ -118179,6 +118179,20 @@ components: RecommendationsFilterRequestDataAttributes: description: Attributes used to filter and sort cost recommendations. properties: + extra_fields: + description: |- + Additional fields to return from the recommendation event's custom attributes, selected + by dotted paths such as `tags.env` or wildcard patterns such as `*target*`. + Arrays are traversed without indexes. Matched objects and arrays are returned whole. + A maximum of 256 selectors can be requested. Selectors that match nothing return no field. + example: + - tags.env + - "*target*" + items: + description: A dotted field path or wildcard pattern. + type: string + maxItems: 256 + type: array filter: description: |- Filter expression applied to the recommendations. When supplied, this attribute overrides @@ -179232,6 +179246,8 @@ paths: value: data: attributes: + extra_fields: + - tags.env scope: ccm sort: - expression: "@potential_daily_savings" @@ -179251,6 +179267,9 @@ paths: data: - attributes: dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0" + extra_fields: + - path: tags.env + value: prod potential_daily_savings: amount: 1.23 currency: USD diff --git a/examples/v2/cloud-cost-management/SearchCostRecommendations.py b/examples/v2/cloud-cost-management/SearchCostRecommendations.py index f3860955b5..493cdf59bf 100644 --- a/examples/v2/cloud-cost-management/SearchCostRecommendations.py +++ b/examples/v2/cloud-cost-management/SearchCostRecommendations.py @@ -17,6 +17,9 @@ body = RecommendationsFilterRequest( data=RecommendationsFilterRequestData( attributes=RecommendationsFilterRequestDataAttributes( + extra_fields=[ + "tags.env", + ], scope=RecommendationsFilterRequestScope.CCM, sort=[ RecommendationsFilterRequestSortItems( diff --git a/src/datadog_api_client/v2/model/cost_recommendation_data_attributes.py b/src/datadog_api_client/v2/model/cost_recommendation_data_attributes.py index 7dae08001c..41f97d7f13 100644 --- a/src/datadog_api_client/v2/model/cost_recommendation_data_attributes.py +++ b/src/datadog_api_client/v2/model/cost_recommendation_data_attributes.py @@ -14,6 +14,7 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.cost_recommendation_extra_field import CostRecommendationExtraField from datadog_api_client.v2.model.cost_recommendation_data_attributes_potential_daily_savings import ( CostRecommendationDataAttributesPotentialDailySavings, ) @@ -22,12 +23,14 @@ class CostRecommendationDataAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.cost_recommendation_extra_field import CostRecommendationExtraField from datadog_api_client.v2.model.cost_recommendation_data_attributes_potential_daily_savings import ( CostRecommendationDataAttributesPotentialDailySavings, ) return { "dd_resource_key": (str,), + "extra_fields": ([CostRecommendationExtraField],), "potential_daily_savings": (CostRecommendationDataAttributesPotentialDailySavings,), "recommendation_type": (str,), "recommender_id": (str,), @@ -38,6 +41,7 @@ def openapi_types(_): attribute_map = { "dd_resource_key": "dd_resource_key", + "extra_fields": "extra_fields", "potential_daily_savings": "potential_daily_savings", "recommendation_type": "recommendation_type", "recommender_id": "recommender_id", @@ -49,6 +53,7 @@ def openapi_types(_): def __init__( self_, dd_resource_key: Union[str, UnsetType] = unset, + extra_fields: Union[List[CostRecommendationExtraField], UnsetType] = unset, potential_daily_savings: Union[CostRecommendationDataAttributesPotentialDailySavings, UnsetType] = unset, recommendation_type: Union[str, UnsetType] = unset, recommender_id: Union[str, UnsetType] = unset, @@ -63,6 +68,9 @@ def __init__( :param dd_resource_key: Datadog resource key identifying the recommended resource. :type dd_resource_key: str, optional + :param extra_fields: Selected recommendation fields. Omitted when no requested fields match. + :type extra_fields: [CostRecommendationExtraField], optional + :param potential_daily_savings: Estimated daily savings if the recommendation is applied. :type potential_daily_savings: CostRecommendationDataAttributesPotentialDailySavings, optional @@ -84,6 +92,8 @@ def __init__( """ if dd_resource_key is not unset: kwargs["dd_resource_key"] = dd_resource_key + if extra_fields is not unset: + kwargs["extra_fields"] = extra_fields if potential_daily_savings is not unset: kwargs["potential_daily_savings"] = potential_daily_savings if recommendation_type is not unset: diff --git a/src/datadog_api_client/v2/model/cost_recommendation_extra_field.py b/src/datadog_api_client/v2/model/cost_recommendation_extra_field.py new file mode 100644 index 0000000000..8fdcd96d4d --- /dev/null +++ b/src/datadog_api_client/v2/model/cost_recommendation_extra_field.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class CostRecommendationExtraField(ModelNormal): + @cached_property + def openapi_types(_): + return { + "path": (str,), + "value": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + } + + attribute_map = { + "path": "path", + "value": "value", + } + + def __init__(self_, path: str, value: Any, **kwargs): + """ + A recommendation field selected by the request's ``extra_fields`` patterns. + + :param path: Dotted path of the matched field in the recommendation event's custom attributes. + :type path: str + + :param value: Matched JSON value. Paths through arrays return the matched values as an array. + :type value: bool, date, datetime, dict, float, int, list, str, UUID, none_type + """ + super().__init__(kwargs) + + self_.path = path + self_.value = value diff --git a/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py b/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py index ea68080f41..3e6785c94b 100644 --- a/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py @@ -21,6 +21,12 @@ class RecommendationsFilterRequestDataAttributes(ModelNormal): + validations = { + "extra_fields": { + "max_items": 256, + }, + } + @cached_property def openapi_types(_): from datadog_api_client.v2.model.recommendations_filter_request_scope import RecommendationsFilterRequestScope @@ -29,6 +35,7 @@ def openapi_types(_): ) return { + "extra_fields": ([str],), "filter": (str,), "scope": (RecommendationsFilterRequestScope,), "sort": ([RecommendationsFilterRequestSortItems],), @@ -36,6 +43,7 @@ def openapi_types(_): } attribute_map = { + "extra_fields": "extra_fields", "filter": "filter", "scope": "scope", "sort": "sort", @@ -44,6 +52,7 @@ def openapi_types(_): def __init__( self_, + extra_fields: Union[List[str], UnsetType] = unset, filter: Union[str, UnsetType] = unset, scope: Union[RecommendationsFilterRequestScope, UnsetType] = unset, sort: Union[List[RecommendationsFilterRequestSortItems], UnsetType] = unset, @@ -53,6 +62,12 @@ def __init__( """ Attributes used to filter and sort cost recommendations. + :param extra_fields: Additional fields to return from the recommendation event's custom attributes, selected + by dotted paths such as ``tags.env`` or wildcard patterns such as ``*target*``. + Arrays are traversed without indexes. Matched objects and arrays are returned whole. + A maximum of 256 selectors can be requested. Selectors that match nothing return no field. + :type extra_fields: [str], optional + :param filter: 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. @@ -69,6 +84,8 @@ def __init__( or ``completed``. Defaults to ``all`` , which returns recommendations in every status. :type view: str, optional """ + if extra_fields is not unset: + kwargs["extra_fields"] = extra_fields if filter is not unset: kwargs["filter"] = filter if scope is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0f56249348..cae7c020c6 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2310,6 +2310,7 @@ CostRecommendationDataAttributesPotentialDailySavings, ) from datadog_api_client.v2.model.cost_recommendation_data_type import CostRecommendationDataType +from datadog_api_client.v2.model.cost_recommendation_extra_field import CostRecommendationExtraField from datadog_api_client.v2.model.cost_tag import CostTag from datadog_api_client.v2.model.cost_tag_attributes import CostTagAttributes from datadog_api_client.v2.model.cost_tag_description import CostTagDescription @@ -16294,6 +16295,7 @@ "CostRecommendationDataAttributes", "CostRecommendationDataAttributesPotentialDailySavings", "CostRecommendationDataType", + "CostRecommendationExtraField", "CostTag", "CostTagAttributes", "CostTagDescription", diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index 5f4cbc46c0..3a7d590ffa 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -1028,7 +1028,7 @@ Feature: Cloud Cost Management 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"}} + And body with value {"data": {"attributes": {"extra_fields": ["tags.env"], "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 @@ -1036,7 +1036,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", "order": "DESC"}]}, "id": "@resource_table:aws_ec2_instance", "type": "recommendations_filter"}} + And body with value {"data": {"attributes": {"extra_fields": ["tags.env"], "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