From 4b47c299266010e80bff85bb0ec224d801b03c9d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 5 Jun 2026 12:51:04 +0000 Subject: [PATCH] Regenerate client from commit 11ca4e2 of spec repo --- .generator/schemas/v2/openapi.yaml | 146 ++++++++- .../cloud-cost-management/UpsertBudget.java | 17 + .../client/v2/api/CloudCostManagementApi.java | 132 +++++++- .../api/client/v2/model/BudgetAttributes.java | 116 ++++++- .../v2/model/BudgetAttributesCosts.java | 261 +++++++++++++++ .../v2/model/BudgetAttributesCostsUnit.java | 273 ++++++++++++++++ ...WithEntriesDataAttributesEntriesItems.java | 31 +- ...ntriesDataAttributesEntriesItemsCosts.java | 309 ++++++++++++++++++ .../v2/api/cloud_cost_management.feature | 20 +- 9 files changed, 1292 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCosts.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCostsUnit.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsCosts.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 74b9de40104..6e1ef6826da 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12570,6 +12570,20 @@ components: BudgetAttributes: description: The attributes of a budget. properties: + costs: + $ref: "#/components/schemas/BudgetAttributesCosts" + description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested. + costs_period_end: + description: The end of the period used to compute cost data, in milliseconds since epoch. + format: int64 + type: integer + costs_period_start: + description: The start of the period used to compute cost data, in milliseconds since epoch. + format: int64 + type: integer + costs_unit: + $ref: "#/components/schemas/BudgetAttributesCostsUnit" + description: The unit used for all cost values in the response. created_at: description: The timestamp when the budget was created. example: 1738258683590 @@ -12622,6 +12636,53 @@ components: example: 00000000-0a0a-0a0a-aaa0-00000000000a type: string type: object + BudgetAttributesCosts: + description: Aggregated cost data for the budget over the requested period. + properties: + actual: + description: The total actual cost. Present only when `actual=true` is requested. + format: double + nullable: true + type: number + amount: + description: The total budgeted amount over the requested period. + format: double + nullable: true + type: number + forecast: + description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + ootb_forecast: + description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + type: object + BudgetAttributesCostsUnit: + description: The unit used for all cost values in the response. + properties: + family: + description: The unit family (for example, `currency`). + type: string + id: + description: The unique identifier for the unit. + type: string + name: + description: The full name of the unit. + type: string + plural: + description: The plural form of the unit name. + type: string + scale_factor: + description: The scale factor applied to raw cost values. + format: double + type: number + short_name: + description: The abbreviated unit name. + type: string + type: object BudgetValidationRequest: description: The request object for validating a budget configuration before creating or updating it. example: @@ -12787,6 +12848,9 @@ components: description: The budgeted amount for this entry. format: double type: number + costs: + $ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts" + description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested. month: description: The month this budget entry applies to, in YYYYMM format. format: int64 @@ -12797,6 +12861,36 @@ components: $ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems" type: array type: object + BudgetWithEntriesDataAttributesEntriesItemsCosts: + description: Cost data for a single budget entry. + properties: + actual: + description: The actual cost for this entry. Present only when `actual=true` is requested. + format: double + nullable: true + type: number + amount: + description: The budgeted amount for this entry. + format: double + nullable: true + type: number + custom_forecast: + description: |- + The custom forecast override for this entry. `null` when `forecast=true` is requested but no custom forecast has been set for this entry's month. A numeric value, including `0`, indicates an explicit custom forecast override. Omitted when `forecast=false` or the feature is not available for the organization. + format: double + nullable: true + type: number + forecast: + description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + ootb_forecast: + description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + type: object BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems: description: A tag filter used to scope a budget entry to specific resource tags. properties: @@ -116220,10 +116314,36 @@ paths: tags: - Cloud Cost Management get: - description: Get a budget + description: Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is). operationId: GetBudget parameters: - $ref: "#/components/parameters/BudgetID" + - description: When `true`, includes actual cost data in the response. + in: query + name: actual + required: false + schema: + type: boolean + - description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry. + in: query + name: forecast + required: false + schema: + type: boolean + - description: Start of the cost window in milliseconds since epoch. Must be used together with `end`. + in: query + name: start + required: false + schema: + format: int64 + type: integer + - description: End of the cost window in milliseconds since epoch. Must be used together with `start`. + in: query + name: end + required: false + schema: + format: int64 + type: integer responses: "200": content: @@ -116233,11 +116353,31 @@ paths: value: data: attributes: + costs: + actual: 850.25 + amount: 1000.0 + forecast: 1100.5 + ootb_forecast: 1100.5 + costs_period_end: 1740873600000 + costs_period_start: 1738281600000 + costs_unit: + family: currency + id: "1" + name: dollar + plural: dollars + scale_factor: 1.0 + short_name: $ created_at: 1738258683590 created_by: 00000000-0a0a-0a0a-aaa0-00000000000a end_month: 202502 entries: - amount: 500 + costs: + actual: 425.5 + amount: 500.0 + custom_forecast: + forecast: 550.25 + ootb_forecast: 550.25 month: 202501 tag_filters: - tag_key: service @@ -116254,6 +116394,10 @@ paths: schema: $ref: "#/components/schemas/BudgetWithEntries" description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" "429": $ref: "#/components/responses/TooManyRequestsResponse" security: diff --git a/examples/v2/cloud-cost-management/UpsertBudget.java b/examples/v2/cloud-cost-management/UpsertBudget.java index 91b35298d5e..30c5bde1a6b 100644 --- a/examples/v2/cloud-cost-management/UpsertBudget.java +++ b/examples/v2/cloud-cost-management/UpsertBudget.java @@ -4,9 +4,12 @@ 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.BudgetAttributesCosts; +import com.datadog.api.client.v2.model.BudgetAttributesCostsUnit; import com.datadog.api.client.v2.model.BudgetWithEntries; import com.datadog.api.client.v2.model.BudgetWithEntriesData; import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItems; +import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsCosts; import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems; import java.util.Collections; @@ -21,12 +24,26 @@ public static void main(String[] args) { new BudgetWithEntriesData() .attributes( new BudgetAttributes() + .costs( + new BudgetAttributesCosts() + .actual(null) + .amount(null) + .forecast(null) + .ootbForecast(null)) + .costsUnit(new BudgetAttributesCostsUnit()) .createdAt(1738258683590L) .createdBy("00000000-0a0a-0a0a-aaa0-00000000000a") .endMonth(202502L) .entries( Collections.singletonList( new BudgetWithEntriesDataAttributesEntriesItems() + .costs( + new BudgetWithEntriesDataAttributesEntriesItemsCosts() + .actual(null) + .amount(null) + .customForecast(null) + .forecast(null) + .ootbForecast(null)) .tagFilters( Collections.singletonList( new BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems())))) 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 27c0d3e2f8d..c2254b0101d 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 @@ -2084,6 +2084,62 @@ public CompletableFuture generateCostTagDesc new GenericType() {}); } + /** Manage optional parameters to getBudget. */ + public static class GetBudgetOptionalParameters { + private Boolean actual; + private Boolean forecast; + private Long start; + private Long end; + + /** + * Set actual. + * + * @param actual When true, includes actual cost data in the response. (optional) + * @return GetBudgetOptionalParameters + */ + public GetBudgetOptionalParameters actual(Boolean actual) { + this.actual = actual; + return this; + } + + /** + * Set forecast. + * + * @param forecast When true, includes forecast cost data in the response, + * including ootb_forecast and custom_forecast per entry. + * (optional) + * @return GetBudgetOptionalParameters + */ + public GetBudgetOptionalParameters forecast(Boolean forecast) { + this.forecast = forecast; + return this; + } + + /** + * Set start. + * + * @param start Start of the cost window in milliseconds since epoch. Must be used together with + * end. (optional) + * @return GetBudgetOptionalParameters + */ + public GetBudgetOptionalParameters start(Long start) { + this.start = start; + return this; + } + + /** + * Set end. + * + * @param end End of the cost window in milliseconds since epoch. Must be used together with + * start. (optional) + * @return GetBudgetOptionalParameters + */ + public GetBudgetOptionalParameters end(Long end) { + this.end = end; + return this; + } + } + /** * Get budget. * @@ -2094,7 +2150,7 @@ public CompletableFuture generateCostTagDesc * @throws ApiException if fails to make API call */ public BudgetWithEntries getBudget(String budgetId) throws ApiException { - return getBudgetWithHttpInfo(budgetId).getData(); + return getBudgetWithHttpInfo(budgetId, new GetBudgetOptionalParameters()).getData(); } /** @@ -2106,7 +2162,40 @@ public BudgetWithEntries getBudget(String budgetId) throws ApiException { * @return CompletableFuture<BudgetWithEntries> */ public CompletableFuture getBudgetAsync(String budgetId) { - return getBudgetWithHttpInfoAsync(budgetId) + return getBudgetWithHttpInfoAsync(budgetId, new GetBudgetOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get budget. + * + *

See {@link #getBudgetWithHttpInfo}. + * + * @param budgetId Budget id. (required) + * @param parameters Optional parameters for the request. + * @return BudgetWithEntries + * @throws ApiException if fails to make API call + */ + public BudgetWithEntries getBudget(String budgetId, GetBudgetOptionalParameters parameters) + throws ApiException { + return getBudgetWithHttpInfo(budgetId, parameters).getData(); + } + + /** + * Get budget. + * + *

See {@link #getBudgetWithHttpInfoAsync}. + * + * @param budgetId Budget id. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<BudgetWithEntries> + */ + public CompletableFuture getBudgetAsync( + String budgetId, GetBudgetOptionalParameters parameters) { + return getBudgetWithHttpInfoAsync(budgetId, parameters) .thenApply( response -> { return response.getData(); @@ -2114,9 +2203,14 @@ public CompletableFuture getBudgetAsync(String budgetId) { } /** - * Get a budget + * Get a budget by ID. Pass actual=true or forecast=true to include cost + * data in the response. Use start and end (millisecond epochs, both + * required) to set the cost window. When forecast=true, each entry also includes + * ootb_forecast (the ML forecast before overrides) and custom_forecast + * (null if no override is set, a number if one is). * * @param budgetId Budget id. (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<BudgetWithEntries> * @throws ApiException if fails to make API call * @http.response.details @@ -2124,10 +2218,13 @@ public CompletableFuture getBudgetAsync(String budgetId) { * 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, GetBudgetOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'budgetId' is set @@ -2135,18 +2232,28 @@ public ApiResponse getBudgetWithHttpInfo(String budgetId) thr throw new ApiException( 400, "Missing the required parameter 'budgetId' when calling getBudget"); } + Boolean actual = parameters.actual; + Boolean forecast = parameters.forecast; + Long start = parameters.start; + Long end = parameters.end; // create path and map variables String localVarPath = "/api/v2/cost/budget/{budget_id}" .replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "actual", actual)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "forecast", forecast)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + Invocation.Builder builder = apiClient.createBuilder( "v2.CloudCostManagementApi.getBudget", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -2168,10 +2275,11 @@ public ApiResponse getBudgetWithHttpInfo(String budgetId) thr *

See {@link #getBudgetWithHttpInfo}. * * @param budgetId Budget id. (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<BudgetWithEntries>> */ public CompletableFuture> getBudgetWithHttpInfoAsync( - String budgetId) { + String budgetId, GetBudgetOptionalParameters parameters) { Object localVarPostBody = null; // verify the required parameter 'budgetId' is set @@ -2182,20 +2290,30 @@ public CompletableFuture> getBudgetWithHttpInfoAs 400, "Missing the required parameter 'budgetId' when calling getBudget")); return result; } + Boolean actual = parameters.actual; + Boolean forecast = parameters.forecast; + Long start = parameters.start; + Long end = parameters.end; // create path and map variables String localVarPath = "/api/v2/cost/budget/{budget_id}" .replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "actual", actual)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "forecast", forecast)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( "v2.CloudCostManagementApi.getBudget", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, 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 e8f169b5eeb..858a980a416 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 @@ -20,6 +20,10 @@ /** The attributes of a budget. */ @JsonPropertyOrder({ + BudgetAttributes.JSON_PROPERTY_COSTS, + BudgetAttributes.JSON_PROPERTY_COSTS_PERIOD_END, + BudgetAttributes.JSON_PROPERTY_COSTS_PERIOD_START, + BudgetAttributes.JSON_PROPERTY_COSTS_UNIT, BudgetAttributes.JSON_PROPERTY_CREATED_AT, BudgetAttributes.JSON_PROPERTY_CREATED_BY, BudgetAttributes.JSON_PROPERTY_END_MONTH, @@ -36,6 +40,18 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class BudgetAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COSTS = "costs"; + private BudgetAttributesCosts costs; + + public static final String JSON_PROPERTY_COSTS_PERIOD_END = "costs_period_end"; + private Long costsPeriodEnd; + + public static final String JSON_PROPERTY_COSTS_PERIOD_START = "costs_period_start"; + private Long costsPeriodStart; + + public static final String JSON_PROPERTY_COSTS_UNIT = "costs_unit"; + private BudgetAttributesCostsUnit costsUnit; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private Long createdAt; @@ -69,6 +85,92 @@ public class BudgetAttributes { public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; private String updatedBy; + public BudgetAttributes costs(BudgetAttributesCosts costs) { + this.costs = costs; + this.unparsed |= costs.unparsed; + return this; + } + + /** + * Aggregated cost data for the budget over the requested period. + * + * @return costs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetAttributesCosts getCosts() { + return costs; + } + + public void setCosts(BudgetAttributesCosts costs) { + this.costs = costs; + } + + public BudgetAttributes costsPeriodEnd(Long costsPeriodEnd) { + this.costsPeriodEnd = costsPeriodEnd; + return this; + } + + /** + * The end of the period used to compute cost data, in milliseconds since epoch. + * + * @return costsPeriodEnd + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COSTS_PERIOD_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCostsPeriodEnd() { + return costsPeriodEnd; + } + + public void setCostsPeriodEnd(Long costsPeriodEnd) { + this.costsPeriodEnd = costsPeriodEnd; + } + + public BudgetAttributes costsPeriodStart(Long costsPeriodStart) { + this.costsPeriodStart = costsPeriodStart; + return this; + } + + /** + * The start of the period used to compute cost data, in milliseconds since epoch. + * + * @return costsPeriodStart + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COSTS_PERIOD_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCostsPeriodStart() { + return costsPeriodStart; + } + + public void setCostsPeriodStart(Long costsPeriodStart) { + this.costsPeriodStart = costsPeriodStart; + } + + public BudgetAttributes costsUnit(BudgetAttributesCostsUnit costsUnit) { + this.costsUnit = costsUnit; + this.unparsed |= costsUnit.unparsed; + return this; + } + + /** + * The unit used for all cost values in the response. + * + * @return costsUnit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COSTS_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetAttributesCostsUnit getCostsUnit() { + return costsUnit; + } + + public void setCostsUnit(BudgetAttributesCostsUnit costsUnit) { + this.costsUnit = costsUnit; + } + public BudgetAttributes createdAt(Long createdAt) { this.createdAt = createdAt; return this; @@ -368,7 +470,11 @@ public boolean equals(Object o) { return false; } BudgetAttributes budgetAttributes = (BudgetAttributes) o; - return Objects.equals(this.createdAt, budgetAttributes.createdAt) + return Objects.equals(this.costs, budgetAttributes.costs) + && Objects.equals(this.costsPeriodEnd, budgetAttributes.costsPeriodEnd) + && Objects.equals(this.costsPeriodStart, budgetAttributes.costsPeriodStart) + && Objects.equals(this.costsUnit, budgetAttributes.costsUnit) + && Objects.equals(this.createdAt, budgetAttributes.createdAt) && Objects.equals(this.createdBy, budgetAttributes.createdBy) && Objects.equals(this.endMonth, budgetAttributes.endMonth) && Objects.equals(this.entries, budgetAttributes.entries) @@ -385,6 +491,10 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + costs, + costsPeriodEnd, + costsPeriodStart, + costsUnit, createdAt, createdBy, endMonth, @@ -403,6 +513,10 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BudgetAttributes {\n"); + sb.append(" costs: ").append(toIndentedString(costs)).append("\n"); + sb.append(" costsPeriodEnd: ").append(toIndentedString(costsPeriodEnd)).append("\n"); + sb.append(" costsPeriodStart: ").append(toIndentedString(costsPeriodStart)).append("\n"); + sb.append(" costsUnit: ").append(toIndentedString(costsUnit)).append("\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"); diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCosts.java b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCosts.java new file mode 100644 index 00000000000..720a74dcb9a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCosts.java @@ -0,0 +1,261 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Aggregated cost data for the budget over the requested period. */ +@JsonPropertyOrder({ + BudgetAttributesCosts.JSON_PROPERTY_ACTUAL, + BudgetAttributesCosts.JSON_PROPERTY_AMOUNT, + BudgetAttributesCosts.JSON_PROPERTY_FORECAST, + BudgetAttributesCosts.JSON_PROPERTY_OOTB_FORECAST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetAttributesCosts { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTUAL = "actual"; + private JsonNullable actual = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private JsonNullable amount = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_FORECAST = "forecast"; + private JsonNullable forecast = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OOTB_FORECAST = "ootb_forecast"; + private JsonNullable ootbForecast = JsonNullable.undefined(); + + public BudgetAttributesCosts actual(Double actual) { + this.actual = JsonNullable.of(actual); + return this; + } + + /** + * The total actual cost. Present only when actual=true is requested. + * + * @return actual + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getActual() { + return actual.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ACTUAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getActual_JsonNullable() { + return actual; + } + + @JsonProperty(JSON_PROPERTY_ACTUAL) + public void setActual_JsonNullable(JsonNullable actual) { + this.actual = actual; + } + + public void setActual(Double actual) { + this.actual = JsonNullable.of(actual); + } + + public BudgetAttributesCosts amount(Double amount) { + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * The total budgeted amount over the requested period. + * + * @return amount + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getAmount() { + return amount.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAmount_JsonNullable() { + return amount; + } + + @JsonProperty(JSON_PROPERTY_AMOUNT) + public void setAmount_JsonNullable(JsonNullable amount) { + this.amount = amount; + } + + public void setAmount(Double amount) { + this.amount = JsonNullable.of(amount); + } + + public BudgetAttributesCosts forecast(Double forecast) { + this.forecast = JsonNullable.of(forecast); + return this; + } + + /** + * The total forecast cost, with any custom forecast overrides applied. Present only when + * forecast=true is requested. + * + * @return forecast + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getForecast() { + return forecast.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FORECAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getForecast_JsonNullable() { + return forecast; + } + + @JsonProperty(JSON_PROPERTY_FORECAST) + public void setForecast_JsonNullable(JsonNullable forecast) { + this.forecast = forecast; + } + + public void setForecast(Double forecast) { + this.forecast = JsonNullable.of(forecast); + } + + public BudgetAttributesCosts ootbForecast(Double ootbForecast) { + this.ootbForecast = JsonNullable.of(ootbForecast); + return this; + } + + /** + * The out-of-the-box ML forecast before custom overrides. Present only when forecast=true + * is requested. + * + * @return ootbForecast + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getOotbForecast() { + return ootbForecast.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OOTB_FORECAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getOotbForecast_JsonNullable() { + return ootbForecast; + } + + @JsonProperty(JSON_PROPERTY_OOTB_FORECAST) + public void setOotbForecast_JsonNullable(JsonNullable ootbForecast) { + this.ootbForecast = ootbForecast; + } + + public void setOotbForecast(Double ootbForecast) { + this.ootbForecast = JsonNullable.of(ootbForecast); + } + + /** + * 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 BudgetAttributesCosts + */ + @JsonAnySetter + public BudgetAttributesCosts 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 BudgetAttributesCosts object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetAttributesCosts budgetAttributesCosts = (BudgetAttributesCosts) o; + return Objects.equals(this.actual, budgetAttributesCosts.actual) + && Objects.equals(this.amount, budgetAttributesCosts.amount) + && Objects.equals(this.forecast, budgetAttributesCosts.forecast) + && Objects.equals(this.ootbForecast, budgetAttributesCosts.ootbForecast) + && Objects.equals(this.additionalProperties, budgetAttributesCosts.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(actual, amount, forecast, ootbForecast, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetAttributesCosts {\n"); + sb.append(" actual: ").append(toIndentedString(actual)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" forecast: ").append(toIndentedString(forecast)).append("\n"); + sb.append(" ootbForecast: ").append(toIndentedString(ootbForecast)).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/BudgetAttributesCostsUnit.java b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCostsUnit.java new file mode 100644 index 00000000000..04429537ea7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetAttributesCostsUnit.java @@ -0,0 +1,273 @@ +/* + * 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; + +/** The unit used for all cost values in the response. */ +@JsonPropertyOrder({ + BudgetAttributesCostsUnit.JSON_PROPERTY_FAMILY, + BudgetAttributesCostsUnit.JSON_PROPERTY_ID, + BudgetAttributesCostsUnit.JSON_PROPERTY_NAME, + BudgetAttributesCostsUnit.JSON_PROPERTY_PLURAL, + BudgetAttributesCostsUnit.JSON_PROPERTY_SCALE_FACTOR, + BudgetAttributesCostsUnit.JSON_PROPERTY_SHORT_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetAttributesCostsUnit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAMILY = "family"; + private String family; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PLURAL = "plural"; + private String plural; + + public static final String JSON_PROPERTY_SCALE_FACTOR = "scale_factor"; + private Double scaleFactor; + + public static final String JSON_PROPERTY_SHORT_NAME = "short_name"; + private String shortName; + + public BudgetAttributesCostsUnit family(String family) { + this.family = family; + return this; + } + + /** + * The unit family (for example, currency). + * + * @return family + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + public BudgetAttributesCostsUnit id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for the unit. + * + * @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 BudgetAttributesCostsUnit name(String name) { + this.name = name; + return this; + } + + /** + * The full name of the unit. + * + * @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 BudgetAttributesCostsUnit plural(String plural) { + this.plural = plural; + return this; + } + + /** + * The plural form of the unit name. + * + * @return plural + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLURAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlural() { + return plural; + } + + public void setPlural(String plural) { + this.plural = plural; + } + + public BudgetAttributesCostsUnit scaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + return this; + } + + /** + * The scale factor applied to raw cost values. + * + * @return scaleFactor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCALE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getScaleFactor() { + return scaleFactor; + } + + public void setScaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + } + + public BudgetAttributesCostsUnit shortName(String shortName) { + this.shortName = shortName; + return this; + } + + /** + * The abbreviated unit name. + * + * @return shortName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + /** + * 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 BudgetAttributesCostsUnit + */ + @JsonAnySetter + public BudgetAttributesCostsUnit 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 BudgetAttributesCostsUnit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetAttributesCostsUnit budgetAttributesCostsUnit = (BudgetAttributesCostsUnit) o; + return Objects.equals(this.family, budgetAttributesCostsUnit.family) + && Objects.equals(this.id, budgetAttributesCostsUnit.id) + && Objects.equals(this.name, budgetAttributesCostsUnit.name) + && Objects.equals(this.plural, budgetAttributesCostsUnit.plural) + && Objects.equals(this.scaleFactor, budgetAttributesCostsUnit.scaleFactor) + && Objects.equals(this.shortName, budgetAttributesCostsUnit.shortName) + && Objects.equals( + this.additionalProperties, budgetAttributesCostsUnit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(family, id, name, plural, scaleFactor, shortName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetAttributesCostsUnit {\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" plural: ").append(toIndentedString(plural)).append("\n"); + sb.append(" scaleFactor: ").append(toIndentedString(scaleFactor)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).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/BudgetWithEntriesDataAttributesEntriesItems.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java index 230751968c0..50792d8ee94 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItems.java @@ -24,6 +24,7 @@ */ @JsonPropertyOrder({ BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_AMOUNT, + BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_COSTS, BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_MONTH, BudgetWithEntriesDataAttributesEntriesItems.JSON_PROPERTY_TAG_FILTERS }) @@ -34,6 +35,9 @@ public class BudgetWithEntriesDataAttributesEntriesItems { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Double amount; + public static final String JSON_PROPERTY_COSTS = "costs"; + private BudgetWithEntriesDataAttributesEntriesItemsCosts costs; + public static final String JSON_PROPERTY_MONTH = "month"; private Long month; @@ -61,6 +65,29 @@ public void setAmount(Double amount) { this.amount = amount; } + public BudgetWithEntriesDataAttributesEntriesItems costs( + BudgetWithEntriesDataAttributesEntriesItemsCosts costs) { + this.costs = costs; + this.unparsed |= costs.unparsed; + return this; + } + + /** + * Cost data for a single budget entry. + * + * @return costs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetWithEntriesDataAttributesEntriesItemsCosts getCosts() { + return costs; + } + + public void setCosts(BudgetWithEntriesDataAttributesEntriesItemsCosts costs) { + this.costs = costs; + } + public BudgetWithEntriesDataAttributesEntriesItems month(Long month) { this.month = month; return this; @@ -177,6 +204,7 @@ public boolean equals(Object o) { BudgetWithEntriesDataAttributesEntriesItems budgetWithEntriesDataAttributesEntriesItems = (BudgetWithEntriesDataAttributesEntriesItems) o; return Objects.equals(this.amount, budgetWithEntriesDataAttributesEntriesItems.amount) + && Objects.equals(this.costs, budgetWithEntriesDataAttributesEntriesItems.costs) && Objects.equals(this.month, budgetWithEntriesDataAttributesEntriesItems.month) && Objects.equals(this.tagFilters, budgetWithEntriesDataAttributesEntriesItems.tagFilters) && Objects.equals( @@ -186,7 +214,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(amount, month, tagFilters, additionalProperties); + return Objects.hash(amount, costs, month, tagFilters, additionalProperties); } @Override @@ -194,6 +222,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BudgetWithEntriesDataAttributesEntriesItems {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" costs: ").append(toIndentedString(costs)).append("\n"); sb.append(" month: ").append(toIndentedString(month)).append("\n"); sb.append(" tagFilters: ").append(toIndentedString(tagFilters)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsCosts.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsCosts.java new file mode 100644 index 00000000000..12dd702e3e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesDataAttributesEntriesItemsCosts.java @@ -0,0 +1,309 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Cost data for a single budget entry. */ +@JsonPropertyOrder({ + BudgetWithEntriesDataAttributesEntriesItemsCosts.JSON_PROPERTY_ACTUAL, + BudgetWithEntriesDataAttributesEntriesItemsCosts.JSON_PROPERTY_AMOUNT, + BudgetWithEntriesDataAttributesEntriesItemsCosts.JSON_PROPERTY_CUSTOM_FORECAST, + BudgetWithEntriesDataAttributesEntriesItemsCosts.JSON_PROPERTY_FORECAST, + BudgetWithEntriesDataAttributesEntriesItemsCosts.JSON_PROPERTY_OOTB_FORECAST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetWithEntriesDataAttributesEntriesItemsCosts { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTUAL = "actual"; + private JsonNullable actual = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private JsonNullable amount = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CUSTOM_FORECAST = "custom_forecast"; + private JsonNullable customForecast = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_FORECAST = "forecast"; + private JsonNullable forecast = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OOTB_FORECAST = "ootb_forecast"; + private JsonNullable ootbForecast = JsonNullable.undefined(); + + public BudgetWithEntriesDataAttributesEntriesItemsCosts actual(Double actual) { + this.actual = JsonNullable.of(actual); + return this; + } + + /** + * The actual cost for this entry. Present only when actual=true is requested. + * + * @return actual + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getActual() { + return actual.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ACTUAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getActual_JsonNullable() { + return actual; + } + + @JsonProperty(JSON_PROPERTY_ACTUAL) + public void setActual_JsonNullable(JsonNullable actual) { + this.actual = actual; + } + + public void setActual(Double actual) { + this.actual = JsonNullable.of(actual); + } + + public BudgetWithEntriesDataAttributesEntriesItemsCosts amount(Double amount) { + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * The budgeted amount for this entry. + * + * @return amount + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getAmount() { + return amount.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAmount_JsonNullable() { + return amount; + } + + @JsonProperty(JSON_PROPERTY_AMOUNT) + public void setAmount_JsonNullable(JsonNullable amount) { + this.amount = amount; + } + + public void setAmount(Double amount) { + this.amount = JsonNullable.of(amount); + } + + public BudgetWithEntriesDataAttributesEntriesItemsCosts customForecast(Double customForecast) { + this.customForecast = JsonNullable.of(customForecast); + return this; + } + + /** + * The custom forecast override for this entry. null when forecast=true + * is requested but no custom forecast has been set for this entry's month. A numeric value, + * including 0, indicates an explicit custom forecast override. Omitted when + * forecast=false or the feature is not available for the organization. + * + * @return customForecast + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getCustomForecast() { + return customForecast.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FORECAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCustomForecast_JsonNullable() { + return customForecast; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FORECAST) + public void setCustomForecast_JsonNullable(JsonNullable customForecast) { + this.customForecast = customForecast; + } + + public void setCustomForecast(Double customForecast) { + this.customForecast = JsonNullable.of(customForecast); + } + + public BudgetWithEntriesDataAttributesEntriesItemsCosts forecast(Double forecast) { + this.forecast = JsonNullable.of(forecast); + return this; + } + + /** + * The final forecast for this entry, with any custom forecast override applied. Present only when + * forecast=true is requested. + * + * @return forecast + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getForecast() { + return forecast.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FORECAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getForecast_JsonNullable() { + return forecast; + } + + @JsonProperty(JSON_PROPERTY_FORECAST) + public void setForecast_JsonNullable(JsonNullable forecast) { + this.forecast = forecast; + } + + public void setForecast(Double forecast) { + this.forecast = JsonNullable.of(forecast); + } + + public BudgetWithEntriesDataAttributesEntriesItemsCosts ootbForecast(Double ootbForecast) { + this.ootbForecast = JsonNullable.of(ootbForecast); + return this; + } + + /** + * The out-of-the-box ML forecast for this entry, before custom overrides. Present only when + * forecast=true is requested. + * + * @return ootbForecast + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getOotbForecast() { + return ootbForecast.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OOTB_FORECAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getOotbForecast_JsonNullable() { + return ootbForecast; + } + + @JsonProperty(JSON_PROPERTY_OOTB_FORECAST) + public void setOotbForecast_JsonNullable(JsonNullable ootbForecast) { + this.ootbForecast = ootbForecast; + } + + public void setOotbForecast(Double ootbForecast) { + this.ootbForecast = JsonNullable.of(ootbForecast); + } + + /** + * 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 BudgetWithEntriesDataAttributesEntriesItemsCosts + */ + @JsonAnySetter + public BudgetWithEntriesDataAttributesEntriesItemsCosts 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 BudgetWithEntriesDataAttributesEntriesItemsCosts object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetWithEntriesDataAttributesEntriesItemsCosts + budgetWithEntriesDataAttributesEntriesItemsCosts = + (BudgetWithEntriesDataAttributesEntriesItemsCosts) o; + return Objects.equals(this.actual, budgetWithEntriesDataAttributesEntriesItemsCosts.actual) + && Objects.equals(this.amount, budgetWithEntriesDataAttributesEntriesItemsCosts.amount) + && Objects.equals( + this.customForecast, budgetWithEntriesDataAttributesEntriesItemsCosts.customForecast) + && Objects.equals(this.forecast, budgetWithEntriesDataAttributesEntriesItemsCosts.forecast) + && Objects.equals( + this.ootbForecast, budgetWithEntriesDataAttributesEntriesItemsCosts.ootbForecast) + && Objects.equals( + this.additionalProperties, + budgetWithEntriesDataAttributesEntriesItemsCosts.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + actual, amount, customForecast, forecast, ootbForecast, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetWithEntriesDataAttributesEntriesItemsCosts {\n"); + sb.append(" actual: ").append(toIndentedString(actual)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" customForecast: ").append(toIndentedString(customForecast)).append("\n"); + sb.append(" forecast: ").append(toIndentedString(forecast)).append("\n"); + sb.append(" ootbForecast: ").append(toIndentedString(ootbForecast)).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..42cf91400a3 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": [{"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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "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": [{"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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "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": [{"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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "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 @@ -336,6 +336,20 @@ 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 "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 + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get budget returns "Not Found" response + Given new "GetBudget" 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: Get budget returns "OK" response Given new "GetBudget" request