Skip to content

Commit f33c5cb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d3bc2b1 of spec repo
1 parent 53c23e2 commit f33c5cb

10 files changed

+1182
-10
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "d93d991",
3-
"generated": "2025-07-15 09:33:00.867"
2+
"spec_repo_commit": "d3bc2b1",
3+
"generated": "2025-07-16 14:18:12.333"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,11 +2016,13 @@ components:
20162016
description: The definition of `ActionConnectionIntegration` object.
20172017
oneOf:
20182018
- $ref: '#/components/schemas/AWSIntegration'
2019+
- $ref: '#/components/schemas/DatadogIntegration'
20192020
- $ref: '#/components/schemas/HTTPIntegration'
20202021
ActionConnectionIntegrationUpdate:
20212022
description: The definition of `ActionConnectionIntegrationUpdate` object.
20222023
oneOf:
20232024
- $ref: '#/components/schemas/AWSIntegrationUpdate'
2025+
- $ref: '#/components/schemas/DatadogIntegrationUpdate'
20242026
- $ref: '#/components/schemas/HTTPIntegrationUpdate'
20252027
ActionQuery:
20262028
description: An action query. This query type is used to trigger an action,
@@ -12186,6 +12188,77 @@ components:
1218612188
required:
1218712189
- databaseMonitoringTrigger
1218812190
type: object
12191+
DatadogCredentials:
12192+
description: The definition of `DatadogCredentials` object.
12193+
oneOf:
12194+
- $ref: '#/components/schemas/DatadogDatadogAPIKey'
12195+
DatadogDatadogAPIKey:
12196+
description: The definition of `DatadogDatadogAPIKey` object.
12197+
properties:
12198+
api_key:
12199+
description: The `DatadogDatadogAPIKey` `api_key`.
12200+
example: ''
12201+
type: string
12202+
app_key:
12203+
description: The `DatadogDatadogAPIKey` `app_key`.
12204+
example: ''
12205+
type: string
12206+
datacenter:
12207+
description: The `DatadogDatadogAPIKey` `datacenter`.
12208+
example: ''
12209+
type: string
12210+
subdomain:
12211+
description: Custom subdomain used for Datadog URLs generated with this
12212+
Connection. For example, if this org uses https://acme.datadoghq.com to
12213+
access Datadog, set this field to `acme`. If this field is omitted, generated
12214+
URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)).
12215+
type: string
12216+
type:
12217+
$ref: '#/components/schemas/DatadogDatadogAPIKeyType'
12218+
required:
12219+
- type
12220+
- datacenter
12221+
- api_key
12222+
- app_key
12223+
type: object
12224+
DatadogDatadogAPIKeyType:
12225+
description: The credential type
12226+
enum:
12227+
- DATADOG_APP_API_KEY
12228+
example: DATADOG_APP_API_KEY
12229+
type: string
12230+
x-enum-varnames:
12231+
- DATADOG_APP_API_KEY
12232+
DatadogIntegration:
12233+
description: The definition of `DatadogIntegration` object.
12234+
properties:
12235+
credentials:
12236+
$ref: '#/components/schemas/DatadogCredentials'
12237+
type:
12238+
$ref: '#/components/schemas/DatadogIntegrationType'
12239+
required:
12240+
- type
12241+
- credentials
12242+
type: object
12243+
DatadogIntegrationType:
12244+
description: The definition of `DatadogIntegrationType` object.
12245+
enum:
12246+
- Datadog
12247+
example: Datadog
12248+
type: string
12249+
x-enum-varnames:
12250+
- DATADOG
12251+
DatadogIntegrationUpdate:
12252+
description: The definition of `DatadogIntegrationUpdate` object.
12253+
properties:
12254+
credentials:
12255+
$ref: '#/components/schemas/DatadogCredentials'
12256+
deleted:
12257+
description: Whether the integration should be deleted
12258+
type: boolean
12259+
type:
12260+
$ref: '#/components/schemas/DatadogIntegrationType'
12261+
type: object
1218912262
Dataset:
1219012263
description: Dataset object.
1219112264
properties:

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

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,50 @@ public ActionConnectionIntegration deserialize(JsonParser jp, DeserializationCon
124124
log.log(Level.FINER, "Input data does not match schema 'AWSIntegration'", e);
125125
}
126126

127+
// deserialize DatadogIntegration
128+
try {
129+
boolean attemptParsing = true;
130+
// ensure that we respect type coercion as set on the client ObjectMapper
131+
if (DatadogIntegration.class.equals(Integer.class)
132+
|| DatadogIntegration.class.equals(Long.class)
133+
|| DatadogIntegration.class.equals(Float.class)
134+
|| DatadogIntegration.class.equals(Double.class)
135+
|| DatadogIntegration.class.equals(Boolean.class)
136+
|| DatadogIntegration.class.equals(String.class)) {
137+
attemptParsing = typeCoercion;
138+
if (!attemptParsing) {
139+
attemptParsing |=
140+
((DatadogIntegration.class.equals(Integer.class)
141+
|| DatadogIntegration.class.equals(Long.class))
142+
&& token == JsonToken.VALUE_NUMBER_INT);
143+
attemptParsing |=
144+
((DatadogIntegration.class.equals(Float.class)
145+
|| DatadogIntegration.class.equals(Double.class))
146+
&& (token == JsonToken.VALUE_NUMBER_FLOAT
147+
|| token == JsonToken.VALUE_NUMBER_INT));
148+
attemptParsing |=
149+
(DatadogIntegration.class.equals(Boolean.class)
150+
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
151+
attemptParsing |=
152+
(DatadogIntegration.class.equals(String.class) && token == JsonToken.VALUE_STRING);
153+
}
154+
}
155+
if (attemptParsing) {
156+
tmp = tree.traverse(jp.getCodec()).readValueAs(DatadogIntegration.class);
157+
// TODO: there is no validation against JSON schema constraints
158+
// (min, max, enum, pattern...), this does not perform a strict JSON
159+
// validation, which means the 'match' count may be higher than it should be.
160+
if (!((DatadogIntegration) tmp).unparsed) {
161+
deserialized = tmp;
162+
match++;
163+
}
164+
log.log(Level.FINER, "Input data matches schema 'DatadogIntegration'");
165+
}
166+
} catch (Exception e) {
167+
// deserialization failed, continue
168+
log.log(Level.FINER, "Input data does not match schema 'DatadogIntegration'", e);
169+
}
170+
127171
// deserialize HTTPIntegration
128172
try {
129173
boolean attemptParsing = true;
@@ -203,13 +247,19 @@ public ActionConnectionIntegration(AWSIntegration o) {
203247
setActualInstance(o);
204248
}
205249

250+
public ActionConnectionIntegration(DatadogIntegration o) {
251+
super("oneOf", Boolean.FALSE);
252+
setActualInstance(o);
253+
}
254+
206255
public ActionConnectionIntegration(HTTPIntegration o) {
207256
super("oneOf", Boolean.FALSE);
208257
setActualInstance(o);
209258
}
210259

211260
static {
212261
schemas.put("AWSIntegration", new GenericType<AWSIntegration>() {});
262+
schemas.put("DatadogIntegration", new GenericType<DatadogIntegration>() {});
213263
schemas.put("HTTPIntegration", new GenericType<HTTPIntegration>() {});
214264
JSON.registerDescendants(
215265
ActionConnectionIntegration.class, Collections.unmodifiableMap(schemas));
@@ -222,7 +272,7 @@ public Map<String, GenericType> getSchemas() {
222272

223273
/**
224274
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
225-
* against the oneOf child schemas: AWSIntegration, HTTPIntegration
275+
* against the oneOf child schemas: AWSIntegration, DatadogIntegration, HTTPIntegration
226276
*
227277
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
228278
* composed schema (allOf, anyOf, oneOf).
@@ -233,6 +283,10 @@ public void setActualInstance(Object instance) {
233283
super.setActualInstance(instance);
234284
return;
235285
}
286+
if (JSON.isInstanceOf(DatadogIntegration.class, instance, new HashSet<Class<?>>())) {
287+
super.setActualInstance(instance);
288+
return;
289+
}
236290
if (JSON.isInstanceOf(HTTPIntegration.class, instance, new HashSet<Class<?>>())) {
237291
super.setActualInstance(instance);
238292
return;
@@ -242,13 +296,15 @@ public void setActualInstance(Object instance) {
242296
super.setActualInstance(instance);
243297
return;
244298
}
245-
throw new RuntimeException("Invalid instance type. Must be AWSIntegration, HTTPIntegration");
299+
throw new RuntimeException(
300+
"Invalid instance type. Must be AWSIntegration, DatadogIntegration, HTTPIntegration");
246301
}
247302

248303
/**
249-
* Get the actual instance, which can be the following: AWSIntegration, HTTPIntegration
304+
* Get the actual instance, which can be the following: AWSIntegration, DatadogIntegration,
305+
* HTTPIntegration
250306
*
251-
* @return The actual instance (AWSIntegration, HTTPIntegration)
307+
* @return The actual instance (AWSIntegration, DatadogIntegration, HTTPIntegration)
252308
*/
253309
@Override
254310
public Object getActualInstance() {
@@ -266,6 +322,17 @@ public AWSIntegration getAWSIntegration() throws ClassCastException {
266322
return (AWSIntegration) super.getActualInstance();
267323
}
268324

325+
/**
326+
* Get the actual instance of `DatadogIntegration`. If the actual instance is not
327+
* `DatadogIntegration`, the ClassCastException will be thrown.
328+
*
329+
* @return The actual instance of `DatadogIntegration`
330+
* @throws ClassCastException if the instance is not `DatadogIntegration`
331+
*/
332+
public DatadogIntegration getDatadogIntegration() throws ClassCastException {
333+
return (DatadogIntegration) super.getActualInstance();
334+
}
335+
269336
/**
270337
* Get the actual instance of `HTTPIntegration`. If the actual instance is not `HTTPIntegration`,
271338
* the ClassCastException will be thrown.

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

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,51 @@ public ActionConnectionIntegrationUpdate deserialize(JsonParser jp, Deserializat
128128
log.log(Level.FINER, "Input data does not match schema 'AWSIntegrationUpdate'", e);
129129
}
130130

131+
// deserialize DatadogIntegrationUpdate
132+
try {
133+
boolean attemptParsing = true;
134+
// ensure that we respect type coercion as set on the client ObjectMapper
135+
if (DatadogIntegrationUpdate.class.equals(Integer.class)
136+
|| DatadogIntegrationUpdate.class.equals(Long.class)
137+
|| DatadogIntegrationUpdate.class.equals(Float.class)
138+
|| DatadogIntegrationUpdate.class.equals(Double.class)
139+
|| DatadogIntegrationUpdate.class.equals(Boolean.class)
140+
|| DatadogIntegrationUpdate.class.equals(String.class)) {
141+
attemptParsing = typeCoercion;
142+
if (!attemptParsing) {
143+
attemptParsing |=
144+
((DatadogIntegrationUpdate.class.equals(Integer.class)
145+
|| DatadogIntegrationUpdate.class.equals(Long.class))
146+
&& token == JsonToken.VALUE_NUMBER_INT);
147+
attemptParsing |=
148+
((DatadogIntegrationUpdate.class.equals(Float.class)
149+
|| DatadogIntegrationUpdate.class.equals(Double.class))
150+
&& (token == JsonToken.VALUE_NUMBER_FLOAT
151+
|| token == JsonToken.VALUE_NUMBER_INT));
152+
attemptParsing |=
153+
(DatadogIntegrationUpdate.class.equals(Boolean.class)
154+
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
155+
attemptParsing |=
156+
(DatadogIntegrationUpdate.class.equals(String.class)
157+
&& token == JsonToken.VALUE_STRING);
158+
}
159+
}
160+
if (attemptParsing) {
161+
tmp = tree.traverse(jp.getCodec()).readValueAs(DatadogIntegrationUpdate.class);
162+
// TODO: there is no validation against JSON schema constraints
163+
// (min, max, enum, pattern...), this does not perform a strict JSON
164+
// validation, which means the 'match' count may be higher than it should be.
165+
if (!((DatadogIntegrationUpdate) tmp).unparsed) {
166+
deserialized = tmp;
167+
match++;
168+
}
169+
log.log(Level.FINER, "Input data matches schema 'DatadogIntegrationUpdate'");
170+
}
171+
} catch (Exception e) {
172+
// deserialization failed, continue
173+
log.log(Level.FINER, "Input data does not match schema 'DatadogIntegrationUpdate'", e);
174+
}
175+
131176
// deserialize HTTPIntegrationUpdate
132177
try {
133178
boolean attemptParsing = true;
@@ -208,13 +253,19 @@ public ActionConnectionIntegrationUpdate(AWSIntegrationUpdate o) {
208253
setActualInstance(o);
209254
}
210255

256+
public ActionConnectionIntegrationUpdate(DatadogIntegrationUpdate o) {
257+
super("oneOf", Boolean.FALSE);
258+
setActualInstance(o);
259+
}
260+
211261
public ActionConnectionIntegrationUpdate(HTTPIntegrationUpdate o) {
212262
super("oneOf", Boolean.FALSE);
213263
setActualInstance(o);
214264
}
215265

216266
static {
217267
schemas.put("AWSIntegrationUpdate", new GenericType<AWSIntegrationUpdate>() {});
268+
schemas.put("DatadogIntegrationUpdate", new GenericType<DatadogIntegrationUpdate>() {});
218269
schemas.put("HTTPIntegrationUpdate", new GenericType<HTTPIntegrationUpdate>() {});
219270
JSON.registerDescendants(
220271
ActionConnectionIntegrationUpdate.class, Collections.unmodifiableMap(schemas));
@@ -227,7 +278,8 @@ public Map<String, GenericType> getSchemas() {
227278

228279
/**
229280
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
230-
* against the oneOf child schemas: AWSIntegrationUpdate, HTTPIntegrationUpdate
281+
* against the oneOf child schemas: AWSIntegrationUpdate, DatadogIntegrationUpdate,
282+
* HTTPIntegrationUpdate
231283
*
232284
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
233285
* composed schema (allOf, anyOf, oneOf).
@@ -238,6 +290,10 @@ public void setActualInstance(Object instance) {
238290
super.setActualInstance(instance);
239291
return;
240292
}
293+
if (JSON.isInstanceOf(DatadogIntegrationUpdate.class, instance, new HashSet<Class<?>>())) {
294+
super.setActualInstance(instance);
295+
return;
296+
}
241297
if (JSON.isInstanceOf(HTTPIntegrationUpdate.class, instance, new HashSet<Class<?>>())) {
242298
super.setActualInstance(instance);
243299
return;
@@ -248,14 +304,16 @@ public void setActualInstance(Object instance) {
248304
return;
249305
}
250306
throw new RuntimeException(
251-
"Invalid instance type. Must be AWSIntegrationUpdate, HTTPIntegrationUpdate");
307+
"Invalid instance type. Must be AWSIntegrationUpdate, DatadogIntegrationUpdate,"
308+
+ " HTTPIntegrationUpdate");
252309
}
253310

254311
/**
255312
* Get the actual instance, which can be the following: AWSIntegrationUpdate,
256-
* HTTPIntegrationUpdate
313+
* DatadogIntegrationUpdate, HTTPIntegrationUpdate
257314
*
258-
* @return The actual instance (AWSIntegrationUpdate, HTTPIntegrationUpdate)
315+
* @return The actual instance (AWSIntegrationUpdate, DatadogIntegrationUpdate,
316+
* HTTPIntegrationUpdate)
259317
*/
260318
@Override
261319
public Object getActualInstance() {
@@ -273,6 +331,17 @@ public AWSIntegrationUpdate getAWSIntegrationUpdate() throws ClassCastException
273331
return (AWSIntegrationUpdate) super.getActualInstance();
274332
}
275333

334+
/**
335+
* Get the actual instance of `DatadogIntegrationUpdate`. If the actual instance is not
336+
* `DatadogIntegrationUpdate`, the ClassCastException will be thrown.
337+
*
338+
* @return The actual instance of `DatadogIntegrationUpdate`
339+
* @throws ClassCastException if the instance is not `DatadogIntegrationUpdate`
340+
*/
341+
public DatadogIntegrationUpdate getDatadogIntegrationUpdate() throws ClassCastException {
342+
return (DatadogIntegrationUpdate) super.getActualInstance();
343+
}
344+
276345
/**
277346
* Get the actual instance of `HTTPIntegrationUpdate`. If the actual instance is not
278347
* `HTTPIntegrationUpdate`, the ClassCastException will be thrown.

0 commit comments

Comments
 (0)