@@ -19,6 +19,9 @@ import java.util.Optional
1919@NoAutoDetect
2020class AuthRule
2121private constructor (
22+ private val token: JsonField <String >,
23+ private val state: JsonField <State >,
24+ private val previousAuthRuleTokens: JsonField <List <String >>,
2225 private val allowedMcc: JsonField <List <String >>,
2326 private val blockedMcc: JsonField <List <String >>,
2427 private val allowedCountries: JsonField <List <String >>,
@@ -34,6 +37,19 @@ private constructor(
3437
3538 private var hashCode: Int = 0
3639
40+ /* * Globally unique identifier. */
41+ fun token (): Optional <String > = Optional .ofNullable(token.getNullable(" token" ))
42+
43+ /* * Indicates whether the Auth Rule is ACTIVE or INACTIVE */
44+ fun state (): Optional <State > = Optional .ofNullable(state.getNullable(" state" ))
45+
46+ /* *
47+ * Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if an
48+ * Auth Rule is applied to entities that previously already had one applied.
49+ */
50+ fun previousAuthRuleTokens (): Optional <List <String >> =
51+ Optional .ofNullable(previousAuthRuleTokens.getNullable(" previous_auth_rule_tokens" ))
52+
3753 /* * Merchant category codes for which the Auth Rule permits transactions. */
3854 fun allowedMcc (): Optional <List <String >> =
3955 Optional .ofNullable(allowedMcc.getNullable(" allowed_mcc" ))
@@ -83,6 +99,20 @@ private constructor(
8399 fun programLevel (): Optional <Boolean > =
84100 Optional .ofNullable(programLevel.getNullable(" program_level" ))
85101
102+ /* * Globally unique identifier. */
103+ @JsonProperty(" token" ) @ExcludeMissing fun _token () = token
104+
105+ /* * Indicates whether the Auth Rule is ACTIVE or INACTIVE */
106+ @JsonProperty(" state" ) @ExcludeMissing fun _state () = state
107+
108+ /* *
109+ * Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if an
110+ * Auth Rule is applied to entities that previously already had one applied.
111+ */
112+ @JsonProperty(" previous_auth_rule_tokens" )
113+ @ExcludeMissing
114+ fun _previousAuthRuleTokens () = previousAuthRuleTokens
115+
86116 /* * Merchant category codes for which the Auth Rule permits transactions. */
87117 @JsonProperty(" allowed_mcc" ) @ExcludeMissing fun _allowedMcc () = allowedMcc
88118
@@ -131,6 +161,9 @@ private constructor(
131161
132162 fun validate () = apply {
133163 if (! validated) {
164+ token()
165+ state()
166+ previousAuthRuleTokens()
134167 allowedMcc()
135168 blockedMcc()
136169 allowedCountries()
@@ -151,6 +184,9 @@ private constructor(
151184 }
152185
153186 return other is AuthRule &&
187+ this .token == other.token &&
188+ this .state == other.state &&
189+ this .previousAuthRuleTokens == other.previousAuthRuleTokens &&
154190 this .allowedMcc == other.allowedMcc &&
155191 this .blockedMcc == other.blockedMcc &&
156192 this .allowedCountries == other.allowedCountries &&
@@ -166,6 +202,9 @@ private constructor(
166202 if (hashCode == 0 ) {
167203 hashCode =
168204 Objects .hash(
205+ token,
206+ state,
207+ previousAuthRuleTokens,
169208 allowedMcc,
170209 blockedMcc,
171210 allowedCountries,
@@ -181,7 +220,7 @@ private constructor(
181220 }
182221
183222 override fun toString () =
184- " AuthRule{allowedMcc=$allowedMcc , blockedMcc=$blockedMcc , allowedCountries=$allowedCountries , blockedCountries=$blockedCountries , avsType=$avsType , accountTokens=$accountTokens , cardTokens=$cardTokens , programLevel=$programLevel , additionalProperties=$additionalProperties }"
223+ " AuthRule{token= $token , state= $state , previousAuthRuleTokens= $previousAuthRuleTokens , allowedMcc=$allowedMcc , blockedMcc=$blockedMcc , allowedCountries=$allowedCountries , blockedCountries=$blockedCountries , avsType=$avsType , accountTokens=$accountTokens , cardTokens=$cardTokens , programLevel=$programLevel , additionalProperties=$additionalProperties }"
185224
186225 companion object {
187226
@@ -190,6 +229,9 @@ private constructor(
190229
191230 class Builder {
192231
232+ private var token: JsonField <String > = JsonMissing .of()
233+ private var state: JsonField <State > = JsonMissing .of()
234+ private var previousAuthRuleTokens: JsonField <List <String >> = JsonMissing .of()
193235 private var allowedMcc: JsonField <List <String >> = JsonMissing .of()
194236 private var blockedMcc: JsonField <List <String >> = JsonMissing .of()
195237 private var allowedCountries: JsonField <List <String >> = JsonMissing .of()
@@ -202,6 +244,9 @@ private constructor(
202244
203245 @JvmSynthetic
204246 internal fun from (authRule : AuthRule ) = apply {
247+ this .token = authRule.token
248+ this .state = authRule.state
249+ this .previousAuthRuleTokens = authRule.previousAuthRuleTokens
205250 this .allowedMcc = authRule.allowedMcc
206251 this .blockedMcc = authRule.blockedMcc
207252 this .allowedCountries = authRule.allowedCountries
@@ -213,6 +258,39 @@ private constructor(
213258 additionalProperties(authRule.additionalProperties)
214259 }
215260
261+ /* * Globally unique identifier. */
262+ fun token (token : String ) = token(JsonField .of(token))
263+
264+ /* * Globally unique identifier. */
265+ @JsonProperty(" token" )
266+ @ExcludeMissing
267+ fun token (token : JsonField <String >) = apply { this .token = token }
268+
269+ /* * Indicates whether the Auth Rule is ACTIVE or INACTIVE */
270+ fun state (state : State ) = state(JsonField .of(state))
271+
272+ /* * Indicates whether the Auth Rule is ACTIVE or INACTIVE */
273+ @JsonProperty(" state" )
274+ @ExcludeMissing
275+ fun state (state : JsonField <State >) = apply { this .state = state }
276+
277+ /* *
278+ * Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if
279+ * an Auth Rule is applied to entities that previously already had one applied.
280+ */
281+ fun previousAuthRuleTokens (previousAuthRuleTokens : List <String >) =
282+ previousAuthRuleTokens(JsonField .of(previousAuthRuleTokens))
283+
284+ /* *
285+ * Identifier for the Auth Rule(s) that a new Auth Rule replaced; will be returned only if
286+ * an Auth Rule is applied to entities that previously already had one applied.
287+ */
288+ @JsonProperty(" previous_auth_rule_tokens" )
289+ @ExcludeMissing
290+ fun previousAuthRuleTokens (previousAuthRuleTokens : JsonField <List <String >>) = apply {
291+ this .previousAuthRuleTokens = previousAuthRuleTokens
292+ }
293+
216294 /* * Merchant category codes for which the Auth Rule permits transactions. */
217295 fun allowedMcc (allowedMcc : List <String >) = allowedMcc(JsonField .of(allowedMcc))
218296
@@ -339,6 +417,9 @@ private constructor(
339417
340418 fun build (): AuthRule =
341419 AuthRule (
420+ token,
421+ state,
422+ previousAuthRuleTokens.map { it.toUnmodifiable() },
342423 allowedMcc.map { it.toUnmodifiable() },
343424 blockedMcc.map { it.toUnmodifiable() },
344425 allowedCountries.map { it.toUnmodifiable() },
@@ -351,6 +432,63 @@ private constructor(
351432 )
352433 }
353434
435+ class State
436+ @JsonCreator
437+ private constructor (
438+ private val value: JsonField <String >,
439+ ) {
440+
441+ @com.fasterxml.jackson.annotation.JsonValue fun _value (): JsonField <String > = value
442+
443+ override fun equals (other : Any? ): Boolean {
444+ if (this == = other) {
445+ return true
446+ }
447+
448+ return other is State && this .value == other.value
449+ }
450+
451+ override fun hashCode () = value.hashCode()
452+
453+ override fun toString () = value.toString()
454+
455+ companion object {
456+
457+ @JvmField val ACTIVE = State (JsonField .of(" ACTIVE" ))
458+
459+ @JvmField val INACTIVE = State (JsonField .of(" INACTIVE" ))
460+
461+ @JvmStatic fun of (value : String ) = State (JsonField .of(value))
462+ }
463+
464+ enum class Known {
465+ ACTIVE ,
466+ INACTIVE ,
467+ }
468+
469+ enum class Value {
470+ ACTIVE ,
471+ INACTIVE ,
472+ _UNKNOWN ,
473+ }
474+
475+ fun value (): Value =
476+ when (this ) {
477+ ACTIVE -> Value .ACTIVE
478+ INACTIVE -> Value .INACTIVE
479+ else -> Value ._UNKNOWN
480+ }
481+
482+ fun known (): Known =
483+ when (this ) {
484+ ACTIVE -> Known .ACTIVE
485+ INACTIVE -> Known .INACTIVE
486+ else -> throw LithicInvalidDataException (" Unknown State: $value " )
487+ }
488+
489+ fun asString (): String = _value ().asStringOrThrow()
490+ }
491+
354492 class AvsType
355493 @JsonCreator
356494 private constructor (
0 commit comments