Skip to content

Commit 523a5e6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d6169193 of spec repo
1 parent f0eb715 commit 523a5e6

File tree

8 files changed

+664
-128
lines changed

8 files changed

+664
-128
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-29 18:57:45.399045",
8-
"spec_repo_commit": "d1252b21"
7+
"regenerated": "2025-04-30 04:01:10.191787",
8+
"spec_repo_commit": "d6169193"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-29 18:57:45.414992",
13-
"spec_repo_commit": "d1252b21"
12+
"regenerated": "2025-04-30 04:01:10.207587",
13+
"spec_repo_commit": "d6169193"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13411,9 +13411,8 @@ components:
1341113411
oneOf:
1341213412
- $ref: '#/components/schemas/TeamReference'
1341313413
- $ref: '#/components/schemas/EscalationPolicyStep'
13414-
- $ref: '#/components/schemas/UserTarget'
13415-
- $ref: '#/components/schemas/ScheduleTarget'
13416-
- $ref: '#/components/schemas/TeamTarget'
13414+
- $ref: '#/components/schemas/EscalationPolicyUser'
13415+
- $ref: '#/components/schemas/ScheduleData'
1341713416
EscalationPolicyStep:
1341813417
description: Represents a single step in an escalation policy, including its
1341913418
attributes, relationships, and resource type.
@@ -13659,6 +13658,44 @@ components:
1365913658
type: string
1366013659
x-enum-varnames:
1366113660
- POLICIES
13661+
EscalationPolicyUser:
13662+
description: Represents a user object in the context of an escalation policy,
13663+
including their `id`, type, and basic attributes.
13664+
properties:
13665+
attributes:
13666+
$ref: '#/components/schemas/EscalationPolicyUserAttributes'
13667+
id:
13668+
description: The unique user identifier.
13669+
type: string
13670+
type:
13671+
$ref: '#/components/schemas/EscalationPolicyUserType'
13672+
required:
13673+
- type
13674+
type: object
13675+
EscalationPolicyUserAttributes:
13676+
description: Provides basic user information for an escalation policy, including
13677+
a name and email address.
13678+
properties:
13679+
email:
13680+
description: The user's email address.
13681+
example: jane.doe@example.com
13682+
type: string
13683+
name:
13684+
description: The user's name.
13685+
example: Jane Doe
13686+
type: string
13687+
status:
13688+
$ref: '#/components/schemas/UserAttributesStatus'
13689+
type: object
13690+
EscalationPolicyUserType:
13691+
default: users
13692+
description: Users resource type.
13693+
enum:
13694+
- users
13695+
example: users
13696+
type: string
13697+
x-enum-varnames:
13698+
- USERS
1366213699
EscalationTarget:
1366313700
description: Represents an escalation target, which can be a team, user, or
1366413701
schedule.
@@ -31594,6 +31631,8 @@ components:
3159431631
description: The user's name.
3159531632
example: Jane Doe
3159631633
type: string
31634+
status:
31635+
$ref: '#/components/schemas/UserAttributesStatus'
3159731636
type: object
3159831637
ScheduleUserType:
3159931638
default: users
@@ -38416,6 +38455,17 @@ components:
3841638455
description: Whether the user is verified.
3841738456
type: boolean
3841838457
type: object
38458+
UserAttributesStatus:
38459+
description: The user's status.
38460+
enum:
38461+
- active
38462+
- deactivated
38463+
- pending
38464+
type: string
38465+
x-enum-varnames:
38466+
- ACTIVE
38467+
- DEACTIVATED
38468+
- PENDING
3841938469
UserCreateAttributes:
3842038470
description: Attributes of the created user.
3842138471
properties:

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

Lines changed: 57 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -169,132 +169,91 @@ public EscalationPolicyIncluded deserialize(JsonParser jp, DeserializationContex
169169
log.log(Level.FINER, "Input data does not match schema 'EscalationPolicyStep'", e);
170170
}
171171

172-
// deserialize UserTarget
172+
// deserialize EscalationPolicyUser
173173
try {
174174
boolean attemptParsing = true;
175175
// ensure that we respect type coercion as set on the client ObjectMapper
176-
if (UserTarget.class.equals(Integer.class)
177-
|| UserTarget.class.equals(Long.class)
178-
|| UserTarget.class.equals(Float.class)
179-
|| UserTarget.class.equals(Double.class)
180-
|| UserTarget.class.equals(Boolean.class)
181-
|| UserTarget.class.equals(String.class)) {
176+
if (EscalationPolicyUser.class.equals(Integer.class)
177+
|| EscalationPolicyUser.class.equals(Long.class)
178+
|| EscalationPolicyUser.class.equals(Float.class)
179+
|| EscalationPolicyUser.class.equals(Double.class)
180+
|| EscalationPolicyUser.class.equals(Boolean.class)
181+
|| EscalationPolicyUser.class.equals(String.class)) {
182182
attemptParsing = typeCoercion;
183183
if (!attemptParsing) {
184184
attemptParsing |=
185-
((UserTarget.class.equals(Integer.class) || UserTarget.class.equals(Long.class))
185+
((EscalationPolicyUser.class.equals(Integer.class)
186+
|| EscalationPolicyUser.class.equals(Long.class))
186187
&& token == JsonToken.VALUE_NUMBER_INT);
187188
attemptParsing |=
188-
((UserTarget.class.equals(Float.class) || UserTarget.class.equals(Double.class))
189+
((EscalationPolicyUser.class.equals(Float.class)
190+
|| EscalationPolicyUser.class.equals(Double.class))
189191
&& (token == JsonToken.VALUE_NUMBER_FLOAT
190192
|| token == JsonToken.VALUE_NUMBER_INT));
191193
attemptParsing |=
192-
(UserTarget.class.equals(Boolean.class)
194+
(EscalationPolicyUser.class.equals(Boolean.class)
193195
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
194196
attemptParsing |=
195-
(UserTarget.class.equals(String.class) && token == JsonToken.VALUE_STRING);
196-
}
197-
}
198-
if (attemptParsing) {
199-
tmp = tree.traverse(jp.getCodec()).readValueAs(UserTarget.class);
200-
// TODO: there is no validation against JSON schema constraints
201-
// (min, max, enum, pattern...), this does not perform a strict JSON
202-
// validation, which means the 'match' count may be higher than it should be.
203-
if (!((UserTarget) tmp).unparsed) {
204-
deserialized = tmp;
205-
match++;
206-
}
207-
log.log(Level.FINER, "Input data matches schema 'UserTarget'");
208-
}
209-
} catch (Exception e) {
210-
// deserialization failed, continue
211-
log.log(Level.FINER, "Input data does not match schema 'UserTarget'", e);
212-
}
213-
214-
// deserialize ScheduleTarget
215-
try {
216-
boolean attemptParsing = true;
217-
// ensure that we respect type coercion as set on the client ObjectMapper
218-
if (ScheduleTarget.class.equals(Integer.class)
219-
|| ScheduleTarget.class.equals(Long.class)
220-
|| ScheduleTarget.class.equals(Float.class)
221-
|| ScheduleTarget.class.equals(Double.class)
222-
|| ScheduleTarget.class.equals(Boolean.class)
223-
|| ScheduleTarget.class.equals(String.class)) {
224-
attemptParsing = typeCoercion;
225-
if (!attemptParsing) {
226-
attemptParsing |=
227-
((ScheduleTarget.class.equals(Integer.class)
228-
|| ScheduleTarget.class.equals(Long.class))
229-
&& token == JsonToken.VALUE_NUMBER_INT);
230-
attemptParsing |=
231-
((ScheduleTarget.class.equals(Float.class)
232-
|| ScheduleTarget.class.equals(Double.class))
233-
&& (token == JsonToken.VALUE_NUMBER_FLOAT
234-
|| token == JsonToken.VALUE_NUMBER_INT));
235-
attemptParsing |=
236-
(ScheduleTarget.class.equals(Boolean.class)
237-
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
238-
attemptParsing |=
239-
(ScheduleTarget.class.equals(String.class) && token == JsonToken.VALUE_STRING);
197+
(EscalationPolicyUser.class.equals(String.class)
198+
&& token == JsonToken.VALUE_STRING);
240199
}
241200
}
242201
if (attemptParsing) {
243-
tmp = tree.traverse(jp.getCodec()).readValueAs(ScheduleTarget.class);
202+
tmp = tree.traverse(jp.getCodec()).readValueAs(EscalationPolicyUser.class);
244203
// TODO: there is no validation against JSON schema constraints
245204
// (min, max, enum, pattern...), this does not perform a strict JSON
246205
// validation, which means the 'match' count may be higher than it should be.
247-
if (!((ScheduleTarget) tmp).unparsed) {
206+
if (!((EscalationPolicyUser) tmp).unparsed) {
248207
deserialized = tmp;
249208
match++;
250209
}
251-
log.log(Level.FINER, "Input data matches schema 'ScheduleTarget'");
210+
log.log(Level.FINER, "Input data matches schema 'EscalationPolicyUser'");
252211
}
253212
} catch (Exception e) {
254213
// deserialization failed, continue
255-
log.log(Level.FINER, "Input data does not match schema 'ScheduleTarget'", e);
214+
log.log(Level.FINER, "Input data does not match schema 'EscalationPolicyUser'", e);
256215
}
257216

258-
// deserialize TeamTarget
217+
// deserialize ScheduleData
259218
try {
260219
boolean attemptParsing = true;
261220
// ensure that we respect type coercion as set on the client ObjectMapper
262-
if (TeamTarget.class.equals(Integer.class)
263-
|| TeamTarget.class.equals(Long.class)
264-
|| TeamTarget.class.equals(Float.class)
265-
|| TeamTarget.class.equals(Double.class)
266-
|| TeamTarget.class.equals(Boolean.class)
267-
|| TeamTarget.class.equals(String.class)) {
221+
if (ScheduleData.class.equals(Integer.class)
222+
|| ScheduleData.class.equals(Long.class)
223+
|| ScheduleData.class.equals(Float.class)
224+
|| ScheduleData.class.equals(Double.class)
225+
|| ScheduleData.class.equals(Boolean.class)
226+
|| ScheduleData.class.equals(String.class)) {
268227
attemptParsing = typeCoercion;
269228
if (!attemptParsing) {
270229
attemptParsing |=
271-
((TeamTarget.class.equals(Integer.class) || TeamTarget.class.equals(Long.class))
230+
((ScheduleData.class.equals(Integer.class) || ScheduleData.class.equals(Long.class))
272231
&& token == JsonToken.VALUE_NUMBER_INT);
273232
attemptParsing |=
274-
((TeamTarget.class.equals(Float.class) || TeamTarget.class.equals(Double.class))
233+
((ScheduleData.class.equals(Float.class) || ScheduleData.class.equals(Double.class))
275234
&& (token == JsonToken.VALUE_NUMBER_FLOAT
276235
|| token == JsonToken.VALUE_NUMBER_INT));
277236
attemptParsing |=
278-
(TeamTarget.class.equals(Boolean.class)
237+
(ScheduleData.class.equals(Boolean.class)
279238
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
280239
attemptParsing |=
281-
(TeamTarget.class.equals(String.class) && token == JsonToken.VALUE_STRING);
240+
(ScheduleData.class.equals(String.class) && token == JsonToken.VALUE_STRING);
282241
}
283242
}
284243
if (attemptParsing) {
285-
tmp = tree.traverse(jp.getCodec()).readValueAs(TeamTarget.class);
244+
tmp = tree.traverse(jp.getCodec()).readValueAs(ScheduleData.class);
286245
// TODO: there is no validation against JSON schema constraints
287246
// (min, max, enum, pattern...), this does not perform a strict JSON
288247
// validation, which means the 'match' count may be higher than it should be.
289-
if (!((TeamTarget) tmp).unparsed) {
248+
if (!((ScheduleData) tmp).unparsed) {
290249
deserialized = tmp;
291250
match++;
292251
}
293-
log.log(Level.FINER, "Input data matches schema 'TeamTarget'");
252+
log.log(Level.FINER, "Input data matches schema 'ScheduleData'");
294253
}
295254
} catch (Exception e) {
296255
// deserialization failed, continue
297-
log.log(Level.FINER, "Input data does not match schema 'TeamTarget'", e);
256+
log.log(Level.FINER, "Input data does not match schema 'ScheduleData'", e);
298257
}
299258

300259
EscalationPolicyIncluded ret = new EscalationPolicyIncluded();
@@ -336,27 +295,21 @@ public EscalationPolicyIncluded(EscalationPolicyStep o) {
336295
setActualInstance(o);
337296
}
338297

339-
public EscalationPolicyIncluded(UserTarget o) {
340-
super("oneOf", Boolean.FALSE);
341-
setActualInstance(o);
342-
}
343-
344-
public EscalationPolicyIncluded(ScheduleTarget o) {
298+
public EscalationPolicyIncluded(EscalationPolicyUser o) {
345299
super("oneOf", Boolean.FALSE);
346300
setActualInstance(o);
347301
}
348302

349-
public EscalationPolicyIncluded(TeamTarget o) {
303+
public EscalationPolicyIncluded(ScheduleData o) {
350304
super("oneOf", Boolean.FALSE);
351305
setActualInstance(o);
352306
}
353307

354308
static {
355309
schemas.put("TeamReference", new GenericType<TeamReference>() {});
356310
schemas.put("EscalationPolicyStep", new GenericType<EscalationPolicyStep>() {});
357-
schemas.put("UserTarget", new GenericType<UserTarget>() {});
358-
schemas.put("ScheduleTarget", new GenericType<ScheduleTarget>() {});
359-
schemas.put("TeamTarget", new GenericType<TeamTarget>() {});
311+
schemas.put("EscalationPolicyUser", new GenericType<EscalationPolicyUser>() {});
312+
schemas.put("ScheduleData", new GenericType<ScheduleData>() {});
360313
JSON.registerDescendants(EscalationPolicyIncluded.class, Collections.unmodifiableMap(schemas));
361314
}
362315

@@ -367,8 +320,8 @@ public Map<String, GenericType> getSchemas() {
367320

368321
/**
369322
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
370-
* against the oneOf child schemas: TeamReference, EscalationPolicyStep, UserTarget,
371-
* ScheduleTarget, TeamTarget
323+
* against the oneOf child schemas: TeamReference, EscalationPolicyStep, EscalationPolicyUser,
324+
* ScheduleData
372325
*
373326
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
374327
* composed schema (allOf, anyOf, oneOf).
@@ -383,15 +336,11 @@ public void setActualInstance(Object instance) {
383336
super.setActualInstance(instance);
384337
return;
385338
}
386-
if (JSON.isInstanceOf(UserTarget.class, instance, new HashSet<Class<?>>())) {
339+
if (JSON.isInstanceOf(EscalationPolicyUser.class, instance, new HashSet<Class<?>>())) {
387340
super.setActualInstance(instance);
388341
return;
389342
}
390-
if (JSON.isInstanceOf(ScheduleTarget.class, instance, new HashSet<Class<?>>())) {
391-
super.setActualInstance(instance);
392-
return;
393-
}
394-
if (JSON.isInstanceOf(TeamTarget.class, instance, new HashSet<Class<?>>())) {
343+
if (JSON.isInstanceOf(ScheduleData.class, instance, new HashSet<Class<?>>())) {
395344
super.setActualInstance(instance);
396345
return;
397346
}
@@ -401,16 +350,16 @@ public void setActualInstance(Object instance) {
401350
return;
402351
}
403352
throw new RuntimeException(
404-
"Invalid instance type. Must be TeamReference, EscalationPolicyStep, UserTarget,"
405-
+ " ScheduleTarget, TeamTarget");
353+
"Invalid instance type. Must be TeamReference, EscalationPolicyStep, EscalationPolicyUser,"
354+
+ " ScheduleData");
406355
}
407356

408357
/**
409358
* Get the actual instance, which can be the following: TeamReference, EscalationPolicyStep,
410-
* UserTarget, ScheduleTarget, TeamTarget
359+
* EscalationPolicyUser, ScheduleData
411360
*
412-
* @return The actual instance (TeamReference, EscalationPolicyStep, UserTarget, ScheduleTarget,
413-
* TeamTarget)
361+
* @return The actual instance (TeamReference, EscalationPolicyStep, EscalationPolicyUser,
362+
* ScheduleData)
414363
*/
415364
@Override
416365
public Object getActualInstance() {
@@ -440,35 +389,24 @@ public EscalationPolicyStep getEscalationPolicyStep() throws ClassCastException
440389
}
441390

442391
/**
443-
* Get the actual instance of `UserTarget`. If the actual instance is not `UserTarget`, the
444-
* ClassCastException will be thrown.
445-
*
446-
* @return The actual instance of `UserTarget`
447-
* @throws ClassCastException if the instance is not `UserTarget`
448-
*/
449-
public UserTarget getUserTarget() throws ClassCastException {
450-
return (UserTarget) super.getActualInstance();
451-
}
452-
453-
/**
454-
* Get the actual instance of `ScheduleTarget`. If the actual instance is not `ScheduleTarget`,
455-
* the ClassCastException will be thrown.
392+
* Get the actual instance of `EscalationPolicyUser`. If the actual instance is not
393+
* `EscalationPolicyUser`, the ClassCastException will be thrown.
456394
*
457-
* @return The actual instance of `ScheduleTarget`
458-
* @throws ClassCastException if the instance is not `ScheduleTarget`
395+
* @return The actual instance of `EscalationPolicyUser`
396+
* @throws ClassCastException if the instance is not `EscalationPolicyUser`
459397
*/
460-
public ScheduleTarget getScheduleTarget() throws ClassCastException {
461-
return (ScheduleTarget) super.getActualInstance();
398+
public EscalationPolicyUser getEscalationPolicyUser() throws ClassCastException {
399+
return (EscalationPolicyUser) super.getActualInstance();
462400
}
463401

464402
/**
465-
* Get the actual instance of `TeamTarget`. If the actual instance is not `TeamTarget`, the
403+
* Get the actual instance of `ScheduleData`. If the actual instance is not `ScheduleData`, the
466404
* ClassCastException will be thrown.
467405
*
468-
* @return The actual instance of `TeamTarget`
469-
* @throws ClassCastException if the instance is not `TeamTarget`
406+
* @return The actual instance of `ScheduleData`
407+
* @throws ClassCastException if the instance is not `ScheduleData`
470408
*/
471-
public TeamTarget getTeamTarget() throws ClassCastException {
472-
return (TeamTarget) super.getActualInstance();
409+
public ScheduleData getScheduleData() throws ClassCastException {
410+
return (ScheduleData) super.getActualInstance();
473411
}
474412
}

0 commit comments

Comments
 (0)