From a48ce3b2dfed137e76ca8727ada82cf17b42e102 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 12 May 2026 16:11:02 +0000 Subject: [PATCH] Regenerate client from commit b142429 of spec repo --- .generator/schemas/v2/openapi.yaml | 143 +++++++++ .../ListCostTagDescriptions.java | 24 ++ .../client/v2/api/CloudCostManagementApi.java | 175 ++++++++++ .../client/v2/model/CostTagDescription.java | 215 +++++++++++++ .../model/CostTagDescriptionAttributes.java | 298 ++++++++++++++++++ .../v2/model/CostTagDescriptionSource.java | 63 ++++ .../v2/model/CostTagDescriptionType.java | 57 ++++ .../v2/model/CostTagDescriptionsResponse.java | 158 ++++++++++ .../v2/api/cloud_cost_management.feature | 6 + .../com/datadog/api/client/v2/api/undo.json | 6 + 10 files changed, 1145 insertions(+) create mode 100644 examples/v2/cloud-cost-management/ListCostTagDescriptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescription.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionSource.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionsResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a04387a6880..07a00c9a7f3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15600,6 +15600,98 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostTagDescription: + description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionAttributes" + id: + description: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - id + - type + type: object + CostTagDescriptionAttributes: + description: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key. + example: aws + type: string + created_at: + description: Timestamp when the description was created, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + source: + $ref: "#/components/schemas/CostTagDescriptionSource" + tag_key: + description: The tag key this description applies to. + example: account_id + type: string + updated_at: + description: Timestamp when the description was last updated, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + required: + - cloud + - created_at + - description + - source + - tag_key + - updated_at + 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: + - human + - ai_generated + - datadog + example: human + type: string + x-enum-varnames: + - HUMAN + - AI_GENERATED + - DATADOG + CostTagDescriptionType: + default: cost_tag_description + description: Type of the Cloud Cost Management tag description resource. + enum: + - cost_tag_description + example: cost_tag_description + type: string + x-enum-varnames: + - COST_TAG_DESCRIPTION + CostTagDescriptionsResponse: + description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. + 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: + description: List of tag key descriptions. + items: + $ref: "#/components/schemas/CostTagDescription" + type: array + required: + - data + type: object CoverageSummaryAttributes: description: Attributes object for code coverage summary response. properties: @@ -96749,6 +96841,57 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions: + get: + description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + operationId: ListCostTagDescriptions + parameters: + - description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + 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/CostTagDescriptionsResponse" + description: OK + "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: List Cloud Cost Management tag descriptions + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost_by_tag/active_billing_dimensions: get: description: |- diff --git a/examples/v2/cloud-cost-management/ListCostTagDescriptions.java b/examples/v2/cloud-cost-management/ListCostTagDescriptions.java new file mode 100644 index 00000000000..3fa8910f4ec --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagDescriptions.java @@ -0,0 +1,24 @@ +// List Cloud Cost Management tag descriptions 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.CostTagDescriptionsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagDescriptionsResponse result = apiInstance.listCostTagDescriptions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#listCostTagDescriptions"); + 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 38d25db131e..7634320e2fe 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 @@ -20,6 +20,7 @@ import com.datadog.api.client.v2.model.BudgetValidationRequest; import com.datadog.api.client.v2.model.BudgetValidationResponse; import com.datadog.api.client.v2.model.BudgetWithEntries; +import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; import com.datadog.api.client.v2.model.CreateRulesetRequest; import com.datadog.api.client.v2.model.CustomCostsFileGetResponse; import com.datadog.api.client.v2.model.CustomCostsFileLineItem; @@ -3211,6 +3212,180 @@ public CompletableFuture> listCostOCIConfigsWith new GenericType() {}); } + /** Manage optional parameters to listCostTagDescriptions. */ + public static class ListCostTagDescriptionsOptionalParameters { + private String filterCloud; + + /** + * Set filterCloud. + * + * @param filterCloud Filter descriptions to a specific cloud provider (for example, aws + * ). Omit to return descriptions across all clouds. (optional) + * @return ListCostTagDescriptionsOptionalParameters + */ + public ListCostTagDescriptionsOptionalParameters filterCloud(String filterCloud) { + this.filterCloud = filterCloud; + return this; + } + } + + /** + * List Cloud Cost Management tag descriptions. + * + *

See {@link #listCostTagDescriptionsWithHttpInfo}. + * + * @return CostTagDescriptionsResponse + * @throws ApiException if fails to make API call + */ + public CostTagDescriptionsResponse listCostTagDescriptions() throws ApiException { + return listCostTagDescriptionsWithHttpInfo(new ListCostTagDescriptionsOptionalParameters()) + .getData(); + } + + /** + * List Cloud Cost Management tag descriptions. + * + *

See {@link #listCostTagDescriptionsWithHttpInfoAsync}. + * + * @return CompletableFuture<CostTagDescriptionsResponse> + */ + public CompletableFuture listCostTagDescriptionsAsync() { + return listCostTagDescriptionsWithHttpInfoAsync(new ListCostTagDescriptionsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag descriptions. + * + *

See {@link #listCostTagDescriptionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CostTagDescriptionsResponse + * @throws ApiException if fails to make API call + */ + public CostTagDescriptionsResponse listCostTagDescriptions( + ListCostTagDescriptionsOptionalParameters parameters) throws ApiException { + return listCostTagDescriptionsWithHttpInfo(parameters).getData(); + } + + /** + * List Cloud Cost Management tag descriptions. + * + *

See {@link #listCostTagDescriptionsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagDescriptionsResponse> + */ + public CompletableFuture listCostTagDescriptionsAsync( + ListCostTagDescriptionsOptionalParameters parameters) { + return listCostTagDescriptionsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag key descriptions for the organization. Use filter[cloud] + * to scope the result to a single cloud provider; when omitted, both cross-cloud defaults + * and cloud-specific descriptions are returned. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagDescriptionsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listCostTagDescriptionsWithHttpInfo( + ListCostTagDescriptionsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String filterCloud = parameters.filterCloud; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_descriptions"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagDescriptions", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * List Cloud Cost Management tag descriptions. + * + *

See {@link #listCostTagDescriptionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagDescriptionsResponse>> + */ + public CompletableFuture> + listCostTagDescriptionsWithHttpInfoAsync( + ListCostTagDescriptionsOptionalParameters parameters) { + Object localVarPostBody = null; + String filterCloud = parameters.filterCloud; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_descriptions"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagDescriptions", + localVarPath, + localVarQueryParams, + 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() {}); + } + /** * List custom allocation rules. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescription.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescription.java new file mode 100644 index 00000000000..29bd6592141 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescription.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; + +/** + * A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud + * provider. + */ +@JsonPropertyOrder({ + CostTagDescription.JSON_PROPERTY_ATTRIBUTES, + CostTagDescription.JSON_PROPERTY_ID, + CostTagDescription.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescription { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagDescriptionAttributes 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 CostTagDescription() {} + + @JsonCreator + public CostTagDescription( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagDescriptionAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagDescription attributes(CostTagDescriptionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally + * scoped to a single cloud provider. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagDescriptionAttributes attributes) { + this.attributes = attributes; + } + + public CostTagDescription id(String id) { + this.id = id; + return this; + } + + /** + * Stable identifier of the tag description. Equals the tag key when the description is the + * cross-cloud default; encodes both the cloud and the tag key when the description is + * cloud-specific. + * + * @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 CostTagDescription 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 CostTagDescription + */ + @JsonAnySetter + public CostTagDescription 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 CostTagDescription object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescription costTagDescription = (CostTagDescription) o; + return Objects.equals(this.attributes, costTagDescription.attributes) + && Objects.equals(this.id, costTagDescription.id) + && Objects.equals(this.type, costTagDescription.type) + && Objects.equals(this.additionalProperties, costTagDescription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescription {\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/CostTagDescriptionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionAttributes.java new file mode 100644 index 00000000000..f567d8b099d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionAttributes.java @@ -0,0 +1,298 @@ +/* + * 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; + +/** + * Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally + * scoped to a single cloud provider. + */ +@JsonPropertyOrder({ + CostTagDescriptionAttributes.JSON_PROPERTY_CLOUD, + CostTagDescriptionAttributes.JSON_PROPERTY_CREATED_AT, + CostTagDescriptionAttributes.JSON_PROPERTY_DESCRIPTION, + CostTagDescriptionAttributes.JSON_PROPERTY_SOURCE, + CostTagDescriptionAttributes.JSON_PROPERTY_TAG_KEY, + CostTagDescriptionAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD = "cloud"; + private String cloud; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private String createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private CostTagDescriptionSource source; + + public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; + private String tagKey; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private String updatedAt; + + public CostTagDescriptionAttributes() {} + + @JsonCreator + public CostTagDescriptionAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CLOUD) String cloud, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) String createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) CostTagDescriptionSource source, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_KEY) String tagKey, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) String updatedAt) { + this.cloud = cloud; + this.createdAt = createdAt; + this.description = description; + this.source = source; + this.unparsed |= !source.isValid(); + this.tagKey = tagKey; + this.updatedAt = updatedAt; + } + + public CostTagDescriptionAttributes cloud(String cloud) { + this.cloud = cloud; + return this; + } + + /** + * Cloud provider this description applies to (for example, aws). Empty when the + * description is the cross-cloud default for the tag key. + * + * @return cloud + */ + @JsonProperty(JSON_PROPERTY_CLOUD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCloud() { + return cloud; + } + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + public CostTagDescriptionAttributes createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the description was created, in RFC 3339 format. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public CostTagDescriptionAttributes 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; + } + + public CostTagDescriptionAttributes source(CostTagDescriptionSource source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * 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. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionSource getSource() { + return source; + } + + public void setSource(CostTagDescriptionSource source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public CostTagDescriptionAttributes tagKey(String tagKey) { + this.tagKey = tagKey; + return this; + } + + /** + * The tag key this description applies to. + * + * @return tagKey + */ + @JsonProperty(JSON_PROPERTY_TAG_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTagKey() { + return tagKey; + } + + public void setTagKey(String tagKey) { + this.tagKey = tagKey; + } + + public CostTagDescriptionAttributes updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Timestamp when the description was last updated, in RFC 3339 format. + * + * @return updatedAt + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 CostTagDescriptionAttributes + */ + @JsonAnySetter + public CostTagDescriptionAttributes 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 CostTagDescriptionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionAttributes costTagDescriptionAttributes = (CostTagDescriptionAttributes) o; + return Objects.equals(this.cloud, costTagDescriptionAttributes.cloud) + && Objects.equals(this.createdAt, costTagDescriptionAttributes.createdAt) + && Objects.equals(this.description, costTagDescriptionAttributes.description) + && Objects.equals(this.source, costTagDescriptionAttributes.source) + && Objects.equals(this.tagKey, costTagDescriptionAttributes.tagKey) + && Objects.equals(this.updatedAt, costTagDescriptionAttributes.updatedAt) + && Objects.equals( + this.additionalProperties, costTagDescriptionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cloud, createdAt, description, source, tagKey, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionAttributes {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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/CostTagDescriptionSource.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionSource.java new file mode 100644 index 00000000000..66873ac7772 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionSource.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** + * 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. + */ +@JsonSerialize(using = CostTagDescriptionSource.CostTagDescriptionSourceSerializer.class) +public class CostTagDescriptionSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("human", "ai_generated", "datadog")); + + public static final CostTagDescriptionSource HUMAN = new CostTagDescriptionSource("human"); + public static final CostTagDescriptionSource AI_GENERATED = + new CostTagDescriptionSource("ai_generated"); + public static final CostTagDescriptionSource DATADOG = new CostTagDescriptionSource("datadog"); + + CostTagDescriptionSource(String value) { + super(value, allowedValues); + } + + public static class CostTagDescriptionSourceSerializer + extends StdSerializer { + public CostTagDescriptionSourceSerializer(Class t) { + super(t); + } + + public CostTagDescriptionSourceSerializer() { + this(null); + } + + @Override + public void serialize( + CostTagDescriptionSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostTagDescriptionSource fromValue(String value) { + return new CostTagDescriptionSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionType.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionType.java new file mode 100644 index 00000000000..4a677a90aec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionType.java @@ -0,0 +1,57 @@ +/* + * 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 Cloud Cost Management tag description resource. */ +@JsonSerialize(using = CostTagDescriptionType.CostTagDescriptionTypeSerializer.class) +public class CostTagDescriptionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_tag_description")); + + public static final CostTagDescriptionType COST_TAG_DESCRIPTION = + new CostTagDescriptionType("cost_tag_description"); + + CostTagDescriptionType(String value) { + super(value, allowedValues); + } + + public static class CostTagDescriptionTypeSerializer + extends StdSerializer { + public CostTagDescriptionTypeSerializer(Class t) { + super(t); + } + + public CostTagDescriptionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CostTagDescriptionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostTagDescriptionType fromValue(String value) { + return new CostTagDescriptionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionsResponse.java new file mode 100644 index 00000000000..74ba24ef753 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionsResponse.java @@ -0,0 +1,158 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a + * single cloud provider. + */ +@JsonPropertyOrder({CostTagDescriptionsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostTagDescriptionsResponse() {} + + @JsonCreator + public CostTagDescriptionsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostTagDescriptionsResponse data(List data) { + this.data = data; + for (CostTagDescription item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostTagDescriptionsResponse addDataItem(CostTagDescription dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of tag key descriptions. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List 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 CostTagDescriptionsResponse + */ + @JsonAnySetter + public CostTagDescriptionsResponse 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 CostTagDescriptionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionsResponse costTagDescriptionsResponse = (CostTagDescriptionsResponse) o; + return Objects.equals(this.data, costTagDescriptionsResponse.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionsResponse {\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/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 1e9f5de20c2..bf9f695d40e 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 @@ -319,6 +319,12 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag descriptions returns "OK" response + Given new "ListCostTagDescriptions" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" 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 aaeb20e65bb..049acf0531b 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 @@ -1470,6 +1470,12 @@ "type": "safe" } }, + "ListCostTagDescriptions": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": {