@@ -241,6 +241,61 @@ public CustomDestinationForwardDestination deserialize(
241
241
e );
242
242
}
243
243
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
+
244
299
CustomDestinationForwardDestination ret = new CustomDestinationForwardDestination ();
245
300
if (match == 1 ) {
246
301
ret .setActualInstance (deserialized );
@@ -286,6 +341,12 @@ public CustomDestinationForwardDestination(CustomDestinationForwardDestinationEl
286
341
setActualInstance (o );
287
342
}
288
343
344
+ public CustomDestinationForwardDestination (
345
+ CustomDestinationForwardDestinationMicrosoftSentinel o ) {
346
+ super ("oneOf" , Boolean .FALSE );
347
+ setActualInstance (o );
348
+ }
349
+
289
350
static {
290
351
schemas .put (
291
352
"CustomDestinationForwardDestinationHttp" ,
@@ -296,6 +357,9 @@ public CustomDestinationForwardDestination(CustomDestinationForwardDestinationEl
296
357
schemas .put (
297
358
"CustomDestinationForwardDestinationElasticsearch" ,
298
359
new GenericType <CustomDestinationForwardDestinationElasticsearch >() {});
360
+ schemas .put (
361
+ "CustomDestinationForwardDestinationMicrosoftSentinel" ,
362
+ new GenericType <CustomDestinationForwardDestinationMicrosoftSentinel >() {});
299
363
JSON .registerDescendants (
300
364
CustomDestinationForwardDestination .class , Collections .unmodifiableMap (schemas ));
301
365
}
@@ -308,7 +372,8 @@ public Map<String, GenericType> getSchemas() {
308
372
/**
309
373
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
310
374
* against the oneOf child schemas: CustomDestinationForwardDestinationHttp,
311
- * CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch
375
+ * CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch,
376
+ * CustomDestinationForwardDestinationMicrosoftSentinel
312
377
*
313
378
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
314
379
* composed schema (allOf, anyOf, oneOf).
@@ -332,6 +397,13 @@ public void setActualInstance(Object instance) {
332
397
super .setActualInstance (instance );
333
398
return ;
334
399
}
400
+ if (JSON .isInstanceOf (
401
+ CustomDestinationForwardDestinationMicrosoftSentinel .class ,
402
+ instance ,
403
+ new HashSet <Class <?>>())) {
404
+ super .setActualInstance (instance );
405
+ return ;
406
+ }
335
407
336
408
if (JSON .isInstanceOf (UnparsedObject .class , instance , new HashSet <Class <?>>())) {
337
409
super .setActualInstance (instance );
@@ -340,16 +412,19 @@ public void setActualInstance(Object instance) {
340
412
throw new RuntimeException (
341
413
"Invalid instance type. Must be CustomDestinationForwardDestinationHttp,"
342
414
+ " CustomDestinationForwardDestinationSplunk,"
343
- + " CustomDestinationForwardDestinationElasticsearch" );
415
+ + " CustomDestinationForwardDestinationElasticsearch,"
416
+ + " CustomDestinationForwardDestinationMicrosoftSentinel" );
344
417
}
345
418
346
419
/**
347
420
* Get the actual instance, which can be the following: CustomDestinationForwardDestinationHttp,
348
- * CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch
421
+ * CustomDestinationForwardDestinationSplunk, CustomDestinationForwardDestinationElasticsearch,
422
+ * CustomDestinationForwardDestinationMicrosoftSentinel
349
423
*
350
424
* @return The actual instance (CustomDestinationForwardDestinationHttp,
351
425
* CustomDestinationForwardDestinationSplunk,
352
- * CustomDestinationForwardDestinationElasticsearch)
426
+ * CustomDestinationForwardDestinationElasticsearch,
427
+ * CustomDestinationForwardDestinationMicrosoftSentinel)
353
428
*/
354
429
@ Override
355
430
public Object getActualInstance () {
@@ -393,4 +468,18 @@ public CustomDestinationForwardDestinationSplunk getCustomDestinationForwardDest
393
468
getCustomDestinationForwardDestinationElasticsearch () throws ClassCastException {
394
469
return (CustomDestinationForwardDestinationElasticsearch ) super .getActualInstance ();
395
470
}
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
+ }
396
485
}
0 commit comments