Skip to content

Commit 986a894

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2e491415 of spec repo
1 parent 83361f7 commit 986a894

12 files changed

+1210
-12
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-06-23 07:59:26.325614",
8-
"spec_repo_commit": "74866a53"
7+
"regenerated": "2025-06-23 13:26:53.019562",
8+
"spec_repo_commit": "2e491415"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-23 07:59:26.342135",
13-
"spec_repo_commit": "74866a53"
12+
"regenerated": "2025-06-23 13:26:53.036893",
13+
"spec_repo_commit": "2e491415"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10590,6 +10590,7 @@ components:
1059010590
- $ref: '#/components/schemas/CustomDestinationForwardDestinationHttp'
1059110591
- $ref: '#/components/schemas/CustomDestinationForwardDestinationSplunk'
1059210592
- $ref: '#/components/schemas/CustomDestinationForwardDestinationElasticsearch'
10593+
- $ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinel'
1059310594
CustomDestinationForwardDestinationElasticsearch:
1059410595
description: The Elasticsearch destination.
1059510596
properties:
@@ -10674,6 +10675,49 @@ components:
1067410675
type: string
1067510676
x-enum-varnames:
1067610677
- HTTP
10678+
CustomDestinationForwardDestinationMicrosoftSentinel:
10679+
description: The Microsoft Sentinel destination.
10680+
properties:
10681+
client_id:
10682+
description: Client ID from the Datadog Azure integration.
10683+
example: 9a2f4d83-2b5e-429e-a35a-2b3c4182db71
10684+
type: string
10685+
data_collection_endpoint:
10686+
description: Azure data collection endpoint.
10687+
example: https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com
10688+
type: string
10689+
data_collection_rule_id:
10690+
description: Azure data collection rule ID.
10691+
example: dcr-000a00a000a00000a000000aa000a0aa
10692+
type: string
10693+
stream_name:
10694+
description: Azure stream name.
10695+
example: Custom-MyTable
10696+
type: string
10697+
writeOnly: true
10698+
tenant_id:
10699+
description: Tenant ID from the Datadog Azure integration.
10700+
example: f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2
10701+
type: string
10702+
type:
10703+
$ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinelType'
10704+
required:
10705+
- type
10706+
- tenant_id
10707+
- client_id
10708+
- data_collection_endpoint
10709+
- data_collection_rule_id
10710+
- stream_name
10711+
type: object
10712+
CustomDestinationForwardDestinationMicrosoftSentinelType:
10713+
default: microsoft_sentinel
10714+
description: Type of the Microsoft Sentinel destination.
10715+
enum:
10716+
- microsoft_sentinel
10717+
example: microsoft_sentinel
10718+
type: string
10719+
x-enum-varnames:
10720+
- MICROSOFT_SENTINEL
1067710721
CustomDestinationForwardDestinationSplunk:
1067810722
description: The Splunk HTTP Event Collector (HEC) destination.
1067910723
properties:
@@ -10849,6 +10893,7 @@ components:
1084910893
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationHttp'
1085010894
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationSplunk'
1085110895
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationElasticsearch'
10896+
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinel'
1085210897
CustomDestinationResponseForwardDestinationElasticsearch:
1085310898
description: The Elasticsearch destination.
1085410899
properties:
@@ -10933,6 +10978,49 @@ components:
1093310978
type: string
1093410979
x-enum-varnames:
1093510980
- HTTP
10981+
CustomDestinationResponseForwardDestinationMicrosoftSentinel:
10982+
description: The Microsoft Sentinel destination.
10983+
properties:
10984+
client_id:
10985+
description: Client ID from the Datadog Azure integration.
10986+
example: 9a2f4d83-2b5e-429e-a35a-2b3c4182db71
10987+
type: string
10988+
data_collection_endpoint:
10989+
description: Azure data collection endpoint.
10990+
example: https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com
10991+
type: string
10992+
data_collection_rule_id:
10993+
description: Azure data collection rule ID.
10994+
example: dcr-000a00a000a00000a000000aa000a0aa
10995+
type: string
10996+
stream_name:
10997+
description: Azure stream name.
10998+
example: Custom-MyTable
10999+
type: string
11000+
writeOnly: true
11001+
tenant_id:
11002+
description: Tenant ID from the Datadog Azure integration.
11003+
example: f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2
11004+
type: string
11005+
type:
11006+
$ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinelType'
11007+
required:
11008+
- type
11009+
- tenant_id
11010+
- client_id
11011+
- data_collection_endpoint
11012+
- data_collection_rule_id
11013+
- stream_name
11014+
type: object
11015+
CustomDestinationResponseForwardDestinationMicrosoftSentinelType:
11016+
default: microsoft_sentinel
11017+
description: Type of the Microsoft Sentinel destination.
11018+
enum:
11019+
- microsoft_sentinel
11020+
example: microsoft_sentinel
11021+
type: string
11022+
x-enum-varnames:
11023+
- MICROSOFT_SENTINEL
1093611024
CustomDestinationResponseForwardDestinationSplunk:
1093711025
description: The Splunk HTTP Event Collector (HEC) destination.
1093811026
properties:
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Create a Microsoft Sentinel custom destination returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.LogsCustomDestinationsApi;
6+
import com.datadog.api.client.v2.model.CustomDestinationAttributeTagsRestrictionListType;
7+
import com.datadog.api.client.v2.model.CustomDestinationCreateRequest;
8+
import com.datadog.api.client.v2.model.CustomDestinationCreateRequestAttributes;
9+
import com.datadog.api.client.v2.model.CustomDestinationCreateRequestDefinition;
10+
import com.datadog.api.client.v2.model.CustomDestinationForwardDestination;
11+
import com.datadog.api.client.v2.model.CustomDestinationForwardDestinationMicrosoftSentinel;
12+
import com.datadog.api.client.v2.model.CustomDestinationForwardDestinationMicrosoftSentinelType;
13+
import com.datadog.api.client.v2.model.CustomDestinationResponse;
14+
import com.datadog.api.client.v2.model.CustomDestinationType;
15+
import java.util.Arrays;
16+
17+
public class Example {
18+
public static void main(String[] args) {
19+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
20+
LogsCustomDestinationsApi apiInstance = new LogsCustomDestinationsApi(defaultClient);
21+
22+
CustomDestinationCreateRequest body =
23+
new CustomDestinationCreateRequest()
24+
.data(
25+
new CustomDestinationCreateRequestDefinition()
26+
.attributes(
27+
new CustomDestinationCreateRequestAttributes()
28+
.enabled(false)
29+
.forwardTags(false)
30+
.forwardTagsRestrictionList(Arrays.asList("datacenter", "host"))
31+
.forwardTagsRestrictionListType(
32+
CustomDestinationAttributeTagsRestrictionListType.ALLOW_LIST)
33+
.forwarderDestination(
34+
new CustomDestinationForwardDestination(
35+
new CustomDestinationForwardDestinationMicrosoftSentinel()
36+
.type(
37+
CustomDestinationForwardDestinationMicrosoftSentinelType
38+
.MICROSOFT_SENTINEL)
39+
.tenantId("f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2")
40+
.clientId("9a2f4d83-2b5e-429e-a35a-2b3c4182db71")
41+
.dataCollectionEndpoint(
42+
"https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com")
43+
.dataCollectionRuleId(
44+
"dcr-000a00a000a00000a000000aa000a0aa")
45+
.streamName("Custom-MyTable")))
46+
.name("Nginx logs")
47+
.query("source:nginx"))
48+
.type(CustomDestinationType.CUSTOM_DESTINATION));
49+
50+
try {
51+
CustomDestinationResponse result = apiInstance.createLogsCustomDestination(body);
52+
System.out.println(result);
53+
} catch (ApiException e) {
54+
System.err.println(
55+
"Exception when calling LogsCustomDestinationsApi#createLogsCustomDestination");
56+
System.err.println("Status code: " + e.getCode());
57+
System.err.println("Reason: " + e.getResponseBody());
58+
System.err.println("Response headers: " + e.getResponseHeaders());
59+
e.printStackTrace();
60+
}
61+
}
62+
}

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

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,61 @@ public CustomDestinationForwardDestination deserialize(
241241
e);
242242
}
243243

244+
// deserialize CustomDestinationForwardDestinationMicrosoftSentinel
245+
try {
246+
boolean attemptParsing = true;
247+
// ensure that we respect type coercion as set on the client ObjectMapper
248+
if (CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Integer.class)
249+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Long.class)
250+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Float.class)
251+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Double.class)
252+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Boolean.class)
253+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(String.class)) {
254+
attemptParsing = typeCoercion;
255+
if (!attemptParsing) {
256+
attemptParsing |=
257+
((CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Integer.class)
258+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(
259+
Long.class))
260+
&& token == JsonToken.VALUE_NUMBER_INT);
261+
attemptParsing |=
262+
((CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Float.class)
263+
|| CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(
264+
Double.class))
265+
&& (token == JsonToken.VALUE_NUMBER_FLOAT
266+
|| token == JsonToken.VALUE_NUMBER_INT));
267+
attemptParsing |=
268+
(CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(Boolean.class)
269+
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
270+
attemptParsing |=
271+
(CustomDestinationForwardDestinationMicrosoftSentinel.class.equals(String.class)
272+
&& token == JsonToken.VALUE_STRING);
273+
}
274+
}
275+
if (attemptParsing) {
276+
tmp =
277+
tree.traverse(jp.getCodec())
278+
.readValueAs(CustomDestinationForwardDestinationMicrosoftSentinel.class);
279+
// TODO: there is no validation against JSON schema constraints
280+
// (min, max, enum, pattern...), this does not perform a strict JSON
281+
// validation, which means the 'match' count may be higher than it should be.
282+
if (!((CustomDestinationForwardDestinationMicrosoftSentinel) tmp).unparsed) {
283+
deserialized = tmp;
284+
match++;
285+
}
286+
log.log(
287+
Level.FINER,
288+
"Input data matches schema 'CustomDestinationForwardDestinationMicrosoftSentinel'");
289+
}
290+
} catch (Exception e) {
291+
// deserialization failed, continue
292+
log.log(
293+
Level.FINER,
294+
"Input data does not match schema"
295+
+ " 'CustomDestinationForwardDestinationMicrosoftSentinel'",
296+
e);
297+
}
298+
244299
CustomDestinationForwardDestination ret = new CustomDestinationForwardDestination();
245300
if (match == 1) {
246301
ret.setActualInstance(deserialized);
@@ -286,6 +341,12 @@ public CustomDestinationForwardDestination(CustomDestinationForwardDestinationEl
286341
setActualInstance(o);
287342
}
288343

344+
public CustomDestinationForwardDestination(
345+
CustomDestinationForwardDestinationMicrosoftSentinel o) {
346+
super("oneOf", Boolean.FALSE);
347+
setActualInstance(o);
348+
}
349+
289350
static {
290351
schemas.put(
291352
"CustomDestinationForwardDestinationHttp",
@@ -296,6 +357,9 @@ public CustomDestinationForwardDestination(CustomDestinationForwardDestinationEl
296357
schemas.put(
297358
"CustomDestinationForwardDestinationElasticsearch",
298359
new GenericType<CustomDestinationForwardDestinationElasticsearch>() {});
360+
schemas.put(
361+
"CustomDestinationForwardDestinationMicrosoftSentinel",
362+
new GenericType<CustomDestinationForwardDestinationMicrosoftSentinel>() {});
299363
JSON.registerDescendants(
300364
CustomDestinationForwardDestination.class, Collections.unmodifiableMap(schemas));
301365
}
@@ -308,7 +372,8 @@ public Map<String, GenericType> getSchemas() {
308372
/**
309373
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
310374
* against the oneOf child schemas: CustomDestinationForwardDestinationHttp,
311-
* CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch
375+
* CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch,
376+
* CustomDestinationForwardDestinationMicrosoftSentinel
312377
*
313378
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
314379
* composed schema (allOf, anyOf, oneOf).
@@ -332,6 +397,13 @@ public void setActualInstance(Object instance) {
332397
super.setActualInstance(instance);
333398
return;
334399
}
400+
if (JSON.isInstanceOf(
401+
CustomDestinationForwardDestinationMicrosoftSentinel.class,
402+
instance,
403+
new HashSet<Class<?>>())) {
404+
super.setActualInstance(instance);
405+
return;
406+
}
335407

336408
if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet<Class<?>>())) {
337409
super.setActualInstance(instance);
@@ -340,16 +412,19 @@ public void setActualInstance(Object instance) {
340412
throw new RuntimeException(
341413
"Invalid instance type. Must be CustomDestinationForwardDestinationHttp,"
342414
+ " CustomDestinationForwardDestinationSplunk,"
343-
+ " CustomDestinationForwardDestinationElasticsearch");
415+
+ " CustomDestinationForwardDestinationElasticsearch,"
416+
+ " CustomDestinationForwardDestinationMicrosoftSentinel");
344417
}
345418

346419
/**
347420
* Get the actual instance, which can be the following: CustomDestinationForwardDestinationHttp,
348-
* CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch
421+
* CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch,
422+
* CustomDestinationForwardDestinationMicrosoftSentinel
349423
*
350424
* @return The actual instance (CustomDestinationForwardDestinationHttp,
351425
* CustomDestinationForwardDestinationSplunk,
352-
* CustomDestinationForwardDestinationElasticsearch)
426+
* CustomDestinationForwardDestinationElasticsearch,
427+
* CustomDestinationForwardDestinationMicrosoftSentinel)
353428
*/
354429
@Override
355430
public Object getActualInstance() {
@@ -393,4 +468,18 @@ public CustomDestinationForwardDestinationSplunk getCustomDestinationForwardDest
393468
getCustomDestinationForwardDestinationElasticsearch() throws ClassCastException {
394469
return (CustomDestinationForwardDestinationElasticsearch) super.getActualInstance();
395470
}
471+
472+
/**
473+
* Get the actual instance of `CustomDestinationForwardDestinationMicrosoftSentinel`. If the
474+
* actual instance is not `CustomDestinationForwardDestinationMicrosoftSentinel`, the
475+
* ClassCastException will be thrown.
476+
*
477+
* @return The actual instance of `CustomDestinationForwardDestinationMicrosoftSentinel`
478+
* @throws ClassCastException if the instance is not
479+
* `CustomDestinationForwardDestinationMicrosoftSentinel`
480+
*/
481+
public CustomDestinationForwardDestinationMicrosoftSentinel
482+
getCustomDestinationForwardDestinationMicrosoftSentinel() throws ClassCastException {
483+
return (CustomDestinationForwardDestinationMicrosoftSentinel) super.getActualInstance();
484+
}
396485
}

0 commit comments

Comments
 (0)