From 100e1681510b2d08453cd07137b3106c0fee1ff5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 26 May 2026 15:08:48 +0000 Subject: [PATCH] Regenerate client from commit af1c31c of spec repo --- .generator/schemas/v2/openapi.yaml | 332 +++++++ .../DeleteCostTagDescriptionByKey.java | 23 + .../GenerateCostTagDescriptionByKey.java | 26 + .../GetCostTagDescriptionByKey.java | 25 + .../UpsertCostTagDescriptionByKey.java | 38 + .../client/v2/api/CloudCostManagementApi.java | 836 ++++++++++++++++-- .../v2/model/CostTagDescriptionResponse.java | 147 +++ .../CostTagDescriptionUpsertRequest.java | 149 ++++ .../CostTagDescriptionUpsertRequestData.java | 215 +++++ ...escriptionUpsertRequestDataAttributes.java | 178 ++++ .../GenerateCostTagDescriptionResponse.java | 148 ++++ .../v2/model/GeneratedCostTagDescription.java | 215 +++++ ...GeneratedCostTagDescriptionAttributes.java | 145 +++ .../GeneratedCostTagDescriptionType.java | 58 ++ .../v2/api/cloud_cost_management.feature | 65 ++ .../com/datadog/api/client/v2/api/undo.json | 24 + 16 files changed, 2564 insertions(+), 60 deletions(-) create mode 100644 examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 086b5f9ef37..78f0da2fdf7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19537,6 +19537,25 @@ components: - tag_key - updated_at type: object + CostTagDescriptionResponse: + description: Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + example: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescription" + required: + - data + type: object CostTagDescriptionSource: description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. enum: @@ -19558,6 +19577,50 @@ components: type: string x-enum-varnames: - COST_TAG_DESCRIPTION + CostTagDescriptionUpsertRequest: + description: Request body for creating or updating a Cloud Cost Management tag key description. + example: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestData" + required: + - data + type: object + CostTagDescriptionUpsertRequestData: + description: Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestDataAttributes" + id: + description: Identifier of the tag key the description applies to. Matches the `tag_key` path parameter. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - type + type: object + CostTagDescriptionUpsertRequestDataAttributes: + description: Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key. + example: aws + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object CostTagDescriptionsResponse: description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. example: @@ -35540,6 +35603,55 @@ components: required: - type type: object + GenerateCostTagDescriptionResponse: + description: Response wrapping an AI-generated Cloud Cost Management tag key description. + example: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + properties: + data: + $ref: "#/components/schemas/GeneratedCostTagDescription" + required: + - data + type: object + GeneratedCostTagDescription: + description: AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + properties: + attributes: + $ref: "#/components/schemas/GeneratedCostTagDescriptionAttributes" + id: + description: The tag key the AI description was generated for. + example: account_id + type: string + type: + $ref: "#/components/schemas/GeneratedCostTagDescriptionType" + required: + - attributes + - id + - type + type: object + GeneratedCostTagDescriptionAttributes: + description: Attributes of an AI-generated Cloud Cost Management tag key description. + properties: + description: + description: The AI-generated description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object + GeneratedCostTagDescriptionType: + default: cost_generated_tag_description + description: Type of the AI-generated Cloud Cost Management tag description resource. + enum: + - cost_generated_tag_description + example: cost_generated_tag_description + type: string + x-enum-varnames: + - COST_GENERATED_TAG_DESCRIPTION GetActionConnectionResponse: description: The response for found connection properties: @@ -110291,6 +110403,226 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions/{tag_key}: + delete: + description: Delete a Cloud Cost Management tag key description. When `cloud` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When `cloud` is provided, deletes only the description scoped to that cloud provider. + operationId: DeleteCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being deleted. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the deletion to (for example, `aws`). Omit to delete every description for the tag key. + in: query + name: cloud + required: false + schema: + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Delete a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + get: + description: Get the Cloud Cost Management description for a single tag key. Use `filter[cloud]` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default). + operationId: GetCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being fetched. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the lookup to (for example, `aws`). Omit to use the resolved fallback. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + put: + description: Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit `cloud` to set a cross-cloud default for the tag key. + operationId: UpsertCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being upserted. + in: path + name: tag_key + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Upsert a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + /api/v2/cost/tag_descriptions/{tag_key}/generate: + get: + description: Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with `UpsertCostTagDescriptionByKey` to save it. + operationId: GenerateCostTagDescriptionByKey + parameters: + - description: The tag key to generate an AI description for. + in: path + name: tag_key + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + schema: + $ref: "#/components/schemas/GenerateCostTagDescriptionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Generate a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost/tag_keys: get: description: List Cloud Cost Management tag keys. diff --git a/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java new file mode 100644 index 00000000000..3d8b97aa170 --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java @@ -0,0 +1,23 @@ +// Delete a Cloud Cost Management tag description returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + apiInstance.deleteCostTagDescriptionByKey("tag_key"); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#deleteCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java new file mode 100644 index 00000000000..b2968547235 --- /dev/null +++ b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java @@ -0,0 +1,26 @@ +// Generate a Cloud Cost Management tag description returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.GenerateCostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + GenerateCostTagDescriptionResponse result = + apiInstance.generateCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#generateCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java new file mode 100644 index 00000000000..ebeea18f5de --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java @@ -0,0 +1,25 @@ +// Get a Cloud Cost Management tag description returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagDescriptionResponse result = apiInstance.getCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java new file mode 100644 index 00000000000..c2566ee1d00 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java @@ -0,0 +1,38 @@ +// Upsert a Cloud Cost Management tag description returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CostTagDescriptionType; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestData; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + CostTagDescriptionUpsertRequest body = + new CostTagDescriptionUpsertRequest() + .data( + new CostTagDescriptionUpsertRequestData() + .attributes( + new CostTagDescriptionUpsertRequestDataAttributes() + .cloud("aws") + .description("AWS account that owns this cost.")) + .id("account_id") + .type(CostTagDescriptionType.COST_TAG_DESCRIPTION)); + + try { + apiInstance.upsertCostTagDescriptionByKey("tag_key", body); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#upsertCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index 482720c505b..192c788b6b1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java @@ -36,6 +36,8 @@ import com.datadog.api.client.v2.model.CostMetricsResponse; import com.datadog.api.client.v2.model.CostOrchestratorsResponse; import com.datadog.api.client.v2.model.CostRecommendationArray; +import com.datadog.api.client.v2.model.CostTagDescriptionResponse; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; import com.datadog.api.client.v2.model.CostTagKeyMetadataResponse; import com.datadog.api.client.v2.model.CostTagKeyResponse; @@ -53,6 +55,7 @@ import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse; import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse; import com.datadog.api.client.v2.model.GcpUcConfigResponse; +import com.datadog.api.client.v2.model.GenerateCostTagDescriptionResponse; import com.datadog.api.client.v2.model.OCIConfigsResponse; import com.datadog.api.client.v2.model.RecommendationsFilterRequest; import com.datadog.api.client.v2.model.ReorderRuleResourceArray; @@ -1335,6 +1338,209 @@ public CompletableFuture> deleteCostGCPUsageCostConfigWithHttp null); } + /** Manage optional parameters to deleteCostTagDescriptionByKey. */ + public static class DeleteCostTagDescriptionByKeyOptionalParameters { + private String cloud; + + /** + * Set cloud. + * + * @param cloud Cloud provider to scope the deletion to (for example, aws). Omit to + * delete every description for the tag key. (optional) + * @return DeleteCostTagDescriptionByKeyOptionalParameters + */ + public DeleteCostTagDescriptionByKeyOptionalParameters cloud(String cloud) { + this.cloud = cloud; + return this; + } + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey(String tagKey) throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync(String tagKey) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag key description. When cloud is omitted, deletes + * every description for the tag key, falling back to Datadog's global default when available. + * When cloud is provided, deletes only the description scoped to that cloud + * provider. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse deleteCostTagDescriptionByKeyWithHttpInfo( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling deleteCostTagDescriptionByKey"); + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " deleteCostTagDescriptionByKey")); + return result; + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete custom allocation rule. * @@ -1733,6 +1939,150 @@ public CompletableFuture> deleteTagPipelinesRulesetWithHttpInf null); } + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return GenerateCostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public GenerateCostTagDescriptionResponse generateCostTagDescriptionByKey(String tagKey) + throws ApiException { + return generateCostTagDescriptionByKeyWithHttpInfo(tagKey).getData(); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<GenerateCostTagDescriptionResponse> + */ + public CompletableFuture generateCostTagDescriptionByKeyAsync( + String tagKey) { + return generateCostTagDescriptionByKeyWithHttpInfoAsync(tagKey) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The + * generated description is returned in the response and is not persisted by this endpoint; follow + * up with UpsertCostTagDescriptionByKey to save it. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return ApiResponse<GenerateCostTagDescriptionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse + generateCostTagDescriptionByKeyWithHttpInfo(String tagKey) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling generateCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<ApiResponse<GenerateCostTagDescriptionResponse>> + */ + public CompletableFuture> + generateCostTagDescriptionByKeyWithHttpInfoAsync(String tagKey) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " generateCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get budget. * @@ -4878,33 +5228,174 @@ public ApiResponse getCostAzureUCConfigWithHttpInfo(Long cloudAcco localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** + * Get cost Azure UC config. + * + *

See {@link #getCostAzureUCConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<ApiResponse<UCConfigPair>> + */ + public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( + Long cloudAccountId) { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/azure_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostAzureUCConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return GcpUcConfigResponse + * @throws ApiException if fails to make API call + */ + public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { + return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<GcpUcConfigResponse> + */ + public CompletableFuture getCostGCPUsageCostConfigAsync( + Long cloudAccountId) { + return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific Google Cloud Usage Cost config. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return ApiResponse<GcpUcConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get cost Azure UC config. + * Get Google Cloud Usage Cost config. * - *

See {@link #getCostAzureUCConfigWithHttpInfo}. + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. * * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<UCConfigPair>> + * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> */ - public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( - Long cloudAccountId) { + public CompletableFuture> + getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { Object localVarPostBody = null; // verify the required parameter 'cloudAccountId' is set if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + "Missing the required parameter 'cloudAccountId' when calling" + + " getCostGCPUsageCostConfig")); return result; } // create path and map variables String localVarPath = - "/api/v2/cost/azure_uc_config/{cloud_account_id}" + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" .replaceAll( "\\{" + "cloud_account_id" + "\\}", apiClient.escapeString(cloudAccountId.toString())); @@ -4915,7 +5406,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostAzureUCConfig", + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4923,7 +5414,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4935,33 +5426,53 @@ public CompletableFuture> getCostAzureUCConfigWithHttp localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getCostTagDescriptionByKey. */ + public static class GetCostTagDescriptionByKeyOptionalParameters { + private String filterCloud; + + /** + * Set filterCloud. + * + * @param filterCloud Cloud provider to scope the lookup to (for example, aws). + * Omit to use the resolved fallback. (optional) + * @return GetCostTagDescriptionByKeyOptionalParameters + */ + public GetCostTagDescriptionByKeyOptionalParameters filterCloud(String filterCloud) { + this.filterCloud = filterCloud; + return this; + } } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return GcpUcConfigResponse + * @param tagKey The tag key whose description is being fetched. (required) + * @return CostTagDescriptionResponse * @throws ApiException if fails to make API call */ - public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { - return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + public CostTagDescriptionResponse getCostTagDescriptionByKey(String tagKey) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) + .getData(); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<GcpUcConfigResponse> + * @param tagKey The tag key whose description is being fetched. (required) + * @return CompletableFuture<CostTagDescriptionResponse> */ - public CompletableFuture getCostGCPUsageCostConfigAsync( - Long cloudAccountId) { - return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey) { + return getCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4969,43 +5480,84 @@ public CompletableFuture getCostGCPUsageCostConfigAsync( } /** - * Get a specific Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return ApiResponse<GcpUcConfigResponse> + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public CostTagDescriptionResponse getCostTagDescriptionByKey( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters).getData(); + } + + /** + * Get a Cloud Cost Management tag description. + * + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagDescriptionResponse> + */ + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { + return getCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the Cloud Cost Management description for a single tag key. Use filter[cloud] + * to scope the lookup to a specific cloud provider; when omitted, the response resolves the + * description in fallback order (cloud-specific organization override, then cloudless + * organization default, then Datadog's global default). + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagDescriptionResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) - throws ApiException { + public ApiResponse getCostTagDescriptionByKeyWithHttpInfo( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { + // verify the required parameter 'tagKey' is set + if (tagKey == null) { throw new ApiException( - 400, - "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + 400, "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey"); } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -5018,53 +5570,56 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagDescriptionResponse>> */ - public CompletableFuture> - getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { + public CompletableFuture> + getCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling" - + " getCostGCPUsageCostConfig")); + "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey")); return result; } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5076,7 +5631,7 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to getCostTagKey. */ @@ -10674,6 +11229,167 @@ public CompletableFuture> upsertBudgetWithHttpInf new GenericType() {}); } + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void upsertCostTagDescriptionByKey(String tagKey, CostTagDescriptionUpsertRequest body) + throws ApiException { + upsertCostTagDescriptionByKeyWithHttpInfo(tagKey, body); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture upsertCostTagDescriptionByKeyAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + return upsertCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update a Cloud Cost Management tag key description. The new description and optional + * cloud scoping are supplied in the request body. Omit cloud to set a cross-cloud + * default for the tag key. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse upsertCostTagDescriptionByKeyWithHttpInfo( + String tagKey, CostTagDescriptionUpsertRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling upsertCostTagDescriptionByKey"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> upsertCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " upsertCostTagDescriptionByKey")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling upsertCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Validate budget. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java new file mode 100644 index 00000000000..6f78139a21f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java @@ -0,0 +1,147 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Single Cloud Cost Management tag key description returned by the get-by-key endpoint. */ +@JsonPropertyOrder({CostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescription data; + + public CostTagDescriptionResponse() {} + + @JsonCreator + public CostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionResponse data(CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud + * provider. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescription getData() { + return data; + } + + public void setData(CostTagDescription data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionResponse + */ + @JsonAnySetter + public CostTagDescriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionResponse costTagDescriptionResponse = (CostTagDescriptionResponse) o; + return Objects.equals(this.data, costTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java new file mode 100644 index 00000000000..a2df7f8bf0d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java @@ -0,0 +1,149 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({CostTagDescriptionUpsertRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescriptionUpsertRequestData data; + + public CostTagDescriptionUpsertRequest() {} + + @JsonCreator + public CostTagDescriptionUpsertRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionUpsertRequest data(CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestData getData() { + return data; + } + + public void setData(CostTagDescriptionUpsertRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequest + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequest costTagDescriptionUpsertRequest = + (CostTagDescriptionUpsertRequest) o; + return Objects.equals(this.data, costTagDescriptionUpsertRequest.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java new file mode 100644 index 00000000000..81458337f8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java @@ -0,0 +1,215 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ATTRIBUTES, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ID, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagDescriptionUpsertRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostTagDescriptionType type = CostTagDescriptionType.COST_TAG_DESCRIPTION; + + public CostTagDescriptionUpsertRequestData() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagDescriptionUpsertRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagDescriptionUpsertRequestData attributes( + CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CostTagDescriptionUpsertRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the tag key the description applies to. Matches the tag_key path + * parameter. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CostTagDescriptionUpsertRequestData type(CostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionType getType() { + return type; + } + + public void setType(CostTagDescriptionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequestData + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestData costTagDescriptionUpsertRequestData = + (CostTagDescriptionUpsertRequestData) o; + return Objects.equals(this.attributes, costTagDescriptionUpsertRequestData.attributes) + && Objects.equals(this.id, costTagDescriptionUpsertRequestData.id) + && Objects.equals(this.type, costTagDescriptionUpsertRequestData.type) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java new file mode 100644 index 00000000000..1756adbf6aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Mutable attributes set when creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_CLOUD, + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD = "cloud"; + private String cloud; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public CostTagDescriptionUpsertRequestDataAttributes() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public CostTagDescriptionUpsertRequestDataAttributes cloud(String cloud) { + this.cloud = cloud; + return this; + } + + /** + * Cloud provider this description applies to (for example, aws). Omit to set the + * cross-cloud default for the tag key. + * + * @return cloud + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOUD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCloud() { + return cloud; + } + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + public CostTagDescriptionUpsertRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The human-readable description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequestDataAttributes + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestDataAttributes costTagDescriptionUpsertRequestDataAttributes = + (CostTagDescriptionUpsertRequestDataAttributes) o; + return Objects.equals(this.cloud, costTagDescriptionUpsertRequestDataAttributes.cloud) + && Objects.equals( + this.description, costTagDescriptionUpsertRequestDataAttributes.description) + && Objects.equals( + this.additionalProperties, + costTagDescriptionUpsertRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cloud, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestDataAttributes {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java new file mode 100644 index 00000000000..078e5630f36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java @@ -0,0 +1,148 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response wrapping an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GenerateCostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GeneratedCostTagDescription data; + + public GenerateCostTagDescriptionResponse() {} + + @JsonCreator + public GenerateCostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GenerateCostTagDescriptionResponse data(GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescription getData() { + return data; + } + + public void setData(GeneratedCostTagDescription data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCostTagDescriptionResponse + */ + @JsonAnySetter + public GenerateCostTagDescriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCostTagDescriptionResponse generateCostTagDescriptionResponse = + (GenerateCostTagDescriptionResponse) o; + return Objects.equals(this.data, generateCostTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, generateCostTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCostTagDescriptionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java new file mode 100644 index 00000000000..9080784cee9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java @@ -0,0 +1,215 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + */ +@JsonPropertyOrder({ + GeneratedCostTagDescription.JSON_PROPERTY_ATTRIBUTES, + GeneratedCostTagDescription.JSON_PROPERTY_ID, + GeneratedCostTagDescription.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescription { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GeneratedCostTagDescriptionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GeneratedCostTagDescriptionType type = + GeneratedCostTagDescriptionType.COST_GENERATED_TAG_DESCRIPTION; + + public GeneratedCostTagDescription() {} + + @JsonCreator + public GeneratedCostTagDescription( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GeneratedCostTagDescriptionAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GeneratedCostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GeneratedCostTagDescription attributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an AI-generated Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + } + + public GeneratedCostTagDescription id(String id) { + this.id = id; + return this; + } + + /** + * The tag key the AI description was generated for. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GeneratedCostTagDescription type(GeneratedCostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the AI-generated Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionType getType() { + return type; + } + + public void setType(GeneratedCostTagDescriptionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GeneratedCostTagDescription + */ + @JsonAnySetter + public GeneratedCostTagDescription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GeneratedCostTagDescription object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescription generatedCostTagDescription = (GeneratedCostTagDescription) o; + return Objects.equals(this.attributes, generatedCostTagDescription.attributes) + && Objects.equals(this.id, generatedCostTagDescription.id) + && Objects.equals(this.type, generatedCostTagDescription.type) + && Objects.equals( + this.additionalProperties, generatedCostTagDescription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescription {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java new file mode 100644 index 00000000000..d52bc622c86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GeneratedCostTagDescriptionAttributes.JSON_PROPERTY_DESCRIPTION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescriptionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public GeneratedCostTagDescriptionAttributes() {} + + @JsonCreator + public GeneratedCostTagDescriptionAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public GeneratedCostTagDescriptionAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The AI-generated description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GeneratedCostTagDescriptionAttributes + */ + @JsonAnySetter + public GeneratedCostTagDescriptionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GeneratedCostTagDescriptionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescriptionAttributes generatedCostTagDescriptionAttributes = + (GeneratedCostTagDescriptionAttributes) o; + return Objects.equals(this.description, generatedCostTagDescriptionAttributes.description) + && Objects.equals( + this.additionalProperties, generatedCostTagDescriptionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescriptionAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java new file mode 100644 index 00000000000..6af35f8a7a7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java @@ -0,0 +1,58 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the AI-generated Cloud Cost Management tag description resource. */ +@JsonSerialize( + using = GeneratedCostTagDescriptionType.GeneratedCostTagDescriptionTypeSerializer.class) +public class GeneratedCostTagDescriptionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_generated_tag_description")); + + public static final GeneratedCostTagDescriptionType COST_GENERATED_TAG_DESCRIPTION = + new GeneratedCostTagDescriptionType("cost_generated_tag_description"); + + GeneratedCostTagDescriptionType(String value) { + super(value, allowedValues); + } + + public static class GeneratedCostTagDescriptionTypeSerializer + extends StdSerializer { + public GeneratedCostTagDescriptionTypeSerializer(Class t) { + super(t); + } + + public GeneratedCostTagDescriptionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GeneratedCostTagDescriptionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GeneratedCostTagDescriptionType fromValue(String value) { + return new GeneratedCostTagDescriptionType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 17779e4599e..8a8beef7ce3 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature @@ -190,6 +190,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "Bad Request" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "No Content" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response Given new "DeleteBudget" request @@ -218,6 +232,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "Bad Request" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "OK" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Custom Costs File returns "OK" response Given new "GetCustomCostsFile" request @@ -250,6 +278,27 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "Bad Request" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "Not Found" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "OK" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response Given new "GetCostTagKey" request @@ -857,6 +906,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "Bad Request" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "No Content" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management Scenario: Validate CSV budget returns "OK" response Given new "ValidateCsvBudget" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a359fccfe1e..308a27f2719 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1868,6 +1868,30 @@ "type": "safe" } }, + "DeleteCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GetCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "UpsertCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GenerateCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagKeys": { "tag": "Cloud Cost Management", "undo": {