From 9d361f83e6f5c83b1aa672ce176c90eb47590944 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 22 Jan 2026 09:01:06 +0000 Subject: [PATCH] Regenerate client from commit 6b6d574 of spec repo --- .generator/schemas/v2/openapi.yaml | 242 ++++++++-- .../cloud-cost-management/DeleteBudget.java | 2 +- .../v2/cloud-cost-management/GetBudget.java | 6 +- .../cloud-cost-management/UpsertBudget.java | 15 +- .../cloud-cost-management/ValidateBudget.java | 69 +++ .../ValidateCsvBudget.java | 24 + .../client/v2/api/CloudCostManagementApi.java | 299 ++++++++++-- .../datadog/api/client/v2/model/Budget.java | 11 +- .../api/client/v2/model/BudgetArray.java | 16 +- .../api/client/v2/model/BudgetAttributes.java | 14 +- .../v2/model/BudgetValidationRequest.java | 136 ++++++ .../v2/model/BudgetValidationRequestData.java | 206 +++++++++ .../v2/model/BudgetValidationResponse.java | 136 ++++++ .../model/BudgetValidationResponseData.java | 209 +++++++++ ...udgetValidationResponseDataAttributes.java | 176 +++++++ .../BudgetValidationResponseDataType.java | 58 +++ .../BudgetWithEntriesDataAttributes.java | 437 ++++++++++++++++++ ...ithEntriesDataAttributesEntriesItems.java} | 57 ++- ...ttributesEntriesItemsTagFiltersItems.java} | 43 +- .../v2/model/BudgetWithEntriesDataType.java | 55 +++ .../v2/api/cloud_cost_management.feature | 42 +- .../com/datadog/api/client/v2/api/undo.json | 12 + 22 files changed, 2100 insertions(+), 165 deletions(-) create mode 100644 examples/v2/cloud-cost-management/ValidateBudget.java create mode 100644 examples/v2/cloud-cost-management/ValidateCsvBudget.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributes.java rename src/main/java/com/datadog/api/client/v2/model/{BudgetEntry.java => BudgetWithEntriesDataAttributesEntriesItems.java} (69%) rename src/main/java/com/datadog/api/client/v2/model/{TagFilter.java => BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.java} (72%) create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 39f6901f1a8..54114258533 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7197,7 +7197,10 @@ components: type: string type: description: The type of the object, must be `budget`. + example: '' type: string + required: + - type type: object BudgetArray: description: An array of budgets. @@ -7222,6 +7225,8 @@ components: items: $ref: '#/components/schemas/Budget' type: array + required: + - data type: object BudgetAttributes: description: The attributes of a budget. @@ -7241,9 +7246,8 @@ components: format: int64 type: integer entries: - description: The entries of the budget. items: - $ref: '#/components/schemas/BudgetEntry' + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItems' type: array metrics_query: description: The cost query used to track against the budget. @@ -7278,25 +7282,89 @@ components: example: 00000000-0a0a-0a0a-aaa0-00000000000a type: string type: object - BudgetEntry: - description: The entry of a budget. + BudgetValidationRequest: + example: + data: + attributes: + created_at: 1738258683590 + created_by: 00000000-0a0a-0a0a-aaa0-00000000000a + end_month: 202502 + entries: + - amount: 500 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 500 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + metrics_query: aws.cost.amortized{service:ec2} by {service} + name: my budget + org_id: 123 + start_month: 202501 + total_amount: 1000 + updated_at: 1738258683590 + updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a + id: '1' + type: budget properties: - amount: - description: The `amount` of the budget entry. - example: 500 - format: double - type: number - month: - description: The `month` of the budget entry. - example: 202501 - format: int64 - type: integer - tag_filters: - description: The `tag_filters` of the budget entry. + data: + $ref: '#/components/schemas/BudgetValidationRequestData' + type: object + BudgetValidationRequestData: + properties: + attributes: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/BudgetWithEntriesDataType' + required: + - type + type: object + BudgetValidationResponse: + example: + data: + attributes: + errors: [] + valid: true + id: budget_validation + type: budget_validation + properties: + data: + $ref: '#/components/schemas/BudgetValidationResponseData' + type: object + BudgetValidationResponseData: + properties: + attributes: + $ref: '#/components/schemas/BudgetValidationResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/BudgetValidationResponseDataType' + required: + - type + type: object + BudgetValidationResponseDataAttributes: + properties: + errors: items: - $ref: '#/components/schemas/TagFilter' + type: string type: array + valid: + type: boolean type: object + BudgetValidationResponseDataType: + default: budget_validation + description: Budget validation resource type. + enum: + - budget_validation + example: budget_validation + type: string + x-enum-varnames: + - BUDGET_VALIDATION BudgetWithEntries: description: The definition of the `BudgetWithEntries` object. properties: @@ -7314,8 +7382,71 @@ components: type: string type: description: The type of the object, must be `budget`. + example: '' + type: string + type: object + BudgetWithEntriesDataAttributes: + properties: + created_at: + format: int64 + type: integer + created_by: + type: string + end_month: + format: int64 + type: integer + entries: + items: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItems' + type: array + metrics_query: + type: string + name: + type: string + org_id: + format: int64 + type: integer + start_month: + format: int64 + type: integer + total_amount: + format: double + type: number + updated_at: + format: int64 + type: integer + updated_by: + type: string + type: object + BudgetWithEntriesDataAttributesEntriesItems: + properties: + amount: + format: double + type: number + month: + format: int64 + type: integer + tag_filters: + items: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems' + type: array + type: object + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems: + properties: + tag_key: + type: string + tag_value: type: string type: object + BudgetWithEntriesDataType: + default: budget + description: Budget resource type. + enum: + - budget + example: budget + type: string + x-enum-varnames: + - BUDGET BulkDeleteAppsDatastoreItemsRequest: description: Request to delete items from a datastore. properties: @@ -58500,18 +58631,6 @@ components: type: string x-enum-varnames: - ROW - TagFilter: - description: Tag filter for the budget's entries. - properties: - tag_key: - description: The key of the tag. - example: service - type: string - tag_value: - description: The value of the tag. - example: ec2 - type: string - type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -70382,34 +70501,69 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_write summary: Create or update a budget tags: - Cloud Cost Management + /api/v2/cost/budget/csv/validate: + post: + operationId: ValidateCsvBudget + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Validate CSV budget + tags: + - Cloud Cost Management + /api/v2/cost/budget/validate: + post: + description: Validate a budget configuration without creating or modifying it + operationId: ValidateBudget + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetValidationRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetValidationResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Validate budget + tags: + - Cloud Cost Management /api/v2/cost/budget/{budget_id}: delete: - description: Delete a budget. + description: Delete a budget operationId: DeleteBudget parameters: - $ref: '#/components/parameters/BudgetID' responses: '204': description: No Content - '400': - $ref: '#/components/responses/BadRequestResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_write - summary: Delete a budget + summary: Delete budget tags: - Cloud Cost Management get: - description: Get a budget. + description: Get a budget operationId: GetBudget parameters: - $ref: '#/components/parameters/BudgetID' @@ -70418,20 +70572,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BudgetWithEntries' + $ref: '#/components/schemas/BudgetValidationRequest' description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read - summary: Get a budget + summary: Get budget tags: - Cloud Cost Management /api/v2/cost/budgets: @@ -70450,8 +70598,6 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read summary: List budgets tags: - Cloud Cost Management diff --git a/examples/v2/cloud-cost-management/DeleteBudget.java b/examples/v2/cloud-cost-management/DeleteBudget.java index 83b92696b74..057a09ef855 100644 --- a/examples/v2/cloud-cost-management/DeleteBudget.java +++ b/examples/v2/cloud-cost-management/DeleteBudget.java @@ -1,4 +1,4 @@ -// Delete a budget returns "No Content" response +// Delete budget returns "No Content" response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/cloud-cost-management/GetBudget.java b/examples/v2/cloud-cost-management/GetBudget.java index 7a90e99f98e..759d4628345 100644 --- a/examples/v2/cloud-cost-management/GetBudget.java +++ b/examples/v2/cloud-cost-management/GetBudget.java @@ -1,9 +1,9 @@ -// Get a budget returns "OK" response +// Get budget 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.BudgetWithEntries; +import com.datadog.api.client.v2.model.BudgetValidationRequest; public class Example { public static void main(String[] args) { @@ -11,7 +11,7 @@ public static void main(String[] args) { CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); try { - BudgetWithEntries result = apiInstance.getBudget("budget_id"); + BudgetValidationRequest result = apiInstance.getBudget("budget_id"); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CloudCostManagementApi#getBudget"); diff --git a/examples/v2/cloud-cost-management/UpsertBudget.java b/examples/v2/cloud-cost-management/UpsertBudget.java index ef6db0fbd4c..91b35298d5e 100644 --- a/examples/v2/cloud-cost-management/UpsertBudget.java +++ b/examples/v2/cloud-cost-management/UpsertBudget.java @@ -4,10 +4,10 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.CloudCostManagementApi; import com.datadog.api.client.v2.model.BudgetAttributes; -import com.datadog.api.client.v2.model.BudgetEntry; import com.datadog.api.client.v2.model.BudgetWithEntries; import com.datadog.api.client.v2.model.BudgetWithEntriesData; -import com.datadog.api.client.v2.model.TagFilter; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItems; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems; import java.util.Collections; public class Example { @@ -26,14 +26,10 @@ public static void main(String[] args) { .endMonth(202502L) .entries( Collections.singletonList( - new BudgetEntry() - .amount(500.0) - .month(202501L) + new BudgetWithEntriesDataAttributesEntriesItems() .tagFilters( Collections.singletonList( - new TagFilter() - .tagKey("service") - .tagValue("ec2"))))) + new BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems())))) .metricsQuery("aws.cost.amortized{service:ec2} by {service}") .name("my budget") .orgId(123L) @@ -41,7 +37,8 @@ public static void main(String[] args) { .totalAmount(1000.0) .updatedAt(1738258683590L) .updatedBy("00000000-0a0a-0a0a-aaa0-00000000000a")) - .id("00000000-0a0a-0a0a-aaa0-00000000000a")); + .id("00000000-0a0a-0a0a-aaa0-00000000000a") + .type("")); try { BudgetWithEntries result = apiInstance.upsertBudget(body); diff --git a/examples/v2/cloud-cost-management/ValidateBudget.java b/examples/v2/cloud-cost-management/ValidateBudget.java new file mode 100644 index 00000000000..05eb6bdec9c --- /dev/null +++ b/examples/v2/cloud-cost-management/ValidateBudget.java @@ -0,0 +1,69 @@ +// Validate budget 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.BudgetValidationRequest; +import com.datadog.api.client.v2.model.BudgetValidationRequestData; +import com.datadog.api.client.v2.model.BudgetValidationResponse; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributes; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItems; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + BudgetValidationRequest body = + new BudgetValidationRequest() + .data( + new BudgetValidationRequestData() + .attributes( + new BudgetWithEntriesDataAttributes() + .createdAt(1738258683590L) + .createdBy("00000000-0a0a-0a0a-aaa0-00000000000a") + .endMonth(202502L) + .entries( + Arrays.asList( + new BudgetWithEntriesDataAttributesEntriesItems() + .amount(500.0) + .month(202501L) + .tagFilters( + Collections.singletonList( + new BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems() + .tagKey("service") + .tagValue("ec2"))), + new BudgetWithEntriesDataAttributesEntriesItems() + .amount(500.0) + .month(202502L) + .tagFilters( + Collections.singletonList( + new BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems() + .tagKey("service") + .tagValue("ec2"))))) + .metricsQuery("aws.cost.amortized{service:ec2} by {service}") + .name("my budget") + .orgId(123L) + .startMonth(202501L) + .totalAmount(1000.0) + .updatedAt(1738258683590L) + .updatedBy("00000000-0a0a-0a0a-aaa0-00000000000a")) + .id("1") + .type(BudgetWithEntriesDataType.BUDGET)); + + try { + BudgetValidationResponse result = apiInstance.validateBudget(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#validateBudget"); + 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/ValidateCsvBudget.java b/examples/v2/cloud-cost-management/ValidateCsvBudget.java new file mode 100644 index 00000000000..f84b7ba24a6 --- /dev/null +++ b/examples/v2/cloud-cost-management/ValidateCsvBudget.java @@ -0,0 +1,24 @@ +// Validate CSV budget 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.ValidationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + ValidationResponse result = apiInstance.validateCsvBudget(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#validateCsvBudget"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index 94bd17e4862..fe16ca198f5 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 @@ -16,6 +16,8 @@ import com.datadog.api.client.v2.model.AzureUCConfigPostRequest; import com.datadog.api.client.v2.model.AzureUCConfigsResponse; import com.datadog.api.client.v2.model.BudgetArray; +import com.datadog.api.client.v2.model.BudgetValidationRequest; +import com.datadog.api.client.v2.model.BudgetValidationResponse; import com.datadog.api.client.v2.model.BudgetWithEntries; import com.datadog.api.client.v2.model.CreateRulesetRequest; import com.datadog.api.client.v2.model.CustomCostsFileGetResponse; @@ -35,6 +37,7 @@ import com.datadog.api.client.v2.model.RulesetRespArray; import com.datadog.api.client.v2.model.UCConfigPair; import com.datadog.api.client.v2.model.UpdateRulesetRequest; +import com.datadog.api.client.v2.model.ValidationResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -752,7 +755,7 @@ public CompletableFuture> createTagPipelinesRulesetWith } /** - * Delete a budget. + * Delete budget. * *

See {@link #deleteBudgetWithHttpInfo}. * @@ -764,7 +767,7 @@ public void deleteBudget(String budgetId) throws ApiException { } /** - * Delete a budget. + * Delete budget. * *

See {@link #deleteBudgetWithHttpInfoAsync}. * @@ -780,7 +783,7 @@ public CompletableFuture deleteBudgetAsync(String budgetId) { } /** - * Delete a budget. + * Delete a budget * * @param budgetId Budget id. (required) * @return ApiResponse<Void> @@ -790,7 +793,6 @@ public CompletableFuture deleteBudgetAsync(String budgetId) { * Response details * Status Code Description Response Headers * 204 No Content - - * 400 Bad Request - * 429 Too many requests - * */ @@ -817,7 +819,7 @@ public ApiResponse deleteBudgetWithHttpInfo(String budgetId) throws ApiExc localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "DELETE", builder, @@ -830,7 +832,7 @@ public ApiResponse deleteBudgetWithHttpInfo(String budgetId) throws ApiExc } /** - * Delete a budget. + * Delete budget. * *

See {@link #deleteBudgetWithHttpInfo}. * @@ -865,7 +867,7 @@ public CompletableFuture> deleteBudgetWithHttpInfoAsync(String localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -1705,27 +1707,27 @@ public CompletableFuture> deleteTagPipelinesRulesetWithHttpInf } /** - * Get a budget. + * Get budget. * *

See {@link #getBudgetWithHttpInfo}. * * @param budgetId Budget id. (required) - * @return BudgetWithEntries + * @return BudgetValidationRequest * @throws ApiException if fails to make API call */ - public BudgetWithEntries getBudget(String budgetId) throws ApiException { + public BudgetValidationRequest getBudget(String budgetId) throws ApiException { return getBudgetWithHttpInfo(budgetId).getData(); } /** - * Get a budget. + * Get budget. * *

See {@link #getBudgetWithHttpInfoAsync}. * * @param budgetId Budget id. (required) - * @return CompletableFuture<BudgetWithEntries> + * @return CompletableFuture<BudgetValidationRequest> */ - public CompletableFuture getBudgetAsync(String budgetId) { + public CompletableFuture getBudgetAsync(String budgetId) { return getBudgetWithHttpInfoAsync(budgetId) .thenApply( response -> { @@ -1734,22 +1736,21 @@ public CompletableFuture getBudgetAsync(String budgetId) { } /** - * Get a budget. + * Get a budget * * @param budgetId Budget id. (required) - * @return ApiResponse<BudgetWithEntries> + * @return ApiResponse<BudgetValidationRequest> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getBudgetWithHttpInfo(String budgetId) throws ApiException { + public ApiResponse getBudgetWithHttpInfo(String budgetId) + throws ApiException { Object localVarPostBody = null; // verify the required parameter 'budgetId' is set @@ -1772,7 +1773,7 @@ public ApiResponse getBudgetWithHttpInfo(String budgetId) thr localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -1781,24 +1782,24 @@ public ApiResponse getBudgetWithHttpInfo(String budgetId) thr localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a budget. + * Get budget. * *

See {@link #getBudgetWithHttpInfo}. * * @param budgetId Budget id. (required) - * @return CompletableFuture<ApiResponse<BudgetWithEntries>> + * @return CompletableFuture<ApiResponse<BudgetValidationRequest>> */ - public CompletableFuture> getBudgetWithHttpInfoAsync( + public CompletableFuture> getBudgetWithHttpInfoAsync( String budgetId) { Object localVarPostBody = null; // verify the required parameter 'budgetId' is set if (budgetId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'budgetId' when calling getBudget")); @@ -1821,9 +1822,9 @@ public CompletableFuture> getBudgetWithHttpInfoAs localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1835,7 +1836,7 @@ public CompletableFuture> getBudgetWithHttpInfoAs localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -2712,7 +2713,7 @@ public ApiResponse listBudgetsWithHttpInfo() throws ApiException { localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -2748,7 +2749,7 @@ public CompletableFuture> listBudgetsWithHttpInfoAsync( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -4834,7 +4835,7 @@ public ApiResponse upsertBudgetWithHttpInfo(BudgetWithEntries localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PUT", builder, @@ -4880,7 +4881,7 @@ public CompletableFuture> upsertBudgetWithHttpInf localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -4897,6 +4898,242 @@ public CompletableFuture> upsertBudgetWithHttpInf new GenericType() {}); } + /** + * Validate budget. + * + *

See {@link #validateBudgetWithHttpInfo}. + * + * @param body (required) + * @return BudgetValidationResponse + * @throws ApiException if fails to make API call + */ + public BudgetValidationResponse validateBudget(BudgetValidationRequest body) throws ApiException { + return validateBudgetWithHttpInfo(body).getData(); + } + + /** + * Validate budget. + * + *

See {@link #validateBudgetWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<BudgetValidationResponse> + */ + public CompletableFuture validateBudgetAsync( + BudgetValidationRequest body) { + return validateBudgetWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Validate a budget configuration without creating or modifying it + * + * @param body (required) + * @return ApiResponse<BudgetValidationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse validateBudgetWithHttpInfo( + BudgetValidationRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling validateBudget"); + } + // create path and map variables + String localVarPath = "/api/v2/cost/budget/validate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.validateBudget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Validate budget. + * + *

See {@link #validateBudgetWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<BudgetValidationResponse>> + */ + public CompletableFuture> validateBudgetWithHttpInfoAsync( + BudgetValidationRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling validateBudget")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cost/budget/validate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.validateBudget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Validate CSV budget. + * + *

See {@link #validateCsvBudgetWithHttpInfo}. + * + * @return ValidationResponse + * @throws ApiException if fails to make API call + */ + public ValidationResponse validateCsvBudget() throws ApiException { + return validateCsvBudgetWithHttpInfo().getData(); + } + + /** + * Validate CSV budget. + * + *

See {@link #validateCsvBudgetWithHttpInfoAsync}. + * + * @return CompletableFuture<ValidationResponse> + */ + public CompletableFuture validateCsvBudgetAsync() { + return validateCsvBudgetWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @return ApiResponse<ValidationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse validateCsvBudgetWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cost/budget/csv/validate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.validateCsvBudget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Validate CSV budget. + * + *

See {@link #validateCsvBudgetWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ValidationResponse>> + */ + public CompletableFuture> validateCsvBudgetWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cost/budget/csv/validate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.validateCsvBudget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Validate query. * diff --git a/src/main/java/com/datadog/api/client/v2/model/Budget.java b/src/main/java/com/datadog/api/client/v2/model/Budget.java index ebc50e41a7d..d94cd812cc1 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Budget.java +++ b/src/main/java/com/datadog/api/client/v2/model/Budget.java @@ -8,6 +8,7 @@ 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; @@ -35,6 +36,13 @@ public class Budget { public static final String JSON_PROPERTY_TYPE = "type"; private String type; + public Budget() {} + + @JsonCreator + public Budget(@JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.type = type; + } + public Budget attributes(BudgetAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; @@ -88,9 +96,8 @@ public Budget type(String type) { * * @return type */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getType() { return type; } diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetArray.java b/src/main/java/com/datadog/api/client/v2/model/BudgetArray.java index f9f6cae7b7e..7fb48aada78 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BudgetArray.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetArray.java @@ -8,6 +8,7 @@ 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; @@ -25,7 +26,14 @@ public class BudgetArray { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private List data = null; + private List data = new ArrayList<>(); + + public BudgetArray() {} + + @JsonCreator + public BudgetArray(@JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } public BudgetArray data(List data) { this.data = data; @@ -36,9 +44,6 @@ public BudgetArray data(List data) { } public BudgetArray addDataItem(Budget dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } this.data.add(dataItem); this.unparsed |= dataItem.unparsed; return this; @@ -49,9 +54,8 @@ public BudgetArray addDataItem(Budget dataItem) { * * @return data */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getData() { return data; } diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetAttributes.java b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributes.java index 8ac06a191f7..8d8eeb7ea71 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BudgetAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributes.java @@ -46,7 +46,7 @@ public class BudgetAttributes { private Long endMonth; public static final String JSON_PROPERTY_ENTRIES = "entries"; - private List entries = null; + private List entries = null; public static final String JSON_PROPERTY_METRICS_QUERY = "metrics_query"; private String metricsQuery; @@ -132,15 +132,15 @@ public void setEndMonth(Long endMonth) { this.endMonth = endMonth; } - public BudgetAttributes entries(List entries) { + public BudgetAttributes entries(List entries) { this.entries = entries; - for (BudgetEntry item : entries) { + for (BudgetWithEntriesDataAttributesEntriesItems item : entries) { this.unparsed |= item.unparsed; } return this; } - public BudgetAttributes addEntriesItem(BudgetEntry entriesItem) { + public BudgetAttributes addEntriesItem(BudgetWithEntriesDataAttributesEntriesItems entriesItem) { if (this.entries == null) { this.entries = new ArrayList<>(); } @@ -150,18 +150,18 @@ public BudgetAttributes addEntriesItem(BudgetEntry entriesItem) { } /** - * The entries of the budget. + * Getentries * * @return entries */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENTRIES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getEntries() { + public List getEntries() { return entries; } - public void setEntries(List entries) { + public void setEntries(List entries) { this.entries = entries; } diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequest.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequest.java new file mode 100644 index 00000000000..9d89d49229d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequest.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({BudgetValidationRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetValidationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private BudgetValidationRequestData data; + + public BudgetValidationRequest data(BudgetValidationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetValidationRequestData getData() { + return data; + } + + public void setData(BudgetValidationRequestData 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 BudgetValidationRequest + */ + @JsonAnySetter + public BudgetValidationRequest 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 BudgetValidationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetValidationRequest budgetValidationRequest = (BudgetValidationRequest) o; + return Objects.equals(this.data, budgetValidationRequest.data) + && Objects.equals(this.additionalProperties, budgetValidationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetValidationRequest {\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/BudgetValidationRequestData.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequestData.java new file mode 100644 index 00000000000..6d3f08d1b58 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationRequestData.java @@ -0,0 +1,206 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + BudgetValidationRequestData.JSON_PROPERTY_ATTRIBUTES, + BudgetValidationRequestData.JSON_PROPERTY_ID, + BudgetValidationRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetValidationRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private BudgetWithEntriesDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private BudgetWithEntriesDataType type = BudgetWithEntriesDataType.BUDGET; + + public BudgetValidationRequestData() {} + + @JsonCreator + public BudgetValidationRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) BudgetWithEntriesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public BudgetValidationRequestData attributes(BudgetWithEntriesDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetWithEntriesDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(BudgetWithEntriesDataAttributes attributes) { + this.attributes = attributes; + } + + public BudgetValidationRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @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 BudgetValidationRequestData type(BudgetWithEntriesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Budget resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BudgetWithEntriesDataType getType() { + return type; + } + + public void setType(BudgetWithEntriesDataType 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 BudgetValidationRequestData + */ + @JsonAnySetter + public BudgetValidationRequestData 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 BudgetValidationRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetValidationRequestData budgetValidationRequestData = (BudgetValidationRequestData) o; + return Objects.equals(this.attributes, budgetValidationRequestData.attributes) + && Objects.equals(this.id, budgetValidationRequestData.id) + && Objects.equals(this.type, budgetValidationRequestData.type) + && Objects.equals( + this.additionalProperties, budgetValidationRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetValidationRequestData {\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/BudgetValidationResponse.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponse.java new file mode 100644 index 00000000000..59ba3de591f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponse.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({BudgetValidationResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetValidationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private BudgetValidationResponseData data; + + public BudgetValidationResponse data(BudgetValidationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetValidationResponseData getData() { + return data; + } + + public void setData(BudgetValidationResponseData 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 BudgetValidationResponse + */ + @JsonAnySetter + public BudgetValidationResponse 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 BudgetValidationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetValidationResponse budgetValidationResponse = (BudgetValidationResponse) o; + return Objects.equals(this.data, budgetValidationResponse.data) + && Objects.equals(this.additionalProperties, budgetValidationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetValidationResponse {\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/BudgetValidationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseData.java new file mode 100644 index 00000000000..426d3738b9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseData.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + BudgetValidationResponseData.JSON_PROPERTY_ATTRIBUTES, + BudgetValidationResponseData.JSON_PROPERTY_ID, + BudgetValidationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetValidationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private BudgetValidationResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private BudgetValidationResponseDataType type = + BudgetValidationResponseDataType.BUDGET_VALIDATION; + + public BudgetValidationResponseData() {} + + @JsonCreator + public BudgetValidationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + BudgetValidationResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public BudgetValidationResponseData attributes( + BudgetValidationResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetValidationResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(BudgetValidationResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public BudgetValidationResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @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 BudgetValidationResponseData type(BudgetValidationResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Budget validation resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BudgetValidationResponseDataType getType() { + return type; + } + + public void setType(BudgetValidationResponseDataType 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 BudgetValidationResponseData + */ + @JsonAnySetter + public BudgetValidationResponseData 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 BudgetValidationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetValidationResponseData budgetValidationResponseData = (BudgetValidationResponseData) o; + return Objects.equals(this.attributes, budgetValidationResponseData.attributes) + && Objects.equals(this.id, budgetValidationResponseData.id) + && Objects.equals(this.type, budgetValidationResponseData.type) + && Objects.equals( + this.additionalProperties, budgetValidationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetValidationResponseData {\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/BudgetValidationResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataAttributes.java new file mode 100644 index 00000000000..0a065556a6d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataAttributes.java @@ -0,0 +1,176 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + BudgetValidationResponseDataAttributes.JSON_PROPERTY_ERRORS, + BudgetValidationResponseDataAttributes.JSON_PROPERTY_VALID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetValidationResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = null; + + public static final String JSON_PROPERTY_VALID = "valid"; + private Boolean valid; + + public BudgetValidationResponseDataAttributes errors(List errors) { + this.errors = errors; + return this; + } + + public BudgetValidationResponseDataAttributes addErrorsItem(String errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Geterrors + * + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + public BudgetValidationResponseDataAttributes valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Getvalid + * + * @return valid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValid() { + return valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + /** + * 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 BudgetValidationResponseDataAttributes + */ + @JsonAnySetter + public BudgetValidationResponseDataAttributes 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 BudgetValidationResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetValidationResponseDataAttributes budgetValidationResponseDataAttributes = + (BudgetValidationResponseDataAttributes) o; + return Objects.equals(this.errors, budgetValidationResponseDataAttributes.errors) + && Objects.equals(this.valid, budgetValidationResponseDataAttributes.valid) + && Objects.equals( + this.additionalProperties, budgetValidationResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errors, valid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetValidationResponseDataAttributes {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).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/BudgetValidationResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataType.java new file mode 100644 index 00000000000..92365f46728 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetValidationResponseDataType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Budget validation resource type. */ +@JsonSerialize( + using = BudgetValidationResponseDataType.BudgetValidationResponseDataTypeSerializer.class) +public class BudgetValidationResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("budget_validation")); + + public static final BudgetValidationResponseDataType BUDGET_VALIDATION = + new BudgetValidationResponseDataType("budget_validation"); + + BudgetValidationResponseDataType(String value) { + super(value, allowedValues); + } + + public static class BudgetValidationResponseDataTypeSerializer + extends StdSerializer { + public BudgetValidationResponseDataTypeSerializer(Class t) { + super(t); + } + + public BudgetValidationResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + BudgetValidationResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static BudgetValidationResponseDataType fromValue(String value) { + return new BudgetValidationResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributes.java new file mode 100644 index 00000000000..1f7bea23d38 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributes.java @@ -0,0 +1,437 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + BudgetWithEntriesDataAttributes.JSON_PROPERTY_CREATED_AT, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_CREATED_BY, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_END_MONTH, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_ENTRIES, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_METRICS_QUERY, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_NAME, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_ORG_ID, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_START_MONTH, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_TOTAL_AMOUNT, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_UPDATED_AT, + BudgetWithEntriesDataAttributes.JSON_PROPERTY_UPDATED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetWithEntriesDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_END_MONTH = "end_month"; + private Long endMonth; + + public static final String JSON_PROPERTY_ENTRIES = "entries"; + private List entries = null; + + public static final String JSON_PROPERTY_METRICS_QUERY = "metrics_query"; + private String metricsQuery; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_START_MONTH = "start_month"; + private Long startMonth; + + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "total_amount"; + private Double totalAmount; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; + private String updatedBy; + + public BudgetWithEntriesDataAttributes createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * GetcreatedAt + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public BudgetWithEntriesDataAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * GetcreatedBy + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public BudgetWithEntriesDataAttributes endMonth(Long endMonth) { + this.endMonth = endMonth; + return this; + } + + /** + * GetendMonth + * + * @return endMonth + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEndMonth() { + return endMonth; + } + + public void setEndMonth(Long endMonth) { + this.endMonth = endMonth; + } + + public BudgetWithEntriesDataAttributes entries( + List entries) { + this.entries = entries; + for (BudgetWithEntriesDataAttributesEntriesItems item : entries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public BudgetWithEntriesDataAttributes addEntriesItem( + BudgetWithEntriesDataAttributesEntriesItems entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + this.unparsed |= entriesItem.unparsed; + return this; + } + + /** + * Getentries + * + * @return entries + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntries() { + return entries; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public BudgetWithEntriesDataAttributes metricsQuery(String metricsQuery) { + this.metricsQuery = metricsQuery; + return this; + } + + /** + * GetmetricsQuery + * + * @return metricsQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRICS_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetricsQuery() { + return metricsQuery; + } + + public void setMetricsQuery(String metricsQuery) { + this.metricsQuery = metricsQuery; + } + + public BudgetWithEntriesDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Getname + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BudgetWithEntriesDataAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * GetorgId + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public BudgetWithEntriesDataAttributes startMonth(Long startMonth) { + this.startMonth = startMonth; + return this; + } + + /** + * GetstartMonth + * + * @return startMonth + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartMonth() { + return startMonth; + } + + public void setStartMonth(Long startMonth) { + this.startMonth = startMonth; + } + + public BudgetWithEntriesDataAttributes totalAmount(Double totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + /** + * GettotalAmount + * + * @return totalAmount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Double totalAmount) { + this.totalAmount = totalAmount; + } + + public BudgetWithEntriesDataAttributes updatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * GetupdatedAt + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public BudgetWithEntriesDataAttributes updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * GetupdatedBy + * + * @return updatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + /** + * 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 BudgetWithEntriesDataAttributes + */ + @JsonAnySetter + public BudgetWithEntriesDataAttributes 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 BudgetWithEntriesDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetWithEntriesDataAttributes budgetWithEntriesDataAttributes = + (BudgetWithEntriesDataAttributes) o; + return Objects.equals(this.createdAt, budgetWithEntriesDataAttributes.createdAt) + && Objects.equals(this.createdBy, budgetWithEntriesDataAttributes.createdBy) + && Objects.equals(this.endMonth, budgetWithEntriesDataAttributes.endMonth) + && Objects.equals(this.entries, budgetWithEntriesDataAttributes.entries) + && Objects.equals(this.metricsQuery, budgetWithEntriesDataAttributes.metricsQuery) + && Objects.equals(this.name, budgetWithEntriesDataAttributes.name) + && Objects.equals(this.orgId, budgetWithEntriesDataAttributes.orgId) + && Objects.equals(this.startMonth, budgetWithEntriesDataAttributes.startMonth) + && Objects.equals(this.totalAmount, budgetWithEntriesDataAttributes.totalAmount) + && Objects.equals(this.updatedAt, budgetWithEntriesDataAttributes.updatedAt) + && Objects.equals(this.updatedBy, budgetWithEntriesDataAttributes.updatedBy) + && Objects.equals( + this.additionalProperties, budgetWithEntriesDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + createdBy, + endMonth, + entries, + metricsQuery, + name, + orgId, + startMonth, + totalAmount, + updatedAt, + updatedBy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetWithEntriesDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" endMonth: ").append(toIndentedString(endMonth)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" metricsQuery: ").append(toIndentedString(metricsQuery)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" startMonth: ").append(toIndentedString(startMonth)).append("\n"); + sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).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/BudgetEntry.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java similarity index 69% rename from src/main/java/com/datadog/api/client/v2/model/BudgetEntry.java rename to src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java index 445b8d6b305..efdb8d46f87 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BudgetEntry.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java @@ -18,15 +18,15 @@ import java.util.Map; import java.util.Objects; -/** The entry of a budget. */ +/** */ @JsonPropertyOrder({ - BudgetEntry.JSON_PROPERTY_AMOUNT, - BudgetEntry.JSON_PROPERTY_MONTH, - BudgetEntry.JSON_PROPERTY_TAG_FILTERS + BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_AMOUNT, + BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_MONTH, + BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_TAG_FILTERS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BudgetEntry { +public class BudgetWithEntriesDataAttributesEntriesItems { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_AMOUNT = "amount"; private Double amount; @@ -35,15 +35,15 @@ public class BudgetEntry { private Long month; public static final String JSON_PROPERTY_TAG_FILTERS = "tag_filters"; - private List tagFilters = null; + private List tagFilters = null; - public BudgetEntry amount(Double amount) { + public BudgetWithEntriesDataAttributesEntriesItems amount(Double amount) { this.amount = amount; return this; } /** - * The amount of the budget entry. + * Getamount * * @return amount */ @@ -58,13 +58,13 @@ public void setAmount(Double amount) { this.amount = amount; } - public BudgetEntry month(Long month) { + public BudgetWithEntriesDataAttributesEntriesItems month(Long month) { this.month = month; return this; } /** - * The month of the budget entry. + * Getmonth * * @return month */ @@ -79,15 +79,17 @@ public void setMonth(Long month) { this.month = month; } - public BudgetEntry tagFilters(List tagFilters) { + public BudgetWithEntriesDataAttributesEntriesItems tagFilters( + List tagFilters) { this.tagFilters = tagFilters; - for (TagFilter item : tagFilters) { + for (BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems item : tagFilters) { this.unparsed |= item.unparsed; } return this; } - public BudgetEntry addTagFiltersItem(TagFilter tagFiltersItem) { + public BudgetWithEntriesDataAttributesEntriesItems addTagFiltersItem( + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems tagFiltersItem) { if (this.tagFilters == null) { this.tagFilters = new ArrayList<>(); } @@ -97,18 +99,19 @@ public BudgetEntry addTagFiltersItem(TagFilter tagFiltersItem) { } /** - * The tag_filters of the budget entry. + * GettagFilters * * @return tagFilters */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAG_FILTERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTagFilters() { + public List getTagFilters() { return tagFilters; } - public void setTagFilters(List tagFilters) { + public void setTagFilters( + List tagFilters) { this.tagFilters = tagFilters; } @@ -124,10 +127,11 @@ public void setTagFilters(List tagFilters) { * * @param key The arbitrary key to set * @param value The associated value - * @return BudgetEntry + * @return BudgetWithEntriesDataAttributesEntriesItems */ @JsonAnySetter - public BudgetEntry putAdditionalProperty(String key, Object value) { + public BudgetWithEntriesDataAttributesEntriesItems putAdditionalProperty( + String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -158,7 +162,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this BudgetEntry object is equal to o. */ + /** Return true if this BudgetWithEntriesDataAttributesEntriesItems object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -167,11 +171,14 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BudgetEntry budgetEntry = (BudgetEntry) o; - return Objects.equals(this.amount, budgetEntry.amount) - && Objects.equals(this.month, budgetEntry.month) - && Objects.equals(this.tagFilters, budgetEntry.tagFilters) - && Objects.equals(this.additionalProperties, budgetEntry.additionalProperties); + BudgetWithEntriesDataAttributesEntriesItems budgetWithEntriesDataAttributesEntriesItems = + (BudgetWithEntriesDataAttributesEntriesItems) o; + return Objects.equals(this.amount, budgetWithEntriesDataAttributesEntriesItems.amount) + && Objects.equals(this.month, budgetWithEntriesDataAttributesEntriesItems.month) + && Objects.equals(this.tagFilters, budgetWithEntriesDataAttributesEntriesItems.tagFilters) + && Objects.equals( + this.additionalProperties, + budgetWithEntriesDataAttributesEntriesItems.additionalProperties); } @Override @@ -182,7 +189,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class BudgetEntry {\n"); + sb.append("class BudgetWithEntriesDataAttributesEntriesItems {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" month: ").append(toIndentedString(month)).append("\n"); sb.append(" tagFilters: ").append(toIndentedString(tagFilters)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TagFilter.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.java similarity index 72% rename from src/main/java/com/datadog/api/client/v2/model/TagFilter.java rename to src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.java index fc56a18c5b1..912d3513c8a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TagFilter.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.java @@ -16,11 +16,14 @@ import java.util.Map; import java.util.Objects; -/** Tag filter for the budget's entries. */ -@JsonPropertyOrder({TagFilter.JSON_PROPERTY_TAG_KEY, TagFilter.JSON_PROPERTY_TAG_VALUE}) +/** */ +@JsonPropertyOrder({ + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.JSON_PROPERTY_TAG_KEY, + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.JSON_PROPERTY_TAG_VALUE +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TagFilter { +public class BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; private String tagKey; @@ -28,13 +31,13 @@ public class TagFilter { public static final String JSON_PROPERTY_TAG_VALUE = "tag_value"; private String tagValue; - public TagFilter tagKey(String tagKey) { + public BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems tagKey(String tagKey) { this.tagKey = tagKey; return this; } /** - * The key of the tag. + * GettagKey * * @return tagKey */ @@ -49,13 +52,13 @@ public void setTagKey(String tagKey) { this.tagKey = tagKey; } - public TagFilter tagValue(String tagValue) { + public BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems tagValue(String tagValue) { this.tagValue = tagValue; return this; } /** - * The value of the tag. + * GettagValue * * @return tagValue */ @@ -82,10 +85,11 @@ public void setTagValue(String tagValue) { * * @param key The arbitrary key to set * @param value The associated value - * @return TagFilter + * @return BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems */ @JsonAnySetter - public TagFilter putAdditionalProperty(String key, Object value) { + public BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems putAdditionalProperty( + String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -116,7 +120,10 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this TagFilter object is equal to o. */ + /** + * Return true if this BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems object is equal + * to o. + */ @Override public boolean equals(Object o) { if (this == o) { @@ -125,10 +132,16 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TagFilter tagFilter = (TagFilter) o; - return Objects.equals(this.tagKey, tagFilter.tagKey) - && Objects.equals(this.tagValue, tagFilter.tagValue) - && Objects.equals(this.additionalProperties, tagFilter.additionalProperties); + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems + budgetWithEntriesDataAttributesEntriesItemsTagFiltersItems = + (BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems) o; + return Objects.equals( + this.tagKey, budgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.tagKey) + && Objects.equals( + this.tagValue, budgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.tagValue) + && Objects.equals( + this.additionalProperties, + budgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.additionalProperties); } @Override @@ -139,7 +152,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TagFilter {\n"); + sb.append("class BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems {\n"); sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); sb.append(" tagValue: ").append(toIndentedString(tagValue)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataType.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataType.java new file mode 100644 index 00000000000..cda887ce2ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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; + +/** Budget resource type. */ +@JsonSerialize(using = BudgetWithEntriesDataType.BudgetWithEntriesDataTypeSerializer.class) +public class BudgetWithEntriesDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("budget")); + + public static final BudgetWithEntriesDataType BUDGET = new BudgetWithEntriesDataType("budget"); + + BudgetWithEntriesDataType(String value) { + super(value, allowedValues); + } + + public static class BudgetWithEntriesDataTypeSerializer + extends StdSerializer { + public BudgetWithEntriesDataTypeSerializer(Class t) { + super(t); + } + + public BudgetWithEntriesDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + BudgetWithEntriesDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static BudgetWithEntriesDataType fromValue(String value) { + return new BudgetWithEntriesDataType(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 d141b80f7ba..66ccd680c23 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 @@ -70,21 +70,21 @@ Feature: Cloud Cost Management @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Not Found" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "OK" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 200 OK @@ -189,7 +189,7 @@ Feature: Cloud Cost Management Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-cost-management - Scenario: Delete a budget returns "No Content" response + Scenario: Delete budget returns "No Content" response Given new "DeleteBudget" request And request contains "budget_id" parameter from "REPLACE.ME" When the request is sent @@ -241,13 +241,6 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" - @generated @skip @team:DataDog/cloud-cost-management - Scenario: Get a budget returns "Bad Request" response - Given new "GetBudget" request - And request contains "budget_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - @team:DataDog/cloud-cost-management Scenario: Get a budget returns "Not Found" response Given new "GetBudget" request @@ -255,13 +248,6 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/cloud-cost-management - Scenario: Get a budget returns "OK" response - Given new "GetBudget" request - And request contains "budget_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - @replay-only @team:DataDog/cloud-cost-management Scenario: Get a tag pipeline ruleset returns "OK" response Given new "GetTagPipelinesRuleset" request @@ -271,6 +257,13 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "EVP Cost Tags" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get budget returns "OK" response + Given new "GetBudget" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request @@ -476,6 +469,19 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Validate CSV budget returns "OK" response + Given new "ValidateCsvBudget" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Validate budget returns "OK" response + Given new "ValidateBudget" request + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}, {"amount": 500, "month": 202502, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "1", "type": "budget"}} + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Validate query returns "OK" response Given new "ValidateQuery" 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 bfcee722b4e..192ad8f9f4c 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 @@ -1091,6 +1091,18 @@ "type": "unsafe" } }, + "ValidateCsvBudget": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ValidateBudget": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "DeleteBudget": { "tag": "Cloud Cost Management", "undo": {