@@ -7659,6 +7659,7 @@ private constructor(
76597659 private val result: JsonField<DeclineResult>,
76607660 private val ruleResults: JsonField<List<RuleResult>>,
76617661 private val type: JsonField<Type>,
7662+ private val accountType: JsonField<Type>,
76627663 private val networkSpecificData: JsonField<NetworkSpecificData>,
76637664 private val additionalProperties: MutableMap<String, JsonValue>,
76647665 ) {
@@ -7689,6 +7690,9 @@ private constructor(
76897690 @ExcludeMissing
76907691 ruleResults: JsonField<List<RuleResult>> = JsonMissing.of(),
76917692 @JsonProperty("type") @ExcludeMissing type: JsonField<Type> = JsonMissing.of(),
7693+ @JsonProperty("account_type")
7694+ @ExcludeMissing
7695+ accountType: JsonField<Type> = JsonMissing.of(),
76927696 @JsonProperty("network_specific_data")
76937697 @ExcludeMissing
76947698 networkSpecificData: JsonField<NetworkSpecificData> = JsonMissing.of(),
@@ -7703,6 +7707,7 @@ private constructor(
77037707 result,
77047708 ruleResults,
77057709 type,
7710+ accountType,
77067711 networkSpecificData,
77077712 mutableMapOf(),
77087713 )
@@ -7788,6 +7793,12 @@ private constructor(
77887793 */
77897794 fun type(): Type = type.getRequired("type")
77907795
7796+ /**
7797+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
7798+ * server responded with an unexpected value).
7799+ */
7800+ fun accountType(): Optional<Type> = accountType.getOptional("account_type")
7801+
77917802 /**
77927803 * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
77937804 * server responded with an unexpected value).
@@ -7880,6 +7891,15 @@ private constructor(
78807891 */
78817892 @JsonProperty("type") @ExcludeMissing fun _type(): JsonField<Type> = type
78827893
7894+ /**
7895+ * Returns the raw JSON value of [accountType].
7896+ *
7897+ * Unlike [accountType], this method doesn't throw if the JSON field has an unexpected type.
7898+ */
7899+ @JsonProperty("account_type")
7900+ @ExcludeMissing
7901+ fun _accountType(): JsonField<Type> = accountType
7902+
78837903 /**
78847904 * Returns the raw JSON value of [networkSpecificData].
78857905 *
@@ -7937,6 +7957,7 @@ private constructor(
79377957 private var result: JsonField<DeclineResult>? = null
79387958 private var ruleResults: JsonField<MutableList<RuleResult>>? = null
79397959 private var type: JsonField<Type>? = null
7960+ private var accountType: JsonField<Type> = JsonMissing.of()
79407961 private var networkSpecificData: JsonField<NetworkSpecificData> = JsonMissing.of()
79417962 private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
79427963
@@ -7952,6 +7973,7 @@ private constructor(
79527973 result = transactionEvent.result
79537974 ruleResults = transactionEvent.ruleResults.map { it.toMutableList() }
79547975 type = transactionEvent.type
7976+ accountType = transactionEvent.accountType
79557977 networkSpecificData = transactionEvent.networkSpecificData
79567978 additionalProperties = transactionEvent.additionalProperties.toMutableMap()
79577979 }
@@ -8124,6 +8146,17 @@ private constructor(
81248146 */
81258147 fun type(type: JsonField<Type>) = apply { this.type = type }
81268148
8149+ fun accountType(accountType: Type) = accountType(JsonField.of(accountType))
8150+
8151+ /**
8152+ * Sets [Builder.accountType] to an arbitrary JSON value.
8153+ *
8154+ * You should usually call [Builder.accountType] with a well-typed [Type] value instead.
8155+ * This method is primarily for setting the field to an undocumented or not yet
8156+ * supported value.
8157+ */
8158+ fun accountType(accountType: JsonField<Type>) = apply { this.accountType = accountType }
8159+
81278160 fun networkSpecificData(networkSpecificData: NetworkSpecificData) =
81288161 networkSpecificData(JsonField.of(networkSpecificData))
81298162
@@ -8190,6 +8223,7 @@ private constructor(
81908223 checkRequired("result", result),
81918224 checkRequired("ruleResults", ruleResults).map { it.toImmutable() },
81928225 checkRequired("type", type),
8226+ accountType,
81938227 networkSpecificData,
81948228 additionalProperties.toMutableMap(),
81958229 )
@@ -8212,6 +8246,7 @@ private constructor(
82128246 result().validate()
82138247 ruleResults().forEach { it.validate() }
82148248 type().validate()
8249+ accountType().ifPresent { it.validate() }
82158250 networkSpecificData().ifPresent { it.validate() }
82168251 validated = true
82178252 }
@@ -8242,6 +8277,7 @@ private constructor(
82428277 (result.asKnown().getOrNull()?.validity() ?: 0) +
82438278 (ruleResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
82448279 (type.asKnown().getOrNull()?.validity() ?: 0) +
8280+ (accountType.asKnown().getOrNull()?.validity() ?: 0) +
82458281 (networkSpecificData.asKnown().getOrNull()?.validity() ?: 0)
82468282
82478283 class TransactionEventAmounts
@@ -12465,6 +12501,133 @@ private constructor(
1246512501 override fun toString() = value.toString()
1246612502 }
1246712503
12504+ class Type @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
12505+
12506+ /**
12507+ * Returns this class instance's raw value.
12508+ *
12509+ * This is usually only useful if this instance was deserialized from data that doesn't
12510+ * match any known member, and you want to know that value. For example, if the SDK is
12511+ * on an older version than the API, then the API may respond with new members that the
12512+ * SDK is unaware of.
12513+ */
12514+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
12515+
12516+ companion object {
12517+
12518+ @JvmField val CHECKING = of("CHECKING")
12519+
12520+ @JvmField val SAVINGS = of("SAVINGS")
12521+
12522+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
12523+ }
12524+
12525+ /** An enum containing [Type]'s known values. */
12526+ enum class Known {
12527+ CHECKING,
12528+ SAVINGS,
12529+ }
12530+
12531+ /**
12532+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
12533+ *
12534+ * An instance of [Type] can contain an unknown value in a couple of cases:
12535+ * - It was deserialized from data that doesn't match any known member. For example, if
12536+ * the SDK is on an older version than the API, then the API may respond with new
12537+ * members that the SDK is unaware of.
12538+ * - It was constructed with an arbitrary value using the [of] method.
12539+ */
12540+ enum class Value {
12541+ CHECKING,
12542+ SAVINGS,
12543+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
12544+ _UNKNOWN,
12545+ }
12546+
12547+ /**
12548+ * Returns an enum member corresponding to this class instance's value, or
12549+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
12550+ *
12551+ * Use the [known] method instead if you're certain the value is always known or if you
12552+ * want to throw for the unknown case.
12553+ */
12554+ fun value(): Value =
12555+ when (this) {
12556+ CHECKING -> Value.CHECKING
12557+ SAVINGS -> Value.SAVINGS
12558+ else -> Value._UNKNOWN
12559+ }
12560+
12561+ /**
12562+ * Returns an enum member corresponding to this class instance's value.
12563+ *
12564+ * Use the [value] method instead if you're uncertain the value is always known and
12565+ * don't want to throw for the unknown case.
12566+ *
12567+ * @throws LithicInvalidDataException if this class instance's value is a not a known
12568+ * member.
12569+ */
12570+ fun known(): Known =
12571+ when (this) {
12572+ CHECKING -> Known.CHECKING
12573+ SAVINGS -> Known.SAVINGS
12574+ else -> throw LithicInvalidDataException("Unknown Type: $value")
12575+ }
12576+
12577+ /**
12578+ * Returns this class instance's primitive wire representation.
12579+ *
12580+ * This differs from the [toString] method because that method is primarily for
12581+ * debugging and generally doesn't throw.
12582+ *
12583+ * @throws LithicInvalidDataException if this class instance's value does not have the
12584+ * expected primitive type.
12585+ */
12586+ fun asString(): String =
12587+ _value().asString().orElseThrow {
12588+ LithicInvalidDataException("Value is not a String")
12589+ }
12590+
12591+ private var validated: Boolean = false
12592+
12593+ fun validate(): Type = apply {
12594+ if (validated) {
12595+ return@apply
12596+ }
12597+
12598+ known()
12599+ validated = true
12600+ }
12601+
12602+ fun isValid(): Boolean =
12603+ try {
12604+ validate()
12605+ true
12606+ } catch (e: LithicInvalidDataException) {
12607+ false
12608+ }
12609+
12610+ /**
12611+ * Returns a score indicating how many valid values are contained in this object
12612+ * recursively.
12613+ *
12614+ * Used for best match union deserialization.
12615+ */
12616+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
12617+
12618+ override fun equals(other: Any?): Boolean {
12619+ if (this === other) {
12620+ return true
12621+ }
12622+
12623+ return /* spotless:off */ other is Type && value == other.value /* spotless:on */
12624+ }
12625+
12626+ override fun hashCode() = value.hashCode()
12627+
12628+ override fun toString() = value.toString()
12629+ }
12630+
1246812631 class NetworkSpecificData
1246912632 private constructor(
1247012633 private val mastercard: JsonField<MastercardNetworkSpecificData>,
@@ -13466,17 +13629,17 @@ private constructor(
1346613629 return true
1346713630 }
1346813631
13469- return /* spotless:off */ other is TransactionEvent && token == other.token && amount == other.amount && amounts == other.amounts && created == other.created && detailedResults == other.detailedResults && effectivePolarity == other.effectivePolarity && networkInfo == other.networkInfo && result == other.result && ruleResults == other.ruleResults && type == other.type && networkSpecificData == other.networkSpecificData && additionalProperties == other.additionalProperties /* spotless:on */
13632+ return /* spotless:off */ other is TransactionEvent && token == other.token && amount == other.amount && amounts == other.amounts && created == other.created && detailedResults == other.detailedResults && effectivePolarity == other.effectivePolarity && networkInfo == other.networkInfo && result == other.result && ruleResults == other.ruleResults && type == other.type && accountType == other.accountType && networkSpecificData == other.networkSpecificData && additionalProperties == other.additionalProperties /* spotless:on */
1347013633 }
1347113634
1347213635 /* spotless:off */
13473- private val hashCode: Int by lazy { Objects.hash(token, amount, amounts, created, detailedResults, effectivePolarity, networkInfo, result, ruleResults, type, networkSpecificData, additionalProperties) }
13636+ private val hashCode: Int by lazy { Objects.hash(token, amount, amounts, created, detailedResults, effectivePolarity, networkInfo, result, ruleResults, type, accountType, networkSpecificData, additionalProperties) }
1347413637 /* spotless:on */
1347513638
1347613639 override fun hashCode(): Int = hashCode
1347713640
1347813641 override fun toString() =
13479- "TransactionEvent{token=$token, amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, networkInfo=$networkInfo, result=$result, ruleResults=$ruleResults, type=$type, networkSpecificData=$networkSpecificData, additionalProperties=$additionalProperties}"
13642+ "TransactionEvent{token=$token, amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, networkInfo=$networkInfo, result=$result, ruleResults=$ruleResults, type=$type, accountType=$accountType, networkSpecificData=$networkSpecificData, additionalProperties=$additionalProperties}"
1348013643 }
1348113644
1348213645 override fun equals(other: Any?): Boolean {
0 commit comments