From 018899f8ce9c610407a3d28d67d19fba0c6dc505 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Mar 2026 19:24:53 +0000 Subject: [PATCH] Regenerate client from commit cbe6966 of spec repo --- .generator/schemas/v1/openapi.yaml | 54 +++-- .generator/schemas/v2/openapi.yaml | 71 +++++++ .../GetUsageAttributionTypes.java | 24 +++ .../api/client/v1/api/UsageMeteringApi.java | 135 +++++++----- .../v1/model/HourlyUsageAttributionBody.java | 8 +- .../HourlyUsageAttributionUsageType.java | 8 +- .../v1/model/MonthlyUsageAttributionBody.java | 4 +- ...nthlyUsageAttributionSupportedMetrics.java | 8 +- .../model/MonthlyUsageAttributionValues.java | 6 +- .../api/client/v2/api/UsageMeteringApi.java | 113 ++++++++++ .../UsageAttributionTypesAttributes.java | 147 +++++++++++++ .../v2/model/UsageAttributionTypesBody.java | 197 ++++++++++++++++++ .../model/UsageAttributionTypesResponse.java | 137 ++++++++++++ .../v2/model/UsageAttributionTypesType.java | 57 +++++ .../com/datadog/api/client/v2/api/undo.json | 6 + .../api/client/v2/api/usage_metering.feature | 6 + 16 files changed, 889 insertions(+), 92 deletions(-) create mode 100644 examples/v2/usage-metering/GetUsageAttributionTypes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesBody.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesType.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 0d4728f9005..fa49bbeaa8c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4506,10 +4506,11 @@ components: type: array type: object HourlyUsageAttributionUsageType: - description: 'Supported products for hourly usage attribution requests. + description: 'Supported products for hourly usage attribution requests. Usage + types are in the format `_usage`. - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_ingested_spans_usage`.' + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' enum: - api_usage - apm_fargate_usage @@ -9059,7 +9060,11 @@ components: type: array type: object MonthlyUsageAttributionSupportedMetrics: - description: Supported metrics for monthly usage attribution requests. + description: 'Supported metrics for monthly usage attribution requests. Usage + types are in the format `_usage`. + + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' enum: - api_usage - api_percentage @@ -9390,10 +9395,7 @@ components: - SCA_FARGATE_PERCENTAGE - ALL MonthlyUsageAttributionValues: - description: 'Fields in Usage Summary by tag(s). - - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`.' + description: Fields in Usage Summary by tag(s). properties: api_percentage: description: The percentage of synthetic API test usage by tag(s). @@ -37274,10 +37276,7 @@ paths: code example:\n\n```\nresponse := GetHourlyUsageAttribution(start_month)\ncursor := response.metadata.pagination.next_record_id\nWHILE cursor != null BEGIN\n \ sleep(5 seconds) # Avoid running into rate limit\n response := GetHourlyUsageAttribution(start_month, - next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```\nThe - following values have been **deprecated**:\n `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`, - `llm_observability_usage`, `llm_observability_percentage`." + next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```" operationId: GetHourlyUsageAttribution parameters: - description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` @@ -37298,9 +37297,14 @@ paths: schema: format: date-time type: string - - description: 'Usage type to retrieve. The following values have been **deprecated**: + - description: 'Usage type to retrieve. Usage types are in the format `_usage`. + + Example: `infra_host_usage` - `estimated_indexed_spans_usage`, `estimated_ingested_spans_usage`.' + To obtain the complete list of active usage types that can be used to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: usage_type required: true @@ -37853,10 +37857,15 @@ paths: - description: 'Comma-separated list of usage types to return, or `*` for all usage types. - The following values have been **deprecated**: + Usage types are in the format `_usage` and `_percentage`. + + Example: `infra_host_usage,infra_host_percentage` - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`, `llm_observability_usage`, `llm_observability_percentage`.' + To obtain the complete list of usage attribution types that can be used + to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: fields required: true @@ -37868,12 +37877,15 @@ paths: required: false schema: $ref: '#/components/schemas/UsageSortDirection' - - description: 'The field to sort by. + - description: 'The field to sort by. Sort fields are in the format `_usage`. + + Example: `infra_host_usage` - The following values have been **deprecated**: + To obtain the complete list of usage attribution types that can be used + to replace - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`.' + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: sort_name required: false diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cad18a6d52a..beb68fe36ba 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -69185,6 +69185,42 @@ components: usage_type: $ref: '#/components/schemas/HourlyUsageType' type: object + UsageAttributionTypesAttributes: + description: List of usage attribution types. + properties: + values: + description: List of usage attribution types. + items: + description: A given usage type in a list. + example: infra_host + type: string + type: array + type: object + UsageAttributionTypesBody: + description: Usage attribution types data. + properties: + attributes: + $ref: '#/components/schemas/UsageAttributionTypesAttributes' + id: + description: Unique ID of the response. + type: string + type: + $ref: '#/components/schemas/UsageAttributionTypesType' + type: object + UsageAttributionTypesResponse: + description: Usage attribution types response. + properties: + data: + $ref: '#/components/schemas/UsageAttributionTypesBody' + type: object + UsageAttributionTypesType: + default: usage_attribution_types + description: Type of usage attribution types data. + enum: + - usage_attribution_types + type: string + x-enum-varnames: + - USAGE_ATTRIBUTION_TYPES UsageDataObject: description: Usage data. properties: @@ -107077,6 +107113,41 @@ paths: permissions: - usage_read - billing_read + /api/v2/usage/usage-attribution-types: + get: + description: Get usage attribution types. + operationId: GetUsageAttributionTypes + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/UsageAttributionTypesResponse' + description: OK + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + '429': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - usage_read + summary: Get usage attribution types + tags: + - Usage Metering + x-permission: + operator: OR + permissions: + - usage_read /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. diff --git a/examples/v2/usage-metering/GetUsageAttributionTypes.java b/examples/v2/usage-metering/GetUsageAttributionTypes.java new file mode 100644 index 00000000000..d9d44dbc7d4 --- /dev/null +++ b/examples/v2/usage-metering/GetUsageAttributionTypes.java @@ -0,0 +1,24 @@ +// Get usage attribution types returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.UsageMeteringApi; +import com.datadog.api.client.v2.model.UsageAttributionTypesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + UsageMeteringApi apiInstance = new UsageMeteringApi(defaultClient); + + try { + UsageAttributionTypesResponse result = apiInstance.getUsageAttributionTypes(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsageMeteringApi#getUsageAttributionTypes"); + 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/v1/api/UsageMeteringApi.java b/src/main/java/com/datadog/api/client/v1/api/UsageMeteringApi.java index bb595cc12f8..5bdf391fb33 100644 --- a/src/main/java/com/datadog/api/client/v1/api/UsageMeteringApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/UsageMeteringApi.java @@ -385,9 +385,12 @@ public GetHourlyUsageAttributionOptionalParameters includeDescendants( * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @return HourlyUsageAttributionResponse * @throws ApiException if fails to make API call */ @@ -405,9 +408,12 @@ startHr, usageType, new GetHourlyUsageAttributionOptionalParameters()) * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @return CompletableFuture<HourlyUsageAttributionResponse> */ public CompletableFuture getHourlyUsageAttributionAsync( @@ -427,9 +433,12 @@ startHr, usageType, new GetHourlyUsageAttributionOptionalParameters()) * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return HourlyUsageAttributionResponse * @throws ApiException if fails to make API call @@ -449,9 +458,12 @@ public HourlyUsageAttributionResponse getHourlyUsageAttribution( * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<HourlyUsageAttributionResponse> */ @@ -479,16 +491,16 @@ public CompletableFuture getHourlyUsageAttributi * sleep(5 seconds) # Avoid running into rate limit * response := GetHourlyUsageAttribution(start_month, next_record_id=cursor) * cursor := response.metadata.pagination.next_record_id - * END The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage, - * llm_observability_usage, llm_observability_percentage. + * END * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return ApiResponse<HourlyUsageAttributionResponse> * @throws ApiException if fails to make API call @@ -565,9 +577,12 @@ public ApiResponse getHourlyUsageAttributionWith * * @param startHr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] * for usage beginning at this hour. (required) - * @param usageType Usage type to retrieve. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. (required) + * @param usageType Usage type to retrieve. Usage types are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of active usage types that can be used to replace <usage_type> + * in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<HourlyUsageAttributionResponse>> */ @@ -1367,10 +1382,12 @@ public GetMonthlyUsageAttributionOptionalParameters sortDirection( /** * Set sortName. * - * @param sortName The field to sort by. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_indexed_spans_percentage, estimated_ingested_spans_usage, - * estimated_ingested_spans_percentage. (optional) + * @param sortName The field to sort by. Sort fields are in the format + * <usage_type>_usage. Example: infra_host_usage To obtain the + * complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (optional) * @return GetMonthlyUsageAttributionOptionalParameters */ public GetMonthlyUsageAttributionOptionalParameters sortName( @@ -1426,11 +1443,12 @@ public GetMonthlyUsageAttributionOptionalParameters includeDescendants( * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @return MonthlyUsageAttributionResponse * @throws ApiException if fails to make API call */ @@ -1450,11 +1468,12 @@ startMonth, fields, new GetMonthlyUsageAttributionOptionalParameters()) * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @return CompletableFuture<MonthlyUsageAttributionResponse> */ public CompletableFuture getMonthlyUsageAttributionAsync( @@ -1475,11 +1494,12 @@ startMonth, fields, new GetMonthlyUsageAttributionOptionalParameters()) * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return MonthlyUsageAttributionResponse * @throws ApiException if fails to make API call @@ -1500,11 +1520,12 @@ public MonthlyUsageAttributionResponse getMonthlyUsageAttribution( * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<MonthlyUsageAttributionResponse> */ @@ -1537,11 +1558,12 @@ public CompletableFuture getMonthlyUsageAttribu * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return ApiResponse<MonthlyUsageAttributionResponse> * @throws ApiException if fails to make API call @@ -1624,11 +1646,12 @@ public ApiResponse getMonthlyUsageAttributionWi * @param startMonth Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] * for usage beginning in this month. Maximum of 15 months ago. (required) * @param fields Comma-separated list of usage types to return, or * for all usage - * types. The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage - * , llm_observability_usage, llm_observability_percentage. - * (required) + * types. Usage types are in the format <usage_type>_usage and + * <usage_type>_percentage. Example: infra_host_usage,infra_host_percentage + * To obtain the complete list of usage attribution types that can be used to replace + * <usage_type> in the field names, make a request to the Get + * usage attribution types API. (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<MonthlyUsageAttributionResponse>> */ diff --git a/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionBody.java b/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionBody.java index b4a0b24ac68..5c7b9addd46 100644 --- a/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionBody.java +++ b/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionBody.java @@ -270,9 +270,11 @@ public HourlyUsageAttributionBody usageType(HourlyUsageAttributionUsageType usag } /** - * Supported products for hourly usage attribution requests. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. + * Supported products for hourly usage attribution requests. Usage types are in the format + * <usage_type>_usage. To obtain the complete list of valid usage types, make a + * request to the Get + * usage attribution types API. * * @return usageType */ diff --git a/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionUsageType.java b/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionUsageType.java index cb339447818..47919f058bc 100644 --- a/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionUsageType.java +++ b/src/main/java/com/datadog/api/client/v1/model/HourlyUsageAttributionUsageType.java @@ -19,9 +19,11 @@ import java.util.Set; /** - * Supported products for hourly usage attribution requests. The following values have been - * deprecated: estimated_indexed_spans_usage, - * estimated_ingested_spans_usage. + * Supported products for hourly usage attribution requests. Usage types are in the format + * <usage_type>_usage. To obtain the complete list of valid usage types, make a request + * to the Get + * usage attribution types API. */ @JsonSerialize( using = HourlyUsageAttributionUsageType.HourlyUsageAttributionUsageTypeSerializer.class) diff --git a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionBody.java b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionBody.java index 869756c7ef0..d1b468836fb 100644 --- a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionBody.java +++ b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionBody.java @@ -244,9 +244,7 @@ public MonthlyUsageAttributionBody values(MonthlyUsageAttributionValues values) } /** - * Fields in Usage Summary by tag(s). The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage. + * Fields in Usage Summary by tag(s). * * @return values */ diff --git a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionSupportedMetrics.java b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionSupportedMetrics.java index 314ffc9612c..bb4d5f4e78a 100644 --- a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionSupportedMetrics.java +++ b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionSupportedMetrics.java @@ -18,7 +18,13 @@ import java.util.HashSet; import java.util.Set; -/** Supported metrics for monthly usage attribution requests. */ +/** + * Supported metrics for monthly usage attribution requests. Usage types are in the format + * <usage_type>_usage. To obtain the complete list of valid usage types, make a request + * to the Get + * usage attribution types API. + */ @JsonSerialize( using = MonthlyUsageAttributionSupportedMetrics.MonthlyUsageAttributionSupportedMetricsSerializer diff --git a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionValues.java b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionValues.java index 65526a873a4..b25b6ef6825 100644 --- a/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionValues.java +++ b/src/main/java/com/datadog/api/client/v1/model/MonthlyUsageAttributionValues.java @@ -16,11 +16,7 @@ import java.util.Map; import java.util.Objects; -/** - * Fields in Usage Summary by tag(s). The following values have been deprecated: - * estimated_indexed_spans_usage, estimated_indexed_spans_percentage, - * estimated_ingested_spans_usage, estimated_ingested_spans_percentage. - */ +/** Fields in Usage Summary by tag(s). */ @JsonPropertyOrder({ MonthlyUsageAttributionValues.JSON_PROPERTY_API_PERCENTAGE, MonthlyUsageAttributionValues.JSON_PROPERTY_API_USAGE, diff --git a/src/main/java/com/datadog/api/client/v2/api/UsageMeteringApi.java b/src/main/java/com/datadog/api/client/v2/api/UsageMeteringApi.java index f1ceb3529a7..38128cc383e 100644 --- a/src/main/java/com/datadog/api/client/v2/api/UsageMeteringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/UsageMeteringApi.java @@ -12,6 +12,7 @@ import com.datadog.api.client.v2.model.ProjectedCostResponse; import com.datadog.api.client.v2.model.SortDirection; import com.datadog.api.client.v2.model.UsageApplicationSecurityMonitoringResponse; +import com.datadog.api.client.v2.model.UsageAttributionTypesResponse; import com.datadog.api.client.v2.model.UsageLambdaTracedInvocationsResponse; import com.datadog.api.client.v2.model.UsageObservabilityPipelinesResponse; import jakarta.ws.rs.client.Invocation; @@ -2412,6 +2413,118 @@ public UsageApplicationSecurityMonitoringResponse getUsageApplicationSecurityMon new GenericType() {}); } + /** + * Get usage attribution types. + * + *

See {@link #getUsageAttributionTypesWithHttpInfo}. + * + * @return UsageAttributionTypesResponse + * @throws ApiException if fails to make API call + */ + public UsageAttributionTypesResponse getUsageAttributionTypes() throws ApiException { + return getUsageAttributionTypesWithHttpInfo().getData(); + } + + /** + * Get usage attribution types. + * + *

See {@link #getUsageAttributionTypesWithHttpInfoAsync}. + * + * @return CompletableFuture<UsageAttributionTypesResponse> + */ + public CompletableFuture getUsageAttributionTypesAsync() { + return getUsageAttributionTypesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get usage attribution types. + * + * @return ApiResponse<UsageAttributionTypesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden - User is not authorized -
429 Too many requests -
+ */ + public ApiResponse getUsageAttributionTypesWithHttpInfo() + throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/usage/usage-attribution-types"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.UsageMeteringApi.getUsageAttributionTypes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json;datetime-format=rfc3339"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get usage attribution types. + * + *

See {@link #getUsageAttributionTypesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<UsageAttributionTypesResponse>> + */ + public CompletableFuture> + getUsageAttributionTypesWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/usage/usage-attribution-types"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.UsageMeteringApi.getUsageAttributionTypes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json;datetime-format=rfc3339"}, + 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 getUsageLambdaTracedInvocations. */ public static class GetUsageLambdaTracedInvocationsOptionalParameters { private OffsetDateTime endHr; diff --git a/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesAttributes.java new file mode 100644 index 00000000000..d8f6a0b5a8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesAttributes.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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 usage attribution types. */ +@JsonPropertyOrder({UsageAttributionTypesAttributes.JSON_PROPERTY_VALUES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UsageAttributionTypesAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = null; + + public UsageAttributionTypesAttributes values(List values) { + this.values = values; + return this; + } + + public UsageAttributionTypesAttributes addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * List of usage attribution types. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 UsageAttributionTypesAttributes + */ + @JsonAnySetter + public UsageAttributionTypesAttributes 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 UsageAttributionTypesAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsageAttributionTypesAttributes usageAttributionTypesAttributes = + (UsageAttributionTypesAttributes) o; + return Objects.equals(this.values, usageAttributionTypesAttributes.values) + && Objects.equals( + this.additionalProperties, usageAttributionTypesAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UsageAttributionTypesAttributes {\n"); + sb.append(" values: ").append(toIndentedString(values)).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/UsageAttributionTypesBody.java b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesBody.java new file mode 100644 index 00000000000..e9cb7f0dfa2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesBody.java @@ -0,0 +1,197 @@ +/* + * 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.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; + +/** Usage attribution types data. */ +@JsonPropertyOrder({ + UsageAttributionTypesBody.JSON_PROPERTY_ATTRIBUTES, + UsageAttributionTypesBody.JSON_PROPERTY_ID, + UsageAttributionTypesBody.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UsageAttributionTypesBody { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UsageAttributionTypesAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UsageAttributionTypesType type = UsageAttributionTypesType.USAGE_ATTRIBUTION_TYPES; + + public UsageAttributionTypesBody attributes(UsageAttributionTypesAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * List of usage attribution types. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UsageAttributionTypesAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UsageAttributionTypesAttributes attributes) { + this.attributes = attributes; + } + + public UsageAttributionTypesBody id(String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the response. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UsageAttributionTypesBody type(UsageAttributionTypesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of usage attribution types data. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UsageAttributionTypesType getType() { + return type; + } + + public void setType(UsageAttributionTypesType 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 UsageAttributionTypesBody + */ + @JsonAnySetter + public UsageAttributionTypesBody 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 UsageAttributionTypesBody object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsageAttributionTypesBody usageAttributionTypesBody = (UsageAttributionTypesBody) o; + return Objects.equals(this.attributes, usageAttributionTypesBody.attributes) + && Objects.equals(this.id, usageAttributionTypesBody.id) + && Objects.equals(this.type, usageAttributionTypesBody.type) + && Objects.equals( + this.additionalProperties, usageAttributionTypesBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UsageAttributionTypesBody {\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/UsageAttributionTypesResponse.java b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesResponse.java new file mode 100644 index 00000000000..dd149f19a22 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesResponse.java @@ -0,0 +1,137 @@ +/* + * 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.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; + +/** Usage attribution types response. */ +@JsonPropertyOrder({UsageAttributionTypesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UsageAttributionTypesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UsageAttributionTypesBody data; + + public UsageAttributionTypesResponse data(UsageAttributionTypesBody data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Usage attribution types data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UsageAttributionTypesBody getData() { + return data; + } + + public void setData(UsageAttributionTypesBody 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 UsageAttributionTypesResponse + */ + @JsonAnySetter + public UsageAttributionTypesResponse 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 UsageAttributionTypesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsageAttributionTypesResponse usageAttributionTypesResponse = (UsageAttributionTypesResponse) o; + return Objects.equals(this.data, usageAttributionTypesResponse.data) + && Objects.equals( + this.additionalProperties, usageAttributionTypesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UsageAttributionTypesResponse {\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/UsageAttributionTypesType.java b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesType.java new file mode 100644 index 00000000000..6e66197a742 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UsageAttributionTypesType.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 usage attribution types data. */ +@JsonSerialize(using = UsageAttributionTypesType.UsageAttributionTypesTypeSerializer.class) +public class UsageAttributionTypesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("usage_attribution_types")); + + public static final UsageAttributionTypesType USAGE_ATTRIBUTION_TYPES = + new UsageAttributionTypesType("usage_attribution_types"); + + UsageAttributionTypesType(String value) { + super(value, allowedValues); + } + + public static class UsageAttributionTypesTypeSerializer + extends StdSerializer { + public UsageAttributionTypesTypeSerializer(Class t) { + super(t); + } + + public UsageAttributionTypesTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UsageAttributionTypesType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UsageAttributionTypesType fromValue(String value) { + return new UsageAttributionTypesType(value); + } +} 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 09186eef673..9512abf9dfd 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 @@ -5951,6 +5951,12 @@ "type": "safe" } }, + "GetUsageAttributionTypes": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "SendInvitations": { "tag": "Users", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/usage_metering.feature b/src/test/resources/com/datadog/api/client/v2/api/usage_metering.feature index 715f443eee3..d953a11c084 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/usage_metering.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/usage_metering.feature @@ -197,6 +197,12 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/revenue-query + Scenario: Get usage attribution types returns "OK" response + Given new "GetUsageAttributionTypes" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/revenue-query Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response Given new "GetEstimatedCostByOrg" request