Skip to content

Commit 9487085

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d54d6be of spec repo
1 parent 741abb2 commit 9487085

5 files changed

Lines changed: 193 additions & 6 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14261,6 +14261,8 @@ components:
1426114261
properties:
1426214262
data:
1426314263
$ref: "#/components/schemas/BudgetWithEntriesData"
14264+
meta:
14265+
$ref: "#/components/schemas/BudgetWithEntriesMeta"
1426414266
type: object
1426514267
BudgetWithEntriesData:
1426614268
description: A budget and all its entries.
@@ -14390,6 +14392,16 @@ components:
1439014392
type: string
1439114393
x-enum-varnames:
1439214394
- BUDGET
14395+
BudgetWithEntriesMeta:
14396+
description: Additional information about errors encountered while retrieving budget cost data.
14397+
properties:
14398+
error:
14399+
description: A user-facing explanation of why budget cost data could not be retrieved.
14400+
example: ""
14401+
type: string
14402+
required:
14403+
- error
14404+
type: object
1439314405
BulkDeleteAppsDatastoreItemsRequest:
1439414406
description: Request to delete items from a datastore.
1439514407
properties:

examples/v2/cloud-cost-management/UpsertBudget.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItems;
1212
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsCosts;
1313
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems;
14+
import com.datadog.api.client.v2.model.BudgetWithEntriesMeta;
1415
import java.util.Collections;
1516

1617
public class Example {
@@ -55,7 +56,8 @@ public static void main(String[] args) {
5556
.updatedAt(1738258683590L)
5657
.updatedBy("00000000-0a0a-0a0a-aaa0-00000000000a"))
5758
.id("00000000-0a0a-0a0a-aaa0-00000000000a")
58-
.type(""));
59+
.type(""))
60+
.meta(new BudgetWithEntriesMeta().error(""));
5961

6062
try {
6163
BudgetWithEntries result = apiInstance.upsertBudget(body);

src/main/java/com/datadog/api/client/v2/model/BudgetWithEntries.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717
import java.util.Objects;
1818

1919
/** The definition of the <code>BudgetWithEntries</code> object. */
20-
@JsonPropertyOrder({BudgetWithEntries.JSON_PROPERTY_DATA})
20+
@JsonPropertyOrder({BudgetWithEntries.JSON_PROPERTY_DATA, BudgetWithEntries.JSON_PROPERTY_META})
2121
@jakarta.annotation.Generated(
2222
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
2323
public class BudgetWithEntries {
2424
@JsonIgnore public boolean unparsed = false;
2525
public static final String JSON_PROPERTY_DATA = "data";
2626
private BudgetWithEntriesData data;
2727

28+
public static final String JSON_PROPERTY_META = "meta";
29+
private BudgetWithEntriesMeta meta;
30+
2831
public BudgetWithEntries data(BudgetWithEntriesData data) {
2932
this.data = data;
3033
this.unparsed |= data.unparsed;
@@ -50,6 +53,31 @@ public void setData(BudgetWithEntriesData data) {
5053
}
5154
}
5255

56+
public BudgetWithEntries meta(BudgetWithEntriesMeta meta) {
57+
this.meta = meta;
58+
this.unparsed |= meta.unparsed;
59+
return this;
60+
}
61+
62+
/**
63+
* Additional information about errors encountered while retrieving budget cost data.
64+
*
65+
* @return meta
66+
*/
67+
@jakarta.annotation.Nullable
68+
@JsonProperty(JSON_PROPERTY_META)
69+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
70+
public BudgetWithEntriesMeta getMeta() {
71+
return meta;
72+
}
73+
74+
public void setMeta(BudgetWithEntriesMeta meta) {
75+
this.meta = meta;
76+
if (meta != null) {
77+
this.unparsed |= meta.unparsed;
78+
}
79+
}
80+
5381
/**
5482
* A container for additional, undeclared properties. This is a holder for any undeclared
5583
* properties as specified with the 'additionalProperties' keyword in the OAS document.
@@ -107,19 +135,21 @@ public boolean equals(Object o) {
107135
}
108136
BudgetWithEntries budgetWithEntries = (BudgetWithEntries) o;
109137
return Objects.equals(this.data, budgetWithEntries.data)
138+
&& Objects.equals(this.meta, budgetWithEntries.meta)
110139
&& Objects.equals(this.additionalProperties, budgetWithEntries.additionalProperties);
111140
}
112141

113142
@Override
114143
public int hashCode() {
115-
return Objects.hash(data, additionalProperties);
144+
return Objects.hash(data, meta, additionalProperties);
116145
}
117146

118147
@Override
119148
public String toString() {
120149
StringBuilder sb = new StringBuilder();
121150
sb.append("class BudgetWithEntries {\n");
122151
sb.append(" data: ").append(toIndentedString(data)).append("\n");
152+
sb.append(" meta: ").append(toIndentedString(meta)).append("\n");
123153
sb.append(" additionalProperties: ")
124154
.append(toIndentedString(additionalProperties))
125155
.append("\n");
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
10+
import com.fasterxml.jackson.annotation.JsonAnySetter;
11+
import com.fasterxml.jackson.annotation.JsonCreator;
12+
import com.fasterxml.jackson.annotation.JsonIgnore;
13+
import com.fasterxml.jackson.annotation.JsonInclude;
14+
import com.fasterxml.jackson.annotation.JsonProperty;
15+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
16+
import java.util.HashMap;
17+
import java.util.Map;
18+
import java.util.Objects;
19+
20+
/** Additional information about errors encountered while retrieving budget cost data. */
21+
@JsonPropertyOrder({BudgetWithEntriesMeta.JSON_PROPERTY_ERROR})
22+
@jakarta.annotation.Generated(
23+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
24+
public class BudgetWithEntriesMeta {
25+
@JsonIgnore public boolean unparsed = false;
26+
public static final String JSON_PROPERTY_ERROR = "error";
27+
private String error;
28+
29+
public BudgetWithEntriesMeta() {}
30+
31+
@JsonCreator
32+
public BudgetWithEntriesMeta(
33+
@JsonProperty(required = true, value = JSON_PROPERTY_ERROR) String error) {
34+
this.error = error;
35+
}
36+
37+
public BudgetWithEntriesMeta error(String error) {
38+
this.error = error;
39+
return this;
40+
}
41+
42+
/**
43+
* A user-facing explanation of why budget cost data could not be retrieved.
44+
*
45+
* @return error
46+
*/
47+
@JsonProperty(JSON_PROPERTY_ERROR)
48+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
49+
public String getError() {
50+
return error;
51+
}
52+
53+
public void setError(String error) {
54+
this.error = error;
55+
}
56+
57+
/**
58+
* A container for additional, undeclared properties. This is a holder for any undeclared
59+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
60+
*/
61+
private Map<String, Object> additionalProperties;
62+
63+
/**
64+
* Set the additional (undeclared) property with the specified name and value. If the property
65+
* does not already exist, create it otherwise replace it.
66+
*
67+
* @param key The arbitrary key to set
68+
* @param value The associated value
69+
* @return BudgetWithEntriesMeta
70+
*/
71+
@JsonAnySetter
72+
public BudgetWithEntriesMeta putAdditionalProperty(String key, Object value) {
73+
if (this.additionalProperties == null) {
74+
this.additionalProperties = new HashMap<String, Object>();
75+
}
76+
this.additionalProperties.put(key, value);
77+
return this;
78+
}
79+
80+
/**
81+
* Return the additional (undeclared) property.
82+
*
83+
* @return The additional properties
84+
*/
85+
@JsonAnyGetter
86+
public Map<String, Object> getAdditionalProperties() {
87+
return additionalProperties;
88+
}
89+
90+
/**
91+
* Return the additional (undeclared) property with the specified name.
92+
*
93+
* @param key The arbitrary key to get
94+
* @return The specific additional property for the given key
95+
*/
96+
public Object getAdditionalProperty(String key) {
97+
if (this.additionalProperties == null) {
98+
return null;
99+
}
100+
return this.additionalProperties.get(key);
101+
}
102+
103+
/** Return true if this BudgetWithEntriesMeta object is equal to o. */
104+
@Override
105+
public boolean equals(Object o) {
106+
if (this == o) {
107+
return true;
108+
}
109+
if (o == null || getClass() != o.getClass()) {
110+
return false;
111+
}
112+
BudgetWithEntriesMeta budgetWithEntriesMeta = (BudgetWithEntriesMeta) o;
113+
return Objects.equals(this.error, budgetWithEntriesMeta.error)
114+
&& Objects.equals(this.additionalProperties, budgetWithEntriesMeta.additionalProperties);
115+
}
116+
117+
@Override
118+
public int hashCode() {
119+
return Objects.hash(error, additionalProperties);
120+
}
121+
122+
@Override
123+
public String toString() {
124+
StringBuilder sb = new StringBuilder();
125+
sb.append("class BudgetWithEntriesMeta {\n");
126+
sb.append(" error: ").append(toIndentedString(error)).append("\n");
127+
sb.append(" additionalProperties: ")
128+
.append(toIndentedString(additionalProperties))
129+
.append("\n");
130+
sb.append('}');
131+
return sb.toString();
132+
}
133+
134+
/**
135+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
136+
*/
137+
private String toIndentedString(Object o) {
138+
if (o == null) {
139+
return "null";
140+
}
141+
return o.toString().replace("\n", "\n ");
142+
}
143+
}

src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,21 @@ Feature: Cloud Cost Management
107107
@generated @skip @team:DataDog/cloud-cost-management
108108
Scenario: Create or update a budget returns "Bad Request" response
109109
Given new "UpsertBudget" request
110-
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": ""}}
110+
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": ""}, "meta": {"error": ""}}
111111
When the request is sent
112112
Then the response status is 400 Bad Request
113113

114114
@generated @skip @team:DataDog/cloud-cost-management
115115
Scenario: Create or update a budget returns "Not Found" response
116116
Given new "UpsertBudget" request
117-
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": ""}}
117+
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": ""}, "meta": {"error": ""}}
118118
When the request is sent
119119
Then the response status is 404 Not Found
120120

121121
@generated @skip @team:DataDog/cloud-cost-management
122122
Scenario: Create or update a budget returns "OK" response
123123
Given new "UpsertBudget" request
124-
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": ""}}
124+
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": ""}, "meta": {"error": ""}}
125125
When the request is sent
126126
Then the response status is 200 OK
127127

0 commit comments

Comments
 (0)