@@ -320,6 +320,7 @@ private constructor(
320320 private val decision: JsonField <Decision >,
321321 private val eventToken: JsonField <String >,
322322 private val timestamp: JsonField <OffsetDateTime >,
323+ private val transactionToken: JsonField <String >,
323324 private val additionalProperties: MutableMap <String , JsonValue >,
324325 ) {
325326
@@ -334,7 +335,10 @@ private constructor(
334335 @JsonProperty(" timestamp" )
335336 @ExcludeMissing
336337 timestamp: JsonField <OffsetDateTime > = JsonMissing .of(),
337- ) : this (decision, eventToken, timestamp, mutableMapOf ())
338+ @JsonProperty(" transaction_token" )
339+ @ExcludeMissing
340+ transactionToken: JsonField <String > = JsonMissing .of(),
341+ ) : this (decision, eventToken, timestamp, transactionToken, mutableMapOf ())
338342
339343 /* *
340344 * The decision made by the rule for this event.
@@ -360,6 +364,14 @@ private constructor(
360364 */
361365 fun timestamp (): Optional <OffsetDateTime > = timestamp.getOptional(" timestamp" )
362366
367+ /* *
368+ * The token of the transaction associated with the event
369+ *
370+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
371+ * server responded with an unexpected value).
372+ */
373+ fun transactionToken (): Optional <String > = transactionToken.getOptional(" transaction_token" )
374+
363375 /* *
364376 * Returns the raw JSON value of [decision].
365377 *
@@ -385,6 +397,16 @@ private constructor(
385397 @ExcludeMissing
386398 fun _timestamp (): JsonField <OffsetDateTime > = timestamp
387399
400+ /* *
401+ * Returns the raw JSON value of [transactionToken].
402+ *
403+ * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected
404+ * type.
405+ */
406+ @JsonProperty(" transaction_token" )
407+ @ExcludeMissing
408+ fun _transactionToken (): JsonField <String > = transactionToken
409+
388410 @JsonAnySetter
389411 private fun putAdditionalProperty (key : String , value : JsonValue ) {
390412 additionalProperties.put(key, value)
@@ -409,13 +431,15 @@ private constructor(
409431 private var decision: JsonField <Decision > = JsonMissing .of()
410432 private var eventToken: JsonField <String > = JsonMissing .of()
411433 private var timestamp: JsonField <OffsetDateTime > = JsonMissing .of()
434+ private var transactionToken: JsonField <String > = JsonMissing .of()
412435 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
413436
414437 @JvmSynthetic
415438 internal fun from (example : Example ) = apply {
416439 decision = example.decision
417440 eventToken = example.eventToken
418441 timestamp = example.timestamp
442+ transactionToken = example.transactionToken
419443 additionalProperties = example.additionalProperties.toMutableMap()
420444 }
421445
@@ -457,6 +481,27 @@ private constructor(
457481 this .timestamp = timestamp
458482 }
459483
484+ /* * The token of the transaction associated with the event */
485+ fun transactionToken (transactionToken : String? ) =
486+ transactionToken(JsonField .ofNullable(transactionToken))
487+
488+ /* *
489+ * Alias for calling [Builder.transactionToken] with `transactionToken.orElse(null)`.
490+ */
491+ fun transactionToken (transactionToken : Optional <String >) =
492+ transactionToken(transactionToken.getOrNull())
493+
494+ /* *
495+ * Sets [Builder.transactionToken] to an arbitrary JSON value.
496+ *
497+ * You should usually call [Builder.transactionToken] with a well-typed [String] value
498+ * instead. This method is primarily for setting the field to an undocumented or not yet
499+ * supported value.
500+ */
501+ fun transactionToken (transactionToken : JsonField <String >) = apply {
502+ this .transactionToken = transactionToken
503+ }
504+
460505 fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
461506 this .additionalProperties.clear()
462507 putAllAdditionalProperties(additionalProperties)
@@ -482,7 +527,13 @@ private constructor(
482527 * Further updates to this [Builder] will not mutate the returned instance.
483528 */
484529 fun build (): Example =
485- Example (decision, eventToken, timestamp, additionalProperties.toMutableMap())
530+ Example (
531+ decision,
532+ eventToken,
533+ timestamp,
534+ transactionToken,
535+ additionalProperties.toMutableMap(),
536+ )
486537 }
487538
488539 private var validated: Boolean = false
@@ -495,6 +546,7 @@ private constructor(
495546 decision().ifPresent { it.validate() }
496547 eventToken()
497548 timestamp()
549+ transactionToken()
498550 validated = true
499551 }
500552
@@ -516,7 +568,8 @@ private constructor(
516568 internal fun validity (): Int =
517569 (decision.asKnown().getOrNull()?.validity() ? : 0 ) +
518570 (if (eventToken.asKnown().isPresent) 1 else 0 ) +
519- (if (timestamp.asKnown().isPresent) 1 else 0 )
571+ (if (timestamp.asKnown().isPresent) 1 else 0 ) +
572+ (if (transactionToken.asKnown().isPresent) 1 else 0 )
520573
521574 /* * The decision made by the rule for this event. */
522575 class Decision @JsonCreator private constructor(private val value : JsonField <String >) :
@@ -664,17 +717,18 @@ private constructor(
664717 decision == other.decision &&
665718 eventToken == other.eventToken &&
666719 timestamp == other.timestamp &&
720+ transactionToken == other.transactionToken &&
667721 additionalProperties == other.additionalProperties
668722 }
669723
670724 private val hashCode: Int by lazy {
671- Objects .hash(decision, eventToken, timestamp, additionalProperties)
725+ Objects .hash(decision, eventToken, timestamp, transactionToken, additionalProperties)
672726 }
673727
674728 override fun hashCode (): Int = hashCode
675729
676730 override fun toString () =
677- " Example{decision=$decision , eventToken=$eventToken , timestamp=$timestamp , additionalProperties=$additionalProperties }"
731+ " Example{decision=$decision , eventToken=$eventToken , timestamp=$timestamp , transactionToken= $transactionToken , additionalProperties=$additionalProperties }"
678732 }
679733
680734 override fun equals (other : Any? ): Boolean {
0 commit comments