diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c37434e9..2969a756 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.110.0"
+ ".": "0.111.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 61c0e26a..a080bc22 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 168
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-2cfd81dfd3ad2c5a4e98161e54dbac5ddee125c058f9163f29aad4632cadf08d.yml
-openapi_spec_hash: 400a2563ad969fba47b3eb0f02372b1e
-config_hash: f5a16e702bac54729afed6e50b0de3ff
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c3f6c23018d70fd1b259b21cfd377b5d905872f0d3c5ce2cdb8013f4b6daa338.yml
+openapi_spec_hash: b551344da9d29eb4c5374874ed84a9b0
+config_hash: 012f050e575d1bbfe8db56a9eeaa5fcd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c53b935..bb9a9745 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## 0.111.0 (2025-11-13)
+
+Full Changelog: [v0.110.0...v0.111.0](https://github.com/lithic-com/lithic-java/compare/v0.110.0...v0.111.0)
+
+### Features
+
+* **api:** re-add rules metadata to tokenization events ([a6c8aab](https://github.com/lithic-com/lithic-java/commit/a6c8aabdecb7f8fdd1bb3c979a6d9550c3d420bb))
+* **api:** remove deprecated fields from Cardholder Authentication object ([a6c8aab](https://github.com/lithic-com/lithic-java/commit/a6c8aabdecb7f8fdd1bb3c979a6d9550c3d420bb))
+
+
+### Bug Fixes
+
+* **api:** adjust Auth Rules spec for better SDK structure ([a6c8aab](https://github.com/lithic-com/lithic-java/commit/a6c8aabdecb7f8fdd1bb3c979a6d9550c3d420bb))
+* **client:** multi-value header serialization ([26cec99](https://github.com/lithic-com/lithic-java/commit/26cec993b5d2d2ed0ee382726743d5573a942426))
+
## 0.110.0 (2025-11-10)
Full Changelog: [v0.109.0...v0.110.0](https://github.com/lithic-com/lithic-java/compare/v0.109.0...v0.110.0)
diff --git a/README.md b/README.md
index 0f829317..286679ae 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.110.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.110.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.111.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.111.0)
@@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc
-The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.110.0).
+The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.111.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.110.0")
+implementation("com.lithic.api:lithic-java:0.111.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.110.0")
com.lithic.api
lithic-java
- 0.110.0
+ 0.111.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 816a8aa9..d50b6512 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.110.0" // x-release-please-version
+ version = "0.111.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
index 859611b4..d4e9564d 100644
--- a/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
+++ b/lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt
@@ -109,19 +109,19 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpC
val builder = Request.Builder().url(toUrl()).method(method.name, body)
headers.names().forEach { name ->
- headers.values(name).forEach { builder.header(name, it) }
+ headers.values(name).forEach { builder.addHeader(name, it) }
}
if (
!headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0
) {
- builder.header(
+ builder.addHeader(
"X-Stainless-Read-Timeout",
Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(),
)
}
if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) {
- builder.header(
+ builder.addHeader(
"X-Stainless-Timeout",
Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(),
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
index c4fa7dea..727366e2 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
@@ -81,26 +81,16 @@ private constructor(
fun body(body: Body) = apply { this.body = body }
- /**
- * Alias for calling [body] with
- * `Body.ofCreateAuthRuleRequestAccountTokens(createAuthRuleRequestAccountTokens)`.
- */
- fun body(createAuthRuleRequestAccountTokens: Body.CreateAuthRuleRequestAccountTokens) =
- body(Body.ofCreateAuthRuleRequestAccountTokens(createAuthRuleRequestAccountTokens))
+ /** Alias for calling [body] with `Body.ofAccountLevelRule(accountLevelRule)`. */
+ fun body(accountLevelRule: Body.AccountLevelRule) =
+ body(Body.ofAccountLevelRule(accountLevelRule))
- /**
- * Alias for calling [body] with
- * `Body.ofCreateAuthRuleRequestCardTokens(createAuthRuleRequestCardTokens)`.
- */
- fun body(createAuthRuleRequestCardTokens: Body.CreateAuthRuleRequestCardTokens) =
- body(Body.ofCreateAuthRuleRequestCardTokens(createAuthRuleRequestCardTokens))
+ /** Alias for calling [body] with `Body.ofCardLevelRule(cardLevelRule)`. */
+ fun body(cardLevelRule: Body.CardLevelRule) = body(Body.ofCardLevelRule(cardLevelRule))
- /**
- * Alias for calling [body] with
- * `Body.ofCreateAuthRuleRequestProgramLevel(createAuthRuleRequestProgramLevel)`.
- */
- fun body(createAuthRuleRequestProgramLevel: Body.CreateAuthRuleRequestProgramLevel) =
- body(Body.ofCreateAuthRuleRequestProgramLevel(createAuthRuleRequestProgramLevel))
+ /** Alias for calling [body] with `Body.ofProgramLevelRule(programLevelRule)`. */
+ fun body(programLevelRule: Body.ProgramLevelRule) =
+ body(Body.ofProgramLevelRule(programLevelRule))
fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
@@ -230,52 +220,37 @@ private constructor(
@JsonSerialize(using = Body.Serializer::class)
class Body
private constructor(
- private val createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens? = null,
- private val createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens? = null,
- private val createAuthRuleRequestProgramLevel: CreateAuthRuleRequestProgramLevel? = null,
+ private val accountLevelRule: AccountLevelRule? = null,
+ private val cardLevelRule: CardLevelRule? = null,
+ private val programLevelRule: ProgramLevelRule? = null,
private val _json: JsonValue? = null,
) {
- fun createAuthRuleRequestAccountTokens(): Optional =
- Optional.ofNullable(createAuthRuleRequestAccountTokens)
+ fun accountLevelRule(): Optional = Optional.ofNullable(accountLevelRule)
- fun createAuthRuleRequestCardTokens(): Optional =
- Optional.ofNullable(createAuthRuleRequestCardTokens)
+ fun cardLevelRule(): Optional = Optional.ofNullable(cardLevelRule)
- fun createAuthRuleRequestProgramLevel(): Optional =
- Optional.ofNullable(createAuthRuleRequestProgramLevel)
+ fun programLevelRule(): Optional = Optional.ofNullable(programLevelRule)
- fun isCreateAuthRuleRequestAccountTokens(): Boolean =
- createAuthRuleRequestAccountTokens != null
+ fun isAccountLevelRule(): Boolean = accountLevelRule != null
- fun isCreateAuthRuleRequestCardTokens(): Boolean = createAuthRuleRequestCardTokens != null
+ fun isCardLevelRule(): Boolean = cardLevelRule != null
- fun isCreateAuthRuleRequestProgramLevel(): Boolean =
- createAuthRuleRequestProgramLevel != null
+ fun isProgramLevelRule(): Boolean = programLevelRule != null
- fun asCreateAuthRuleRequestAccountTokens(): CreateAuthRuleRequestAccountTokens =
- createAuthRuleRequestAccountTokens.getOrThrow("createAuthRuleRequestAccountTokens")
+ fun asAccountLevelRule(): AccountLevelRule = accountLevelRule.getOrThrow("accountLevelRule")
- fun asCreateAuthRuleRequestCardTokens(): CreateAuthRuleRequestCardTokens =
- createAuthRuleRequestCardTokens.getOrThrow("createAuthRuleRequestCardTokens")
+ fun asCardLevelRule(): CardLevelRule = cardLevelRule.getOrThrow("cardLevelRule")
- fun asCreateAuthRuleRequestProgramLevel(): CreateAuthRuleRequestProgramLevel =
- createAuthRuleRequestProgramLevel.getOrThrow("createAuthRuleRequestProgramLevel")
+ fun asProgramLevelRule(): ProgramLevelRule = programLevelRule.getOrThrow("programLevelRule")
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
when {
- createAuthRuleRequestAccountTokens != null ->
- visitor.visitCreateAuthRuleRequestAccountTokens(
- createAuthRuleRequestAccountTokens
- )
- createAuthRuleRequestCardTokens != null ->
- visitor.visitCreateAuthRuleRequestCardTokens(createAuthRuleRequestCardTokens)
- createAuthRuleRequestProgramLevel != null ->
- visitor.visitCreateAuthRuleRequestProgramLevel(
- createAuthRuleRequestProgramLevel
- )
+ accountLevelRule != null -> visitor.visitAccountLevelRule(accountLevelRule)
+ cardLevelRule != null -> visitor.visitCardLevelRule(cardLevelRule)
+ programLevelRule != null -> visitor.visitProgramLevelRule(programLevelRule)
else -> visitor.unknown(_json)
}
@@ -288,22 +263,16 @@ private constructor(
accept(
object : Visitor {
- override fun visitCreateAuthRuleRequestAccountTokens(
- createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens
- ) {
- createAuthRuleRequestAccountTokens.validate()
+ override fun visitAccountLevelRule(accountLevelRule: AccountLevelRule) {
+ accountLevelRule.validate()
}
- override fun visitCreateAuthRuleRequestCardTokens(
- createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens
- ) {
- createAuthRuleRequestCardTokens.validate()
+ override fun visitCardLevelRule(cardLevelRule: CardLevelRule) {
+ cardLevelRule.validate()
}
- override fun visitCreateAuthRuleRequestProgramLevel(
- createAuthRuleRequestProgramLevel: CreateAuthRuleRequestProgramLevel
- ) {
- createAuthRuleRequestProgramLevel.validate()
+ override fun visitProgramLevelRule(programLevelRule: ProgramLevelRule) {
+ programLevelRule.validate()
}
}
)
@@ -328,17 +297,14 @@ private constructor(
internal fun validity(): Int =
accept(
object : Visitor {
- override fun visitCreateAuthRuleRequestAccountTokens(
- createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens
- ) = createAuthRuleRequestAccountTokens.validity()
+ override fun visitAccountLevelRule(accountLevelRule: AccountLevelRule) =
+ accountLevelRule.validity()
- override fun visitCreateAuthRuleRequestCardTokens(
- createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens
- ) = createAuthRuleRequestCardTokens.validity()
+ override fun visitCardLevelRule(cardLevelRule: CardLevelRule) =
+ cardLevelRule.validity()
- override fun visitCreateAuthRuleRequestProgramLevel(
- createAuthRuleRequestProgramLevel: CreateAuthRuleRequestProgramLevel
- ) = createAuthRuleRequestProgramLevel.validity()
+ override fun visitProgramLevelRule(programLevelRule: ProgramLevelRule) =
+ programLevelRule.validity()
override fun unknown(json: JsonValue?) = 0
}
@@ -350,26 +316,19 @@ private constructor(
}
return other is Body &&
- createAuthRuleRequestAccountTokens == other.createAuthRuleRequestAccountTokens &&
- createAuthRuleRequestCardTokens == other.createAuthRuleRequestCardTokens &&
- createAuthRuleRequestProgramLevel == other.createAuthRuleRequestProgramLevel
+ accountLevelRule == other.accountLevelRule &&
+ cardLevelRule == other.cardLevelRule &&
+ programLevelRule == other.programLevelRule
}
override fun hashCode(): Int =
- Objects.hash(
- createAuthRuleRequestAccountTokens,
- createAuthRuleRequestCardTokens,
- createAuthRuleRequestProgramLevel,
- )
+ Objects.hash(accountLevelRule, cardLevelRule, programLevelRule)
override fun toString(): String =
when {
- createAuthRuleRequestAccountTokens != null ->
- "Body{createAuthRuleRequestAccountTokens=$createAuthRuleRequestAccountTokens}"
- createAuthRuleRequestCardTokens != null ->
- "Body{createAuthRuleRequestCardTokens=$createAuthRuleRequestCardTokens}"
- createAuthRuleRequestProgramLevel != null ->
- "Body{createAuthRuleRequestProgramLevel=$createAuthRuleRequestProgramLevel}"
+ accountLevelRule != null -> "Body{accountLevelRule=$accountLevelRule}"
+ cardLevelRule != null -> "Body{cardLevelRule=$cardLevelRule}"
+ programLevelRule != null -> "Body{programLevelRule=$programLevelRule}"
_json != null -> "Body{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Body")
}
@@ -377,35 +336,25 @@ private constructor(
companion object {
@JvmStatic
- fun ofCreateAuthRuleRequestAccountTokens(
- createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens
- ) = Body(createAuthRuleRequestAccountTokens = createAuthRuleRequestAccountTokens)
+ fun ofAccountLevelRule(accountLevelRule: AccountLevelRule) =
+ Body(accountLevelRule = accountLevelRule)
@JvmStatic
- fun ofCreateAuthRuleRequestCardTokens(
- createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens
- ) = Body(createAuthRuleRequestCardTokens = createAuthRuleRequestCardTokens)
+ fun ofCardLevelRule(cardLevelRule: CardLevelRule) = Body(cardLevelRule = cardLevelRule)
@JvmStatic
- fun ofCreateAuthRuleRequestProgramLevel(
- createAuthRuleRequestProgramLevel: CreateAuthRuleRequestProgramLevel
- ) = Body(createAuthRuleRequestProgramLevel = createAuthRuleRequestProgramLevel)
+ fun ofProgramLevelRule(programLevelRule: ProgramLevelRule) =
+ Body(programLevelRule = programLevelRule)
}
/** An interface that defines how to map each variant of [Body] to a value of type [T]. */
interface Visitor {
- fun visitCreateAuthRuleRequestAccountTokens(
- createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens
- ): T
+ fun visitAccountLevelRule(accountLevelRule: AccountLevelRule): T
- fun visitCreateAuthRuleRequestCardTokens(
- createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens
- ): T
+ fun visitCardLevelRule(cardLevelRule: CardLevelRule): T
- fun visitCreateAuthRuleRequestProgramLevel(
- createAuthRuleRequestProgramLevel: CreateAuthRuleRequestProgramLevel
- ): T
+ fun visitProgramLevelRule(programLevelRule: ProgramLevelRule): T
/**
* Maps an unknown variant of [Body] to a value of type [T].
@@ -428,20 +377,15 @@ private constructor(
val bestMatches =
sequenceOf(
- tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let {
- Body(createAuthRuleRequestAccountTokens = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())
- ?.let { Body(createAuthRuleRequestCardTokens = it, _json = json) },
- tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Body(createAuthRuleRequestProgramLevel = it, _json = json) },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Body(accountLevelRule = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Body(cardLevelRule = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Body(programLevelRule = it, _json = json)
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -467,32 +411,35 @@ private constructor(
provider: SerializerProvider,
) {
when {
- value.createAuthRuleRequestAccountTokens != null ->
- generator.writeObject(value.createAuthRuleRequestAccountTokens)
- value.createAuthRuleRequestCardTokens != null ->
- generator.writeObject(value.createAuthRuleRequestCardTokens)
- value.createAuthRuleRequestProgramLevel != null ->
- generator.writeObject(value.createAuthRuleRequestProgramLevel)
+ value.accountLevelRule != null -> generator.writeObject(value.accountLevelRule)
+ value.cardLevelRule != null -> generator.writeObject(value.cardLevelRule)
+ value.programLevelRule != null -> generator.writeObject(value.programLevelRule)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Body")
}
}
}
- class CreateAuthRuleRequestAccountTokens
+ class AccountLevelRule
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
+ private val parameters: JsonField,
+ private val type: JsonField,
private val accountTokens: JsonField>,
private val businessAccountTokens: JsonField>,
private val eventStream: JsonField,
private val name: JsonField,
- private val parameters: JsonField,
- private val type: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
+ @JsonProperty("parameters")
+ @ExcludeMissing
+ parameters: JsonField = JsonMissing.of(),
+ @JsonProperty("type")
+ @ExcludeMissing
+ type: JsonField = JsonMissing.of(),
@JsonProperty("account_tokens")
@ExcludeMissing
accountTokens: JsonField> = JsonMissing.of(),
@@ -503,22 +450,40 @@ private constructor(
@ExcludeMissing
eventStream: JsonField = JsonMissing.of(),
@JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("parameters")
- @ExcludeMissing
- parameters: JsonField = JsonMissing.of(),
- @JsonProperty("type")
- @ExcludeMissing
- type: JsonField = JsonMissing.of(),
) : this(
+ parameters,
+ type,
accountTokens,
businessAccountTokens,
eventStream,
name,
- parameters,
- type,
mutableMapOf(),
)
+ /**
+ * Parameters for the Auth Rule
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun parameters(): Parameters = parameters.getRequired("parameters")
+
+ /**
+ * The type of Auth Rule. For certain rule types, this determines the event stream
+ * during which it will be evaluated. For rules that can be applied to one of several
+ * event streams, the effective one is defined by the separate `event_stream` field.
+ * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
+ * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
+ * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun type(): AuthRuleType = type.getRequired("type")
+
/**
* Account tokens to which the Auth Rule applies.
*
@@ -554,26 +519,21 @@ private constructor(
fun name(): Optional = name.getOptional("name")
/**
- * Parameters for the Auth Rule
+ * Returns the raw JSON value of [parameters].
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
+ * Unlike [parameters], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun parameters(): Optional = parameters.getOptional("parameters")
+ @JsonProperty("parameters")
+ @ExcludeMissing
+ fun _parameters(): JsonField = parameters
/**
- * The type of Auth Rule. For certain rule types, this determines the event stream
- * during which it will be evaluated. For rules that can be applied to one of several
- * event streams, the effective one is defined by the separate `event_stream` field.
- * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * Returns the raw JSON value of [type].
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
*/
- fun type(): Optional = type.getOptional("type")
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
/**
* Returns the raw JSON value of [accountTokens].
@@ -612,23 +572,6 @@ private constructor(
*/
@JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
- /**
- * Returns the raw JSON value of [parameters].
- *
- * Unlike [parameters], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("parameters")
- @ExcludeMissing
- fun _parameters(): JsonField = parameters
-
- /**
- * Returns the raw JSON value of [type].
- *
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
-
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -644,41 +587,113 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of
- * [CreateAuthRuleRequestAccountTokens].
+ * Returns a mutable builder for constructing an instance of [AccountLevelRule].
+ *
+ * The following fields are required:
+ * ```java
+ * .parameters()
+ * .type()
+ * ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CreateAuthRuleRequestAccountTokens]. */
+ /** A builder for [AccountLevelRule]. */
class Builder internal constructor() {
+ private var parameters: JsonField? = null
+ private var type: JsonField? = null
private var accountTokens: JsonField>? = null
private var businessAccountTokens: JsonField>? = null
private var eventStream: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
- private var parameters: JsonField = JsonMissing.of()
- private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(
- createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens
- ) = apply {
- accountTokens =
- createAuthRuleRequestAccountTokens.accountTokens.map { it.toMutableList() }
+ internal fun from(accountLevelRule: AccountLevelRule) = apply {
+ parameters = accountLevelRule.parameters
+ type = accountLevelRule.type
+ accountTokens = accountLevelRule.accountTokens.map { it.toMutableList() }
businessAccountTokens =
- createAuthRuleRequestAccountTokens.businessAccountTokens.map {
- it.toMutableList()
- }
- eventStream = createAuthRuleRequestAccountTokens.eventStream
- name = createAuthRuleRequestAccountTokens.name
- parameters = createAuthRuleRequestAccountTokens.parameters
- type = createAuthRuleRequestAccountTokens.type
- additionalProperties =
- createAuthRuleRequestAccountTokens.additionalProperties.toMutableMap()
+ accountLevelRule.businessAccountTokens.map { it.toMutableList() }
+ eventStream = accountLevelRule.eventStream
+ name = accountLevelRule.name
+ additionalProperties = accountLevelRule.additionalProperties.toMutableMap()
+ }
+
+ /** Parameters for the Auth Rule */
+ fun parameters(parameters: Parameters) = parameters(JsonField.of(parameters))
+
+ /**
+ * Sets [Builder.parameters] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.parameters] with a well-typed [Parameters] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun parameters(parameters: JsonField) = apply {
+ this.parameters = parameters
}
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalBlock(conditionalBlock)`.
+ */
+ fun parameters(conditionalBlock: ConditionalBlockParameters) =
+ parameters(Parameters.ofConditionalBlock(conditionalBlock))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofVelocityLimitParams(velocityLimitParams)`.
+ */
+ fun parameters(velocityLimitParams: VelocityLimitParams) =
+ parameters(Parameters.ofVelocityLimitParams(velocityLimitParams))
+
+ /**
+ * Alias for calling [parameters] with `Parameters.ofMerchantLock(merchantLock)`.
+ */
+ fun parameters(merchantLock: MerchantLockParameters) =
+ parameters(Parameters.ofMerchantLock(merchantLock))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditional3dsAction(conditional3dsAction)`.
+ */
+ fun parameters(conditional3dsAction: Conditional3dsActionParameters) =
+ parameters(Parameters.ofConditional3dsAction(conditional3dsAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)`.
+ */
+ fun parameters(
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
+ ) =
+ parameters(
+ Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
+ )
+
+ /**
+ * The type of Auth Rule. For certain rule types, this determines the event stream
+ * during which it will be evaluated. For rules that can be applied to one of
+ * several event streams, the effective one is defined by the separate
+ * `event_stream` field.
+ * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
+ * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
+ * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ */
+ fun type(type: AuthRuleType) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [AuthRuleType] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
/** Account tokens to which the Auth Rule applies. */
fun accountTokens(accountTokens: List) =
accountTokens(JsonField.of(accountTokens))
@@ -762,80 +777,6 @@ private constructor(
*/
fun name(name: JsonField) = apply { this.name = name }
- /** Parameters for the Auth Rule */
- fun parameters(parameters: Parameters) = parameters(JsonField.of(parameters))
-
- /**
- * Sets [Builder.parameters] to an arbitrary JSON value.
- *
- * You should usually call [Builder.parameters] with a well-typed [Parameters] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun parameters(parameters: JsonField) = apply {
- this.parameters = parameters
- }
-
- /**
- * Alias for calling [parameters] with
- * `Parameters.ofConditionalBlock(conditionalBlock)`.
- */
- fun parameters(conditionalBlock: ConditionalBlockParameters) =
- parameters(Parameters.ofConditionalBlock(conditionalBlock))
-
- /**
- * Alias for calling [parameters] with
- * `Parameters.ofVelocityLimitParams(velocityLimitParams)`.
- */
- fun parameters(velocityLimitParams: VelocityLimitParams) =
- parameters(Parameters.ofVelocityLimitParams(velocityLimitParams))
-
- /**
- * Alias for calling [parameters] with `Parameters.ofMerchantLock(merchantLock)`.
- */
- fun parameters(merchantLock: MerchantLockParameters) =
- parameters(Parameters.ofMerchantLock(merchantLock))
-
- /**
- * Alias for calling [parameters] with
- * `Parameters.ofConditional3dsAction(conditional3dsAction)`.
- */
- fun parameters(conditional3dsAction: Conditional3dsActionParameters) =
- parameters(Parameters.ofConditional3dsAction(conditional3dsAction))
-
- /**
- * Alias for calling [parameters] with
- * `Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)`.
- */
- fun parameters(
- conditionalAuthorizationAction:
- Parameters.ConditionalAuthorizationActionParameters
- ) =
- parameters(
- Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
- )
-
- /**
- * The type of Auth Rule. For certain rule types, this determines the event stream
- * during which it will be evaluated. For rules that can be applied to one of
- * several event streams, the effective one is defined by the separate
- * `event_stream` field.
- * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
- */
- fun type(type: AuthRuleType) = type(JsonField.of(type))
-
- /**
- * Sets [Builder.type] to an arbitrary JSON value.
- *
- * You should usually call [Builder.type] with a well-typed [AuthRuleType] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun type(type: JsonField) = apply { this.type = type }
-
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -859,35 +800,43 @@ private constructor(
}
/**
- * Returns an immutable instance of [CreateAuthRuleRequestAccountTokens].
+ * Returns an immutable instance of [AccountLevelRule].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .parameters()
+ * .type()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
- fun build(): CreateAuthRuleRequestAccountTokens =
- CreateAuthRuleRequestAccountTokens(
+ fun build(): AccountLevelRule =
+ AccountLevelRule(
+ checkRequired("parameters", parameters),
+ checkRequired("type", type),
(accountTokens ?: JsonMissing.of()).map { it.toImmutable() },
(businessAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
eventStream,
name,
- parameters,
- type,
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): CreateAuthRuleRequestAccountTokens = apply {
+ fun validate(): AccountLevelRule = apply {
if (validated) {
return@apply
}
+ parameters().validate()
+ type().validate()
accountTokens()
businessAccountTokens()
eventStream().ifPresent { it.validate() }
name()
- parameters().ifPresent { it.validate() }
- type().ifPresent { it.validate() }
validated = true
}
@@ -907,145 +856,12 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (accountTokens.asKnown().getOrNull()?.size ?: 0) +
+ (parameters.asKnown().getOrNull()?.validity() ?: 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0) +
+ (accountTokens.asKnown().getOrNull()?.size ?: 0) +
(businessAccountTokens.asKnown().getOrNull()?.size ?: 0) +
(eventStream.asKnown().getOrNull()?.validity() ?: 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- (parameters.asKnown().getOrNull()?.validity() ?: 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /** The event stream during which the rule will be evaluated. */
- class EventStream
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that
- * doesn't match any known member, and you want to know that value. For example, if
- * the SDK is on an older version than the API, then the API may respond with new
- * members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val AUTHORIZATION = of("AUTHORIZATION")
-
- @JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
-
- @JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
- }
-
- /** An enum containing [EventStream]'s known values. */
- enum class Known {
- AUTHORIZATION,
- THREE_DS_AUTHENTICATION,
- }
-
- /**
- * An enum containing [EventStream]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [EventStream] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example,
- * if the SDK is on an older version than the API, then the API may respond with
- * new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- AUTHORIZATION,
- THREE_DS_AUTHENTICATION,
- /**
- * An enum member indicating that [EventStream] was instantiated with an unknown
- * value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if
- * you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- AUTHORIZATION -> Value.AUTHORIZATION
- THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always known and
- * don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is a not a
- * known member.
- */
- fun known(): Known =
- when (this) {
- AUTHORIZATION -> Known.AUTHORIZATION
- THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
- else -> throw LithicInvalidDataException("Unknown EventStream: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for
- * debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value does not have
- * the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): EventStream = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is EventStream && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
+ (if (name.asKnown().isPresent) 1 else 0)
/** Parameters for the Auth Rule */
@JsonDeserialize(using = Parameters.Deserializer::class)
@@ -1378,1512 +1194,164 @@ private constructor(
}
}
}
+ }
- class ConditionalAuthorizationActionParameters
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val action: JsonField,
- private val conditions: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("action")
- @ExcludeMissing
- action: JsonField = JsonMissing.of(),
- @JsonProperty("conditions")
- @ExcludeMissing
- conditions: JsonField> = JsonMissing.of(),
- ) : this(action, conditions, mutableMapOf())
-
- /**
- * The action to take if the conditions are met.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an
- * unexpected value).
- */
- fun action(): Action = action.getRequired("action")
+ /**
+ * The type of Auth Rule. For certain rule types, this determines the event stream
+ * during which it will be evaluated. For rules that can be applied to one of several
+ * event streams, the effective one is defined by the separate `event_stream` field.
+ * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
+ * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
+ * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ */
+ class AuthRuleType
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
- /**
- * @throws LithicInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an
- * unexpected value).
- */
- fun conditions(): List = conditions.getRequired("conditions")
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that
+ * doesn't match any known member, and you want to know that value. For example, if
+ * the SDK is on an older version than the API, then the API may respond with new
+ * members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
- /**
- * Returns the raw JSON value of [action].
- *
- * Unlike [action], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("action")
- @ExcludeMissing
- fun _action(): JsonField = action
+ companion object {
- /**
- * Returns the raw JSON value of [conditions].
- *
- * Unlike [conditions], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("conditions")
- @ExcludeMissing
- fun _conditions(): JsonField> = conditions
+ @JvmField val CONDITIONAL_BLOCK = of("CONDITIONAL_BLOCK")
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
+ @JvmField val VELOCITY_LIMIT = of("VELOCITY_LIMIT")
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [ConditionalAuthorizationActionParameters].
- *
- * The following fields are required:
- * ```java
- * .action()
- * .conditions()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
+ @JvmField val MERCHANT_LOCK = of("MERCHANT_LOCK")
- /** A builder for [ConditionalAuthorizationActionParameters]. */
- class Builder internal constructor() {
-
- private var action: JsonField? = null
- private var conditions: JsonField>? = null
- private var additionalProperties: MutableMap =
- mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- conditionalAuthorizationActionParameters:
- ConditionalAuthorizationActionParameters
- ) = apply {
- action = conditionalAuthorizationActionParameters.action
- conditions =
- conditionalAuthorizationActionParameters.conditions.map {
- it.toMutableList()
- }
- additionalProperties =
- conditionalAuthorizationActionParameters.additionalProperties
- .toMutableMap()
- }
+ @JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
- /** The action to take if the conditions are met. */
- fun action(action: Action) = action(JsonField.of(action))
-
- /**
- * Sets [Builder.action] to an arbitrary JSON value.
- *
- * You should usually call [Builder.action] with a well-typed [Action] value
- * instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun action(action: JsonField) = apply { this.action = action }
-
- fun conditions(conditions: List) =
- conditions(JsonField.of(conditions))
-
- /**
- * Sets [Builder.conditions] to an arbitrary JSON value.
- *
- * You should usually call [Builder.conditions] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun conditions(conditions: JsonField>) = apply {
- this.conditions = conditions.map { it.toMutableList() }
- }
+ @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
+ }
- /**
- * Adds a single [Condition] to [conditions].
- *
- * @throws IllegalStateException if the field was previously set to a
- * non-list.
- */
- fun addCondition(condition: Condition) = apply {
- conditions =
- (conditions ?: JsonField.of(mutableListOf())).also {
- checkKnown("conditions", it).add(condition)
- }
- }
+ /** An enum containing [AuthRuleType]'s known values. */
+ enum class Known {
+ CONDITIONAL_BLOCK,
+ VELOCITY_LIMIT,
+ MERCHANT_LOCK,
+ CONDITIONAL_ACTION,
+ }
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
+ /**
+ * An enum containing [AuthRuleType]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [AuthRuleType] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example,
+ * if the SDK is on an older version than the API, then the API may respond with
+ * new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ CONDITIONAL_BLOCK,
+ VELOCITY_LIMIT,
+ MERCHANT_LOCK,
+ CONDITIONAL_ACTION,
+ /**
+ * An enum member indicating that [AuthRuleType] was instantiated with an
+ * unknown value.
+ */
+ _UNKNOWN,
+ }
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if
+ * you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ CONDITIONAL_BLOCK -> Value.CONDITIONAL_BLOCK
+ VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
+ MERCHANT_LOCK -> Value.MERCHANT_LOCK
+ CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ else -> Value._UNKNOWN
+ }
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and
+ * don't want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a
+ * known member.
+ */
+ fun known(): Known =
+ when (this) {
+ CONDITIONAL_BLOCK -> Known.CONDITIONAL_BLOCK
+ VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
+ MERCHANT_LOCK -> Known.MERCHANT_LOCK
+ CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
+ else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
+ }
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for
+ * debugging and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have
+ * the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ LithicInvalidDataException("Value is not a String")
+ }
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
+ private var validated: Boolean = false
- /**
- * Returns an immutable instance of
- * [ConditionalAuthorizationActionParameters].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .action()
- * .conditions()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): ConditionalAuthorizationActionParameters =
- ConditionalAuthorizationActionParameters(
- checkRequired("action", action),
- checkRequired("conditions", conditions).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
+ fun validate(): AuthRuleType = apply {
+ if (validated) {
+ return@apply
}
- private var validated: Boolean = false
-
- fun validate(): ConditionalAuthorizationActionParameters = apply {
- if (validated) {
- return@apply
- }
-
- action().validate()
- conditions().forEach { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (action.asKnown().getOrNull()?.validity() ?: 0) +
- (conditions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
-
- /** The action to take if the conditions are met. */
- class Action
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data
- * that doesn't match any known member, and you want to know that value. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val DECLINE = of("DECLINE")
-
- @JvmField val CHALLENGE = of("CHALLENGE")
-
- @JvmStatic fun of(value: String) = Action(JsonField.of(value))
- }
-
- /** An enum containing [Action]'s known values. */
- enum class Known {
- DECLINE,
- CHALLENGE,
- }
-
- /**
- * An enum containing [Action]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [Action] can contain an unknown value in a couple of
- * cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API
- * may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- DECLINE,
- CHALLENGE,
- /**
- * An enum member indicating that [Action] was instantiated with an
- * unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- DECLINE -> Value.DECLINE
- CHALLENGE -> Value.CHALLENGE
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always
- * known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is a
- * not a known member.
- */
- fun known(): Known =
- when (this) {
- DECLINE -> Known.DECLINE
- CHALLENGE -> Known.CHALLENGE
- else -> throw LithicInvalidDataException("Unknown Action: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily
- * for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value does
- * not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Action = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Action && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class Condition
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val attribute: JsonField,
- private val operation: JsonField,
- private val value: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("attribute")
- @ExcludeMissing
- attribute: JsonField = JsonMissing.of(),
- @JsonProperty("operation")
- @ExcludeMissing
- operation: JsonField = JsonMissing.of(),
- @JsonProperty("value")
- @ExcludeMissing
- value: JsonField = JsonMissing.of(),
- ) : this(attribute, operation, value, mutableMapOf())
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1)
- * all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT
- * for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the
- * issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account
- * number (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`,
- * `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`,
- * `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, `MANUAL`, `OCR`,
- * `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, `CREDENTIAL_ON_FILE`, or
- * `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the
- * acquirer fee field in the settlement/cardholder billing currency. This
- * is the amount the issuer should authorize against unless the issuer is
- * paying the acquirer fee on behalf of the cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level associated
- * with a given authorization. Scores are on a range of 0-999, with 0
- * representing the lowest risk and 999 representing the highest risk. For
- * Visa transactions, where the raw score has a range of 0-99, Lithic will
- * normalize the score by multiplying the raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in
- * the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in
- * the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in
- * the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates
- * the source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
- * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid values
- * are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun attribute(): Optional = attribute.getOptional("attribute")
-
- /**
- * The operation to apply to the attribute
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun operation(): Optional = operation.getOptional("operation")
-
- /**
- * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun value(): Optional = value.getOptional("value")
-
- /**
- * Returns the raw JSON value of [attribute].
- *
- * Unlike [attribute], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("attribute")
- @ExcludeMissing
- fun _attribute(): JsonField = attribute
-
- /**
- * Returns the raw JSON value of [operation].
- *
- * Unlike [operation], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("operation")
- @ExcludeMissing
- fun _operation(): JsonField = operation
-
- /**
- * Returns the raw JSON value of [value].
- *
- * Unlike [value], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("value")
- @ExcludeMissing
- fun _value(): JsonField = value
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [Condition].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Condition]. */
- class Builder internal constructor() {
-
- private var attribute: JsonField = JsonMissing.of()
- private var operation: JsonField = JsonMissing.of()
- private var value: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap =
- mutableMapOf()
-
- @JvmSynthetic
- internal fun from(condition: Condition) = apply {
- attribute = condition.attribute
- operation = condition.operation
- value = condition.value
- additionalProperties = condition.additionalProperties.toMutableMap()
- }
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are:
- * (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and
- * (3) ANT for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to
- * the issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary
- * account number (PAN) was entered. Valid values are `AUTO_ENTRY`,
- * `BAR_CODE`, `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`,
- * `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`,
- * `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`,
- * `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus
- * the acquirer fee field in the settlement/cardholder billing
- * currency. This is the amount the issuer should authorize against
- * unless the issuer is paying the acquirer fee on behalf of the
- * cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level
- * associated with a given authorization. Scores are on a range of
- * 0-999, with 0 representing the lowest risk and 999 representing the
- * highest risk. For Visa transactions, where the raw score has a
- * range of 0-99, Lithic will normalize the score by multiplying the
- * raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the
- * card in the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card
- * in the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the
- * card in the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token,
- * indicates the source of the token. Valid values are `APPLE_PAY`,
- * `GOOGLE_PAY`, `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`,
- * `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid
- * values are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- */
- fun attribute(attribute: Attribute) = attribute(JsonField.of(attribute))
-
- /**
- * Sets [Builder.attribute] to an arbitrary JSON value.
- *
- * You should usually call [Builder.attribute] with a well-typed
- * [Attribute] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun attribute(attribute: JsonField) = apply {
- this.attribute = attribute
- }
-
- /** The operation to apply to the attribute */
- fun operation(operation: Operation) = operation(JsonField.of(operation))
-
- /**
- * Sets [Builder.operation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.operation] with a well-typed
- * [Operation] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun operation(operation: JsonField) = apply {
- this.operation = operation
- }
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun value(value: Value) = value(JsonField.of(value))
-
- /**
- * Sets [Builder.value] to an arbitrary JSON value.
- *
- * You should usually call [Builder.value] with a well-typed [Value]
- * value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun value(value: JsonField) = apply { this.value = value }
-
- /** Alias for calling [value] with `Value.ofRegex(regex)`. */
- fun value(regex: String) = value(Value.ofRegex(regex))
-
- /** Alias for calling [value] with `Value.ofNumber(number)`. */
- fun value(number: Long) = value(Value.ofNumber(number))
-
- /**
- * Alias for calling [value] with
- * `Value.ofListOfStrings(listOfStrings)`.
- */
- fun valueOfListOfStrings(listOfStrings: List) =
- value(Value.ofListOfStrings(listOfStrings))
-
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Condition].
- *
- * Further updates to this [Builder] will not mutate the returned
- * instance.
- */
- fun build(): Condition =
- Condition(
- attribute,
- operation,
- value,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Condition = apply {
- if (validated) {
- return@apply
- }
-
- attribute().ifPresent { it.validate() }
- operation().ifPresent { it.validate() }
- value().ifPresent { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (attribute.asKnown().getOrNull()?.validity() ?: 0) +
- (operation.asKnown().getOrNull()?.validity() ?: 0) +
- (value.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1)
- * all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT
- * for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the
- * issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account
- * number (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`,
- * `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`,
- * `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, `MANUAL`, `OCR`,
- * `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, `CREDENTIAL_ON_FILE`, or
- * `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the
- * acquirer fee field in the settlement/cardholder billing currency. This
- * is the amount the issuer should authorize against unless the issuer is
- * paying the acquirer fee on behalf of the cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level associated
- * with a given authorization. Scores are on a range of 0-999, with 0
- * representing the lowest risk and 999 representing the highest risk. For
- * Visa transactions, where the raw score has a range of 0-99, Lithic will
- * normalize the score by multiplying the raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in
- * the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in
- * the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in
- * the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates
- * the source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
- * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid values
- * are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- */
- class Attribute
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from
- * data that doesn't match any known member, and you want to know that
- * value. For example, if the SDK is on an older version than the API,
- * then the API may respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val MCC = of("MCC")
-
- @JvmField val COUNTRY = of("COUNTRY")
-
- @JvmField val CURRENCY = of("CURRENCY")
-
- @JvmField val MERCHANT_ID = of("MERCHANT_ID")
-
- @JvmField val DESCRIPTOR = of("DESCRIPTOR")
-
- @JvmField val LIABILITY_SHIFT = of("LIABILITY_SHIFT")
-
- @JvmField val PAN_ENTRY_MODE = of("PAN_ENTRY_MODE")
-
- @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT")
-
- @JvmField val CASH_AMOUNT = of("CASH_AMOUNT")
-
- @JvmField val RISK_SCORE = of("RISK_SCORE")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_15_M = of("CARD_TRANSACTION_COUNT_15M")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_1_H = of("CARD_TRANSACTION_COUNT_1H")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_24_H = of("CARD_TRANSACTION_COUNT_24H")
-
- @JvmField val CARD_STATE = of("CARD_STATE")
-
- @JvmField val PIN_ENTERED = of("PIN_ENTERED")
-
- @JvmField val PIN_STATUS = of("PIN_STATUS")
-
- @JvmField val WALLET_TYPE = of("WALLET_TYPE")
-
- @JvmField val TRANSACTION_INITIATOR = of("TRANSACTION_INITIATOR")
-
- @JvmField val ADDRESS_MATCH = of("ADDRESS_MATCH")
-
- @JvmStatic fun of(value: String) = Attribute(JsonField.of(value))
- }
-
- /** An enum containing [Attribute]'s known values. */
- enum class Known {
- MCC,
- COUNTRY,
- CURRENCY,
- MERCHANT_ID,
- DESCRIPTOR,
- LIABILITY_SHIFT,
- PAN_ENTRY_MODE,
- TRANSACTION_AMOUNT,
- CASH_AMOUNT,
- RISK_SCORE,
- CARD_TRANSACTION_COUNT_15_M,
- CARD_TRANSACTION_COUNT_1_H,
- CARD_TRANSACTION_COUNT_24_H,
- CARD_STATE,
- PIN_ENTERED,
- PIN_STATUS,
- WALLET_TYPE,
- TRANSACTION_INITIATOR,
- ADDRESS_MATCH,
- }
-
- /**
- * An enum containing [Attribute]'s known values, as well as an
- * [_UNKNOWN] member.
- *
- * An instance of [Attribute] can contain an unknown value in a couple
- * of cases:
- * - It was deserialized from data that doesn't match any known member.
- * For example, if the SDK is on an older version than the API, then
- * the API may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- MCC,
- COUNTRY,
- CURRENCY,
- MERCHANT_ID,
- DESCRIPTOR,
- LIABILITY_SHIFT,
- PAN_ENTRY_MODE,
- TRANSACTION_AMOUNT,
- CASH_AMOUNT,
- RISK_SCORE,
- CARD_TRANSACTION_COUNT_15_M,
- CARD_TRANSACTION_COUNT_1_H,
- CARD_TRANSACTION_COUNT_24_H,
- CARD_STATE,
- PIN_ENTERED,
- PIN_STATUS,
- WALLET_TYPE,
- TRANSACTION_INITIATOR,
- ADDRESS_MATCH,
- /**
- * An enum member indicating that [Attribute] was instantiated with
- * an unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value,
- * or [Value._UNKNOWN] if the class was instantiated with an unknown
- * value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- MCC -> Value.MCC
- COUNTRY -> Value.COUNTRY
- CURRENCY -> Value.CURRENCY
- MERCHANT_ID -> Value.MERCHANT_ID
- DESCRIPTOR -> Value.DESCRIPTOR
- LIABILITY_SHIFT -> Value.LIABILITY_SHIFT
- PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE
- TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT
- CASH_AMOUNT -> Value.CASH_AMOUNT
- RISK_SCORE -> Value.RISK_SCORE
- CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M
- CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H
- CARD_TRANSACTION_COUNT_24_H -> Value.CARD_TRANSACTION_COUNT_24_H
- CARD_STATE -> Value.CARD_STATE
- PIN_ENTERED -> Value.PIN_ENTERED
- PIN_STATUS -> Value.PIN_STATUS
- WALLET_TYPE -> Value.WALLET_TYPE
- TRANSACTION_INITIATOR -> Value.TRANSACTION_INITIATOR
- ADDRESS_MATCH -> Value.ADDRESS_MATCH
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is
- * always known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is
- * a not a known member.
- */
- fun known(): Known =
- when (this) {
- MCC -> Known.MCC
- COUNTRY -> Known.COUNTRY
- CURRENCY -> Known.CURRENCY
- MERCHANT_ID -> Known.MERCHANT_ID
- DESCRIPTOR -> Known.DESCRIPTOR
- LIABILITY_SHIFT -> Known.LIABILITY_SHIFT
- PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE
- TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT
- CASH_AMOUNT -> Known.CASH_AMOUNT
- RISK_SCORE -> Known.RISK_SCORE
- CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M
- CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H
- CARD_TRANSACTION_COUNT_24_H -> Known.CARD_TRANSACTION_COUNT_24_H
- CARD_STATE -> Known.CARD_STATE
- PIN_ENTERED -> Known.PIN_ENTERED
- PIN_STATUS -> Known.PIN_STATUS
- WALLET_TYPE -> Known.WALLET_TYPE
- TRANSACTION_INITIATOR -> Known.TRANSACTION_INITIATOR
- ADDRESS_MATCH -> Known.ADDRESS_MATCH
- else ->
- throw LithicInvalidDataException(
- "Unknown Attribute: $value"
- )
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is
- * primarily for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value
- * does not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Attribute = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Attribute && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** The operation to apply to the attribute */
- class Operation
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from
- * data that doesn't match any known member, and you want to know that
- * value. For example, if the SDK is on an older version than the API,
- * then the API may respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val IS_ONE_OF = of("IS_ONE_OF")
-
- @JvmField val IS_NOT_ONE_OF = of("IS_NOT_ONE_OF")
-
- @JvmField val MATCHES = of("MATCHES")
-
- @JvmField val DOES_NOT_MATCH = of("DOES_NOT_MATCH")
-
- @JvmField val IS_EQUAL_TO = of("IS_EQUAL_TO")
-
- @JvmField val IS_NOT_EQUAL_TO = of("IS_NOT_EQUAL_TO")
-
- @JvmField val IS_GREATER_THAN = of("IS_GREATER_THAN")
-
- @JvmField
- val IS_GREATER_THAN_OR_EQUAL_TO = of("IS_GREATER_THAN_OR_EQUAL_TO")
-
- @JvmField val IS_LESS_THAN = of("IS_LESS_THAN")
-
- @JvmField
- val IS_LESS_THAN_OR_EQUAL_TO = of("IS_LESS_THAN_OR_EQUAL_TO")
-
- @JvmStatic fun of(value: String) = Operation(JsonField.of(value))
- }
-
- /** An enum containing [Operation]'s known values. */
- enum class Known {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- }
-
- /**
- * An enum containing [Operation]'s known values, as well as an
- * [_UNKNOWN] member.
- *
- * An instance of [Operation] can contain an unknown value in a couple
- * of cases:
- * - It was deserialized from data that doesn't match any known member.
- * For example, if the SDK is on an older version than the API, then
- * the API may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- /**
- * An enum member indicating that [Operation] was instantiated with
- * an unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value,
- * or [Value._UNKNOWN] if the class was instantiated with an unknown
- * value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- IS_ONE_OF -> Value.IS_ONE_OF
- IS_NOT_ONE_OF -> Value.IS_NOT_ONE_OF
- MATCHES -> Value.MATCHES
- DOES_NOT_MATCH -> Value.DOES_NOT_MATCH
- IS_EQUAL_TO -> Value.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Value.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Value.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Value.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Value.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Value.IS_LESS_THAN_OR_EQUAL_TO
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is
- * always known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is
- * a not a known member.
- */
- fun known(): Known =
- when (this) {
- IS_ONE_OF -> Known.IS_ONE_OF
- IS_NOT_ONE_OF -> Known.IS_NOT_ONE_OF
- MATCHES -> Known.MATCHES
- DOES_NOT_MATCH -> Known.DOES_NOT_MATCH
- IS_EQUAL_TO -> Known.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Known.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Known.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Known.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Known.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Known.IS_LESS_THAN_OR_EQUAL_TO
- else ->
- throw LithicInvalidDataException(
- "Unknown Operation: $value"
- )
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is
- * primarily for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value
- * does not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Operation = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Operation && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JsonDeserialize(using = Value.Deserializer::class)
- @JsonSerialize(using = Value.Serializer::class)
- class Value
- private constructor(
- private val regex: String? = null,
- private val number: Long? = null,
- private val listOfStrings: List? = null,
- private val _json: JsonValue? = null,
- ) {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun regex(): Optional = Optional.ofNullable(regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun number(): Optional = Optional.ofNullable(number)
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF`
- */
- fun listOfStrings(): Optional> =
- Optional.ofNullable(listOfStrings)
-
- fun isRegex(): Boolean = regex != null
-
- fun isNumber(): Boolean = number != null
-
- fun isListOfStrings(): Boolean = listOfStrings != null
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun asRegex(): String = regex.getOrThrow("regex")
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun asNumber(): Long = number.getOrThrow("number")
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF`
- */
- fun asListOfStrings(): List =
- listOfStrings.getOrThrow("listOfStrings")
-
- fun _json(): Optional = Optional.ofNullable(_json)
-
- fun accept(visitor: Visitor): T =
- when {
- regex != null -> visitor.visitRegex(regex)
- number != null -> visitor.visitNumber(number)
- listOfStrings != null ->
- visitor.visitListOfStrings(listOfStrings)
- else -> visitor.unknown(_json)
- }
-
- private var validated: Boolean = false
-
- fun validate(): Value = apply {
- if (validated) {
- return@apply
- }
-
- accept(
- object : Visitor {
- override fun visitRegex(regex: String) {}
-
- override fun visitNumber(number: Long) {}
-
- override fun visitListOfStrings(
- listOfStrings: List
- ) {}
- }
- )
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- accept(
- object : Visitor {
- override fun visitRegex(regex: String) = 1
-
- override fun visitNumber(number: Long) = 1
-
- override fun visitListOfStrings(
- listOfStrings: List
- ) = listOfStrings.size
-
- override fun unknown(json: JsonValue?) = 0
- }
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Value &&
- regex == other.regex &&
- number == other.number &&
- listOfStrings == other.listOfStrings
- }
-
- override fun hashCode(): Int =
- Objects.hash(regex, number, listOfStrings)
-
- override fun toString(): String =
- when {
- regex != null -> "Value{regex=$regex}"
- number != null -> "Value{number=$number}"
- listOfStrings != null -> "Value{listOfStrings=$listOfStrings}"
- _json != null -> "Value{_unknown=$_json}"
- else -> throw IllegalStateException("Invalid Value")
- }
-
- companion object {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JvmStatic fun ofRegex(regex: String) = Value(regex = regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- @JvmStatic fun ofNumber(number: Long) = Value(number = number)
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or
- * `IS_NOT_ONE_OF`
- */
- @JvmStatic
- fun ofListOfStrings(listOfStrings: List) =
- Value(listOfStrings = listOfStrings.toImmutable())
- }
-
- /**
- * An interface that defines how to map each variant of [Value] to a
- * value of type [T].
- */
- interface Visitor {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun visitRegex(regex: String): T
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun visitNumber(number: Long): T
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or
- * `IS_NOT_ONE_OF`
- */
- fun visitListOfStrings(listOfStrings: List): T
-
- /**
- * Maps an unknown variant of [Value] to a value of type [T].
- *
- * An instance of [Value] can contain an unknown variant if it was
- * deserialized from data that doesn't match any known variant. For
- * example, if the SDK is on an older version than the API, then the
- * API may respond with new variants that the SDK is unaware of.
- *
- * @throws LithicInvalidDataException in the default implementation.
- */
- fun unknown(json: JsonValue?): T {
- throw LithicInvalidDataException("Unknown Value: $json")
- }
- }
-
- internal class Deserializer : BaseDeserializer(Value::class) {
-
- override fun ObjectCodec.deserialize(node: JsonNode): Value {
- val json = JsonValue.fromJsonNode(node)
-
- val bestMatches =
- sequenceOf(
- tryDeserialize(node, jacksonTypeRef())
- ?.let { Value(regex = it, _json = json) },
- tryDeserialize(node, jacksonTypeRef())?.let {
- Value(number = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef>())
- ?.let {
- Value(listOfStrings = it, _json = json)
- },
- )
- .filterNotNull()
- .allMaxBy { it.validity() }
- .toList()
- return when (bestMatches.size) {
- // This can happen if what we're deserializing is completely
- // incompatible with all the possible variants (e.g.
- // deserializing from object).
- 0 -> Value(_json = json)
- 1 -> bestMatches.single()
- // If there's more than one match with the highest validity,
- // then use the first completely valid match, or simply the
- // first match if none are completely valid.
- else ->
- bestMatches.firstOrNull { it.isValid() }
- ?: bestMatches.first()
- }
- }
- }
-
- internal class Serializer : BaseSerializer(Value::class) {
-
- override fun serialize(
- value: Value,
- generator: JsonGenerator,
- provider: SerializerProvider,
- ) {
- when {
- value.regex != null -> generator.writeObject(value.regex)
- value.number != null -> generator.writeObject(value.number)
- value.listOfStrings != null ->
- generator.writeObject(value.listOfStrings)
- value._json != null -> generator.writeObject(value._json)
- else -> throw IllegalStateException("Invalid Value")
- }
- }
- }
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Condition &&
- attribute == other.attribute &&
- operation == other.operation &&
- value == other.value &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(attribute, operation, value, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
+ known()
+ validated = true
+ }
- override fun toString() =
- "Condition{attribute=$attribute, operation=$operation, value=$value, additionalProperties=$additionalProperties}"
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
}
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
- return other is ConditionalAuthorizationActionParameters &&
- action == other.action &&
- conditions == other.conditions &&
- additionalProperties == other.additionalProperties
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
}
- private val hashCode: Int by lazy {
- Objects.hash(action, conditions, additionalProperties)
- }
+ return other is AuthRuleType && value == other.value
+ }
- override fun hashCode(): Int = hashCode
+ override fun hashCode() = value.hashCode()
- override fun toString() =
- "ConditionalAuthorizationActionParameters{action=$action, conditions=$conditions, additionalProperties=$additionalProperties}"
- }
+ override fun toString() = value.toString()
}
- /**
- * The type of Auth Rule. For certain rule types, this determines the event stream
- * during which it will be evaluated. For rules that can be applied to one of several
- * event streams, the effective one is defined by the separate `event_stream` field.
- * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
- */
- class AuthRuleType
+ /** The event stream during which the rule will be evaluated. */
+ class EventStream
@JsonCreator
private constructor(private val value: JsonField) : Enum {
@@ -2899,43 +1367,34 @@ private constructor(
companion object {
- @JvmField val CONDITIONAL_BLOCK = of("CONDITIONAL_BLOCK")
-
- @JvmField val VELOCITY_LIMIT = of("VELOCITY_LIMIT")
-
- @JvmField val MERCHANT_LOCK = of("MERCHANT_LOCK")
+ @JvmField val AUTHORIZATION = of("AUTHORIZATION")
- @JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
+ @JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
- @JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
+ @JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
}
- /** An enum containing [AuthRuleType]'s known values. */
+ /** An enum containing [EventStream]'s known values. */
enum class Known {
- CONDITIONAL_BLOCK,
- VELOCITY_LIMIT,
- MERCHANT_LOCK,
- CONDITIONAL_ACTION,
+ AUTHORIZATION,
+ THREE_DS_AUTHENTICATION,
}
/**
- * An enum containing [AuthRuleType]'s known values, as well as an [_UNKNOWN]
- * member.
+ * An enum containing [EventStream]'s known values, as well as an [_UNKNOWN] member.
*
- * An instance of [AuthRuleType] can contain an unknown value in a couple of cases:
+ * An instance of [EventStream] can contain an unknown value in a couple of cases:
* - It was deserialized from data that doesn't match any known member. For example,
* if the SDK is on an older version than the API, then the API may respond with
* new members that the SDK is unaware of.
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- CONDITIONAL_BLOCK,
- VELOCITY_LIMIT,
- MERCHANT_LOCK,
- CONDITIONAL_ACTION,
+ AUTHORIZATION,
+ THREE_DS_AUTHENTICATION,
/**
- * An enum member indicating that [AuthRuleType] was instantiated with an
- * unknown value.
+ * An enum member indicating that [EventStream] was instantiated with an unknown
+ * value.
*/
_UNKNOWN,
}
@@ -2949,10 +1408,8 @@ private constructor(
*/
fun value(): Value =
when (this) {
- CONDITIONAL_BLOCK -> Value.CONDITIONAL_BLOCK
- VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
- MERCHANT_LOCK -> Value.MERCHANT_LOCK
- CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ AUTHORIZATION -> Value.AUTHORIZATION
+ THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
else -> Value._UNKNOWN
}
@@ -2967,11 +1424,9 @@ private constructor(
*/
fun known(): Known =
when (this) {
- CONDITIONAL_BLOCK -> Known.CONDITIONAL_BLOCK
- VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
- MERCHANT_LOCK -> Known.MERCHANT_LOCK
- CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
- else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
+ AUTHORIZATION -> Known.AUTHORIZATION
+ THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
+ else -> throw LithicInvalidDataException("Unknown EventStream: $value")
}
/**
@@ -2990,7 +1445,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): AuthRuleType = apply {
+ fun validate(): EventStream = apply {
if (validated) {
return@apply
}
@@ -3020,7 +1475,7 @@ private constructor(
return true
}
- return other is AuthRuleType && value == other.value
+ return other is EventStream && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -3033,24 +1488,24 @@ private constructor(
return true
}
- return other is CreateAuthRuleRequestAccountTokens &&
+ return other is AccountLevelRule &&
+ parameters == other.parameters &&
+ type == other.type &&
accountTokens == other.accountTokens &&
businessAccountTokens == other.businessAccountTokens &&
eventStream == other.eventStream &&
name == other.name &&
- parameters == other.parameters &&
- type == other.type &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
Objects.hash(
+ parameters,
+ type,
accountTokens,
businessAccountTokens,
eventStream,
name,
- parameters,
- type,
additionalProperties,
)
}
@@ -3058,17 +1513,17 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CreateAuthRuleRequestAccountTokens{accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, eventStream=$eventStream, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}"
+ "AccountLevelRule{parameters=$parameters, type=$type, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, eventStream=$eventStream, name=$name, additionalProperties=$additionalProperties}"
}
- class CreateAuthRuleRequestCardTokens
+ class CardLevelRule
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val cardTokens: JsonField>,
- private val eventStream: JsonField,
- private val name: JsonField,
private val parameters: JsonField,
private val type: JsonField,
+ private val eventStream: JsonField,
+ private val name: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -3077,17 +1532,17 @@ private constructor(
@JsonProperty("card_tokens")
@ExcludeMissing
cardTokens: JsonField> = JsonMissing.of(),
- @JsonProperty("event_stream")
- @ExcludeMissing
- eventStream: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
@JsonProperty("parameters")
@ExcludeMissing
parameters: JsonField = JsonMissing.of(),
@JsonProperty("type")
@ExcludeMissing
type: JsonField = JsonMissing.of(),
- ) : this(cardTokens, eventStream, name, parameters, type, mutableMapOf())
+ @JsonProperty("event_stream")
+ @ExcludeMissing
+ eventStream: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ ) : this(cardTokens, parameters, type, eventStream, name, mutableMapOf())
/**
* Card tokens to which the Auth Rule applies.
@@ -3099,42 +1554,44 @@ private constructor(
fun cardTokens(): List = cardTokens.getRequired("card_tokens")
/**
- * The event stream during which the rule will be evaluated.
+ * Parameters for the Auth Rule
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
*/
- fun eventStream(): Optional = eventStream.getOptional("event_stream")
+ fun parameters(): Parameters = parameters.getRequired("parameters")
/**
- * Auth Rule Name
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun name(): Optional = name.getOptional("name")
+ * The type of Auth Rule. For certain rule types, this determines the event stream
+ * during which it will be evaluated. For rules that can be applied to one of several
+ * event streams, the effective one is defined by the separate `event_stream` field.
+ * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
+ * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
+ * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
+ * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun type(): AuthRuleType = type.getRequired("type")
/**
- * Parameters for the Auth Rule
+ * The event stream during which the rule will be evaluated.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
- fun parameters(): Optional = parameters.getOptional("parameters")
+ fun eventStream(): Optional = eventStream.getOptional("event_stream")
/**
- * The type of Auth Rule. For certain rule types, this determines the event stream
- * during which it will be evaluated. For rules that can be applied to one of several
- * event streams, the effective one is defined by the separate `event_stream` field.
- * - `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- * - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- * - `MERCHANT_LOCK`: AUTHORIZATION event stream.
- * - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ * Auth Rule Name
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
- fun type(): Optional = type.getOptional("type")
+ fun name(): Optional = name.getOptional("name")
/**
* Returns the raw JSON value of [cardTokens].
@@ -3147,38 +1604,38 @@ private constructor(
fun _cardTokens(): JsonField> = cardTokens
/**
- * Returns the raw JSON value of [eventStream].
+ * Returns the raw JSON value of [parameters].
*
- * Unlike [eventStream], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [parameters], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("event_stream")
+ @JsonProperty("parameters")
@ExcludeMissing
- fun _eventStream(): JsonField = eventStream
+ fun _parameters(): JsonField = parameters
/**
- * Returns the raw JSON value of [name].
+ * Returns the raw JSON value of [type].
*
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
/**
- * Returns the raw JSON value of [parameters].
+ * Returns the raw JSON value of [eventStream].
*
- * Unlike [parameters], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [eventStream], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("parameters")
+ @JsonProperty("event_stream")
@ExcludeMissing
- fun _parameters(): JsonField = parameters
+ fun _eventStream(): JsonField = eventStream
/**
- * Returns the raw JSON value of [type].
+ * Returns the raw JSON value of [name].
*
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -3195,39 +1652,36 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of
- * [CreateAuthRuleRequestCardTokens].
+ * Returns a mutable builder for constructing an instance of [CardLevelRule].
*
* The following fields are required:
* ```java
* .cardTokens()
+ * .parameters()
+ * .type()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CreateAuthRuleRequestCardTokens]. */
+ /** A builder for [CardLevelRule]. */
class Builder internal constructor() {
private var cardTokens: JsonField>? = null
+ private var parameters: JsonField? = null
+ private var type: JsonField? = null
private var eventStream: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
- private var parameters: JsonField = JsonMissing.of()
- private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(
- createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens
- ) = apply {
- cardTokens =
- createAuthRuleRequestCardTokens.cardTokens.map { it.toMutableList() }
- eventStream = createAuthRuleRequestCardTokens.eventStream
- name = createAuthRuleRequestCardTokens.name
- parameters = createAuthRuleRequestCardTokens.parameters
- type = createAuthRuleRequestCardTokens.type
- additionalProperties =
- createAuthRuleRequestCardTokens.additionalProperties.toMutableMap()
+ internal fun from(cardLevelRule: CardLevelRule) = apply {
+ cardTokens = cardLevelRule.cardTokens.map { it.toMutableList() }
+ parameters = cardLevelRule.parameters
+ type = cardLevelRule.type
+ eventStream = cardLevelRule.eventStream
+ name = cardLevelRule.name
+ additionalProperties = cardLevelRule.additionalProperties.toMutableMap()
}
/** Card tokens to which the Auth Rule applies. */
@@ -3256,35 +1710,6 @@ private constructor(
}
}
- /** The event stream during which the rule will be evaluated. */
- fun eventStream(eventStream: EventStream) = eventStream(JsonField.of(eventStream))
-
- /**
- * Sets [Builder.eventStream] to an arbitrary JSON value.
- *
- * You should usually call [Builder.eventStream] with a well-typed [EventStream]
- * value instead. This method is primarily for setting the field to an undocumented
- * or not yet supported value.
- */
- fun eventStream(eventStream: JsonField) = apply {
- this.eventStream = eventStream
- }
-
- /** Auth Rule Name */
- fun name(name: String?) = name(JsonField.ofNullable(name))
-
- /** Alias for calling [Builder.name] with `name.orElse(null)`. */
- fun name(name: Optional) = name(name.getOrNull())
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
/** Parameters for the Auth Rule */
fun parameters(parameters: Parameters) = parameters(JsonField.of(parameters))
@@ -3331,8 +1756,7 @@ private constructor(
* `Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)`.
*/
fun parameters(
- conditionalAuthorizationAction:
- Parameters.ConditionalAuthorizationActionParameters
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
) =
parameters(
Parameters.ofConditionalAuthorizationAction(conditionalAuthorizationAction)
@@ -3359,6 +1783,35 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** The event stream during which the rule will be evaluated. */
+ fun eventStream(eventStream: EventStream) = eventStream(JsonField.of(eventStream))
+
+ /**
+ * Sets [Builder.eventStream] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.eventStream] with a well-typed [EventStream]
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun eventStream(eventStream: JsonField) = apply {
+ this.eventStream = eventStream
+ }
+
+ /** Auth Rule Name */
+ fun name(name: String?) = name(JsonField.ofNullable(name))
+
+ /** Alias for calling [Builder.name] with `name.orElse(null)`. */
+ fun name(name: Optional) = name(name.getOrNull())
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun name(name: JsonField) = apply { this.name = name }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -3382,40 +1835,42 @@ private constructor(
}
/**
- * Returns an immutable instance of [CreateAuthRuleRequestCardTokens].
+ * Returns an immutable instance of [CardLevelRule].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
* .cardTokens()
+ * .parameters()
+ * .type()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): CreateAuthRuleRequestCardTokens =
- CreateAuthRuleRequestCardTokens(
+ fun build(): CardLevelRule =
+ CardLevelRule(
checkRequired("cardTokens", cardTokens).map { it.toImmutable() },
+ checkRequired("parameters", parameters),
+ checkRequired("type", type),
eventStream,
name,
- parameters,
- type,
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): CreateAuthRuleRequestCardTokens = apply {
+ fun validate(): CardLevelRule = apply {
if (validated) {
return@apply
}
cardTokens()
+ parameters().validate()
+ type().validate()
eventStream().ifPresent { it.validate() }
name()
- parameters().ifPresent { it.validate() }
- type().ifPresent { it.validate() }
validated = true
}
@@ -3436,143 +1891,10 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(cardTokens.asKnown().getOrNull()?.size ?: 0) +
- (eventStream.asKnown().getOrNull()?.validity() ?: 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
(parameters.asKnown().getOrNull()?.validity() ?: 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /** The event stream during which the rule will be evaluated. */
- class EventStream
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that
- * doesn't match any known member, and you want to know that value. For example, if
- * the SDK is on an older version than the API, then the API may respond with new
- * members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val AUTHORIZATION = of("AUTHORIZATION")
-
- @JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
-
- @JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
- }
-
- /** An enum containing [EventStream]'s known values. */
- enum class Known {
- AUTHORIZATION,
- THREE_DS_AUTHENTICATION,
- }
-
- /**
- * An enum containing [EventStream]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [EventStream] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example,
- * if the SDK is on an older version than the API, then the API may respond with
- * new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- AUTHORIZATION,
- THREE_DS_AUTHENTICATION,
- /**
- * An enum member indicating that [EventStream] was instantiated with an unknown
- * value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if
- * you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- AUTHORIZATION -> Value.AUTHORIZATION
- THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always known and
- * don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is a not a
- * known member.
- */
- fun known(): Known =
- when (this) {
- AUTHORIZATION -> Known.AUTHORIZATION
- THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
- else -> throw LithicInvalidDataException("Unknown EventStream: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for
- * debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value does not have
- * the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): EventStream = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is EventStream && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
+ (type.asKnown().getOrNull()?.validity() ?: 0) +
+ (eventStream.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (name.asKnown().isPresent) 1 else 0)
/** Parameters for the Auth Rule */
@JsonDeserialize(using = Parameters.Deserializer::class)
@@ -3905,1501 +2227,7 @@ private constructor(
}
}
}
-
- class ConditionalAuthorizationActionParameters
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val action: JsonField,
- private val conditions: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("action")
- @ExcludeMissing
- action: JsonField = JsonMissing.of(),
- @JsonProperty("conditions")
- @ExcludeMissing
- conditions: JsonField> = JsonMissing.of(),
- ) : this(action, conditions, mutableMapOf())
-
- /**
- * The action to take if the conditions are met.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an
- * unexpected value).
- */
- fun action(): Action = action.getRequired("action")
-
- /**
- * @throws LithicInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an
- * unexpected value).
- */
- fun conditions(): List = conditions.getRequired("conditions")
-
- /**
- * Returns the raw JSON value of [action].
- *
- * Unlike [action], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("action")
- @ExcludeMissing
- fun _action(): JsonField = action
-
- /**
- * Returns the raw JSON value of [conditions].
- *
- * Unlike [conditions], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("conditions")
- @ExcludeMissing
- fun _conditions(): JsonField> = conditions
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [ConditionalAuthorizationActionParameters].
- *
- * The following fields are required:
- * ```java
- * .action()
- * .conditions()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ConditionalAuthorizationActionParameters]. */
- class Builder internal constructor() {
-
- private var action: JsonField? = null
- private var conditions: JsonField>? = null
- private var additionalProperties: MutableMap =
- mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- conditionalAuthorizationActionParameters:
- ConditionalAuthorizationActionParameters
- ) = apply {
- action = conditionalAuthorizationActionParameters.action
- conditions =
- conditionalAuthorizationActionParameters.conditions.map {
- it.toMutableList()
- }
- additionalProperties =
- conditionalAuthorizationActionParameters.additionalProperties
- .toMutableMap()
- }
-
- /** The action to take if the conditions are met. */
- fun action(action: Action) = action(JsonField.of(action))
-
- /**
- * Sets [Builder.action] to an arbitrary JSON value.
- *
- * You should usually call [Builder.action] with a well-typed [Action] value
- * instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun action(action: JsonField) = apply { this.action = action }
-
- fun conditions(conditions: List) =
- conditions(JsonField.of(conditions))
-
- /**
- * Sets [Builder.conditions] to an arbitrary JSON value.
- *
- * You should usually call [Builder.conditions] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun conditions(conditions: JsonField>) = apply {
- this.conditions = conditions.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [Condition] to [conditions].
- *
- * @throws IllegalStateException if the field was previously set to a
- * non-list.
- */
- fun addCondition(condition: Condition) = apply {
- conditions =
- (conditions ?: JsonField.of(mutableListOf())).also {
- checkKnown("conditions", it).add(condition)
- }
- }
-
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of
- * [ConditionalAuthorizationActionParameters].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .action()
- * .conditions()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): ConditionalAuthorizationActionParameters =
- ConditionalAuthorizationActionParameters(
- checkRequired("action", action),
- checkRequired("conditions", conditions).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): ConditionalAuthorizationActionParameters = apply {
- if (validated) {
- return@apply
- }
-
- action().validate()
- conditions().forEach { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (action.asKnown().getOrNull()?.validity() ?: 0) +
- (conditions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
-
- /** The action to take if the conditions are met. */
- class Action
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data
- * that doesn't match any known member, and you want to know that value. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val DECLINE = of("DECLINE")
-
- @JvmField val CHALLENGE = of("CHALLENGE")
-
- @JvmStatic fun of(value: String) = Action(JsonField.of(value))
- }
-
- /** An enum containing [Action]'s known values. */
- enum class Known {
- DECLINE,
- CHALLENGE,
- }
-
- /**
- * An enum containing [Action]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [Action] can contain an unknown value in a couple of
- * cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API
- * may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- DECLINE,
- CHALLENGE,
- /**
- * An enum member indicating that [Action] was instantiated with an
- * unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- DECLINE -> Value.DECLINE
- CHALLENGE -> Value.CHALLENGE
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always
- * known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is a
- * not a known member.
- */
- fun known(): Known =
- when (this) {
- DECLINE -> Known.DECLINE
- CHALLENGE -> Known.CHALLENGE
- else -> throw LithicInvalidDataException("Unknown Action: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily
- * for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value does
- * not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Action = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Action && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class Condition
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val attribute: JsonField,
- private val operation: JsonField,
- private val value: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("attribute")
- @ExcludeMissing
- attribute: JsonField = JsonMissing.of(),
- @JsonProperty("operation")
- @ExcludeMissing
- operation: JsonField = JsonMissing.of(),
- @JsonProperty("value")
- @ExcludeMissing
- value: JsonField = JsonMissing.of(),
- ) : this(attribute, operation, value, mutableMapOf())
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1)
- * all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT
- * for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the
- * issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account
- * number (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`,
- * `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`,
- * `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, `MANUAL`, `OCR`,
- * `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, `CREDENTIAL_ON_FILE`, or
- * `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the
- * acquirer fee field in the settlement/cardholder billing currency. This
- * is the amount the issuer should authorize against unless the issuer is
- * paying the acquirer fee on behalf of the cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level associated
- * with a given authorization. Scores are on a range of 0-999, with 0
- * representing the lowest risk and 999 representing the highest risk. For
- * Visa transactions, where the raw score has a range of 0-99, Lithic will
- * normalize the score by multiplying the raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in
- * the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in
- * the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in
- * the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates
- * the source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
- * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid values
- * are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun attribute(): Optional = attribute.getOptional("attribute")
-
- /**
- * The operation to apply to the attribute
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun operation(): Optional = operation.getOptional("operation")
-
- /**
- * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun value(): Optional = value.getOptional("value")
-
- /**
- * Returns the raw JSON value of [attribute].
- *
- * Unlike [attribute], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("attribute")
- @ExcludeMissing
- fun _attribute(): JsonField = attribute
-
- /**
- * Returns the raw JSON value of [operation].
- *
- * Unlike [operation], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("operation")
- @ExcludeMissing
- fun _operation(): JsonField = operation
-
- /**
- * Returns the raw JSON value of [value].
- *
- * Unlike [value], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("value")
- @ExcludeMissing
- fun _value(): JsonField = value
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [Condition].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Condition]. */
- class Builder internal constructor() {
-
- private var attribute: JsonField = JsonMissing.of()
- private var operation: JsonField = JsonMissing.of()
- private var value: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap =
- mutableMapOf()
-
- @JvmSynthetic
- internal fun from(condition: Condition) = apply {
- attribute = condition.attribute
- operation = condition.operation
- value = condition.value
- additionalProperties = condition.additionalProperties.toMutableMap()
- }
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are:
- * (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and
- * (3) ANT for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to
- * the issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary
- * account number (PAN) was entered. Valid values are `AUTO_ENTRY`,
- * `BAR_CODE`, `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`,
- * `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`,
- * `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`,
- * `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus
- * the acquirer fee field in the settlement/cardholder billing
- * currency. This is the amount the issuer should authorize against
- * unless the issuer is paying the acquirer fee on behalf of the
- * cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level
- * associated with a given authorization. Scores are on a range of
- * 0-999, with 0 representing the lowest risk and 999 representing the
- * highest risk. For Visa transactions, where the raw score has a
- * range of 0-99, Lithic will normalize the score by multiplying the
- * raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the
- * card in the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card
- * in the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the
- * card in the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token,
- * indicates the source of the token. Valid values are `APPLE_PAY`,
- * `GOOGLE_PAY`, `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`,
- * `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid
- * values are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- */
- fun attribute(attribute: Attribute) = attribute(JsonField.of(attribute))
-
- /**
- * Sets [Builder.attribute] to an arbitrary JSON value.
- *
- * You should usually call [Builder.attribute] with a well-typed
- * [Attribute] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun attribute(attribute: JsonField) = apply {
- this.attribute = attribute
- }
-
- /** The operation to apply to the attribute */
- fun operation(operation: Operation) = operation(JsonField.of(operation))
-
- /**
- * Sets [Builder.operation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.operation] with a well-typed
- * [Operation] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun operation(operation: JsonField) = apply {
- this.operation = operation
- }
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun value(value: Value) = value(JsonField.of(value))
-
- /**
- * Sets [Builder.value] to an arbitrary JSON value.
- *
- * You should usually call [Builder.value] with a well-typed [Value]
- * value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun value(value: JsonField) = apply { this.value = value }
-
- /** Alias for calling [value] with `Value.ofRegex(regex)`. */
- fun value(regex: String) = value(Value.ofRegex(regex))
-
- /** Alias for calling [value] with `Value.ofNumber(number)`. */
- fun value(number: Long) = value(Value.ofNumber(number))
-
- /**
- * Alias for calling [value] with
- * `Value.ofListOfStrings(listOfStrings)`.
- */
- fun valueOfListOfStrings(listOfStrings: List) =
- value(Value.ofListOfStrings(listOfStrings))
-
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Condition].
- *
- * Further updates to this [Builder] will not mutate the returned
- * instance.
- */
- fun build(): Condition =
- Condition(
- attribute,
- operation,
- value,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Condition = apply {
- if (validated) {
- return@apply
- }
-
- attribute().ifPresent { it.validate() }
- operation().ifPresent { it.validate() }
- value().ifPresent { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (attribute.asKnown().getOrNull()?.validity() ?: 0) +
- (operation.asKnown().getOrNull()?.validity() ?: 0) +
- (value.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * The attribute to target.
- *
- * The following attributes may be targeted:
- * * `MCC`: A four-digit number listed in ISO 18245. An MCC is used to
- * classify a business by the types of goods or services it provides.
- * * `COUNTRY`: Country of entity of card acceptor. Possible values are: (1)
- * all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT
- * for Netherlands Antilles.
- * * `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant
- * currency of the transaction.
- * * `MERCHANT_ID`: Unique alphanumeric identifier for the payment card
- * acceptor (merchant).
- * * `DESCRIPTOR`: Short description of card acceptor.
- * * `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the
- * issuer applies to the transaction. Valid values are `NONE`,
- * `3DS_AUTHENTICATED`, or `TOKEN_AUTHENTICATED`.
- * * `PAN_ENTRY_MODE`: The method by which the cardholder's primary account
- * number (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`,
- * `CONTACTLESS`, `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`,
- * `ICC`, `KEY_ENTERED`, `MAGNETIC_STRIPE`, `MANUAL`, `OCR`,
- * `SECURE_CARDLESS`, `UNSPECIFIED`, `UNKNOWN`, `CREDENTIAL_ON_FILE`, or
- * `ECOMMERCE`.
- * * `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the
- * acquirer fee field in the settlement/cardholder billing currency. This
- * is the amount the issuer should authorize against unless the issuer is
- * paying the acquirer fee on behalf of the cardholder.
- * * `CASH_AMOUNT`: The cash amount of the transaction in minor units
- * (cents). This represents the amount of cash being withdrawn or
- * advanced.
- * * `RISK_SCORE`: Network-provided score assessing risk level associated
- * with a given authorization. Scores are on a range of 0-999, with 0
- * representing the lowest risk and 999 representing the highest risk. For
- * Visa transactions, where the raw score has a range of 0-99, Lithic will
- * normalize the score by multiplying the raw score by 10x.
- * * `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in
- * the trailing 15 minutes before the authorization.
- * * `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in
- * the trailing hour up and until the authorization.
- * * `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in
- * the trailing 24 hours up and until the authorization.
- * * `CARD_STATE`: The current state of the card associated with the
- * transaction. Valid values are `CLOSED`, `OPEN`, `PAUSED`,
- * `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
- * * `PIN_ENTERED`: Indicates whether a PIN was entered during the
- * transaction. Valid values are `TRUE`, `FALSE`.
- * * `PIN_STATUS`: The current state of card's PIN. Valid values are
- * `NOT_SET`, `OK`, `BLOCKED`.
- * * `WALLET_TYPE`: For transactions using a digital wallet token, indicates
- * the source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
- * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
- * * `TRANSACTION_INITIATOR`: The entity that initiated the transaction
- * indicates the source of the token. Valid values are `CARDHOLDER`,
- * `MERCHANT`, `UNKNOWN`.
- * * `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's
- * address data with the cardholder KYC data if it exists. Valid values
- * are `MATCH`, `MATCH_ADDRESS_ONLY`,
- * `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
- */
- class Attribute
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from
- * data that doesn't match any known member, and you want to know that
- * value. For example, if the SDK is on an older version than the API,
- * then the API may respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val MCC = of("MCC")
-
- @JvmField val COUNTRY = of("COUNTRY")
-
- @JvmField val CURRENCY = of("CURRENCY")
-
- @JvmField val MERCHANT_ID = of("MERCHANT_ID")
-
- @JvmField val DESCRIPTOR = of("DESCRIPTOR")
-
- @JvmField val LIABILITY_SHIFT = of("LIABILITY_SHIFT")
-
- @JvmField val PAN_ENTRY_MODE = of("PAN_ENTRY_MODE")
-
- @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT")
-
- @JvmField val CASH_AMOUNT = of("CASH_AMOUNT")
-
- @JvmField val RISK_SCORE = of("RISK_SCORE")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_15_M = of("CARD_TRANSACTION_COUNT_15M")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_1_H = of("CARD_TRANSACTION_COUNT_1H")
-
- @JvmField
- val CARD_TRANSACTION_COUNT_24_H = of("CARD_TRANSACTION_COUNT_24H")
-
- @JvmField val CARD_STATE = of("CARD_STATE")
-
- @JvmField val PIN_ENTERED = of("PIN_ENTERED")
-
- @JvmField val PIN_STATUS = of("PIN_STATUS")
-
- @JvmField val WALLET_TYPE = of("WALLET_TYPE")
-
- @JvmField val TRANSACTION_INITIATOR = of("TRANSACTION_INITIATOR")
-
- @JvmField val ADDRESS_MATCH = of("ADDRESS_MATCH")
-
- @JvmStatic fun of(value: String) = Attribute(JsonField.of(value))
- }
-
- /** An enum containing [Attribute]'s known values. */
- enum class Known {
- MCC,
- COUNTRY,
- CURRENCY,
- MERCHANT_ID,
- DESCRIPTOR,
- LIABILITY_SHIFT,
- PAN_ENTRY_MODE,
- TRANSACTION_AMOUNT,
- CASH_AMOUNT,
- RISK_SCORE,
- CARD_TRANSACTION_COUNT_15_M,
- CARD_TRANSACTION_COUNT_1_H,
- CARD_TRANSACTION_COUNT_24_H,
- CARD_STATE,
- PIN_ENTERED,
- PIN_STATUS,
- WALLET_TYPE,
- TRANSACTION_INITIATOR,
- ADDRESS_MATCH,
- }
-
- /**
- * An enum containing [Attribute]'s known values, as well as an
- * [_UNKNOWN] member.
- *
- * An instance of [Attribute] can contain an unknown value in a couple
- * of cases:
- * - It was deserialized from data that doesn't match any known member.
- * For example, if the SDK is on an older version than the API, then
- * the API may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- MCC,
- COUNTRY,
- CURRENCY,
- MERCHANT_ID,
- DESCRIPTOR,
- LIABILITY_SHIFT,
- PAN_ENTRY_MODE,
- TRANSACTION_AMOUNT,
- CASH_AMOUNT,
- RISK_SCORE,
- CARD_TRANSACTION_COUNT_15_M,
- CARD_TRANSACTION_COUNT_1_H,
- CARD_TRANSACTION_COUNT_24_H,
- CARD_STATE,
- PIN_ENTERED,
- PIN_STATUS,
- WALLET_TYPE,
- TRANSACTION_INITIATOR,
- ADDRESS_MATCH,
- /**
- * An enum member indicating that [Attribute] was instantiated with
- * an unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value,
- * or [Value._UNKNOWN] if the class was instantiated with an unknown
- * value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- MCC -> Value.MCC
- COUNTRY -> Value.COUNTRY
- CURRENCY -> Value.CURRENCY
- MERCHANT_ID -> Value.MERCHANT_ID
- DESCRIPTOR -> Value.DESCRIPTOR
- LIABILITY_SHIFT -> Value.LIABILITY_SHIFT
- PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE
- TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT
- CASH_AMOUNT -> Value.CASH_AMOUNT
- RISK_SCORE -> Value.RISK_SCORE
- CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M
- CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H
- CARD_TRANSACTION_COUNT_24_H -> Value.CARD_TRANSACTION_COUNT_24_H
- CARD_STATE -> Value.CARD_STATE
- PIN_ENTERED -> Value.PIN_ENTERED
- PIN_STATUS -> Value.PIN_STATUS
- WALLET_TYPE -> Value.WALLET_TYPE
- TRANSACTION_INITIATOR -> Value.TRANSACTION_INITIATOR
- ADDRESS_MATCH -> Value.ADDRESS_MATCH
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is
- * always known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is
- * a not a known member.
- */
- fun known(): Known =
- when (this) {
- MCC -> Known.MCC
- COUNTRY -> Known.COUNTRY
- CURRENCY -> Known.CURRENCY
- MERCHANT_ID -> Known.MERCHANT_ID
- DESCRIPTOR -> Known.DESCRIPTOR
- LIABILITY_SHIFT -> Known.LIABILITY_SHIFT
- PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE
- TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT
- CASH_AMOUNT -> Known.CASH_AMOUNT
- RISK_SCORE -> Known.RISK_SCORE
- CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M
- CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H
- CARD_TRANSACTION_COUNT_24_H -> Known.CARD_TRANSACTION_COUNT_24_H
- CARD_STATE -> Known.CARD_STATE
- PIN_ENTERED -> Known.PIN_ENTERED
- PIN_STATUS -> Known.PIN_STATUS
- WALLET_TYPE -> Known.WALLET_TYPE
- TRANSACTION_INITIATOR -> Known.TRANSACTION_INITIATOR
- ADDRESS_MATCH -> Known.ADDRESS_MATCH
- else ->
- throw LithicInvalidDataException(
- "Unknown Attribute: $value"
- )
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is
- * primarily for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value
- * does not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Attribute = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Attribute && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** The operation to apply to the attribute */
- class Operation
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from
- * data that doesn't match any known member, and you want to know that
- * value. For example, if the SDK is on an older version than the API,
- * then the API may respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val IS_ONE_OF = of("IS_ONE_OF")
-
- @JvmField val IS_NOT_ONE_OF = of("IS_NOT_ONE_OF")
-
- @JvmField val MATCHES = of("MATCHES")
-
- @JvmField val DOES_NOT_MATCH = of("DOES_NOT_MATCH")
-
- @JvmField val IS_EQUAL_TO = of("IS_EQUAL_TO")
-
- @JvmField val IS_NOT_EQUAL_TO = of("IS_NOT_EQUAL_TO")
-
- @JvmField val IS_GREATER_THAN = of("IS_GREATER_THAN")
-
- @JvmField
- val IS_GREATER_THAN_OR_EQUAL_TO = of("IS_GREATER_THAN_OR_EQUAL_TO")
-
- @JvmField val IS_LESS_THAN = of("IS_LESS_THAN")
-
- @JvmField
- val IS_LESS_THAN_OR_EQUAL_TO = of("IS_LESS_THAN_OR_EQUAL_TO")
-
- @JvmStatic fun of(value: String) = Operation(JsonField.of(value))
- }
-
- /** An enum containing [Operation]'s known values. */
- enum class Known {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- }
-
- /**
- * An enum containing [Operation]'s known values, as well as an
- * [_UNKNOWN] member.
- *
- * An instance of [Operation] can contain an unknown value in a couple
- * of cases:
- * - It was deserialized from data that doesn't match any known member.
- * For example, if the SDK is on an older version than the API, then
- * the API may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- IS_ONE_OF,
- IS_NOT_ONE_OF,
- MATCHES,
- DOES_NOT_MATCH,
- IS_EQUAL_TO,
- IS_NOT_EQUAL_TO,
- IS_GREATER_THAN,
- IS_GREATER_THAN_OR_EQUAL_TO,
- IS_LESS_THAN,
- IS_LESS_THAN_OR_EQUAL_TO,
- /**
- * An enum member indicating that [Operation] was instantiated with
- * an unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value,
- * or [Value._UNKNOWN] if the class was instantiated with an unknown
- * value.
- *
- * Use the [known] method instead if you're certain the value is always
- * known or if you want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- IS_ONE_OF -> Value.IS_ONE_OF
- IS_NOT_ONE_OF -> Value.IS_NOT_ONE_OF
- MATCHES -> Value.MATCHES
- DOES_NOT_MATCH -> Value.DOES_NOT_MATCH
- IS_EQUAL_TO -> Value.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Value.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Value.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Value.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Value.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Value.IS_LESS_THAN_OR_EQUAL_TO
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is
- * always known and don't want to throw for the unknown case.
- *
- * @throws LithicInvalidDataException if this class instance's value is
- * a not a known member.
- */
- fun known(): Known =
- when (this) {
- IS_ONE_OF -> Known.IS_ONE_OF
- IS_NOT_ONE_OF -> Known.IS_NOT_ONE_OF
- MATCHES -> Known.MATCHES
- DOES_NOT_MATCH -> Known.DOES_NOT_MATCH
- IS_EQUAL_TO -> Known.IS_EQUAL_TO
- IS_NOT_EQUAL_TO -> Known.IS_NOT_EQUAL_TO
- IS_GREATER_THAN -> Known.IS_GREATER_THAN
- IS_GREATER_THAN_OR_EQUAL_TO -> Known.IS_GREATER_THAN_OR_EQUAL_TO
- IS_LESS_THAN -> Known.IS_LESS_THAN
- IS_LESS_THAN_OR_EQUAL_TO -> Known.IS_LESS_THAN_OR_EQUAL_TO
- else ->
- throw LithicInvalidDataException(
- "Unknown Operation: $value"
- )
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is
- * primarily for debugging and generally doesn't throw.
- *
- * @throws LithicInvalidDataException if this class instance's value
- * does not have the expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- LithicInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Operation = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Operation && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JsonDeserialize(using = Value.Deserializer::class)
- @JsonSerialize(using = Value.Serializer::class)
- class Value
- private constructor(
- private val regex: String? = null,
- private val number: Long? = null,
- private val listOfStrings: List? = null,
- private val _json: JsonValue? = null,
- ) {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun regex(): Optional = Optional.ofNullable(regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun number(): Optional = Optional.ofNullable(number)
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF`
- */
- fun listOfStrings(): Optional> =
- Optional.ofNullable(listOfStrings)
-
- fun isRegex(): Boolean = regex != null
-
- fun isNumber(): Boolean = number != null
-
- fun isListOfStrings(): Boolean = listOfStrings != null
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun asRegex(): String = regex.getOrThrow("regex")
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun asNumber(): Long = number.getOrThrow("number")
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF`
- */
- fun asListOfStrings(): List =
- listOfStrings.getOrThrow("listOfStrings")
-
- fun _json(): Optional = Optional.ofNullable(_json)
-
- fun accept(visitor: Visitor): T =
- when {
- regex != null -> visitor.visitRegex(regex)
- number != null -> visitor.visitNumber(number)
- listOfStrings != null ->
- visitor.visitListOfStrings(listOfStrings)
- else -> visitor.unknown(_json)
- }
-
- private var validated: Boolean = false
-
- fun validate(): Value = apply {
- if (validated) {
- return@apply
- }
-
- accept(
- object : Visitor {
- override fun visitRegex(regex: String) {}
-
- override fun visitNumber(number: Long) {}
-
- override fun visitListOfStrings(
- listOfStrings: List
- ) {}
- }
- )
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: LithicInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in
- * this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- accept(
- object : Visitor {
- override fun visitRegex(regex: String) = 1
-
- override fun visitNumber(number: Long) = 1
-
- override fun visitListOfStrings(
- listOfStrings: List
- ) = listOfStrings.size
-
- override fun unknown(json: JsonValue?) = 0
- }
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Value &&
- regex == other.regex &&
- number == other.number &&
- listOfStrings == other.listOfStrings
- }
-
- override fun hashCode(): Int =
- Objects.hash(regex, number, listOfStrings)
-
- override fun toString(): String =
- when {
- regex != null -> "Value{regex=$regex}"
- number != null -> "Value{number=$number}"
- listOfStrings != null -> "Value{listOfStrings=$listOfStrings}"
- _json != null -> "Value{_unknown=$_json}"
- else -> throw IllegalStateException("Invalid Value")
- }
-
- companion object {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- @JvmStatic fun ofRegex(regex: String) = Value(regex = regex)
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- @JvmStatic fun ofNumber(number: Long) = Value(number = number)
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or
- * `IS_NOT_ONE_OF`
- */
- @JvmStatic
- fun ofListOfStrings(listOfStrings: List) =
- Value(listOfStrings = listOfStrings.toImmutable())
- }
-
- /**
- * An interface that defines how to map each variant of [Value] to a
- * value of type [T].
- */
- interface Visitor {
-
- /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */
- fun visitRegex(regex: String): T
-
- /**
- * A number, to be used with `IS_GREATER_THAN`,
- * `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`,
- * `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO`
- */
- fun visitNumber(number: Long): T
-
- /**
- * An array of strings, to be used with `IS_ONE_OF` or
- * `IS_NOT_ONE_OF`
- */
- fun visitListOfStrings(listOfStrings: List): T
-
- /**
- * Maps an unknown variant of [Value] to a value of type [T].
- *
- * An instance of [Value] can contain an unknown variant if it was
- * deserialized from data that doesn't match any known variant. For
- * example, if the SDK is on an older version than the API, then the
- * API may respond with new variants that the SDK is unaware of.
- *
- * @throws LithicInvalidDataException in the default implementation.
- */
- fun unknown(json: JsonValue?): T {
- throw LithicInvalidDataException("Unknown Value: $json")
- }
- }
-
- internal class Deserializer : BaseDeserializer(Value::class) {
-
- override fun ObjectCodec.deserialize(node: JsonNode): Value {
- val json = JsonValue.fromJsonNode(node)
-
- val bestMatches =
- sequenceOf(
- tryDeserialize(node, jacksonTypeRef())
- ?.let { Value(regex = it, _json = json) },
- tryDeserialize(node, jacksonTypeRef())?.let {
- Value(number = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef>())
- ?.let {
- Value(listOfStrings = it, _json = json)
- },
- )
- .filterNotNull()
- .allMaxBy { it.validity() }
- .toList()
- return when (bestMatches.size) {
- // This can happen if what we're deserializing is completely
- // incompatible with all the possible variants (e.g.
- // deserializing from object).
- 0 -> Value(_json = json)
- 1 -> bestMatches.single()
- // If there's more than one match with the highest validity,
- // then use the first completely valid match, or simply the
- // first match if none are completely valid.
- else ->
- bestMatches.firstOrNull { it.isValid() }
- ?: bestMatches.first()
- }
- }
- }
-
- internal class Serializer : BaseSerializer(Value::class) {
-
- override fun serialize(
- value: Value,
- generator: JsonGenerator,
- provider: SerializerProvider,
- ) {
- when {
- value.regex != null -> generator.writeObject(value.regex)
- value.number != null -> generator.writeObject(value.number)
- value.listOfStrings != null ->
- generator.writeObject(value.listOfStrings)
- value._json != null -> generator.writeObject(value._json)
- else -> throw IllegalStateException("Invalid Value")
- }
- }
- }
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Condition &&
- attribute == other.attribute &&
- operation == other.operation &&
- value == other.value &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(attribute, operation, value, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Condition{attribute=$attribute, operation=$operation, value=$value, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is ConditionalAuthorizationActionParameters &&
- action == other.action &&
- conditions == other.conditions &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(action, conditions, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "ConditionalAuthorizationActionParameters{action=$action, conditions=$conditions, additionalProperties=$additionalProperties}"
- }
- }
+ }
/**
* The type of Auth Rule. For certain rule types, this determines the event stream
@@ -5555,79 +2383,236 @@ private constructor(
override fun toString() = value.toString()
}
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /** The event stream during which the rule will be evaluated. */
+ class EventStream
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
- return other is CreateAuthRuleRequestCardTokens &&
- cardTokens == other.cardTokens &&
- eventStream == other.eventStream &&
- name == other.name &&
- parameters == other.parameters &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that
+ * doesn't match any known member, and you want to know that value. For example, if
+ * the SDK is on an older version than the API, then the API may respond with new
+ * members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
- private val hashCode: Int by lazy {
- Objects.hash(cardTokens, eventStream, name, parameters, type, additionalProperties)
- }
+ companion object {
- override fun hashCode(): Int = hashCode
+ @JvmField val AUTHORIZATION = of("AUTHORIZATION")
- override fun toString() =
- "CreateAuthRuleRequestCardTokens{cardTokens=$cardTokens, eventStream=$eventStream, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}"
- }
+ @JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
- class CreateAuthRuleRequestProgramLevel
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val programLevel: JsonField