diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 39623cac69e..66a1f30dbe8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14680,7 +14680,8 @@ components: example: - 0.85 - 0.72 - items: {} + items: + description: A scalar column value, either a group key (string) or a numeric metric. type: array CommitmentsScalarColumns: description: Array of scalar columns in the response. @@ -14708,6 +14709,7 @@ components: CommitmentsTimeseriesValues: description: A series of numeric values for a timeseries metric. items: + description: A single numeric value in the timeseries. format: double type: number type: array @@ -14717,6 +14719,7 @@ components: - 1693526400 - 1693612800 items: + description: A Unix timestamp in seconds. format: int64 type: integer type: array @@ -16478,6 +16481,7 @@ components: additionalProperties: description: The list of correlated values for the tag key. items: + description: A correlated tag value. type: string type: array description: Map of correlated tag keys to the list of correlated tag values. @@ -16658,6 +16662,121 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostCurrency: + description: A Cloud Cost Management billing currency entry. + properties: + id: + description: The currency code (for example, `USD`). + example: USD + type: string + type: + $ref: "#/components/schemas/CostCurrencyType" + required: + - id + - type + type: object + CostCurrencyResponse: + description: The dominant Cloud Cost Management billing currency for the requested period. The `data` array contains at most one entry, and is empty when no currency data is available. + example: + data: + - id: USD + type: cost_currency + properties: + data: + description: The dominant billing currency. Empty when no data is available, or a single entry otherwise. + items: + $ref: "#/components/schemas/CostCurrency" + type: array + required: + - data + type: object + CostCurrencyType: + default: cost_currency + description: Type of the Cloud Cost Management billing currency resource. + enum: + - cost_currency + example: cost_currency + type: string + x-enum-varnames: + - COST_CURRENCY + CostMetric: + description: A Cloud Cost Management metric that has data for the requested period. + properties: + id: + description: The metric name, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostMetricType" + required: + - id + - type + type: object + CostMetricType: + default: cost_metric + description: Type of the Cloud Cost Management available metric resource. + enum: + - cost_metric + example: cost_metric + type: string + x-enum-varnames: + - COST_METRIC + CostMetricsResponse: + description: List of available Cloud Cost Management metrics for the requested period. + example: + data: + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric + properties: + data: + description: List of available metrics. + items: + $ref: "#/components/schemas/CostMetric" + type: array + required: + - data + type: object + CostOrchestrator: + description: A container orchestrator detected in Cloud Cost Management data. + properties: + id: + description: The orchestrator name, for example `kubernetes` or `ecs`. + example: kubernetes + type: string + type: + $ref: "#/components/schemas/CostOrchestratorType" + required: + - id + - type + type: object + CostOrchestratorType: + default: cost_orchestrator + description: Type of the Cloud Cost Management orchestrator resource. + enum: + - cost_orchestrator + example: cost_orchestrator + type: string + x-enum-varnames: + - COST_ORCHESTRATOR + CostOrchestratorsResponse: + description: List of container orchestrators detected in Cloud Cost Management data for the requested period. + example: + data: + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator + properties: + data: + description: List of detected container orchestrators. + items: + $ref: "#/components/schemas/CostOrchestrator" + type: array + required: + - data + type: object CostTag: description: A Cloud Cost Management tag. properties: @@ -16843,6 +16962,121 @@ components: - description - tag_values type: object + CostTagKeyMetadata: + description: A Cloud Cost Management tag key metadata entry, aggregating coverage and example values for a single tag key, metric, and period. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeyMetadataAttributes" + id: + description: A composite identifier of the form `tag_key:metric` for monthly roll-ups, or `tag_key:metric:YYYY-MM-DD` when `filter[daily]=true`. + example: env:aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostTagKeyMetadataType" + required: + - attributes + - id + - type + type: object + CostTagKeyMetadataAttributes: + description: Attributes of a Cloud Cost Management tag key metadata entry. + properties: + cardinality_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataCardinalityByAccount" + cost_covered: + description: Total cost (in the report currency) of cost line items that carry this tag key for the requested period. + example: 1234.56 + format: double + type: number + date: + description: The day this row corresponds to, in `YYYY-MM-DD` format. Present only when `filter[daily]=true`; omitted for the monthly roll-up returned by default. + example: "2026-02-15" + type: string + metric: + description: The Cloud Cost Management metric this row aggregates, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + row_count: + description: Number of cost rows that carry this tag key over the requested period. + example: 100 + format: int64 + type: integer + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + items: + description: A tag source. + type: string + type: array + top_values_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataTopValuesByAccount" + required: + - cardinality_by_account + - cost_covered + - metric + - row_count + - tag_sources + - top_values_by_account + type: object + CostTagKeyMetadataCardinalityByAccount: + additionalProperties: + description: Number of unique tag values observed in the account. + format: int64 + type: integer + description: Number of unique tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": 42 + type: object + CostTagKeyMetadataResponse: + description: List of Cloud Cost Management tag key metadata entries for the requested period. + example: + data: + - attributes: + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata + properties: + data: + description: List of tag key metadata entries. + items: + $ref: "#/components/schemas/CostTagKeyMetadata" + type: array + required: + - data + type: object + CostTagKeyMetadataTopValuesByAccount: + additionalProperties: + description: A sample of the most frequent tag values observed in the account. + items: + description: A tag value observed for this tag key. + type: string + type: array + description: A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": + - prod + - staging + type: object + CostTagKeyMetadataType: + default: cost_tag_key_metadata + description: Type of the Cloud Cost Management tag key metadata resource. + enum: + - cost_tag_key_metadata + example: cost_tag_key_metadata + type: string + x-enum-varnames: + - COST_TAG_KEY_METADATA CostTagKeyResponse: description: A single Cloud Cost Management tag key. example: @@ -16865,6 +17099,77 @@ components: required: - data type: object + CostTagKeySource: + description: A Cloud Cost Management tag key paired with the sources that produced it. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeySourceAttributes" + id: + description: The tag key identifier. Equal to the empty-tag sentinel `__empty_tag_key__` when the tag key is empty. + example: env + type: string + type: + $ref: "#/components/schemas/CostTagKeySourceType" + required: + - attributes + - id + - type + type: object + CostTagKeySourceAttributes: + description: Attributes of a Cloud Cost Management tag source. + properties: + tag_key: + description: The tag key name. + example: env + type: string + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + - custom + items: + description: A tag source. + type: string + type: array + required: + - tag_key + - tag_sources + type: object + CostTagKeySourceType: + default: cost_tag_key_source + description: Type of the Cloud Cost Management tag source resource. + enum: + - cost_tag_key_source + example: cost_tag_key_source + type: string + x-enum-varnames: + - COST_TAG_KEY_SOURCE + CostTagKeySourcesResponse: + description: List of Cloud Cost Management tag keys with their origin sources for the requested period. + example: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + properties: + data: + description: List of tag keys with their origin sources. + items: + $ref: "#/components/schemas/CostTagKeySource" + type: array + required: + - data + type: object CostTagKeyType: default: cost_tag_key description: Type of the Cloud Cost Management tag key resource. @@ -16898,6 +17203,16 @@ components: required: - data type: object + CostTagMetadataDailyFilter: + description: Granularity for tag metadata results. `true` returns one row per day, `false` (or omitted) returns the monthly roll-up. + enum: + - "true" + - "false" + example: "true" + type: string + x-enum-varnames: + - "TRUE" + - "FALSE" CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -100048,6 +100363,343 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_metadata: + get: + description: List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, and a sample of top tag values per cloud account. Use `filter[daily]=true` to return daily rows instead of the default monthly roll-up. + operationId: ListCostTagMetadata + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + - description: Filter results to a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, every available metric for the requested period is returned. + in: query + name: filter[metric] + schema: + type: string + - description: Restrict results to a single tag key. + in: query + name: filter[tag_key] + schema: + type: string + - description: When `true`, return one row per day with the day in the `date` attribute. Defaults to the monthly roll-up when omitted. + in: query + name: filter[daily] + schema: + $ref: "#/components/schemas/CostTagMetadataDailyFilter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata + schema: + $ref: "#/components/schemas/CostTagKeyMetadataResponse" + 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: List Cloud Cost Management tag key metadata + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/currency: + get: + description: Get the dominant billing currency observed in Cloud Cost Management data for the requested period. The response wraps the currency in a JSON:API `data` array containing at most one entry; the array is empty when no currency data is available. + operationId: GetCostTagMetadataCurrency + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: USD + type: cost_currency + schema: + $ref: "#/components/schemas/CostCurrencyResponse" + 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: Get the Cloud Cost Management billing currency + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/metrics: + get: + description: List Cloud Cost Management metrics that have data for the requested period. + operationId: ListCostTagMetadataMetrics + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric + schema: + $ref: "#/components/schemas/CostMetricsResponse" + 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: List available Cloud Cost Management metrics + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/orchestrators: + get: + description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. + operationId: ListCostTagMetadataOrchestrators + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator + schema: + $ref: "#/components/schemas/CostOrchestratorsResponse" + 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: List Cloud Cost Management orchestrators + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/tag_sources: + get: + description: List Cloud Cost Management tag keys observed for the requested period, along with the origin sources that produced them (for example, `aws-user-defined`, `custom`). + operationId: ListCostTagKeySources + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + schema: + $ref: "#/components/schemas/CostTagKeySourcesResponse" + 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: List Cloud Cost Management tag sources + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/tags: get: description: List Cloud Cost Management tags for a given metric. diff --git a/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.java b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.java new file mode 100644 index 00000000000..927e69100f9 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.java @@ -0,0 +1,26 @@ +// Get the Cloud Cost Management billing currency 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.CostCurrencyResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCostTagMetadataCurrency", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostCurrencyResponse result = apiInstance.getCostTagMetadataCurrency("2026-02"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCostTagMetadataCurrency"); + 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/ListCostTagKeySources.java b/examples/v2/cloud-cost-management/ListCostTagKeySources.java new file mode 100644 index 00000000000..6ca2875be10 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagKeySources.java @@ -0,0 +1,25 @@ +// List Cloud Cost Management tag sources 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.CostTagKeySourcesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCostTagKeySources", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagKeySourcesResponse result = apiInstance.listCostTagKeySources("2026-02"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#listCostTagKeySources"); + 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/ListCostTagMetadata.java b/examples/v2/cloud-cost-management/ListCostTagMetadata.java new file mode 100644 index 00000000000..347d9f2e60b --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadata.java @@ -0,0 +1,25 @@ +// List Cloud Cost Management tag key metadata 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.CostTagKeyMetadataResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCostTagMetadata", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagKeyMetadataResponse result = apiInstance.listCostTagMetadata("2026-02"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#listCostTagMetadata"); + 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/ListCostTagMetadataMetrics.java b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.java new file mode 100644 index 00000000000..8aa2a8d163a --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.java @@ -0,0 +1,26 @@ +// List available Cloud Cost Management metrics 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.CostMetricsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCostTagMetadataMetrics", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostMetricsResponse result = apiInstance.listCostTagMetadataMetrics("2026-02"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#listCostTagMetadataMetrics"); + 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/ListCostTagMetadataOrchestrators.java b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.java new file mode 100644 index 00000000000..bdb4d85417f --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.java @@ -0,0 +1,26 @@ +// List Cloud Cost Management orchestrators 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.CostOrchestratorsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCostTagMetadataOrchestrators", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostOrchestratorsResponse result = apiInstance.listCostTagMetadataOrchestrators("2026-02"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#listCostTagMetadataOrchestrators"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 412e469ea96..40867b589fa 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -869,7 +869,12 @@ public class ApiClient { put("v2.getCommitmentsUtilizationScalar", false); put("v2.getCommitmentsUtilizationTimeseries", false); put("v2.getCostAnomaly", false); + put("v2.getCostTagMetadataCurrency", false); put("v2.listCostAnomalies", false); + put("v2.listCostTagKeySources", false); + put("v2.listCostTagMetadata", false); + put("v2.listCostTagMetadataMetrics", false); + put("v2.listCostTagMetadataOrchestrators", false); put("v2.createDashboardSecureEmbed", false); put("v2.deleteDashboardSecureEmbed", false); put("v2.getDashboardSecureEmbed", false); 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 e119877a3b6..46db44f7a8e 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 @@ -32,9 +32,15 @@ import com.datadog.api.client.v2.model.CommitmentsUtilizationTimeseriesResponse; import com.datadog.api.client.v2.model.CostAnomaliesResponse; import com.datadog.api.client.v2.model.CostAnomalyResponse; +import com.datadog.api.client.v2.model.CostCurrencyResponse; +import com.datadog.api.client.v2.model.CostMetricsResponse; +import com.datadog.api.client.v2.model.CostOrchestratorsResponse; import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; +import com.datadog.api.client.v2.model.CostTagKeyMetadataResponse; import com.datadog.api.client.v2.model.CostTagKeyResponse; +import com.datadog.api.client.v2.model.CostTagKeySourcesResponse; import com.datadog.api.client.v2.model.CostTagKeysResponse; +import com.datadog.api.client.v2.model.CostTagMetadataDailyFilter; import com.datadog.api.client.v2.model.CostTagsResponse; import com.datadog.api.client.v2.model.CreateRulesetRequest; import com.datadog.api.client.v2.model.CustomCostsFileGetResponse; @@ -5292,6 +5298,231 @@ public CompletableFuture> getCostTagKeyWithHttpI new GenericType() {}); } + /** Manage optional parameters to getCostTagMetadataCurrency. */ + public static class GetCostTagMetadataCurrencyOptionalParameters { + private String filterProvider; + + /** + * Set filterProvider. + * + * @param filterProvider Filter results to a specific provider. Common cloud values are + * aws, azure, gcp, Oracle (OCI), and + * custom. SaaS billing integrations (for example, Snowflake, + * MongoDB, Databricks) are also accepted using their display-name + * string. Values are case-sensitive. (optional) + * @return GetCostTagMetadataCurrencyOptionalParameters + */ + public GetCostTagMetadataCurrencyOptionalParameters filterProvider(String filterProvider) { + this.filterProvider = filterProvider; + return this; + } + } + + /** + * Get the Cloud Cost Management billing currency. + * + *

See {@link #getCostTagMetadataCurrencyWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CostCurrencyResponse + * @throws ApiException if fails to make API call + */ + public CostCurrencyResponse getCostTagMetadataCurrency(String filterMonth) throws ApiException { + return getCostTagMetadataCurrencyWithHttpInfo( + filterMonth, new GetCostTagMetadataCurrencyOptionalParameters()) + .getData(); + } + + /** + * Get the Cloud Cost Management billing currency. + * + *

See {@link #getCostTagMetadataCurrencyWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CompletableFuture<CostCurrencyResponse> + */ + public CompletableFuture getCostTagMetadataCurrencyAsync( + String filterMonth) { + return getCostTagMetadataCurrencyWithHttpInfoAsync( + filterMonth, new GetCostTagMetadataCurrencyOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the Cloud Cost Management billing currency. + * + *

See {@link #getCostTagMetadataCurrencyWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CostCurrencyResponse + * @throws ApiException if fails to make API call + */ + public CostCurrencyResponse getCostTagMetadataCurrency( + String filterMonth, GetCostTagMetadataCurrencyOptionalParameters parameters) + throws ApiException { + return getCostTagMetadataCurrencyWithHttpInfo(filterMonth, parameters).getData(); + } + + /** + * Get the Cloud Cost Management billing currency. + * + *

See {@link #getCostTagMetadataCurrencyWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostCurrencyResponse> + */ + public CompletableFuture getCostTagMetadataCurrencyAsync( + String filterMonth, GetCostTagMetadataCurrencyOptionalParameters parameters) { + return getCostTagMetadataCurrencyWithHttpInfoAsync(filterMonth, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the dominant billing currency observed in Cloud Cost Management data for the requested + * period. The response wraps the currency in a JSON:API data array containing at + * most one entry; the array is empty when no currency data is available. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostCurrencyResponse> + * @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 getCostTagMetadataCurrencyWithHttpInfo( + String filterMonth, GetCostTagMetadataCurrencyOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCostTagMetadataCurrency"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + throw new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling getCostTagMetadataCurrency"); + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/currency"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostTagMetadataCurrency", + 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() {}); + } + + /** + * Get the Cloud Cost Management billing currency. + * + *

See {@link #getCostTagMetadataCurrencyWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostCurrencyResponse>> + */ + public CompletableFuture> + getCostTagMetadataCurrencyWithHttpInfoAsync( + String filterMonth, GetCostTagMetadataCurrencyOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCostTagMetadataCurrency"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling" + + " getCostTagMetadataCurrency")); + return result; + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/currency"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostTagMetadataCurrency", + 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() {}); + } + /** * Get custom allocation rule. * @@ -6971,6 +7202,948 @@ public CompletableFuture> listCostTagKeysWithHt new GenericType() {}); } + /** Manage optional parameters to listCostTagKeySources. */ + public static class ListCostTagKeySourcesOptionalParameters { + private String filterProvider; + + /** + * Set filterProvider. + * + * @param filterProvider Filter results to a specific provider. Common cloud values are + * aws, azure, gcp, Oracle (OCI), and + * custom. SaaS billing integrations (for example, Snowflake, + * MongoDB, Databricks) are also accepted using their display-name + * string. Values are case-sensitive. (optional) + * @return ListCostTagKeySourcesOptionalParameters + */ + public ListCostTagKeySourcesOptionalParameters filterProvider(String filterProvider) { + this.filterProvider = filterProvider; + return this; + } + } + + /** + * List Cloud Cost Management tag sources. + * + *

See {@link #listCostTagKeySourcesWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CostTagKeySourcesResponse + * @throws ApiException if fails to make API call + */ + public CostTagKeySourcesResponse listCostTagKeySources(String filterMonth) throws ApiException { + return listCostTagKeySourcesWithHttpInfo( + filterMonth, new ListCostTagKeySourcesOptionalParameters()) + .getData(); + } + + /** + * List Cloud Cost Management tag sources. + * + *

See {@link #listCostTagKeySourcesWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CompletableFuture<CostTagKeySourcesResponse> + */ + public CompletableFuture listCostTagKeySourcesAsync( + String filterMonth) { + return listCostTagKeySourcesWithHttpInfoAsync( + filterMonth, new ListCostTagKeySourcesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag sources. + * + *

See {@link #listCostTagKeySourcesWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CostTagKeySourcesResponse + * @throws ApiException if fails to make API call + */ + public CostTagKeySourcesResponse listCostTagKeySources( + String filterMonth, ListCostTagKeySourcesOptionalParameters parameters) throws ApiException { + return listCostTagKeySourcesWithHttpInfo(filterMonth, parameters).getData(); + } + + /** + * List Cloud Cost Management tag sources. + * + *

See {@link #listCostTagKeySourcesWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagKeySourcesResponse> + */ + public CompletableFuture listCostTagKeySourcesAsync( + String filterMonth, ListCostTagKeySourcesOptionalParameters parameters) { + return listCostTagKeySourcesWithHttpInfoAsync(filterMonth, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag keys observed for the requested period, along with the origin + * sources that produced them (for example, aws-user-defined, custom). + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagKeySourcesResponse> + * @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 listCostTagKeySourcesWithHttpInfo( + String filterMonth, ListCostTagKeySourcesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCostTagKeySources"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + throw new ApiException( + 400, "Missing the required parameter 'filterMonth' when calling listCostTagKeySources"); + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/tag_sources"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagKeySources", + 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 sources. + * + *

See {@link #listCostTagKeySourcesWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagKeySourcesResponse>> + */ + public CompletableFuture> + listCostTagKeySourcesWithHttpInfoAsync( + String filterMonth, ListCostTagKeySourcesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCostTagKeySources"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling listCostTagKeySources")); + return result; + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/tag_sources"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagKeySources", + 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() {}); + } + + /** Manage optional parameters to listCostTagMetadata. */ + public static class ListCostTagMetadataOptionalParameters { + private String filterProvider; + private String filterMetric; + private String filterTagKey; + private CostTagMetadataDailyFilter filterDaily; + + /** + * Set filterProvider. + * + * @param filterProvider Filter results to a specific provider. Common cloud values are + * aws, azure, gcp, Oracle (OCI), and + * custom. SaaS billing integrations (for example, Snowflake, + * MongoDB, Databricks) are also accepted using their display-name + * string. Values are case-sensitive. (optional) + * @return ListCostTagMetadataOptionalParameters + */ + public ListCostTagMetadataOptionalParameters filterProvider(String filterProvider) { + this.filterProvider = filterProvider; + return this; + } + + /** + * Set filterMetric. + * + * @param filterMetric Filter results to a specific Cloud Cost Management metric (for example, + * aws.cost.net.amortized). When omitted, every available metric for the + * requested period is returned. (optional) + * @return ListCostTagMetadataOptionalParameters + */ + public ListCostTagMetadataOptionalParameters filterMetric(String filterMetric) { + this.filterMetric = filterMetric; + return this; + } + + /** + * Set filterTagKey. + * + * @param filterTagKey Restrict results to a single tag key. (optional) + * @return ListCostTagMetadataOptionalParameters + */ + public ListCostTagMetadataOptionalParameters filterTagKey(String filterTagKey) { + this.filterTagKey = filterTagKey; + return this; + } + + /** + * Set filterDaily. + * + * @param filterDaily When true, return one row per day with the day in the + * date attribute. Defaults to the monthly roll-up when omitted. (optional) + * @return ListCostTagMetadataOptionalParameters + */ + public ListCostTagMetadataOptionalParameters filterDaily( + CostTagMetadataDailyFilter filterDaily) { + this.filterDaily = filterDaily; + return this; + } + } + + /** + * List Cloud Cost Management tag key metadata. + * + *

See {@link #listCostTagMetadataWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CostTagKeyMetadataResponse + * @throws ApiException if fails to make API call + */ + public CostTagKeyMetadataResponse listCostTagMetadata(String filterMonth) throws ApiException { + return listCostTagMetadataWithHttpInfo(filterMonth, new ListCostTagMetadataOptionalParameters()) + .getData(); + } + + /** + * List Cloud Cost Management tag key metadata. + * + *

See {@link #listCostTagMetadataWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CompletableFuture<CostTagKeyMetadataResponse> + */ + public CompletableFuture listCostTagMetadataAsync( + String filterMonth) { + return listCostTagMetadataWithHttpInfoAsync( + filterMonth, new ListCostTagMetadataOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag key metadata. + * + *

See {@link #listCostTagMetadataWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CostTagKeyMetadataResponse + * @throws ApiException if fails to make API call + */ + public CostTagKeyMetadataResponse listCostTagMetadata( + String filterMonth, ListCostTagMetadataOptionalParameters parameters) throws ApiException { + return listCostTagMetadataWithHttpInfo(filterMonth, parameters).getData(); + } + + /** + * List Cloud Cost Management tag key metadata. + * + *

See {@link #listCostTagMetadataWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagKeyMetadataResponse> + */ + public CompletableFuture listCostTagMetadataAsync( + String filterMonth, ListCostTagMetadataOptionalParameters parameters) { + return listCostTagMetadataWithHttpInfoAsync(filterMonth, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, + * and a sample of top tag values per cloud account. Use filter[daily]=true to return + * daily rows instead of the default monthly roll-up. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagKeyMetadataResponse> + * @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 listCostTagMetadataWithHttpInfo( + String filterMonth, ListCostTagMetadataOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadata"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + throw new ApiException( + 400, "Missing the required parameter 'filterMonth' when calling listCostTagMetadata"); + } + String filterProvider = parameters.filterProvider; + String filterMetric = parameters.filterMetric; + String filterTagKey = parameters.filterTagKey; + CostTagMetadataDailyFilter filterDaily = parameters.filterDaily; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[metric]", filterMetric)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tag_key]", filterTagKey)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[daily]", filterDaily)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadata", + 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 key metadata. + * + *

See {@link #listCostTagMetadataWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagKeyMetadataResponse>> + */ + public CompletableFuture> + listCostTagMetadataWithHttpInfoAsync( + String filterMonth, ListCostTagMetadataOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadata"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling listCostTagMetadata")); + return result; + } + String filterProvider = parameters.filterProvider; + String filterMetric = parameters.filterMetric; + String filterTagKey = parameters.filterTagKey; + CostTagMetadataDailyFilter filterDaily = parameters.filterDaily; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[metric]", filterMetric)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tag_key]", filterTagKey)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[daily]", filterDaily)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadata", + 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() {}); + } + + /** Manage optional parameters to listCostTagMetadataMetrics. */ + public static class ListCostTagMetadataMetricsOptionalParameters { + private String filterProvider; + + /** + * Set filterProvider. + * + * @param filterProvider Filter results to a specific provider. Common cloud values are + * aws, azure, gcp, Oracle (OCI), and + * custom. SaaS billing integrations (for example, Snowflake, + * MongoDB, Databricks) are also accepted using their display-name + * string. Values are case-sensitive. (optional) + * @return ListCostTagMetadataMetricsOptionalParameters + */ + public ListCostTagMetadataMetricsOptionalParameters filterProvider(String filterProvider) { + this.filterProvider = filterProvider; + return this; + } + } + + /** + * List available Cloud Cost Management metrics. + * + *

See {@link #listCostTagMetadataMetricsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CostMetricsResponse + * @throws ApiException if fails to make API call + */ + public CostMetricsResponse listCostTagMetadataMetrics(String filterMonth) throws ApiException { + return listCostTagMetadataMetricsWithHttpInfo( + filterMonth, new ListCostTagMetadataMetricsOptionalParameters()) + .getData(); + } + + /** + * List available Cloud Cost Management metrics. + * + *

See {@link #listCostTagMetadataMetricsWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CompletableFuture<CostMetricsResponse> + */ + public CompletableFuture listCostTagMetadataMetricsAsync( + String filterMonth) { + return listCostTagMetadataMetricsWithHttpInfoAsync( + filterMonth, new ListCostTagMetadataMetricsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List available Cloud Cost Management metrics. + * + *

See {@link #listCostTagMetadataMetricsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CostMetricsResponse + * @throws ApiException if fails to make API call + */ + public CostMetricsResponse listCostTagMetadataMetrics( + String filterMonth, ListCostTagMetadataMetricsOptionalParameters parameters) + throws ApiException { + return listCostTagMetadataMetricsWithHttpInfo(filterMonth, parameters).getData(); + } + + /** + * List available Cloud Cost Management metrics. + * + *

See {@link #listCostTagMetadataMetricsWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostMetricsResponse> + */ + public CompletableFuture listCostTagMetadataMetricsAsync( + String filterMonth, ListCostTagMetadataMetricsOptionalParameters parameters) { + return listCostTagMetadataMetricsWithHttpInfoAsync(filterMonth, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management metrics that have data for the requested period. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostMetricsResponse> + * @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 listCostTagMetadataMetricsWithHttpInfo( + String filterMonth, ListCostTagMetadataMetricsOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataMetrics"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + throw new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling listCostTagMetadataMetrics"); + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/metrics"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataMetrics", + 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 available Cloud Cost Management metrics. + * + *

See {@link #listCostTagMetadataMetricsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostMetricsResponse>> + */ + public CompletableFuture> + listCostTagMetadataMetricsWithHttpInfoAsync( + String filterMonth, ListCostTagMetadataMetricsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataMetrics"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling" + + " listCostTagMetadataMetrics")); + return result; + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/metrics"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataMetrics", + 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() {}); + } + + /** Manage optional parameters to listCostTagMetadataOrchestrators. */ + public static class ListCostTagMetadataOrchestratorsOptionalParameters { + private String filterProvider; + + /** + * Set filterProvider. + * + * @param filterProvider Filter results to a specific provider. Common cloud values are + * aws, azure, gcp, Oracle (OCI), and + * custom. SaaS billing integrations (for example, Snowflake, + * MongoDB, Databricks) are also accepted using their display-name + * string. Values are case-sensitive. (optional) + * @return ListCostTagMetadataOrchestratorsOptionalParameters + */ + public ListCostTagMetadataOrchestratorsOptionalParameters filterProvider( + String filterProvider) { + this.filterProvider = filterProvider; + return this; + } + } + + /** + * List Cloud Cost Management orchestrators. + * + *

See {@link #listCostTagMetadataOrchestratorsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CostOrchestratorsResponse + * @throws ApiException if fails to make API call + */ + public CostOrchestratorsResponse listCostTagMetadataOrchestrators(String filterMonth) + throws ApiException { + return listCostTagMetadataOrchestratorsWithHttpInfo( + filterMonth, new ListCostTagMetadataOrchestratorsOptionalParameters()) + .getData(); + } + + /** + * List Cloud Cost Management orchestrators. + * + *

See {@link #listCostTagMetadataOrchestratorsWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @return CompletableFuture<CostOrchestratorsResponse> + */ + public CompletableFuture listCostTagMetadataOrchestratorsAsync( + String filterMonth) { + return listCostTagMetadataOrchestratorsWithHttpInfoAsync( + filterMonth, new ListCostTagMetadataOrchestratorsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Cloud Cost Management orchestrators. + * + *

See {@link #listCostTagMetadataOrchestratorsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CostOrchestratorsResponse + * @throws ApiException if fails to make API call + */ + public CostOrchestratorsResponse listCostTagMetadataOrchestrators( + String filterMonth, ListCostTagMetadataOrchestratorsOptionalParameters parameters) + throws ApiException { + return listCostTagMetadataOrchestratorsWithHttpInfo(filterMonth, parameters).getData(); + } + + /** + * List Cloud Cost Management orchestrators. + * + *

See {@link #listCostTagMetadataOrchestratorsWithHttpInfoAsync}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostOrchestratorsResponse> + */ + public CompletableFuture listCostTagMetadataOrchestratorsAsync( + String filterMonth, ListCostTagMetadataOrchestratorsOptionalParameters parameters) { + return listCostTagMetadataOrchestratorsWithHttpInfoAsync(filterMonth, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List container orchestrators (for example, kubernetes, ecs) detected + * in Cloud Cost Management data for the requested period. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostOrchestratorsResponse> + * @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 listCostTagMetadataOrchestratorsWithHttpInfo( + String filterMonth, ListCostTagMetadataOrchestratorsOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataOrchestrators"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + throw new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling" + + " listCostTagMetadataOrchestrators"); + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/orchestrators"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataOrchestrators", + 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 orchestrators. + * + *

See {@link #listCostTagMetadataOrchestratorsWithHttpInfo}. + * + * @param filterMonth The month to scope the query to, in YYYY-MM format. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostOrchestratorsResponse>> + */ + public CompletableFuture> + listCostTagMetadataOrchestratorsWithHttpInfoAsync( + String filterMonth, ListCostTagMetadataOrchestratorsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataOrchestrators"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterMonth' is set + if (filterMonth == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterMonth' when calling" + + " listCostTagMetadataOrchestrators")); + return result; + } + String filterProvider = parameters.filterProvider; + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/orchestrators"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[month]", filterMonth)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataOrchestrators", + 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() {}); + } + /** Manage optional parameters to listCostTags. */ public static class ListCostTagsOptionalParameters { private String filterMetric; diff --git a/src/main/java/com/datadog/api/client/v2/model/CostCurrency.java b/src/main/java/com/datadog/api/client/v2/model/CostCurrency.java new file mode 100644 index 00000000000..bc01e847caa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostCurrency.java @@ -0,0 +1,175 @@ +/* + * 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 billing currency entry. */ +@JsonPropertyOrder({CostCurrency.JSON_PROPERTY_ID, CostCurrency.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostCurrency { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostCurrencyType type = CostCurrencyType.COST_CURRENCY; + + public CostCurrency() {} + + @JsonCreator + public CostCurrency( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostCurrencyType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostCurrency id(String id) { + this.id = id; + return this; + } + + /** + * The currency code (for example, USD). + * + * @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 CostCurrency type(CostCurrencyType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management billing currency resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostCurrencyType getType() { + return type; + } + + public void setType(CostCurrencyType 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 CostCurrency + */ + @JsonAnySetter + public CostCurrency 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 CostCurrency object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostCurrency costCurrency = (CostCurrency) o; + return Objects.equals(this.id, costCurrency.id) + && Objects.equals(this.type, costCurrency.type) + && Objects.equals(this.additionalProperties, costCurrency.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostCurrency {\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/CostCurrencyResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostCurrencyResponse.java new file mode 100644 index 00000000000..d612856a54b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostCurrencyResponse.java @@ -0,0 +1,157 @@ +/* + * 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; + +/** + * The dominant Cloud Cost Management billing currency for the requested period. The data + * array contains at most one entry, and is empty when no currency data is available. + */ +@JsonPropertyOrder({CostCurrencyResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostCurrencyResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostCurrencyResponse() {} + + @JsonCreator + public CostCurrencyResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostCurrencyResponse data(List data) { + this.data = data; + for (CostCurrency item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostCurrencyResponse addDataItem(CostCurrency dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The dominant billing currency. Empty when no data is available, or a single entry otherwise. + * + * @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 CostCurrencyResponse + */ + @JsonAnySetter + public CostCurrencyResponse 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 CostCurrencyResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostCurrencyResponse costCurrencyResponse = (CostCurrencyResponse) o; + return Objects.equals(this.data, costCurrencyResponse.data) + && Objects.equals(this.additionalProperties, costCurrencyResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostCurrencyResponse {\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/CostCurrencyType.java b/src/main/java/com/datadog/api/client/v2/model/CostCurrencyType.java new file mode 100644 index 00000000000..fa0d242b3c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostCurrencyType.java @@ -0,0 +1,54 @@ +/* + * 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 billing currency resource. */ +@JsonSerialize(using = CostCurrencyType.CostCurrencyTypeSerializer.class) +public class CostCurrencyType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_currency")); + + public static final CostCurrencyType COST_CURRENCY = new CostCurrencyType("cost_currency"); + + CostCurrencyType(String value) { + super(value, allowedValues); + } + + public static class CostCurrencyTypeSerializer extends StdSerializer { + public CostCurrencyTypeSerializer(Class t) { + super(t); + } + + public CostCurrencyTypeSerializer() { + this(null); + } + + @Override + public void serialize(CostCurrencyType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostCurrencyType fromValue(String value) { + return new CostCurrencyType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostMetric.java b/src/main/java/com/datadog/api/client/v2/model/CostMetric.java new file mode 100644 index 00000000000..f5fb52798de --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostMetric.java @@ -0,0 +1,175 @@ +/* + * 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 metric that has data for the requested period. */ +@JsonPropertyOrder({CostMetric.JSON_PROPERTY_ID, CostMetric.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostMetric { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostMetricType type = CostMetricType.COST_METRIC; + + public CostMetric() {} + + @JsonCreator + public CostMetric( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostMetricType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostMetric id(String id) { + this.id = id; + return this; + } + + /** + * The metric name, for example aws.cost.net.amortized. + * + * @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 CostMetric type(CostMetricType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management available metric resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostMetricType getType() { + return type; + } + + public void setType(CostMetricType 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 CostMetric + */ + @JsonAnySetter + public CostMetric 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 CostMetric object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostMetric costMetric = (CostMetric) o; + return Objects.equals(this.id, costMetric.id) + && Objects.equals(this.type, costMetric.type) + && Objects.equals(this.additionalProperties, costMetric.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostMetric {\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/CostMetricType.java b/src/main/java/com/datadog/api/client/v2/model/CostMetricType.java new file mode 100644 index 00000000000..0d8c0f6f370 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostMetricType.java @@ -0,0 +1,54 @@ +/* + * 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 available metric resource. */ +@JsonSerialize(using = CostMetricType.CostMetricTypeSerializer.class) +public class CostMetricType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_metric")); + + public static final CostMetricType COST_METRIC = new CostMetricType("cost_metric"); + + CostMetricType(String value) { + super(value, allowedValues); + } + + public static class CostMetricTypeSerializer extends StdSerializer { + public CostMetricTypeSerializer(Class t) { + super(t); + } + + public CostMetricTypeSerializer() { + this(null); + } + + @Override + public void serialize(CostMetricType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostMetricType fromValue(String value) { + return new CostMetricType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostMetricsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostMetricsResponse.java new file mode 100644 index 00000000000..1cdd4f08fab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostMetricsResponse.java @@ -0,0 +1,154 @@ +/* + * 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 available Cloud Cost Management metrics for the requested period. */ +@JsonPropertyOrder({CostMetricsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostMetricsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostMetricsResponse() {} + + @JsonCreator + public CostMetricsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostMetricsResponse data(List data) { + this.data = data; + for (CostMetric item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostMetricsResponse addDataItem(CostMetric dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of available metrics. + * + * @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 CostMetricsResponse + */ + @JsonAnySetter + public CostMetricsResponse 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 CostMetricsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostMetricsResponse costMetricsResponse = (CostMetricsResponse) o; + return Objects.equals(this.data, costMetricsResponse.data) + && Objects.equals(this.additionalProperties, costMetricsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostMetricsResponse {\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/CostOrchestrator.java b/src/main/java/com/datadog/api/client/v2/model/CostOrchestrator.java new file mode 100644 index 00000000000..600f6fecdbb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostOrchestrator.java @@ -0,0 +1,175 @@ +/* + * 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 container orchestrator detected in Cloud Cost Management data. */ +@JsonPropertyOrder({CostOrchestrator.JSON_PROPERTY_ID, CostOrchestrator.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostOrchestrator { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostOrchestratorType type = CostOrchestratorType.COST_ORCHESTRATOR; + + public CostOrchestrator() {} + + @JsonCreator + public CostOrchestrator( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostOrchestratorType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostOrchestrator id(String id) { + this.id = id; + return this; + } + + /** + * The orchestrator name, for example kubernetes or ecs. + * + * @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 CostOrchestrator type(CostOrchestratorType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management orchestrator resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostOrchestratorType getType() { + return type; + } + + public void setType(CostOrchestratorType 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 CostOrchestrator + */ + @JsonAnySetter + public CostOrchestrator 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 CostOrchestrator object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostOrchestrator costOrchestrator = (CostOrchestrator) o; + return Objects.equals(this.id, costOrchestrator.id) + && Objects.equals(this.type, costOrchestrator.type) + && Objects.equals(this.additionalProperties, costOrchestrator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostOrchestrator {\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/CostOrchestratorType.java b/src/main/java/com/datadog/api/client/v2/model/CostOrchestratorType.java new file mode 100644 index 00000000000..743986292fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostOrchestratorType.java @@ -0,0 +1,56 @@ +/* + * 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 orchestrator resource. */ +@JsonSerialize(using = CostOrchestratorType.CostOrchestratorTypeSerializer.class) +public class CostOrchestratorType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_orchestrator")); + + public static final CostOrchestratorType COST_ORCHESTRATOR = + new CostOrchestratorType("cost_orchestrator"); + + CostOrchestratorType(String value) { + super(value, allowedValues); + } + + public static class CostOrchestratorTypeSerializer extends StdSerializer { + public CostOrchestratorTypeSerializer(Class t) { + super(t); + } + + public CostOrchestratorTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CostOrchestratorType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostOrchestratorType fromValue(String value) { + return new CostOrchestratorType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostOrchestratorsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostOrchestratorsResponse.java new file mode 100644 index 00000000000..68871cbc9e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostOrchestratorsResponse.java @@ -0,0 +1,157 @@ +/* + * 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 container orchestrators detected in Cloud Cost Management data for the requested period. + */ +@JsonPropertyOrder({CostOrchestratorsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostOrchestratorsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostOrchestratorsResponse() {} + + @JsonCreator + public CostOrchestratorsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostOrchestratorsResponse data(List data) { + this.data = data; + for (CostOrchestrator item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostOrchestratorsResponse addDataItem(CostOrchestrator dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of detected container orchestrators. + * + * @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 CostOrchestratorsResponse + */ + @JsonAnySetter + public CostOrchestratorsResponse 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 CostOrchestratorsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostOrchestratorsResponse costOrchestratorsResponse = (CostOrchestratorsResponse) o; + return Objects.equals(this.data, costOrchestratorsResponse.data) + && Objects.equals( + this.additionalProperties, costOrchestratorsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostOrchestratorsResponse {\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/CostTagKeyMetadata.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadata.java new file mode 100644 index 00000000000..e601a478472 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadata.java @@ -0,0 +1,213 @@ +/* + * 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 metadata entry, aggregating coverage and example values for a + * single tag key, metric, and period. + */ +@JsonPropertyOrder({ + CostTagKeyMetadata.JSON_PROPERTY_ATTRIBUTES, + CostTagKeyMetadata.JSON_PROPERTY_ID, + CostTagKeyMetadata.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeyMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagKeyMetadataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostTagKeyMetadataType type = CostTagKeyMetadataType.COST_TAG_KEY_METADATA; + + public CostTagKeyMetadata() {} + + @JsonCreator + public CostTagKeyMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagKeyMetadataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagKeyMetadataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagKeyMetadata attributes(CostTagKeyMetadataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a Cloud Cost Management tag key metadata entry. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagKeyMetadataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagKeyMetadataAttributes attributes) { + this.attributes = attributes; + } + + public CostTagKeyMetadata id(String id) { + this.id = id; + return this; + } + + /** + * A composite identifier of the form tag_key:metric for monthly roll-ups, or + * tag_key:metric:YYYY-MM-DD when filter[daily]=true. + * + * @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 CostTagKeyMetadata type(CostTagKeyMetadataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management tag key metadata resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagKeyMetadataType getType() { + return type; + } + + public void setType(CostTagKeyMetadataType 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 CostTagKeyMetadata + */ + @JsonAnySetter + public CostTagKeyMetadata 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 CostTagKeyMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeyMetadata costTagKeyMetadata = (CostTagKeyMetadata) o; + return Objects.equals(this.attributes, costTagKeyMetadata.attributes) + && Objects.equals(this.id, costTagKeyMetadata.id) + && Objects.equals(this.type, costTagKeyMetadata.type) + && Objects.equals(this.additionalProperties, costTagKeyMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeyMetadata {\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/CostTagKeyMetadataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataAttributes.java new file mode 100644 index 00000000000..ae87a1a86bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataAttributes.java @@ -0,0 +1,349 @@ +/* + * 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; + +/** Attributes of a Cloud Cost Management tag key metadata entry. */ +@JsonPropertyOrder({ + CostTagKeyMetadataAttributes.JSON_PROPERTY_CARDINALITY_BY_ACCOUNT, + CostTagKeyMetadataAttributes.JSON_PROPERTY_COST_COVERED, + CostTagKeyMetadataAttributes.JSON_PROPERTY_DATE, + CostTagKeyMetadataAttributes.JSON_PROPERTY_METRIC, + CostTagKeyMetadataAttributes.JSON_PROPERTY_ROW_COUNT, + CostTagKeyMetadataAttributes.JSON_PROPERTY_TAG_SOURCES, + CostTagKeyMetadataAttributes.JSON_PROPERTY_TOP_VALUES_BY_ACCOUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeyMetadataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CARDINALITY_BY_ACCOUNT = "cardinality_by_account"; + private Map cardinalityByAccount = new HashMap(); + + public static final String JSON_PROPERTY_COST_COVERED = "cost_covered"; + private Double costCovered; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private String metric; + + public static final String JSON_PROPERTY_ROW_COUNT = "row_count"; + private Long rowCount; + + public static final String JSON_PROPERTY_TAG_SOURCES = "tag_sources"; + private List tagSources = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOP_VALUES_BY_ACCOUNT = "top_values_by_account"; + private Map> topValuesByAccount = new HashMap>(); + + public CostTagKeyMetadataAttributes() {} + + @JsonCreator + public CostTagKeyMetadataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CARDINALITY_BY_ACCOUNT) + Map cardinalityByAccount, + @JsonProperty(required = true, value = JSON_PROPERTY_COST_COVERED) Double costCovered, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC) String metric, + @JsonProperty(required = true, value = JSON_PROPERTY_ROW_COUNT) Long rowCount, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_SOURCES) List tagSources, + @JsonProperty(required = true, value = JSON_PROPERTY_TOP_VALUES_BY_ACCOUNT) + Map> topValuesByAccount) { + this.cardinalityByAccount = cardinalityByAccount; + this.costCovered = costCovered; + this.metric = metric; + this.rowCount = rowCount; + this.tagSources = tagSources; + this.topValuesByAccount = topValuesByAccount; + } + + public CostTagKeyMetadataAttributes cardinalityByAccount(Map cardinalityByAccount) { + this.cardinalityByAccount = cardinalityByAccount; + return this; + } + + public CostTagKeyMetadataAttributes putCardinalityByAccountItem( + String key, Long cardinalityByAccountItem) { + this.cardinalityByAccount.put(key, cardinalityByAccountItem); + return this; + } + + /** + * Number of unique tag values observed for this tag key, keyed by cloud account ID. + * + * @return cardinalityByAccount + */ + @JsonProperty(JSON_PROPERTY_CARDINALITY_BY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getCardinalityByAccount() { + return cardinalityByAccount; + } + + public void setCardinalityByAccount(Map cardinalityByAccount) { + this.cardinalityByAccount = cardinalityByAccount; + } + + public CostTagKeyMetadataAttributes costCovered(Double costCovered) { + this.costCovered = costCovered; + return this; + } + + /** + * Total cost (in the report currency) of cost line items that carry this tag key for the + * requested period. + * + * @return costCovered + */ + @JsonProperty(JSON_PROPERTY_COST_COVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getCostCovered() { + return costCovered; + } + + public void setCostCovered(Double costCovered) { + this.costCovered = costCovered; + } + + public CostTagKeyMetadataAttributes date(String date) { + this.date = date; + return this; + } + + /** + * The day this row corresponds to, in YYYY-MM-DD format. Present only when + * filter[daily]=true; omitted for the monthly roll-up returned by default. + * + * @return date + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public CostTagKeyMetadataAttributes metric(String metric) { + this.metric = metric; + return this; + } + + /** + * The Cloud Cost Management metric this row aggregates, for example aws.cost.net.amortized + * . + * + * @return metric + */ + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public CostTagKeyMetadataAttributes rowCount(Long rowCount) { + this.rowCount = rowCount; + return this; + } + + /** + * Number of cost rows that carry this tag key over the requested period. + * + * @return rowCount + */ + @JsonProperty(JSON_PROPERTY_ROW_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getRowCount() { + return rowCount; + } + + public void setRowCount(Long rowCount) { + this.rowCount = rowCount; + } + + public CostTagKeyMetadataAttributes tagSources(List tagSources) { + this.tagSources = tagSources; + return this; + } + + public CostTagKeyMetadataAttributes addTagSourcesItem(String tagSourcesItem) { + this.tagSources.add(tagSourcesItem); + return this; + } + + /** + * Origins where this tag key was observed (for example, aws-user-defined). + * + * @return tagSources + */ + @JsonProperty(JSON_PROPERTY_TAG_SOURCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTagSources() { + return tagSources; + } + + public void setTagSources(List tagSources) { + this.tagSources = tagSources; + } + + public CostTagKeyMetadataAttributes topValuesByAccount( + Map> topValuesByAccount) { + this.topValuesByAccount = topValuesByAccount; + return this; + } + + public CostTagKeyMetadataAttributes putTopValuesByAccountItem( + String key, List topValuesByAccountItem) { + this.topValuesByAccount.put(key, topValuesByAccountItem); + return this; + } + + /** + * A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + * + * @return topValuesByAccount + */ + @JsonProperty(JSON_PROPERTY_TOP_VALUES_BY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map> getTopValuesByAccount() { + return topValuesByAccount; + } + + public void setTopValuesByAccount(Map> topValuesByAccount) { + this.topValuesByAccount = topValuesByAccount; + } + + /** + * 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 CostTagKeyMetadataAttributes + */ + @JsonAnySetter + public CostTagKeyMetadataAttributes 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 CostTagKeyMetadataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeyMetadataAttributes costTagKeyMetadataAttributes = (CostTagKeyMetadataAttributes) o; + return Objects.equals( + this.cardinalityByAccount, costTagKeyMetadataAttributes.cardinalityByAccount) + && Objects.equals(this.costCovered, costTagKeyMetadataAttributes.costCovered) + && Objects.equals(this.date, costTagKeyMetadataAttributes.date) + && Objects.equals(this.metric, costTagKeyMetadataAttributes.metric) + && Objects.equals(this.rowCount, costTagKeyMetadataAttributes.rowCount) + && Objects.equals(this.tagSources, costTagKeyMetadataAttributes.tagSources) + && Objects.equals(this.topValuesByAccount, costTagKeyMetadataAttributes.topValuesByAccount) + && Objects.equals( + this.additionalProperties, costTagKeyMetadataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cardinalityByAccount, + costCovered, + date, + metric, + rowCount, + tagSources, + topValuesByAccount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeyMetadataAttributes {\n"); + sb.append(" cardinalityByAccount: ") + .append(toIndentedString(cardinalityByAccount)) + .append("\n"); + sb.append(" costCovered: ").append(toIndentedString(costCovered)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" rowCount: ").append(toIndentedString(rowCount)).append("\n"); + sb.append(" tagSources: ").append(toIndentedString(tagSources)).append("\n"); + sb.append(" topValuesByAccount: ").append(toIndentedString(topValuesByAccount)).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/CostTagKeyMetadataResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataResponse.java new file mode 100644 index 00000000000..0f6e317f719 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataResponse.java @@ -0,0 +1,155 @@ +/* + * 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 metadata entries for the requested period. */ +@JsonPropertyOrder({CostTagKeyMetadataResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeyMetadataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostTagKeyMetadataResponse() {} + + @JsonCreator + public CostTagKeyMetadataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostTagKeyMetadataResponse data(List data) { + this.data = data; + for (CostTagKeyMetadata item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostTagKeyMetadataResponse addDataItem(CostTagKeyMetadata dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of tag key metadata entries. + * + * @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 CostTagKeyMetadataResponse + */ + @JsonAnySetter + public CostTagKeyMetadataResponse 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 CostTagKeyMetadataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeyMetadataResponse costTagKeyMetadataResponse = (CostTagKeyMetadataResponse) o; + return Objects.equals(this.data, costTagKeyMetadataResponse.data) + && Objects.equals( + this.additionalProperties, costTagKeyMetadataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeyMetadataResponse {\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/CostTagKeyMetadataType.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataType.java new file mode 100644 index 00000000000..ae9d678628c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeyMetadataType.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 key metadata resource. */ +@JsonSerialize(using = CostTagKeyMetadataType.CostTagKeyMetadataTypeSerializer.class) +public class CostTagKeyMetadataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_tag_key_metadata")); + + public static final CostTagKeyMetadataType COST_TAG_KEY_METADATA = + new CostTagKeyMetadataType("cost_tag_key_metadata"); + + CostTagKeyMetadataType(String value) { + super(value, allowedValues); + } + + public static class CostTagKeyMetadataTypeSerializer + extends StdSerializer { + public CostTagKeyMetadataTypeSerializer(Class t) { + super(t); + } + + public CostTagKeyMetadataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CostTagKeyMetadataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostTagKeyMetadataType fromValue(String value) { + return new CostTagKeyMetadataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagKeySource.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySource.java new file mode 100644 index 00000000000..e9a159ea962 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySource.java @@ -0,0 +1,210 @@ +/* + * 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 paired with the sources that produced it. */ +@JsonPropertyOrder({ + CostTagKeySource.JSON_PROPERTY_ATTRIBUTES, + CostTagKeySource.JSON_PROPERTY_ID, + CostTagKeySource.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeySource { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagKeySourceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostTagKeySourceType type = CostTagKeySourceType.COST_TAG_KEY_SOURCE; + + public CostTagKeySource() {} + + @JsonCreator + public CostTagKeySource( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagKeySourceAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagKeySourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagKeySource attributes(CostTagKeySourceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a Cloud Cost Management tag source. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagKeySourceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagKeySourceAttributes attributes) { + this.attributes = attributes; + } + + public CostTagKeySource id(String id) { + this.id = id; + return this; + } + + /** + * The tag key identifier. Equal to the empty-tag sentinel __empty_tag_key__ when the + * tag key is empty. + * + * @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 CostTagKeySource type(CostTagKeySourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management tag source resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagKeySourceType getType() { + return type; + } + + public void setType(CostTagKeySourceType 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 CostTagKeySource + */ + @JsonAnySetter + public CostTagKeySource 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 CostTagKeySource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeySource costTagKeySource = (CostTagKeySource) o; + return Objects.equals(this.attributes, costTagKeySource.attributes) + && Objects.equals(this.id, costTagKeySource.id) + && Objects.equals(this.type, costTagKeySource.type) + && Objects.equals(this.additionalProperties, costTagKeySource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeySource {\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/CostTagKeySourceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourceAttributes.java new file mode 100644 index 00000000000..3dad76465b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourceAttributes.java @@ -0,0 +1,181 @@ +/* + * 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; + +/** Attributes of a Cloud Cost Management tag source. */ +@JsonPropertyOrder({ + CostTagKeySourceAttributes.JSON_PROPERTY_TAG_KEY, + CostTagKeySourceAttributes.JSON_PROPERTY_TAG_SOURCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeySourceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; + private String tagKey; + + public static final String JSON_PROPERTY_TAG_SOURCES = "tag_sources"; + private List tagSources = new ArrayList<>(); + + public CostTagKeySourceAttributes() {} + + @JsonCreator + public CostTagKeySourceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_KEY) String tagKey, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_SOURCES) List tagSources) { + this.tagKey = tagKey; + this.tagSources = tagSources; + } + + public CostTagKeySourceAttributes tagKey(String tagKey) { + this.tagKey = tagKey; + return this; + } + + /** + * The tag key name. + * + * @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 CostTagKeySourceAttributes tagSources(List tagSources) { + this.tagSources = tagSources; + return this; + } + + public CostTagKeySourceAttributes addTagSourcesItem(String tagSourcesItem) { + this.tagSources.add(tagSourcesItem); + return this; + } + + /** + * Origins where this tag key was observed (for example, aws-user-defined). + * + * @return tagSources + */ + @JsonProperty(JSON_PROPERTY_TAG_SOURCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTagSources() { + return tagSources; + } + + public void setTagSources(List tagSources) { + this.tagSources = tagSources; + } + + /** + * 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 CostTagKeySourceAttributes + */ + @JsonAnySetter + public CostTagKeySourceAttributes 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 CostTagKeySourceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeySourceAttributes costTagKeySourceAttributes = (CostTagKeySourceAttributes) o; + return Objects.equals(this.tagKey, costTagKeySourceAttributes.tagKey) + && Objects.equals(this.tagSources, costTagKeySourceAttributes.tagSources) + && Objects.equals( + this.additionalProperties, costTagKeySourceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tagKey, tagSources, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeySourceAttributes {\n"); + sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); + sb.append(" tagSources: ").append(toIndentedString(tagSources)).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/CostTagKeySourceType.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourceType.java new file mode 100644 index 00000000000..0b5bd77882c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourceType.java @@ -0,0 +1,56 @@ +/* + * 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 source resource. */ +@JsonSerialize(using = CostTagKeySourceType.CostTagKeySourceTypeSerializer.class) +public class CostTagKeySourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_tag_key_source")); + + public static final CostTagKeySourceType COST_TAG_KEY_SOURCE = + new CostTagKeySourceType("cost_tag_key_source"); + + CostTagKeySourceType(String value) { + super(value, allowedValues); + } + + public static class CostTagKeySourceTypeSerializer extends StdSerializer { + public CostTagKeySourceTypeSerializer(Class t) { + super(t); + } + + public CostTagKeySourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CostTagKeySourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostTagKeySourceType fromValue(String value) { + return new CostTagKeySourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourcesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourcesResponse.java new file mode 100644 index 00000000000..4fb83a70e8d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagKeySourcesResponse.java @@ -0,0 +1,155 @@ +/* + * 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 keys with their origin sources for the requested period. */ +@JsonPropertyOrder({CostTagKeySourcesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagKeySourcesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CostTagKeySourcesResponse() {} + + @JsonCreator + public CostTagKeySourcesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CostTagKeySourcesResponse data(List data) { + this.data = data; + for (CostTagKeySource item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostTagKeySourcesResponse addDataItem(CostTagKeySource dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of tag keys with their origin sources. + * + * @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 CostTagKeySourcesResponse + */ + @JsonAnySetter + public CostTagKeySourcesResponse 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 CostTagKeySourcesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagKeySourcesResponse costTagKeySourcesResponse = (CostTagKeySourcesResponse) o; + return Objects.equals(this.data, costTagKeySourcesResponse.data) + && Objects.equals( + this.additionalProperties, costTagKeySourcesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagKeySourcesResponse {\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/CostTagMetadataDailyFilter.java b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataDailyFilter.java new file mode 100644 index 00000000000..189e0f30bd7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataDailyFilter.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * Granularity for tag metadata results. true returns one row per day, false + * (or omitted) returns the monthly roll-up. + */ +@JsonSerialize(using = CostTagMetadataDailyFilter.CostTagMetadataDailyFilterSerializer.class) +public class CostTagMetadataDailyFilter extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("true", "false")); + + public static final CostTagMetadataDailyFilter TRUE = new CostTagMetadataDailyFilter("true"); + public static final CostTagMetadataDailyFilter FALSE = new CostTagMetadataDailyFilter("false"); + + CostTagMetadataDailyFilter(String value) { + super(value, allowedValues); + } + + public static class CostTagMetadataDailyFilterSerializer + extends StdSerializer { + public CostTagMetadataDailyFilterSerializer(Class t) { + super(t); + } + + public CostTagMetadataDailyFilterSerializer() { + this(null); + } + + @Override + public void serialize( + CostTagMetadataDailyFilter value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CostTagMetadataDailyFilter fromValue(String value) { + return new CostTagMetadataDailyFilter(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 76cb7c1d63e..578dbb42001 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 @@ -520,6 +520,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get the Cloud Cost Management billing currency returns "Bad Request" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" 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 the Cloud Cost Management billing currency returns "OK" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management AWS CUR configs returns "OK" response Given new "ListCostAWSCURConfigs" request @@ -540,12 +556,44 @@ 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 orchestrators returns "Bad Request" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" 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: List Cloud Cost Management orchestrators returns "OK" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" parameter from "REPLACE.ME" + 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 + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag key metadata returns "Bad Request" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" 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: List Cloud Cost Management tag key metadata returns "OK" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" parameter from "REPLACE.ME" + 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 keys returns "Bad Request" response Given new "ListCostTagKeys" request @@ -558,6 +606,22 @@ 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 sources returns "Bad Request" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" 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: List Cloud Cost Management tag sources returns "OK" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tags returns "Bad Request" response Given new "ListCostTags" request @@ -596,6 +660,22 @@ 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 available Cloud Cost Management metrics returns "Bad Request" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" 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: List available Cloud Cost Management metrics returns "OK" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: List budgets returns "OK" response Given new "ListBudgets" 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 7a5941a2c04..faa660d7de0 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 @@ -1609,6 +1609,36 @@ "type": "safe" } }, + "ListCostTagMetadata": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCostTagMetadataCurrency": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataMetrics": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataOrchestrators": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagKeySources": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTags": { "tag": "Cloud Cost Management", "undo": {