diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 99b25f0ac87..7696e4a9b68 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -27149,6 +27149,156 @@ components: $ref: "#/components/schemas/CustomDestinationResponseDefinition" type: array type: object + CustomForecastEntry: + description: A monthly entry of a custom budget forecast. + properties: + amount: + description: Forecast amount for the month. + example: 400 + format: double + type: number + month: + description: Month the custom forecast entry applies to, in `YYYYMM` format. + example: 202501 + format: int64 + type: integer + tag_filters: + description: Tag filters that scope this custom forecast entry to specific resources. + items: + $ref: "#/components/schemas/CustomForecastEntryTagFilter" + type: array + required: + - month + - amount + - tag_filters + type: object + CustomForecastEntryTagFilter: + description: A tag filter that scopes a custom forecast entry to specific resource tags. + properties: + tag_key: + description: The tag key to filter on. + example: service + type: string + tag_value: + description: The tag value to filter on. + example: ec2 + type: string + required: + - tag_key + - tag_value + type: object + CustomForecastResponse: + description: Response object containing the custom forecast for a budget. + properties: + data: + $ref: "#/components/schemas/CustomForecastResponseData" + required: + - data + type: object + CustomForecastResponseData: + description: Custom forecast resource wrapper in a response. + properties: + attributes: + $ref: "#/components/schemas/CustomForecastResponseDataAttributes" + id: + description: The unique identifier of the custom forecast. + example: 11111111-1111-1111-1111-111111111111 + type: string + type: + $ref: "#/components/schemas/CustomForecastType" + required: + - id + - type + - attributes + type: object + CustomForecastResponseDataAttributes: + description: Attributes of a custom forecast. + properties: + budget_uid: + description: The UUID of the budget that this custom forecast belongs to. + example: 00000000-0000-0000-0000-000000000001 + type: string + created_at: + description: Timestamp the custom forecast was created, in Unix milliseconds. + example: 1738258683590 + format: int64 + type: integer + created_by: + description: The id of the user that created the custom forecast. + example: 00000000-0a0a-0a0a-aaa0-00000000000a + type: string + entries: + description: Monthly custom forecast entries. + items: + $ref: "#/components/schemas/CustomForecastEntry" + type: array + updated_at: + description: Timestamp the custom forecast was last updated, in Unix milliseconds. + example: 1738258683590 + format: int64 + type: integer + updated_by: + description: The id of the user that last updated the custom forecast. + example: 00000000-0a0a-0a0a-aaa0-00000000000a + type: string + required: + - budget_uid + - created_at + - updated_at + - created_by + - updated_by + - entries + type: object + CustomForecastType: + default: custom_forecast + description: The type of the custom forecast resource. Must be `custom_forecast`. + enum: + - custom_forecast + example: custom_forecast + type: string + x-enum-varnames: + - CUSTOM_FORECAST + CustomForecastUpsertRequest: + description: Request body to upsert (create or replace) the custom forecast for a budget. + properties: + data: + $ref: "#/components/schemas/CustomForecastUpsertRequestData" + required: + - data + type: object + CustomForecastUpsertRequestData: + description: Custom forecast resource wrapper in an upsert request. + properties: + attributes: + $ref: "#/components/schemas/CustomForecastUpsertRequestDataAttributes" + id: + description: Unused on upsert; the resource is keyed by `budget_uid`. Send an empty string. + example: "" + type: string + type: + $ref: "#/components/schemas/CustomForecastType" + required: + - type + - attributes + type: object + CustomForecastUpsertRequestDataAttributes: + description: Attributes of a custom forecast upsert request. + properties: + budget_uid: + description: The UUID of the budget that this custom forecast belongs to. + example: 00000000-0000-0000-0000-000000000001 + type: string + entries: + description: |- + Monthly custom forecast entries. An empty list deletes any existing + custom forecast for the budget. + items: + $ref: "#/components/schemas/CustomForecastEntry" + type: array + required: + - budget_uid + - entries + type: object CustomFrameworkControl: description: Framework Control. properties: @@ -123849,6 +123999,82 @@ paths: summary: Validate CSV budget tags: - Cloud Cost Management + /api/v2/cost/budget/custom-forecast: + put: + description: |- + Create or replace the custom forecast for an existing budget. + Pass an empty `entries` list to delete the custom forecast for the budget. + operationId: UpsertCustomForecast + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + budget_uid: 00000000-0000-0000-0000-000000000001 + entries: + - amount: 400 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 450 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + id: "" + type: custom_forecast + schema: + $ref: "#/components/schemas/CustomForecastUpsertRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + budget_uid: 00000000-0000-0000-0000-000000000001 + created_at: 1738258683590 + created_by: 00000000-0a0a-0a0a-aaa0-00000000000a + entries: + - amount: 400 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 450 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + updated_at: 1738258683590 + updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a + id: 11111111-1111-1111-1111-111111111111 + type: custom_forecast + schema: + $ref: "#/components/schemas/CustomForecastResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create or replace a budget's custom forecast + tags: + - Cloud Cost Management + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/budget/validate: post: description: Validate a budget configuration without creating or modifying it @@ -123971,6 +124197,30 @@ paths: summary: Get budget tags: - Cloud Cost Management + /api/v2/cost/budget/{budget_id}/custom-forecast: + delete: + description: Delete the custom forecast for a budget. + operationId: DeleteCustomForecast + parameters: + - $ref: "#/components/parameters/BudgetID" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a budget's custom forecast + tags: + - Cloud Cost Management + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/budgets: get: description: List budgets. diff --git a/examples/v2/cloud-cost-management/DeleteCustomForecast.java b/examples/v2/cloud-cost-management/DeleteCustomForecast.java new file mode 100644 index 00000000000..5262bb779bb --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCustomForecast.java @@ -0,0 +1,23 @@ +// Delete a budget's custom forecast returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteCustomForecast", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + apiInstance.deleteCustomForecast("budget_id"); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#deleteCustomForecast"); + 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/UpsertCustomForecast.java b/examples/v2/cloud-cost-management/UpsertCustomForecast.java new file mode 100644 index 00000000000..147a5cbac34 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCustomForecast.java @@ -0,0 +1,52 @@ +// Create or replace a budget's custom forecast 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.CustomForecastEntry; +import com.datadog.api.client.v2.model.CustomForecastEntryTagFilter; +import com.datadog.api.client.v2.model.CustomForecastResponse; +import com.datadog.api.client.v2.model.CustomForecastType; +import com.datadog.api.client.v2.model.CustomForecastUpsertRequest; +import com.datadog.api.client.v2.model.CustomForecastUpsertRequestData; +import com.datadog.api.client.v2.model.CustomForecastUpsertRequestDataAttributes; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.upsertCustomForecast", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + CustomForecastUpsertRequest body = + new CustomForecastUpsertRequest() + .data( + new CustomForecastUpsertRequestData() + .attributes( + new CustomForecastUpsertRequestDataAttributes() + .budgetUid("00000000-0000-0000-0000-000000000001") + .entries( + Collections.singletonList( + new CustomForecastEntry() + .amount(400.0) + .month(202501L) + .tagFilters( + Collections.singletonList( + new CustomForecastEntryTagFilter() + .tagKey("service") + .tagValue("ec2")))))) + .id("") + .type(CustomForecastType.CUSTOM_FORECAST)); + + try { + CustomForecastResponse result = apiInstance.upsertCustomForecast(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#upsertCustomForecast"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index cc9f4472187..3b9f6b45809 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -983,6 +983,7 @@ public class ApiClient { put("v2.getCodeCoverageBranchSummary", false); put("v2.getCodeCoverageCommitSummary", false); put("v2.getRuleBasedView", false); + put("v2.deleteCustomForecast", false); put("v2.getCommitmentsCommitmentList", false); put("v2.getCommitmentsCoverageScalar", false); put("v2.getCommitmentsCoverageTimeseries", false); @@ -1000,6 +1001,7 @@ public class ApiClient { put("v2.listCostTagMetadataMonths", false); put("v2.listCostTagMetadataOrchestrators", false); put("v2.searchCostRecommendations", false); + put("v2.upsertCustomForecast", false); put("v2.createOwnershipFeedback", false); put("v2.getOwnershipEvidence", false); put("v2.getOwnershipInference", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index 5b637e02a44..303ea4da5ad 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 @@ -51,6 +51,8 @@ import com.datadog.api.client.v2.model.CustomCostsFileLineItem; import com.datadog.api.client.v2.model.CustomCostsFileListResponse; import com.datadog.api.client.v2.model.CustomCostsFileUploadResponse; +import com.datadog.api.client.v2.model.CustomForecastResponse; +import com.datadog.api.client.v2.model.CustomForecastUpsertRequest; import com.datadog.api.client.v2.model.GCPUsageCostConfigPatchRequest; import com.datadog.api.client.v2.model.GCPUsageCostConfigPostRequest; import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse; @@ -1807,6 +1809,156 @@ public CompletableFuture> deleteCustomCostsFileWithHttpInfoAsy null); } + /** + * Delete a budget's custom forecast. + * + *

See {@link #deleteCustomForecastWithHttpInfo}. + * + * @param budgetId Budget id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteCustomForecast(String budgetId) throws ApiException { + deleteCustomForecastWithHttpInfo(budgetId); + } + + /** + * Delete a budget's custom forecast. + * + *

See {@link #deleteCustomForecastWithHttpInfoAsync}. + * + * @param budgetId Budget id. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteCustomForecastAsync(String budgetId) { + return deleteCustomForecastWithHttpInfoAsync(budgetId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete the custom forecast for a budget. + * + * @param budgetId Budget id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteCustomForecastWithHttpInfo(String budgetId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteCustomForecast"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'budgetId' is set + if (budgetId == null) { + throw new ApiException( + 400, "Missing the required parameter 'budgetId' when calling deleteCustomForecast"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/budget/{budget_id}/custom-forecast" + .replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCustomForecast", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a budget's custom forecast. + * + *

See {@link #deleteCustomForecastWithHttpInfo}. + * + * @param budgetId Budget id. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCustomForecastWithHttpInfoAsync( + String budgetId) { + // Check if unstable operation is enabled + String operationId = "deleteCustomForecast"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'budgetId' is set + if (budgetId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'budgetId' when calling deleteCustomForecast")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/budget/{budget_id}/custom-forecast" + .replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCustomForecast", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete tag pipeline ruleset. * @@ -11588,6 +11740,157 @@ public CompletableFuture> upsertCostTagDescriptionByKeyWithHtt null); } + /** + * Create or replace a budget's custom forecast. + * + *

See {@link #upsertCustomForecastWithHttpInfo}. + * + * @param body (required) + * @return CustomForecastResponse + * @throws ApiException if fails to make API call + */ + public CustomForecastResponse upsertCustomForecast(CustomForecastUpsertRequest body) + throws ApiException { + return upsertCustomForecastWithHttpInfo(body).getData(); + } + + /** + * Create or replace a budget's custom forecast. + * + *

See {@link #upsertCustomForecastWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<CustomForecastResponse> + */ + public CompletableFuture upsertCustomForecastAsync( + CustomForecastUpsertRequest body) { + return upsertCustomForecastWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or replace the custom forecast for an existing budget. Pass an empty entries + * list to delete the custom forecast for the budget. + * + * @param body (required) + * @return ApiResponse<CustomForecastResponse> + * @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 upsertCustomForecastWithHttpInfo( + CustomForecastUpsertRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "upsertCustomForecast"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertCustomForecast"); + } + // create path and map variables + String localVarPath = "/api/v2/cost/budget/custom-forecast"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCustomForecast", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create or replace a budget's custom forecast. + * + *

See {@link #upsertCustomForecastWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<CustomForecastResponse>> + */ + public CompletableFuture> + upsertCustomForecastWithHttpInfoAsync(CustomForecastUpsertRequest body) { + // Check if unstable operation is enabled + String operationId = "upsertCustomForecast"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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 upsertCustomForecast")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cost/budget/custom-forecast"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCustomForecast", + 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( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Validate budget. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomForecastEntry.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastEntry.java new file mode 100644 index 00000000000..b8786162d31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastEntry.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A monthly entry of a custom budget forecast. */ +@JsonPropertyOrder({ + CustomForecastEntry.JSON_PROPERTY_AMOUNT, + CustomForecastEntry.JSON_PROPERTY_MONTH, + CustomForecastEntry.JSON_PROPERTY_TAG_FILTERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastEntry { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Double amount; + + public static final String JSON_PROPERTY_MONTH = "month"; + private Long month; + + public static final String JSON_PROPERTY_TAG_FILTERS = "tag_filters"; + private List tagFilters = new ArrayList<>(); + + public CustomForecastEntry() {} + + @JsonCreator + public CustomForecastEntry( + @JsonProperty(required = true, value = JSON_PROPERTY_AMOUNT) Double amount, + @JsonProperty(required = true, value = JSON_PROPERTY_MONTH) Long month, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_FILTERS) + List tagFilters) { + this.amount = amount; + this.month = month; + this.tagFilters = tagFilters; + } + + public CustomForecastEntry amount(Double amount) { + this.amount = amount; + return this; + } + + /** + * Forecast amount for the month. + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public CustomForecastEntry month(Long month) { + this.month = month; + return this; + } + + /** + * Month the custom forecast entry applies to, in YYYYMM format. + * + * @return month + */ + @JsonProperty(JSON_PROPERTY_MONTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMonth() { + return month; + } + + public void setMonth(Long month) { + this.month = month; + } + + public CustomForecastEntry tagFilters(List tagFilters) { + this.tagFilters = tagFilters; + for (CustomForecastEntryTagFilter item : tagFilters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CustomForecastEntry addTagFiltersItem(CustomForecastEntryTagFilter tagFiltersItem) { + this.tagFilters.add(tagFiltersItem); + this.unparsed |= tagFiltersItem.unparsed; + return this; + } + + /** + * Tag filters that scope this custom forecast entry to specific resources. + * + * @return tagFilters + */ + @JsonProperty(JSON_PROPERTY_TAG_FILTERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTagFilters() { + return tagFilters; + } + + public void setTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + } + + /** + * 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 CustomForecastEntry + */ + @JsonAnySetter + public CustomForecastEntry 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 CustomForecastEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastEntry customForecastEntry = (CustomForecastEntry) o; + return Objects.equals(this.amount, customForecastEntry.amount) + && Objects.equals(this.month, customForecastEntry.month) + && Objects.equals(this.tagFilters, customForecastEntry.tagFilters) + && Objects.equals(this.additionalProperties, customForecastEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(amount, month, tagFilters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastEntry {\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"); + 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/CustomForecastEntryTagFilter.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastEntryTagFilter.java new file mode 100644 index 00000000000..75cedfeb5ee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastEntryTagFilter.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A tag filter that scopes a custom forecast entry to specific resource tags. */ +@JsonPropertyOrder({ + CustomForecastEntryTagFilter.JSON_PROPERTY_TAG_KEY, + CustomForecastEntryTagFilter.JSON_PROPERTY_TAG_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastEntryTagFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; + private String tagKey; + + public static final String JSON_PROPERTY_TAG_VALUE = "tag_value"; + private String tagValue; + + public CustomForecastEntryTagFilter() {} + + @JsonCreator + public CustomForecastEntryTagFilter( + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_KEY) String tagKey, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_VALUE) String tagValue) { + this.tagKey = tagKey; + this.tagValue = tagValue; + } + + public CustomForecastEntryTagFilter tagKey(String tagKey) { + this.tagKey = tagKey; + return this; + } + + /** + * The tag key to filter on. + * + * @return tagKey + */ + @JsonProperty(JSON_PROPERTY_TAG_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTagKey() { + return tagKey; + } + + public void setTagKey(String tagKey) { + this.tagKey = tagKey; + } + + public CustomForecastEntryTagFilter tagValue(String tagValue) { + this.tagValue = tagValue; + return this; + } + + /** + * The tag value to filter on. + * + * @return tagValue + */ + @JsonProperty(JSON_PROPERTY_TAG_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTagValue() { + return tagValue; + } + + public void setTagValue(String tagValue) { + this.tagValue = tagValue; + } + + /** + * 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 CustomForecastEntryTagFilter + */ + @JsonAnySetter + public CustomForecastEntryTagFilter 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 CustomForecastEntryTagFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastEntryTagFilter customForecastEntryTagFilter = (CustomForecastEntryTagFilter) o; + return Objects.equals(this.tagKey, customForecastEntryTagFilter.tagKey) + && Objects.equals(this.tagValue, customForecastEntryTagFilter.tagValue) + && Objects.equals( + this.additionalProperties, customForecastEntryTagFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tagKey, tagValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastEntryTagFilter {\n"); + sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); + sb.append(" tagValue: ").append(toIndentedString(tagValue)).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/CustomForecastResponse.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponse.java new file mode 100644 index 00000000000..00a3d3501df --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response object containing the custom forecast for a budget. */ +@JsonPropertyOrder({CustomForecastResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CustomForecastResponseData data; + + public CustomForecastResponse() {} + + @JsonCreator + public CustomForecastResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CustomForecastResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CustomForecastResponse data(CustomForecastResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Custom forecast resource wrapper in a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastResponseData getData() { + return data; + } + + public void setData(CustomForecastResponseData 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 CustomForecastResponse + */ + @JsonAnySetter + public CustomForecastResponse 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 CustomForecastResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastResponse customForecastResponse = (CustomForecastResponse) o; + return Objects.equals(this.data, customForecastResponse.data) + && Objects.equals(this.additionalProperties, customForecastResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastResponse {\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/CustomForecastResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponseData.java new file mode 100644 index 00000000000..ac914929b04 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponseData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Custom forecast resource wrapper in a response. */ +@JsonPropertyOrder({ + CustomForecastResponseData.JSON_PROPERTY_ATTRIBUTES, + CustomForecastResponseData.JSON_PROPERTY_ID, + CustomForecastResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CustomForecastResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CustomForecastType type = CustomForecastType.CUSTOM_FORECAST; + + public CustomForecastResponseData() {} + + @JsonCreator + public CustomForecastResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CustomForecastResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CustomForecastType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CustomForecastResponseData attributes(CustomForecastResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a custom forecast. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CustomForecastResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public CustomForecastResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the custom forecast. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CustomForecastResponseData type(CustomForecastType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the custom forecast resource. Must be custom_forecast. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastType getType() { + return type; + } + + public void setType(CustomForecastType 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 CustomForecastResponseData + */ + @JsonAnySetter + public CustomForecastResponseData 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 CustomForecastResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastResponseData customForecastResponseData = (CustomForecastResponseData) o; + return Objects.equals(this.attributes, customForecastResponseData.attributes) + && Objects.equals(this.id, customForecastResponseData.id) + && Objects.equals(this.type, customForecastResponseData.type) + && Objects.equals( + this.additionalProperties, customForecastResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastResponseData {\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/CustomForecastResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponseDataAttributes.java new file mode 100644 index 00000000000..f51e01f23fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastResponseDataAttributes.java @@ -0,0 +1,300 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a custom forecast. */ +@JsonPropertyOrder({ + CustomForecastResponseDataAttributes.JSON_PROPERTY_BUDGET_UID, + CustomForecastResponseDataAttributes.JSON_PROPERTY_CREATED_AT, + CustomForecastResponseDataAttributes.JSON_PROPERTY_CREATED_BY, + CustomForecastResponseDataAttributes.JSON_PROPERTY_ENTRIES, + CustomForecastResponseDataAttributes.JSON_PROPERTY_UPDATED_AT, + CustomForecastResponseDataAttributes.JSON_PROPERTY_UPDATED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BUDGET_UID = "budget_uid"; + private String budgetUid; + + 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_ENTRIES = "entries"; + private List entries = new ArrayList<>(); + + 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 CustomForecastResponseDataAttributes() {} + + @JsonCreator + public CustomForecastResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_BUDGET_UID) String budgetUid, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_ENTRIES) + List entries, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) Long updatedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_BY) String updatedBy) { + this.budgetUid = budgetUid; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.entries = entries; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + public CustomForecastResponseDataAttributes budgetUid(String budgetUid) { + this.budgetUid = budgetUid; + return this; + } + + /** + * The UUID of the budget that this custom forecast belongs to. + * + * @return budgetUid + */ + @JsonProperty(JSON_PROPERTY_BUDGET_UID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBudgetUid() { + return budgetUid; + } + + public void setBudgetUid(String budgetUid) { + this.budgetUid = budgetUid; + } + + public CustomForecastResponseDataAttributes createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp the custom forecast was created, in Unix milliseconds. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public CustomForecastResponseDataAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user that created the custom forecast. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public CustomForecastResponseDataAttributes entries(List entries) { + this.entries = entries; + for (CustomForecastEntry item : entries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CustomForecastResponseDataAttributes addEntriesItem(CustomForecastEntry entriesItem) { + this.entries.add(entriesItem); + this.unparsed |= entriesItem.unparsed; + return this; + } + + /** + * Monthly custom forecast entries. + * + * @return entries + */ + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEntries() { + return entries; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public CustomForecastResponseDataAttributes updatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Timestamp the custom forecast was last updated, in Unix milliseconds. + * + * @return updatedAt + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public CustomForecastResponseDataAttributes updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * The id of the user that last updated the custom forecast. + * + * @return updatedBy + */ + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 CustomForecastResponseDataAttributes + */ + @JsonAnySetter + public CustomForecastResponseDataAttributes 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 CustomForecastResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastResponseDataAttributes customForecastResponseDataAttributes = + (CustomForecastResponseDataAttributes) o; + return Objects.equals(this.budgetUid, customForecastResponseDataAttributes.budgetUid) + && Objects.equals(this.createdAt, customForecastResponseDataAttributes.createdAt) + && Objects.equals(this.createdBy, customForecastResponseDataAttributes.createdBy) + && Objects.equals(this.entries, customForecastResponseDataAttributes.entries) + && Objects.equals(this.updatedAt, customForecastResponseDataAttributes.updatedAt) + && Objects.equals(this.updatedBy, customForecastResponseDataAttributes.updatedBy) + && Objects.equals( + this.additionalProperties, customForecastResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + budgetUid, createdAt, createdBy, entries, updatedAt, updatedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastResponseDataAttributes {\n"); + sb.append(" budgetUid: ").append(toIndentedString(budgetUid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).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/CustomForecastType.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastType.java new file mode 100644 index 00000000000..30cacc7bb6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastType.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; + +/** The type of the custom forecast resource. Must be custom_forecast. */ +@JsonSerialize(using = CustomForecastType.CustomForecastTypeSerializer.class) +public class CustomForecastType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("custom_forecast")); + + public static final CustomForecastType CUSTOM_FORECAST = + new CustomForecastType("custom_forecast"); + + CustomForecastType(String value) { + super(value, allowedValues); + } + + public static class CustomForecastTypeSerializer extends StdSerializer { + public CustomForecastTypeSerializer(Class t) { + super(t); + } + + public CustomForecastTypeSerializer() { + this(null); + } + + @Override + public void serialize(CustomForecastType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CustomForecastType fromValue(String value) { + return new CustomForecastType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequest.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequest.java new file mode 100644 index 00000000000..5c7f7643ab0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body to upsert (create or replace) the custom forecast for a budget. */ +@JsonPropertyOrder({CustomForecastUpsertRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastUpsertRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CustomForecastUpsertRequestData data; + + public CustomForecastUpsertRequest() {} + + @JsonCreator + public CustomForecastUpsertRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CustomForecastUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CustomForecastUpsertRequest data(CustomForecastUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Custom forecast resource wrapper in an upsert request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastUpsertRequestData getData() { + return data; + } + + public void setData(CustomForecastUpsertRequestData 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 CustomForecastUpsertRequest + */ + @JsonAnySetter + public CustomForecastUpsertRequest 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 CustomForecastUpsertRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastUpsertRequest customForecastUpsertRequest = (CustomForecastUpsertRequest) o; + return Objects.equals(this.data, customForecastUpsertRequest.data) + && Objects.equals( + this.additionalProperties, customForecastUpsertRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastUpsertRequest {\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/CustomForecastUpsertRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequestData.java new file mode 100644 index 00000000000..4cb496b5198 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequestData.java @@ -0,0 +1,211 @@ +/* + * 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; + +/** Custom forecast resource wrapper in an upsert request. */ +@JsonPropertyOrder({ + CustomForecastUpsertRequestData.JSON_PROPERTY_ATTRIBUTES, + CustomForecastUpsertRequestData.JSON_PROPERTY_ID, + CustomForecastUpsertRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastUpsertRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CustomForecastUpsertRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CustomForecastType type = CustomForecastType.CUSTOM_FORECAST; + + public CustomForecastUpsertRequestData() {} + + @JsonCreator + public CustomForecastUpsertRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CustomForecastUpsertRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CustomForecastType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CustomForecastUpsertRequestData attributes( + CustomForecastUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a custom forecast upsert request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastUpsertRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CustomForecastUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CustomForecastUpsertRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Unused on upsert; the resource is keyed by budget_uid. Send an empty string. + * + * @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 CustomForecastUpsertRequestData type(CustomForecastType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the custom forecast resource. Must be custom_forecast. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomForecastType getType() { + return type; + } + + public void setType(CustomForecastType 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 CustomForecastUpsertRequestData + */ + @JsonAnySetter + public CustomForecastUpsertRequestData 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 CustomForecastUpsertRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastUpsertRequestData customForecastUpsertRequestData = + (CustomForecastUpsertRequestData) o; + return Objects.equals(this.attributes, customForecastUpsertRequestData.attributes) + && Objects.equals(this.id, customForecastUpsertRequestData.id) + && Objects.equals(this.type, customForecastUpsertRequestData.type) + && Objects.equals( + this.additionalProperties, customForecastUpsertRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastUpsertRequestData {\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/CustomForecastUpsertRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequestDataAttributes.java new file mode 100644 index 00000000000..460a346dd12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomForecastUpsertRequestDataAttributes.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a custom forecast upsert request. */ +@JsonPropertyOrder({ + CustomForecastUpsertRequestDataAttributes.JSON_PROPERTY_BUDGET_UID, + CustomForecastUpsertRequestDataAttributes.JSON_PROPERTY_ENTRIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomForecastUpsertRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BUDGET_UID = "budget_uid"; + private String budgetUid; + + public static final String JSON_PROPERTY_ENTRIES = "entries"; + private List entries = new ArrayList<>(); + + public CustomForecastUpsertRequestDataAttributes() {} + + @JsonCreator + public CustomForecastUpsertRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_BUDGET_UID) String budgetUid, + @JsonProperty(required = true, value = JSON_PROPERTY_ENTRIES) + List entries) { + this.budgetUid = budgetUid; + this.entries = entries; + } + + public CustomForecastUpsertRequestDataAttributes budgetUid(String budgetUid) { + this.budgetUid = budgetUid; + return this; + } + + /** + * The UUID of the budget that this custom forecast belongs to. + * + * @return budgetUid + */ + @JsonProperty(JSON_PROPERTY_BUDGET_UID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBudgetUid() { + return budgetUid; + } + + public void setBudgetUid(String budgetUid) { + this.budgetUid = budgetUid; + } + + public CustomForecastUpsertRequestDataAttributes entries(List entries) { + this.entries = entries; + for (CustomForecastEntry item : entries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CustomForecastUpsertRequestDataAttributes addEntriesItem(CustomForecastEntry entriesItem) { + this.entries.add(entriesItem); + this.unparsed |= entriesItem.unparsed; + return this; + } + + /** + * Monthly custom forecast entries. An empty list deletes any existing custom forecast for the + * budget. + * + * @return entries + */ + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEntries() { + return entries; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * 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 CustomForecastUpsertRequestDataAttributes + */ + @JsonAnySetter + public CustomForecastUpsertRequestDataAttributes 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 CustomForecastUpsertRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomForecastUpsertRequestDataAttributes customForecastUpsertRequestDataAttributes = + (CustomForecastUpsertRequestDataAttributes) o; + return Objects.equals(this.budgetUid, customForecastUpsertRequestDataAttributes.budgetUid) + && Objects.equals(this.entries, customForecastUpsertRequestDataAttributes.entries) + && Objects.equals( + this.additionalProperties, + customForecastUpsertRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(budgetUid, entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomForecastUpsertRequestDataAttributes {\n"); + sb.append(" budgetUid: ").append(toIndentedString(budgetUid)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 535fe88d7c7..d9434ef4075 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 @@ -67,6 +67,30 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "arbitrary_rule" And the response "data.attributes.rule_name" is equal to "example-arbitrary-cost-rule" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "Bad Request" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "Not Found" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "OK" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request @@ -211,6 +235,30 @@ 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: Delete a budget's custom forecast returns "Bad Request" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a budget's custom forecast returns "No Content" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a budget's custom forecast returns "Not Found" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete budget returns "No Content" response Given new "DeleteBudget" 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 a5c43f6c0f2..00f6525933d 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 @@ -1755,6 +1755,12 @@ "type": "safe" } }, + "UpsertCustomForecast": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "ValidateBudget": { "tag": "Cloud Cost Management", "undo": { @@ -1773,6 +1779,12 @@ "type": "safe" } }, + "DeleteCustomForecast": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "ListBudgets": { "tag": "Cloud Cost Management", "undo": {