@@ -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