From 6c4e0696f14e916578639a67c1d1d32c1b4a2d39 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 16 Sep 2026 11:12:22 +0000 Subject: [PATCH] Regenerate client from commit 93c07d3 of spec repo --- .generator/schemas/v2/openapi.yaml | 19 +++ .../cloud-cost-management/UpsertBudget.java | 5 +- .../api/client/v2/model/BudgetAttributes.java | 36 +++++ .../client/v2/model/BudgetWithEntries.java | 34 ++++- .../v2/model/BudgetWithEntriesMeta.java | 143 ++++++++++++++++++ .../v2/api/cloud_cost_management.feature | 6 +- 6 files changed, 237 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesMeta.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 35263bfe95d..1c6fb51af7e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14099,6 +14099,13 @@ components: example: 202501 format: int64 type: integer + tags: + description: The tag keys used to group costs for the budget. + example: + - service + items: + type: string + type: array total_amount: description: The sum of all budget entries' amounts. example: 1000 @@ -14261,6 +14268,8 @@ components: properties: data: $ref: "#/components/schemas/BudgetWithEntriesData" + meta: + $ref: "#/components/schemas/BudgetWithEntriesMeta" type: object BudgetWithEntriesData: description: A budget and all its entries. @@ -14390,6 +14399,16 @@ components: type: string x-enum-varnames: - BUDGET + BudgetWithEntriesMeta: + description: Additional information about errors encountered while retrieving budget cost data. + properties: + error: + description: A user-facing explanation of why budget cost data could not be retrieved. + example: "" + type: string + required: + - error + type: object BulkDeleteAppsDatastoreItemsRequest: description: Request to delete items from a datastore. properties: diff --git a/examples/v2/cloud-cost-management/UpsertBudget.java b/examples/v2/cloud-cost-management/UpsertBudget.java index a75d4e0f66a..879030a06f0 100644 --- a/examples/v2/cloud-cost-management/UpsertBudget.java +++ b/examples/v2/cloud-cost-management/UpsertBudget.java @@ -11,6 +11,7 @@ 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 com.datadog.api.client.v2.model.BudgetWithEntriesMeta; import java.util.Collections; public class Example { @@ -51,11 +52,13 @@ public static void main(String[] args) { .name("my budget") .orgId(123L) .startMonth(202501L) + .tags(Collections.singletonList("service")) .totalAmount(1000.0) .updatedAt(1738258683590L) .updatedBy("00000000-0a0a-0a0a-aaa0-00000000000a")) .id("00000000-0a0a-0a0a-aaa0-00000000000a") - .type("")); + .type("")) + .meta(new BudgetWithEntriesMeta().error("")); try { BudgetWithEntries result = apiInstance.upsertBudget(body); 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 465085ce263..4ef66120018 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 @@ -32,6 +32,7 @@ BudgetAttributes.JSON_PROPERTY_NAME, BudgetAttributes.JSON_PROPERTY_ORG_ID, BudgetAttributes.JSON_PROPERTY_START_MONTH, + BudgetAttributes.JSON_PROPERTY_TAGS, BudgetAttributes.JSON_PROPERTY_TOTAL_AMOUNT, BudgetAttributes.JSON_PROPERTY_UPDATED_AT, BudgetAttributes.JSON_PROPERTY_UPDATED_BY @@ -76,6 +77,9 @@ public class BudgetAttributes { public static final String JSON_PROPERTY_START_MONTH = "start_month"; private Long startMonth; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "total_amount"; private Double totalAmount; @@ -364,6 +368,35 @@ public void setStartMonth(Long startMonth) { this.startMonth = startMonth; } + public BudgetAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public BudgetAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tag keys used to group costs for the budget. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + public BudgetAttributes totalAmount(Double totalAmount) { this.totalAmount = totalAmount; return this; @@ -495,6 +528,7 @@ public boolean equals(Object o) { && Objects.equals(this.name, budgetAttributes.name) && Objects.equals(this.orgId, budgetAttributes.orgId) && Objects.equals(this.startMonth, budgetAttributes.startMonth) + && Objects.equals(this.tags, budgetAttributes.tags) && Objects.equals(this.totalAmount, budgetAttributes.totalAmount) && Objects.equals(this.updatedAt, budgetAttributes.updatedAt) && Objects.equals(this.updatedBy, budgetAttributes.updatedBy) @@ -516,6 +550,7 @@ public int hashCode() { name, orgId, startMonth, + tags, totalAmount, updatedAt, updatedBy, @@ -538,6 +573,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); sb.append(" startMonth: ").append(toIndentedString(startMonth)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntries.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntries.java index 3235089309e..b21fb35cd68 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntries.java +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntries.java @@ -17,7 +17,7 @@ import java.util.Objects; /** The definition of the BudgetWithEntries object. */ -@JsonPropertyOrder({BudgetWithEntries.JSON_PROPERTY_DATA}) +@JsonPropertyOrder({BudgetWithEntries.JSON_PROPERTY_DATA, BudgetWithEntries.JSON_PROPERTY_META}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class BudgetWithEntries { @@ -25,6 +25,9 @@ public class BudgetWithEntries { public static final String JSON_PROPERTY_DATA = "data"; private BudgetWithEntriesData data; + public static final String JSON_PROPERTY_META = "meta"; + private BudgetWithEntriesMeta meta; + public BudgetWithEntries data(BudgetWithEntriesData data) { this.data = data; this.unparsed |= data.unparsed; @@ -50,6 +53,31 @@ public void setData(BudgetWithEntriesData data) { } } + public BudgetWithEntries meta(BudgetWithEntriesMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Additional information about errors encountered while retrieving budget cost data. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BudgetWithEntriesMeta getMeta() { + return meta; + } + + public void setMeta(BudgetWithEntriesMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -107,12 +135,13 @@ public boolean equals(Object o) { } BudgetWithEntries budgetWithEntries = (BudgetWithEntries) o; return Objects.equals(this.data, budgetWithEntries.data) + && Objects.equals(this.meta, budgetWithEntries.meta) && Objects.equals(this.additionalProperties, budgetWithEntries.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, additionalProperties); + return Objects.hash(data, meta, additionalProperties); } @Override @@ -120,6 +149,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BudgetWithEntries {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesMeta.java b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesMeta.java new file mode 100644 index 00000000000..f737a167a38 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BudgetWithEntriesMeta.java @@ -0,0 +1,143 @@ +/* + * 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; + +/** Additional information about errors encountered while retrieving budget cost data. */ +@JsonPropertyOrder({BudgetWithEntriesMeta.JSON_PROPERTY_ERROR}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BudgetWithEntriesMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public BudgetWithEntriesMeta() {} + + @JsonCreator + public BudgetWithEntriesMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_ERROR) String error) { + this.error = error; + } + + public BudgetWithEntriesMeta error(String error) { + this.error = error; + return this; + } + + /** + * A user-facing explanation of why budget cost data could not be retrieved. + * + * @return error + */ + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + /** + * 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 BudgetWithEntriesMeta + */ + @JsonAnySetter + public BudgetWithEntriesMeta 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 BudgetWithEntriesMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BudgetWithEntriesMeta budgetWithEntriesMeta = (BudgetWithEntriesMeta) o; + return Objects.equals(this.error, budgetWithEntriesMeta.error) + && Objects.equals(this.additionalProperties, budgetWithEntriesMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(error, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BudgetWithEntriesMeta {\n"); + sb.append(" error: ").append(toIndentedString(error)).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 aa7365ed633..205054b8a53 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 @@ -107,21 +107,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": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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, "tags": ["service"], "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}, "meta": {"error": ""}} 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": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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, "tags": ["service"], "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}, "meta": {"error": ""}} 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": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {"id": 42}, "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, "tags": ["service"], "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}, "meta": {"error": ""}} When the request is sent Then the response status is 200 OK