Skip to content

Commit f520c46

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a18fdf5e of spec repo
1 parent f047baf commit f520c46

10 files changed

+1152
-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-17 18:21:58.620175",
8-
"spec_repo_commit": "b1a1c000"
7+
"regenerated": "2025-06-18 09:01:45.701047",
8+
"spec_repo_commit": "a18fdf5e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-17 18:21:58.636299",
13-
"spec_repo_commit": "b1a1c000"
12+
"regenerated": "2025-06-18 09:01:45.717026",
13+
"spec_repo_commit": "a18fdf5e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10468,6 +10468,7 @@ components:
1046810468
- $ref: '#/components/schemas/CustomDestinationForwardDestinationHttp'
1046910469
- $ref: '#/components/schemas/CustomDestinationForwardDestinationSplunk'
1047010470
- $ref: '#/components/schemas/CustomDestinationForwardDestinationElasticsearch'
10471+
- $ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinel'
1047110472
CustomDestinationForwardDestinationElasticsearch:
1047210473
description: The Elasticsearch destination.
1047310474
properties:
@@ -10552,6 +10553,49 @@ components:
1055210553
type: string
1055310554
x-enum-varnames:
1055410555
- HTTP
10556+
CustomDestinationForwardDestinationMicrosoftSentinel:
10557+
description: The Microsoft Sentinel destination.
10558+
properties:
10559+
client_id:
10560+
description: Client ID from the Datadog Azure Integration.
10561+
example: 9a2f4d83-2b5e-429e-a35a-2b3c4182db71
10562+
type: string
10563+
data_collection_endpoint:
10564+
description: Azure Data Collection Endpoint.
10565+
example: https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com
10566+
type: string
10567+
data_collection_rule_id:
10568+
description: Azure Data Collection Rule ID.
10569+
example: dcr-000a00a000a00000a000000aa000a0aa
10570+
type: string
10571+
stream_name:
10572+
description: Azure stream name.
10573+
example: Custom-MyTable
10574+
type: string
10575+
writeOnly: true
10576+
tenant_id:
10577+
description: Tenant ID from the Datadog Azure Integration.
10578+
example: f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2
10579+
type: string
10580+
type:
10581+
$ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinelType'
10582+
required:
10583+
- type
10584+
- tenant_id
10585+
- client_id
10586+
- data_collection_endpoint
10587+
- data_collection_rule_id
10588+
- stream_name
10589+
type: object
10590+
CustomDestinationForwardDestinationMicrosoftSentinelType:
10591+
default: microsoft_sentinel
10592+
description: Type of the Microsoft Sentinel destination.
10593+
enum:
10594+
- microsoft_sentinel
10595+
example: microsoft_sentinel
10596+
type: string
10597+
x-enum-varnames:
10598+
- MICROSOFT_SENTINEL
1055510599
CustomDestinationForwardDestinationSplunk:
1055610600
description: The Splunk HTTP Event Collector (HEC) destination.
1055710601
properties:
@@ -10727,6 +10771,7 @@ components:
1072710771
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationHttp'
1072810772
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationSplunk'
1072910773
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationElasticsearch'
10774+
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinel'
1073010775
CustomDestinationResponseForwardDestinationElasticsearch:
1073110776
description: The Elasticsearch destination.
1073210777
properties:
@@ -10811,6 +10856,49 @@ components:
1081110856
type: string
1081210857
x-enum-varnames:
1081310858
- HTTP
10859+
CustomDestinationResponseForwardDestinationMicrosoftSentinel:
10860+
description: The Microsoft Sentinel destination.
10861+
properties:
10862+
client_id:
10863+
description: Client ID from the Datadog Azure Integration.
10864+
example: 9a2f4d83-2b5e-429e-a35a-2b3c4182db71
10865+
type: string
10866+
data_collection_endpoint:
10867+
description: Azure Data Collection Endpoint.
10868+
example: https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com
10869+
type: string
10870+
data_collection_rule_id:
10871+
description: Azure Data Collection Rule ID.
10872+
example: dcr-000a00a000a00000a000000aa000a0aa
10873+
type: string
10874+
stream_name:
10875+
description: Azure stream name.
10876+
example: Custom-MyTable
10877+
type: string
10878+
writeOnly: true
10879+
tenant_id:
10880+
description: Tenant ID from the Datadog Azure Integration.
10881+
example: f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2
10882+
type: string
10883+
type:
10884+
$ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinelType'
10885+
required:
10886+
- type
10887+
- tenant_id
10888+
- client_id
10889+
- data_collection_endpoint
10890+
- data_collection_rule_id
10891+
- stream_name
10892+
type: object
10893+
CustomDestinationResponseForwardDestinationMicrosoftSentinelType:
10894+
default: microsoft_sentinel
10895+
description: Type of the Microsoft Sentinel destination.
10896+
enum:
10897+
- microsoft_sentinel
10898+
example: microsoft_sentinel
10899+
type: string
10900+
x-enum-varnames:
10901+
- MICROSOFT_SENTINEL
1081410902
CustomDestinationResponseForwardDestinationSplunk:
1081510903
description: The Splunk HTTP Event Collector (HEC) destination.
1081610904
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)