diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 620a05d92..e7d7ae237 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -65,14 +65,18 @@ jobs:
run: ./scripts/build
- name: Get GitHub OIDC Token
- if: github.repository == 'stainless-sdks/lithic-java'
+ if: |-
+ github.repository == 'stainless-sdks/lithic-java' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());
- name: Build and upload Maven artifacts
- if: github.repository == 'stainless-sdks/lithic-java'
+ if: |-
+ github.repository == 'stainless-sdks/lithic-java' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 124b9841a..486a203fc 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.119.0"
+ ".": "0.120.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 4f6a4f909..6976609b6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 185
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee8607f0a2cdcaee420935050334a439db8dd097be83023fccdaf1d6f9a7de14.yml
-openapi_spec_hash: 0f21c68cdddb7c5bd99f42356d507393
-config_hash: fb5070d41fcabdedbc084b83964b592a
+configured_endpoints: 190
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e88a4837037207e9591d48d534bd61acca57ca6e7c59ec0d4fdcf6e05288cc6d.yml
+openapi_spec_hash: fd8bbc173d1b6dafd117fb1a3a3d446c
+config_hash: 3005e2502301e77754e5e1455584525b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afbe3e6a2..5443c14dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,41 @@
# Changelog
+## 0.120.0 (2026-03-16)
+
+Full Changelog: [v0.119.0...v0.120.0](https://github.com/lithic-com/lithic-java/compare/v0.119.0...v0.120.0)
+
+### Features
+
+* **api:** add EARLY_DIRECT_DEPOSIT_FLOAT type to financial account ([e333879](https://github.com/lithic-com/lithic-java/commit/e333879612c488e74effb36cca27da4fe9ed134f))
+* **api:** Add event_subtype to statement line items ([b79d216](https://github.com/lithic-com/lithic-java/commit/b79d216cc18514631e585e04478ff35b0d04756e))
+* **api:** add excluded_account_tokens to auth rules v2 create/update/response ([48172eb](https://github.com/lithic-com/lithic-java/commit/48172eb32c967897424c5ede57ab13db79816ad5))
+* **api:** add loan_tape_date field to statement line items ([be3f3fb](https://github.com/lithic-com/lithic-java/commit/be3f3fb90c7492fc1a6707f217c4fc1bf8e45211))
+* **api:** add penaltyRates field to InterestTierSchedule ([d76bd05](https://github.com/lithic-com/lithic-java/commit/d76bd05f0683bc7b2ff959b761206f165fb7a9ab))
+* **api:** Add support for early direct deposit ([de8c713](https://github.com/lithic-com/lithic-java/commit/de8c71325409c0b70285dba8100289872d835c72))
+* **api:** add TypeScript rules, RuleFeature model, draft version state fields ([f57cd63](https://github.com/lithic-com/lithic-java/commit/f57cd63e55e1331e79cd7f4bdea8b64bf5d05582))
+* **api:** add versions field to V2RetrieveReportResponse DailyStatistic ([3cfb7a6](https://github.com/lithic-com/lithic-java/commit/3cfb7a679a5398aeebcbf72c7b50278ab1e527ab))
+* **api:** add wire event types/category, remove remittance field from wire attributes ([e0279aa](https://github.com/lithic-com/lithic-java/commit/e0279aaffec5a2304524b9a96e4ed468af0647df))
+
+
+### Bug Fixes
+
+* **api:** [breaking] unify webhook schemas for digital_wallet.tokenization_approval_request webhooks ([bb93367](https://github.com/lithic-com/lithic-java/commit/bb93367ad5ca32a3a113c2d358cc198d2c588dfc))
+* **api:** Disable MCP server to fix TypeScript SDK package publishing ([1e30690](https://github.com/lithic-com/lithic-java/commit/1e30690af36ee4c265fd3e772680ee3bf8878091))
+* **client:** incorrect `Retry-After` parsing ([42c61b6](https://github.com/lithic-com/lithic-java/commit/42c61b6534cff16b5e45a4b8ca15f5e8e3f4dacd))
+* **types:** rename SimulationParameters, remove auth_rule_token, require end/start fields ([3d97da0](https://github.com/lithic-com/lithic-java/commit/3d97da075d03155088bc9b7a7a6f832f87ea73dc))
+
+
+### Chores
+
+* **internal:** codegen related update ([10b1473](https://github.com/lithic-com/lithic-java/commit/10b14732a71e84708c2da1234a47664b19354c97))
+* **internal:** regenerate SDK with no functional changes ([56d8344](https://github.com/lithic-com/lithic-java/commit/56d834455da97e0514bb52bb3a8e0a7c60d6ca73))
+
+
+### Documentation
+
+* **api:** update dispute resource documentation to use chargeback terminology ([0540f6c](https://github.com/lithic-com/lithic-java/commit/0540f6cc8a567d830da50ddbde8d5066b79305ec))
+* **client:** add MCP Server integration section to README ([357a68b](https://github.com/lithic-com/lithic-java/commit/357a68b75098f97431986f0880043cbfaf34e3f4))
+
## 0.119.0 (2026-03-05)
Full Changelog: [v0.118.0...v0.119.0](https://github.com/lithic-com/lithic-java/compare/v0.118.0...v0.119.0)
diff --git a/README.md b/README.md
index cd00fb363..145515afb 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.119.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.119.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.120.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.120.0)
@@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all
-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.119.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.120.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.119.0")
+implementation("com.lithic.api:lithic-java:0.120.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.119.0")
com.lithic.api
lithic-java
- 0.119.0
+ 0.120.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 322e98c9b..a704d259d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.119.0" // x-release-please-version
+ version = "0.120.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
index 5c62db05a..6dd840a35 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt
@@ -28,6 +28,7 @@ import com.lithic.api.services.blocking.ExternalPaymentService
import com.lithic.api.services.blocking.FinancialAccountService
import com.lithic.api.services.blocking.FraudService
import com.lithic.api.services.blocking.FundingEventService
+import com.lithic.api.services.blocking.HoldService
import com.lithic.api.services.blocking.InternalTransactionService
import com.lithic.api.services.blocking.ManagementOperationService
import com.lithic.api.services.blocking.NetworkProgramService
@@ -139,6 +140,8 @@ interface LithicClient {
fun networkPrograms(): NetworkProgramService
+ fun holds(): HoldService
+
fun accountActivity(): AccountActivityService
fun transferLimits(): TransferLimitService
@@ -245,6 +248,8 @@ interface LithicClient {
fun networkPrograms(): NetworkProgramService.WithRawResponse
+ fun holds(): HoldService.WithRawResponse
+
fun accountActivity(): AccountActivityService.WithRawResponse
fun transferLimits(): TransferLimitService.WithRawResponse
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
index 720abfe67..d5ee8d117 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt
@@ -27,6 +27,7 @@ import com.lithic.api.services.async.ExternalPaymentServiceAsync
import com.lithic.api.services.async.FinancialAccountServiceAsync
import com.lithic.api.services.async.FraudServiceAsync
import com.lithic.api.services.async.FundingEventServiceAsync
+import com.lithic.api.services.async.HoldServiceAsync
import com.lithic.api.services.async.InternalTransactionServiceAsync
import com.lithic.api.services.async.ManagementOperationServiceAsync
import com.lithic.api.services.async.NetworkProgramServiceAsync
@@ -139,6 +140,8 @@ interface LithicClientAsync {
fun networkPrograms(): NetworkProgramServiceAsync
+ fun holds(): HoldServiceAsync
+
fun accountActivity(): AccountActivityServiceAsync
fun transferLimits(): TransferLimitServiceAsync
@@ -248,6 +251,8 @@ interface LithicClientAsync {
fun networkPrograms(): NetworkProgramServiceAsync.WithRawResponse
+ fun holds(): HoldServiceAsync.WithRawResponse
+
fun accountActivity(): AccountActivityServiceAsync.WithRawResponse
fun transferLimits(): TransferLimitServiceAsync.WithRawResponse
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
index 10e87732d..97d63df67 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt
@@ -57,6 +57,8 @@ import com.lithic.api.services.async.FraudServiceAsync
import com.lithic.api.services.async.FraudServiceAsyncImpl
import com.lithic.api.services.async.FundingEventServiceAsync
import com.lithic.api.services.async.FundingEventServiceAsyncImpl
+import com.lithic.api.services.async.HoldServiceAsync
+import com.lithic.api.services.async.HoldServiceAsyncImpl
import com.lithic.api.services.async.InternalTransactionServiceAsync
import com.lithic.api.services.async.InternalTransactionServiceAsyncImpl
import com.lithic.api.services.async.ManagementOperationServiceAsync
@@ -221,6 +223,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
NetworkProgramServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val holds: HoldServiceAsync by lazy { HoldServiceAsyncImpl(clientOptionsWithUserAgent) }
+
private val accountActivity: AccountActivityServiceAsync by lazy {
AccountActivityServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -301,6 +305,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
override fun networkPrograms(): NetworkProgramServiceAsync = networkPrograms
+ override fun holds(): HoldServiceAsync = holds
+
override fun accountActivity(): AccountActivityServiceAsync = accountActivity
override fun transferLimits(): TransferLimitServiceAsync = transferLimits
@@ -443,6 +449,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
NetworkProgramServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val holds: HoldServiceAsync.WithRawResponse by lazy {
+ HoldServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val accountActivity: AccountActivityServiceAsync.WithRawResponse by lazy {
AccountActivityServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -530,6 +540,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
override fun networkPrograms(): NetworkProgramServiceAsync.WithRawResponse = networkPrograms
+ override fun holds(): HoldServiceAsync.WithRawResponse = holds
+
override fun accountActivity(): AccountActivityServiceAsync.WithRawResponse =
accountActivity
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
index 411eeb787..f98080090 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt
@@ -57,6 +57,8 @@ import com.lithic.api.services.blocking.FraudService
import com.lithic.api.services.blocking.FraudServiceImpl
import com.lithic.api.services.blocking.FundingEventService
import com.lithic.api.services.blocking.FundingEventServiceImpl
+import com.lithic.api.services.blocking.HoldService
+import com.lithic.api.services.blocking.HoldServiceImpl
import com.lithic.api.services.blocking.InternalTransactionService
import com.lithic.api.services.blocking.InternalTransactionServiceImpl
import com.lithic.api.services.blocking.ManagementOperationService
@@ -204,6 +206,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
NetworkProgramServiceImpl(clientOptionsWithUserAgent)
}
+ private val holds: HoldService by lazy { HoldServiceImpl(clientOptionsWithUserAgent) }
+
private val accountActivity: AccountActivityService by lazy {
AccountActivityServiceImpl(clientOptionsWithUserAgent)
}
@@ -281,6 +285,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
override fun networkPrograms(): NetworkProgramService = networkPrograms
+ override fun holds(): HoldService = holds
+
override fun accountActivity(): AccountActivityService = accountActivity
override fun transferLimits(): TransferLimitService = transferLimits
@@ -423,6 +429,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
NetworkProgramServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val holds: HoldService.WithRawResponse by lazy {
+ HoldServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val accountActivity: AccountActivityService.WithRawResponse by lazy {
AccountActivityServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -509,6 +519,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
override fun networkPrograms(): NetworkProgramService.WithRawResponse = networkPrograms
+ override fun holds(): HoldService.WithRawResponse = holds
+
override fun accountActivity(): AccountActivityService.WithRawResponse = accountActivity
override fun transferLimits(): TransferLimitService.WithRawResponse = transferLimits
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
index 733b9370a..1a3efdc54 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt
@@ -201,7 +201,7 @@ private constructor(
?: headers.values("Retry-After").getOrNull(0)?.let { retryAfter ->
retryAfter.toFloatOrNull()?.times(TimeUnit.SECONDS.toNanos(1))
?: try {
- ChronoUnit.MILLIS.between(
+ ChronoUnit.NANOS.between(
OffsetDateTime.now(clock),
OffsetDateTime.parse(
retryAfter,
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
index 68f308289..798daf0cf 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
@@ -69,6 +69,9 @@ private constructor(
managementOperation: ManagementOperationTransaction
): Optional =
managementOperation._token().getOptional("token")
+
+ override fun visitHold(hold: Hold): Optional =
+ hold._token().getOptional("token")
}
)
)
@@ -104,6 +107,9 @@ private constructor(
managementOperation: ManagementOperationTransaction
): Optional =
managementOperation._token().getOptional("token")
+
+ override fun visitHold(hold: Hold): Optional =
+ hold._token().getOptional("token")
}
)
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
index cc509dfd6..1f14a7e6b 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
@@ -72,6 +72,9 @@ private constructor(
managementOperation: ManagementOperationTransaction
): Optional =
managementOperation._token().getOptional("token")
+
+ override fun visitHold(hold: Hold): Optional =
+ hold._token().getOptional("token")
}
)
)
@@ -107,6 +110,9 @@ private constructor(
managementOperation: ManagementOperationTransaction
): Optional =
managementOperation._token().getOptional("token")
+
+ override fun visitHold(hold: Hold): Optional =
+ hold._token().getOptional("token")
}
)
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
index 29731923e..ccf10fd86 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
@@ -156,6 +156,9 @@ private constructor(
fun addData(managementOperation: ManagementOperationTransaction) =
addData(AccountActivityListResponse.ofManagementOperation(managementOperation))
+ /** Alias for calling [addData] with `AccountActivityListResponse.ofHold(hold)`. */
+ fun addData(hold: Hold) = addData(AccountActivityListResponse.ofHold(hold))
+
/** Indicates if there are more transactions available for pagination */
fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore))
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
index eb2aa72b3..b368fcff1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
@@ -388,6 +388,8 @@ private constructor(
@JvmField val ACH = of("ACH")
+ @JvmField val WIRE = of("WIRE")
+
@JvmField val BALANCE_OR_FUNDING = of("BALANCE_OR_FUNDING")
@JvmField val FEE = of("FEE")
@@ -424,6 +426,8 @@ private constructor(
@JvmField val MANAGEMENT_DISBURSEMENT = of("MANAGEMENT_DISBURSEMENT")
+ @JvmField val HOLD = of("HOLD")
+
@JvmField val PROGRAM_FUNDING = of("PROGRAM_FUNDING")
@JvmStatic fun of(value: String) = TransactionCategory(JsonField.of(value))
@@ -432,6 +436,7 @@ private constructor(
/** An enum containing [TransactionCategory]'s known values. */
enum class Known {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -450,6 +455,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -464,6 +470,7 @@ private constructor(
*/
enum class Value {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -482,6 +489,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an unknown
@@ -500,6 +508,7 @@ private constructor(
fun value(): Value =
when (this) {
ACH -> Value.ACH
+ WIRE -> Value.WIRE
BALANCE_OR_FUNDING -> Value.BALANCE_OR_FUNDING
FEE -> Value.FEE
REWARD -> Value.REWARD
@@ -518,6 +527,7 @@ private constructor(
MANAGEMENT_FEE -> Value.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Value.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Value.MANAGEMENT_DISBURSEMENT
+ HOLD -> Value.HOLD
PROGRAM_FUNDING -> Value.PROGRAM_FUNDING
else -> Value._UNKNOWN
}
@@ -534,6 +544,7 @@ private constructor(
fun known(): Known =
when (this) {
ACH -> Known.ACH
+ WIRE -> Known.WIRE
BALANCE_OR_FUNDING -> Known.BALANCE_OR_FUNDING
FEE -> Known.FEE
REWARD -> Known.REWARD
@@ -552,6 +563,7 @@ private constructor(
MANAGEMENT_FEE -> Known.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Known.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Known.MANAGEMENT_DISBURSEMENT
+ HOLD -> Known.HOLD
PROGRAM_FUNDING -> Known.PROGRAM_FUNDING
else -> throw LithicInvalidDataException("Unknown TransactionCategory: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
index 93a1516f1..8382433fa 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
@@ -35,8 +35,8 @@ import kotlin.jvm.optionals.getOrNull
* Response containing multiple transaction types. The `family` field determines which transaction
* type is returned: INTERNAL returns FinancialTransaction, TRANSFER returns
* BookTransferTransaction, CARD returns CardTransaction, PAYMENT returns PaymentTransaction,
- * EXTERNAL_PAYMENT returns ExternalPaymentResponse, and MANAGEMENT_OPERATION returns
- * ManagementOperationTransaction
+ * EXTERNAL_PAYMENT returns ExternalPaymentResponse, MANAGEMENT_OPERATION returns
+ * ManagementOperationTransaction, and HOLD returns HoldTransaction
*/
@JsonDeserialize(using = AccountActivityListResponse.Deserializer::class)
@JsonSerialize(using = AccountActivityListResponse.Serializer::class)
@@ -48,6 +48,7 @@ private constructor(
private val payment: Payment? = null,
private val externalPayment: ExternalPayment? = null,
private val managementOperation: ManagementOperationTransaction? = null,
+ private val hold: Hold? = null,
private val _json: JsonValue? = null,
) {
@@ -68,6 +69,13 @@ private constructor(
fun managementOperation(): Optional =
Optional.ofNullable(managementOperation)
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds from
+ * available to pending balance in anticipation of future payments. They can be resolved via
+ * settlement (linked to payment), manual release, or expiration.
+ */
+ fun hold(): Optional = Optional.ofNullable(hold)
+
fun isInternal(): Boolean = internal_ != null
fun isTransfer(): Boolean = transfer != null
@@ -80,6 +88,8 @@ private constructor(
fun isManagementOperation(): Boolean = managementOperation != null
+ fun isHold(): Boolean = hold != null
+
/** Financial transaction with inheritance from unified base transaction */
fun asInternal(): FinancialTransaction = internal_.getOrThrow("internal_")
@@ -97,6 +107,13 @@ private constructor(
fun asManagementOperation(): ManagementOperationTransaction =
managementOperation.getOrThrow("managementOperation")
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds from
+ * available to pending balance in anticipation of future payments. They can be resolved via
+ * settlement (linked to payment), manual release, or expiration.
+ */
+ fun asHold(): Hold = hold.getOrThrow("hold")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -107,6 +124,7 @@ private constructor(
payment != null -> visitor.visitPayment(payment)
externalPayment != null -> visitor.visitExternalPayment(externalPayment)
managementOperation != null -> visitor.visitManagementOperation(managementOperation)
+ hold != null -> visitor.visitHold(hold)
else -> visitor.unknown(_json)
}
@@ -144,6 +162,10 @@ private constructor(
) {
managementOperation.validate()
}
+
+ override fun visitHold(hold: Hold) {
+ hold.validate()
+ }
}
)
validated = true
@@ -181,6 +203,8 @@ private constructor(
managementOperation: ManagementOperationTransaction
) = managementOperation.validity()
+ override fun visitHold(hold: Hold) = hold.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -196,11 +220,12 @@ private constructor(
card == other.card &&
payment == other.payment &&
externalPayment == other.externalPayment &&
- managementOperation == other.managementOperation
+ managementOperation == other.managementOperation &&
+ hold == other.hold
}
override fun hashCode(): Int =
- Objects.hash(internal_, transfer, card, payment, externalPayment, managementOperation)
+ Objects.hash(internal_, transfer, card, payment, externalPayment, managementOperation, hold)
override fun toString(): String =
when {
@@ -212,6 +237,7 @@ private constructor(
"AccountActivityListResponse{externalPayment=$externalPayment}"
managementOperation != null ->
"AccountActivityListResponse{managementOperation=$managementOperation}"
+ hold != null -> "AccountActivityListResponse{hold=$hold}"
_json != null -> "AccountActivityListResponse{_unknown=$_json}"
else -> throw IllegalStateException("Invalid AccountActivityListResponse")
}
@@ -241,6 +267,13 @@ private constructor(
@JvmStatic
fun ofManagementOperation(managementOperation: ManagementOperationTransaction) =
AccountActivityListResponse(managementOperation = managementOperation)
+
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds
+ * from available to pending balance in anticipation of future payments. They can be
+ * resolved via settlement (linked to payment), manual release, or expiration.
+ */
+ @JvmStatic fun ofHold(hold: Hold) = AccountActivityListResponse(hold = hold)
}
/**
@@ -265,6 +298,13 @@ private constructor(
fun visitManagementOperation(managementOperation: ManagementOperationTransaction): T
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds
+ * from available to pending balance in anticipation of future payments. They can be
+ * resolved via settlement (linked to payment), manual release, or expiration.
+ */
+ fun visitHold(hold: Hold): T
+
/**
* Maps an unknown variant of [AccountActivityListResponse] to a value of type [T].
*
@@ -319,6 +359,11 @@ private constructor(
AccountActivityListResponse(managementOperation = it, _json = json)
} ?: AccountActivityListResponse(_json = json)
}
+ "HOLD" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(hold = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
}
return AccountActivityListResponse(_json = json)
@@ -341,6 +386,7 @@ private constructor(
value.externalPayment != null -> generator.writeObject(value.externalPayment)
value.managementOperation != null ->
generator.writeObject(value.managementOperation)
+ value.hold != null -> generator.writeObject(value.hold)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid AccountActivityListResponse")
}
@@ -1018,6 +1064,8 @@ private constructor(
@JvmField val ACH = of("ACH")
+ @JvmField val WIRE = of("WIRE")
+
@JvmField val BALANCE_OR_FUNDING = of("BALANCE_OR_FUNDING")
@JvmField val FEE = of("FEE")
@@ -1054,6 +1102,8 @@ private constructor(
@JvmField val MANAGEMENT_DISBURSEMENT = of("MANAGEMENT_DISBURSEMENT")
+ @JvmField val HOLD = of("HOLD")
+
@JvmField val PROGRAM_FUNDING = of("PROGRAM_FUNDING")
@JvmStatic fun of(value: String) = TransactionCategory(JsonField.of(value))
@@ -1062,6 +1112,7 @@ private constructor(
/** An enum containing [TransactionCategory]'s known values. */
enum class Known {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -1080,6 +1131,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -1096,6 +1148,7 @@ private constructor(
*/
enum class Value {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -1114,6 +1167,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an
@@ -1132,6 +1186,7 @@ private constructor(
fun value(): Value =
when (this) {
ACH -> Value.ACH
+ WIRE -> Value.WIRE
BALANCE_OR_FUNDING -> Value.BALANCE_OR_FUNDING
FEE -> Value.FEE
REWARD -> Value.REWARD
@@ -1150,6 +1205,7 @@ private constructor(
MANAGEMENT_FEE -> Value.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Value.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Value.MANAGEMENT_DISBURSEMENT
+ HOLD -> Value.HOLD
PROGRAM_FUNDING -> Value.PROGRAM_FUNDING
else -> Value._UNKNOWN
}
@@ -1166,6 +1222,7 @@ private constructor(
fun known(): Known =
when (this) {
ACH -> Known.ACH
+ WIRE -> Known.WIRE
BALANCE_OR_FUNDING -> Known.BALANCE_OR_FUNDING
FEE -> Known.FEE
REWARD -> Known.REWARD
@@ -1184,6 +1241,7 @@ private constructor(
MANAGEMENT_FEE -> Known.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Known.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Known.MANAGEMENT_DISBURSEMENT
+ HOLD -> Known.HOLD
PROGRAM_FUNDING -> Known.PROGRAM_FUNDING
else -> throw LithicInvalidDataException("Unknown TransactionCategory: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
index 8691ebef3..901ac3320 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
@@ -35,8 +35,8 @@ import kotlin.jvm.optionals.getOrNull
* Response containing multiple transaction types. The `family` field determines which transaction
* type is returned: INTERNAL returns FinancialTransaction, TRANSFER returns
* BookTransferTransaction, CARD returns CardTransaction, PAYMENT returns PaymentTransaction,
- * EXTERNAL_PAYMENT returns ExternalPaymentResponse, and MANAGEMENT_OPERATION returns
- * ManagementOperationTransaction
+ * EXTERNAL_PAYMENT returns ExternalPaymentResponse, MANAGEMENT_OPERATION returns
+ * ManagementOperationTransaction, and HOLD returns HoldTransaction
*/
@JsonDeserialize(using = AccountActivityRetrieveTransactionResponse.Deserializer::class)
@JsonSerialize(using = AccountActivityRetrieveTransactionResponse.Serializer::class)
@@ -48,6 +48,7 @@ private constructor(
private val payment: Payment? = null,
private val externalPayment: ExternalPayment? = null,
private val managementOperation: ManagementOperationTransaction? = null,
+ private val hold: Hold? = null,
private val _json: JsonValue? = null,
) {
@@ -68,6 +69,13 @@ private constructor(
fun managementOperation(): Optional =
Optional.ofNullable(managementOperation)
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds from
+ * available to pending balance in anticipation of future payments. They can be resolved via
+ * settlement (linked to payment), manual release, or expiration.
+ */
+ fun hold(): Optional = Optional.ofNullable(hold)
+
fun isInternal(): Boolean = internal_ != null
fun isTransfer(): Boolean = transfer != null
@@ -80,6 +88,8 @@ private constructor(
fun isManagementOperation(): Boolean = managementOperation != null
+ fun isHold(): Boolean = hold != null
+
/** Financial transaction with inheritance from unified base transaction */
fun asInternal(): FinancialTransaction = internal_.getOrThrow("internal_")
@@ -97,6 +107,13 @@ private constructor(
fun asManagementOperation(): ManagementOperationTransaction =
managementOperation.getOrThrow("managementOperation")
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds from
+ * available to pending balance in anticipation of future payments. They can be resolved via
+ * settlement (linked to payment), manual release, or expiration.
+ */
+ fun asHold(): Hold = hold.getOrThrow("hold")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -107,6 +124,7 @@ private constructor(
payment != null -> visitor.visitPayment(payment)
externalPayment != null -> visitor.visitExternalPayment(externalPayment)
managementOperation != null -> visitor.visitManagementOperation(managementOperation)
+ hold != null -> visitor.visitHold(hold)
else -> visitor.unknown(_json)
}
@@ -144,6 +162,10 @@ private constructor(
) {
managementOperation.validate()
}
+
+ override fun visitHold(hold: Hold) {
+ hold.validate()
+ }
}
)
validated = true
@@ -181,6 +203,8 @@ private constructor(
managementOperation: ManagementOperationTransaction
) = managementOperation.validity()
+ override fun visitHold(hold: Hold) = hold.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -196,11 +220,12 @@ private constructor(
card == other.card &&
payment == other.payment &&
externalPayment == other.externalPayment &&
- managementOperation == other.managementOperation
+ managementOperation == other.managementOperation &&
+ hold == other.hold
}
override fun hashCode(): Int =
- Objects.hash(internal_, transfer, card, payment, externalPayment, managementOperation)
+ Objects.hash(internal_, transfer, card, payment, externalPayment, managementOperation, hold)
override fun toString(): String =
when {
@@ -212,6 +237,7 @@ private constructor(
"AccountActivityRetrieveTransactionResponse{externalPayment=$externalPayment}"
managementOperation != null ->
"AccountActivityRetrieveTransactionResponse{managementOperation=$managementOperation}"
+ hold != null -> "AccountActivityRetrieveTransactionResponse{hold=$hold}"
_json != null -> "AccountActivityRetrieveTransactionResponse{_unknown=$_json}"
else ->
throw IllegalStateException("Invalid AccountActivityRetrieveTransactionResponse")
@@ -245,6 +271,13 @@ private constructor(
@JvmStatic
fun ofManagementOperation(managementOperation: ManagementOperationTransaction) =
AccountActivityRetrieveTransactionResponse(managementOperation = managementOperation)
+
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds
+ * from available to pending balance in anticipation of future payments. They can be
+ * resolved via settlement (linked to payment), manual release, or expiration.
+ */
+ @JvmStatic fun ofHold(hold: Hold) = AccountActivityRetrieveTransactionResponse(hold = hold)
}
/**
@@ -269,6 +302,13 @@ private constructor(
fun visitManagementOperation(managementOperation: ManagementOperationTransaction): T
+ /**
+ * A hold transaction representing reserved funds on a financial account. Holds move funds
+ * from available to pending balance in anticipation of future payments. They can be
+ * resolved via settlement (linked to payment), manual release, or expiration.
+ */
+ fun visitHold(hold: Hold): T
+
/**
* Maps an unknown variant of [AccountActivityRetrieveTransactionResponse] to a value of
* type [T].
@@ -336,6 +376,11 @@ private constructor(
)
} ?: AccountActivityRetrieveTransactionResponse(_json = json)
}
+ "HOLD" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityRetrieveTransactionResponse(hold = it, _json = json)
+ } ?: AccountActivityRetrieveTransactionResponse(_json = json)
+ }
}
return AccountActivityRetrieveTransactionResponse(_json = json)
@@ -360,6 +405,7 @@ private constructor(
value.externalPayment != null -> generator.writeObject(value.externalPayment)
value.managementOperation != null ->
generator.writeObject(value.managementOperation)
+ value.hold != null -> generator.writeObject(value.hold)
value._json != null -> generator.writeObject(value._json)
else ->
throw IllegalStateException(
@@ -1040,6 +1086,8 @@ private constructor(
@JvmField val ACH = of("ACH")
+ @JvmField val WIRE = of("WIRE")
+
@JvmField val BALANCE_OR_FUNDING = of("BALANCE_OR_FUNDING")
@JvmField val FEE = of("FEE")
@@ -1076,6 +1124,8 @@ private constructor(
@JvmField val MANAGEMENT_DISBURSEMENT = of("MANAGEMENT_DISBURSEMENT")
+ @JvmField val HOLD = of("HOLD")
+
@JvmField val PROGRAM_FUNDING = of("PROGRAM_FUNDING")
@JvmStatic fun of(value: String) = TransactionCategory(JsonField.of(value))
@@ -1084,6 +1134,7 @@ private constructor(
/** An enum containing [TransactionCategory]'s known values. */
enum class Known {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -1102,6 +1153,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -1118,6 +1170,7 @@ private constructor(
*/
enum class Value {
ACH,
+ WIRE,
BALANCE_OR_FUNDING,
FEE,
REWARD,
@@ -1136,6 +1189,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an
@@ -1154,6 +1208,7 @@ private constructor(
fun value(): Value =
when (this) {
ACH -> Value.ACH
+ WIRE -> Value.WIRE
BALANCE_OR_FUNDING -> Value.BALANCE_OR_FUNDING
FEE -> Value.FEE
REWARD -> Value.REWARD
@@ -1172,6 +1227,7 @@ private constructor(
MANAGEMENT_FEE -> Value.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Value.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Value.MANAGEMENT_DISBURSEMENT
+ HOLD -> Value.HOLD
PROGRAM_FUNDING -> Value.PROGRAM_FUNDING
else -> Value._UNKNOWN
}
@@ -1188,6 +1244,7 @@ private constructor(
fun known(): Known =
when (this) {
ACH -> Known.ACH
+ WIRE -> Known.WIRE
BALANCE_OR_FUNDING -> Known.BALANCE_OR_FUNDING
FEE -> Known.FEE
REWARD -> Known.REWARD
@@ -1206,6 +1263,7 @@ private constructor(
MANAGEMENT_FEE -> Known.MANAGEMENT_FEE
MANAGEMENT_REWARD -> Known.MANAGEMENT_REWARD
MANAGEMENT_DISBURSEMENT -> Known.MANAGEMENT_DISBURSEMENT
+ HOLD -> Known.HOLD
PROGRAM_FUNDING -> Known.PROGRAM_FUNDING
else -> throw LithicInvalidDataException("Unknown TransactionCategory: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
index 1d805631d..6741e8056 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
@@ -46,6 +46,8 @@ private constructor(
private val programLevel: JsonField,
private val state: JsonField,
private val type: JsonField,
+ private val excludedAccountTokens: JsonField>,
+ private val excludedBusinessAccountTokens: JsonField>,
private val excludedCardTokens: JsonField>,
private val additionalProperties: MutableMap,
) {
@@ -80,6 +82,12 @@ private constructor(
programLevel: JsonField = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
@JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ excludedAccountTokens: JsonField> = JsonMissing.of(),
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ excludedBusinessAccountTokens: JsonField> = JsonMissing.of(),
@JsonProperty("excluded_card_tokens")
@ExcludeMissing
excludedCardTokens: JsonField> = JsonMissing.of(),
@@ -96,6 +104,8 @@ private constructor(
programLevel,
state,
type,
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
excludedCardTokens,
mutableMapOf(),
)
@@ -196,12 +206,32 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT 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 does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun excludedAccountTokens(): Optional> =
+ excludedAccountTokens.getOptional("excluded_account_tokens")
+
+ /**
+ * Business account tokens to which the Auth Rule does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun excludedBusinessAccountTokens(): Optional> =
+ excludedBusinessAccountTokens.getOptional("excluded_business_account_tokens")
+
/**
* Card tokens to which the Auth Rule does not apply.
*
@@ -312,6 +342,26 @@ private constructor(
*/
@JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+ /**
+ * Returns the raw JSON value of [excludedAccountTokens].
+ *
+ * Unlike [excludedAccountTokens], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ fun _excludedAccountTokens(): JsonField> = excludedAccountTokens
+
+ /**
+ * Returns the raw JSON value of [excludedBusinessAccountTokens].
+ *
+ * Unlike [excludedBusinessAccountTokens], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ fun _excludedBusinessAccountTokens(): JsonField> = excludedBusinessAccountTokens
+
/**
* Returns the raw JSON value of [excludedCardTokens].
*
@@ -373,6 +423,8 @@ private constructor(
private var programLevel: JsonField? = null
private var state: JsonField? = null
private var type: JsonField? = null
+ private var excludedAccountTokens: JsonField>? = null
+ private var excludedBusinessAccountTokens: JsonField>? = null
private var excludedCardTokens: JsonField>? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -390,6 +442,9 @@ private constructor(
programLevel = authRule.programLevel
state = authRule.state
type = authRule.type
+ excludedAccountTokens = authRule.excludedAccountTokens.map { it.toMutableList() }
+ excludedBusinessAccountTokens =
+ authRule.excludedBusinessAccountTokens.map { it.toMutableList() }
excludedCardTokens = authRule.excludedCardTokens.map { it.toMutableList() }
additionalProperties = authRule.additionalProperties.toMutableMap()
}
@@ -601,6 +656,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -613,6 +670,63 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Account tokens to which the Auth Rule does not apply. */
+ fun excludedAccountTokens(excludedAccountTokens: List) =
+ excludedAccountTokens(JsonField.of(excludedAccountTokens))
+
+ /**
+ * Sets [Builder.excludedAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedAccountTokens] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun excludedAccountTokens(excludedAccountTokens: JsonField>) = apply {
+ this.excludedAccountTokens = excludedAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedAccountToken(excludedAccountToken: String) = apply {
+ excludedAccountTokens =
+ (excludedAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedAccountTokens", it).add(excludedAccountToken)
+ }
+ }
+
+ /** Business account tokens to which the Auth Rule does not apply. */
+ fun excludedBusinessAccountTokens(excludedBusinessAccountTokens: List) =
+ excludedBusinessAccountTokens(JsonField.of(excludedBusinessAccountTokens))
+
+ /**
+ * Sets [Builder.excludedBusinessAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedBusinessAccountTokens] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun excludedBusinessAccountTokens(excludedBusinessAccountTokens: JsonField>) =
+ apply {
+ this.excludedBusinessAccountTokens =
+ excludedBusinessAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedBusinessAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedBusinessAccountToken(excludedBusinessAccountToken: String) = apply {
+ excludedBusinessAccountTokens =
+ (excludedBusinessAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedBusinessAccountTokens", it)
+ .add(excludedBusinessAccountToken)
+ }
+ }
+
/** Card tokens to which the Auth Rule does not apply. */
fun excludedCardTokens(excludedCardTokens: List) =
excludedCardTokens(JsonField.of(excludedCardTokens))
@@ -698,6 +812,8 @@ private constructor(
checkRequired("programLevel", programLevel),
checkRequired("state", state),
checkRequired("type", type),
+ (excludedAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
+ (excludedBusinessAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
(excludedCardTokens ?: JsonMissing.of()).map { it.toImmutable() },
additionalProperties.toMutableMap(),
)
@@ -722,6 +838,8 @@ private constructor(
programLevel()
state().validate()
type().validate()
+ excludedAccountTokens()
+ excludedBusinessAccountTokens()
excludedCardTokens()
validated = true
}
@@ -753,6 +871,8 @@ private constructor(
(if (programLevel.asKnown().isPresent) 1 else 0) +
(state.asKnown().getOrNull()?.validity() ?: 0) +
(type.asKnown().getOrNull()?.validity() ?: 0) +
+ (excludedAccountTokens.asKnown().getOrNull()?.size ?: 0) +
+ (excludedBusinessAccountTokens.asKnown().getOrNull()?.size ?: 0) +
(excludedCardTokens.asKnown().getOrNull()?.size ?: 0)
class CurrentVersion
@@ -910,6 +1030,12 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
/**
* The version of the rule, this is incremented whenever the rule's parameters change.
*/
@@ -1009,6 +1135,7 @@ private constructor(
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -1035,6 +1162,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated") fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -1049,6 +1180,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -1071,6 +1204,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -1087,6 +1224,7 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -1138,6 +1276,10 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -1188,6 +1330,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1204,7 +1349,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -1216,6 +1362,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -1232,6 +1379,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1269,6 +1417,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -1301,6 +1454,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -1357,6 +1513,8 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -1395,6 +1553,7 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1426,18 +1585,31 @@ private constructor(
class DraftVersion
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
+ private val error: JsonField,
private val parameters: JsonField,
+ private val state: JsonField,
private val version: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
+ @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(),
@JsonProperty("parameters")
@ExcludeMissing
parameters: JsonField = JsonMissing.of(),
+ @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
@JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(),
- ) : this(parameters, version, mutableMapOf())
+ ) : this(error, parameters, state, version, mutableMapOf())
+
+ /**
+ * An error message if the draft version failed compilation. Populated when `state` is
+ * `ERROR`, `null` otherwise.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun error(): Optional = error.getOptional("error")
/**
* Parameters for the Auth Rule
@@ -1447,6 +1619,21 @@ private constructor(
*/
fun parameters(): Parameters = parameters.getRequired("parameters")
+ /**
+ * The state of the draft version. Most rules are created synchronously and the state is
+ * immediately `SHADOWING`. Rules backed by TypeScript code are compiled asynchronously —
+ * the state starts as `PENDING` and transitions to `SHADOWING` on success or `ERROR` on
+ * failure.
+ * - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
+ * - `SHADOWING`: The draft version is ready and evaluating in shadow mode alongside the
+ * current active version. It can be promoted to the active version.
+ * - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
+ *
+ * @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 state(): State = state.getRequired("state")
+
/**
* The version of the rule, this is incremented whenever the rule's parameters change.
*
@@ -1455,6 +1642,13 @@ private constructor(
*/
fun version(): Long = version.getRequired("version")
+ /**
+ * Returns the raw JSON value of [error].
+ *
+ * Unlike [error], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error
+
/**
* Returns the raw JSON value of [parameters].
*
@@ -1464,6 +1658,13 @@ private constructor(
@ExcludeMissing
fun _parameters(): JsonField = parameters
+ /**
+ * Returns the raw JSON value of [state].
+ *
+ * Unlike [state], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state
+
/**
* Returns the raw JSON value of [version].
*
@@ -1490,7 +1691,9 @@ private constructor(
*
* The following fields are required:
* ```java
+ * .error()
* .parameters()
+ * .state()
* .version()
* ```
*/
@@ -1500,17 +1703,39 @@ private constructor(
/** A builder for [DraftVersion]. */
class Builder internal constructor() {
+ private var error: JsonField? = null
private var parameters: JsonField? = null
+ private var state: JsonField? = null
private var version: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(draftVersion: DraftVersion) = apply {
+ error = draftVersion.error
parameters = draftVersion.parameters
+ state = draftVersion.state
version = draftVersion.version
additionalProperties = draftVersion.additionalProperties.toMutableMap()
}
+ /**
+ * An error message if the draft version failed compilation. Populated when `state` is
+ * `ERROR`, `null` otherwise.
+ */
+ fun error(error: String?) = error(JsonField.ofNullable(error))
+
+ /** Alias for calling [Builder.error] with `error.orElse(null)`. */
+ fun error(error: Optional) = error(error.getOrNull())
+
+ /**
+ * Sets [Builder.error] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.error] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun error(error: JsonField) = apply { this.error = error }
+
/** Parameters for the Auth Rule */
fun parameters(parameters: Parameters) = parameters(JsonField.of(parameters))
@@ -1578,6 +1803,33 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
+ /**
+ * The state of the draft version. Most rules are created synchronously and the state is
+ * immediately `SHADOWING`. Rules backed by TypeScript code are compiled asynchronously
+ * — the state starts as `PENDING` and transitions to `SHADOWING` on success or `ERROR`
+ * on failure.
+ * - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
+ * - `SHADOWING`: The draft version is ready and evaluating in shadow mode alongside the
+ * current active version. It can be promoted to the active version.
+ * - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
+ */
+ fun state(state: State) = state(JsonField.of(state))
+
+ /**
+ * Sets [Builder.state] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.state] with a well-typed [State] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun state(state: JsonField) = apply { this.state = state }
+
/**
* The version of the rule, this is incremented whenever the rule's parameters change.
*/
@@ -1618,7 +1870,9 @@ private constructor(
*
* The following fields are required:
* ```java
+ * .error()
* .parameters()
+ * .state()
* .version()
* ```
*
@@ -1626,7 +1880,9 @@ private constructor(
*/
fun build(): DraftVersion =
DraftVersion(
+ checkRequired("error", error),
checkRequired("parameters", parameters),
+ checkRequired("state", state),
checkRequired("version", version),
additionalProperties.toMutableMap(),
)
@@ -1639,7 +1895,9 @@ private constructor(
return@apply
}
+ error()
parameters().validate()
+ state().validate()
version()
validated = true
}
@@ -1660,7 +1918,9 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (parameters.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (error.asKnown().isPresent) 1 else 0) +
+ (parameters.asKnown().getOrNull()?.validity() ?: 0) +
+ (state.asKnown().getOrNull()?.validity() ?: 0) +
(if (version.asKnown().isPresent) 1 else 0)
/** Parameters for the Auth Rule */
@@ -1677,6 +1937,7 @@ private constructor(
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -1703,6 +1964,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated") fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -1717,6 +1982,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -1739,6 +2006,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -1755,6 +2026,7 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -1806,6 +2078,10 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -1856,6 +2132,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1872,7 +2151,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -1884,6 +2164,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -1900,6 +2181,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1937,6 +2219,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -1969,6 +2256,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -2025,6 +2315,8 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -2063,6 +2355,7 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -2070,25 +2363,172 @@ private constructor(
}
}
+ /**
+ * The state of the draft version. Most rules are created synchronously and the state is
+ * immediately `SHADOWING`. Rules backed by TypeScript code are compiled asynchronously —
+ * the state starts as `PENDING` and transitions to `SHADOWING` on success or `ERROR` on
+ * failure.
+ * - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
+ * - `SHADOWING`: The draft version is ready and evaluating in shadow mode alongside the
+ * current active version. It can be promoted to the active version.
+ * - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
+ */
+ class State @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 PENDING = of("PENDING")
+
+ @JvmField val SHADOWING = of("SHADOWING")
+
+ @JvmField val ERROR = of("ERROR")
+
+ @JvmStatic fun of(value: String) = State(JsonField.of(value))
+ }
+
+ /** An enum containing [State]'s known values. */
+ enum class Known {
+ PENDING,
+ SHADOWING,
+ ERROR,
+ }
+
+ /**
+ * An enum containing [State]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [State] 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 {
+ PENDING,
+ SHADOWING,
+ ERROR,
+ /**
+ * An enum member indicating that [State] 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) {
+ PENDING -> Value.PENDING
+ SHADOWING -> Value.SHADOWING
+ ERROR -> Value.ERROR
+ 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) {
+ PENDING -> Known.PENDING
+ SHADOWING -> Known.SHADOWING
+ ERROR -> Known.ERROR
+ else -> throw LithicInvalidDataException("Unknown State: $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(): State = 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 State && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is DraftVersion &&
+ error == other.error &&
parameters == other.parameters &&
+ state == other.state &&
version == other.version &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(parameters, version, additionalProperties)
+ Objects.hash(error, parameters, state, version, additionalProperties)
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "DraftVersion{parameters=$parameters, version=$version, additionalProperties=$additionalProperties}"
+ "DraftVersion{error=$error, parameters=$parameters, state=$state, version=$version, additionalProperties=$additionalProperties}"
}
/** The state of the Auth Rule */
@@ -2231,6 +2671,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType @JsonCreator private constructor(private val value: JsonField) :
Enum {
@@ -2255,6 +2697,8 @@ private constructor(
@JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
+ @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -2264,6 +2708,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -2280,6 +2725,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an unknown value.
*/
@@ -2299,6 +2745,7 @@ private constructor(
VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
else -> Value._UNKNOWN
}
@@ -2317,6 +2764,7 @@ private constructor(
VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -2390,6 +2838,8 @@ private constructor(
programLevel == other.programLevel &&
state == other.state &&
type == other.type &&
+ excludedAccountTokens == other.excludedAccountTokens &&
+ excludedBusinessAccountTokens == other.excludedBusinessAccountTokens &&
excludedCardTokens == other.excludedCardTokens &&
additionalProperties == other.additionalProperties
}
@@ -2408,6 +2858,8 @@ private constructor(
programLevel,
state,
type,
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
excludedCardTokens,
additionalProperties,
)
@@ -2416,5 +2868,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "AuthRule{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}"
+ "AuthRule{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedAccountTokens=$excludedAccountTokens, excludedBusinessAccountTokens=$excludedBusinessAccountTokens, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}"
}
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 ff88bcb14..c90ef0ae5 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
@@ -479,6 +479,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT 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
@@ -694,6 +696,13 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
/**
* 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
@@ -705,6 +714,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -902,6 +913,7 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -930,6 +942,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated")
fun isConditionalBlock(): Boolean = conditionalBlock != null
@@ -947,6 +963,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -970,6 +988,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -990,6 +1012,7 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -1043,6 +1066,12 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -1095,6 +1124,10 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) = typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1111,7 +1144,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -1123,6 +1157,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -1139,6 +1174,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1178,6 +1214,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -1210,6 +1251,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -1281,6 +1325,8 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -1320,6 +1366,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null ->
+ generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -1337,6 +1385,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -1362,6 +1412,8 @@ private constructor(
@JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
+ @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -1371,6 +1423,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -1388,6 +1441,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -1408,6 +1462,7 @@ private constructor(
VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
else -> Value._UNKNOWN
}
@@ -1426,6 +1481,7 @@ private constructor(
VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -1572,6 +1628,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT 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
@@ -1783,6 +1841,13 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
/**
* 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
@@ -1794,6 +1859,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -1935,6 +2002,7 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -1963,6 +2031,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated")
fun isConditionalBlock(): Boolean = conditionalBlock != null
@@ -1980,6 +2052,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -2003,6 +2077,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -2023,6 +2101,7 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -2076,6 +2155,12 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -2128,6 +2213,10 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) = typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -2144,7 +2233,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -2156,6 +2246,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -2172,6 +2263,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -2211,6 +2303,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -2243,6 +2340,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -2314,6 +2414,8 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -2353,6 +2455,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null ->
+ generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -2370,6 +2474,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -2395,6 +2501,8 @@ private constructor(
@JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
+ @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -2404,6 +2512,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -2421,6 +2530,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -2441,6 +2551,7 @@ private constructor(
VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
else -> Value._UNKNOWN
}
@@ -2459,6 +2570,7 @@ private constructor(
VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -2547,6 +2659,8 @@ private constructor(
private val programLevel: JsonField,
private val type: JsonField,
private val eventStream: JsonField,
+ private val excludedAccountTokens: JsonField>,
+ private val excludedBusinessAccountTokens: JsonField>,
private val excludedCardTokens: JsonField>,
private val name: JsonField,
private val additionalProperties: MutableMap,
@@ -2566,6 +2680,12 @@ private constructor(
@JsonProperty("event_stream")
@ExcludeMissing
eventStream: JsonField = JsonMissing.of(),
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ excludedAccountTokens: JsonField> = JsonMissing.of(),
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ excludedBusinessAccountTokens: JsonField> = JsonMissing.of(),
@JsonProperty("excluded_card_tokens")
@ExcludeMissing
excludedCardTokens: JsonField> = JsonMissing.of(),
@@ -2575,6 +2695,8 @@ private constructor(
programLevel,
type,
eventStream,
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
excludedCardTokens,
name,
mutableMapOf(),
@@ -2608,6 +2730,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT 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
@@ -2623,6 +2747,24 @@ private constructor(
*/
fun eventStream(): Optional = eventStream.getOptional("event_stream")
+ /**
+ * Account tokens to which the Auth Rule does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun excludedAccountTokens(): Optional> =
+ excludedAccountTokens.getOptional("excluded_account_tokens")
+
+ /**
+ * Business account tokens to which the Auth Rule does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun excludedBusinessAccountTokens(): Optional> =
+ excludedBusinessAccountTokens.getOptional("excluded_business_account_tokens")
+
/**
* Card tokens to which the Auth Rule does not apply.
*
@@ -2677,6 +2819,27 @@ private constructor(
@ExcludeMissing
fun _eventStream(): JsonField = eventStream
+ /**
+ * Returns the raw JSON value of [excludedAccountTokens].
+ *
+ * Unlike [excludedAccountTokens], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ fun _excludedAccountTokens(): JsonField> = excludedAccountTokens
+
+ /**
+ * Returns the raw JSON value of [excludedBusinessAccountTokens].
+ *
+ * Unlike [excludedBusinessAccountTokens], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ fun _excludedBusinessAccountTokens(): JsonField> =
+ excludedBusinessAccountTokens
+
/**
* Returns the raw JSON value of [excludedCardTokens].
*
@@ -2728,6 +2891,8 @@ private constructor(
private var programLevel: JsonField? = null
private var type: JsonField? = null
private var eventStream: JsonField = JsonMissing.of()
+ private var excludedAccountTokens: JsonField>? = null
+ private var excludedBusinessAccountTokens: JsonField>? = null
private var excludedCardTokens: JsonField>? = null
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -2738,6 +2903,10 @@ private constructor(
programLevel = programLevelRule.programLevel
type = programLevelRule.type
eventStream = programLevelRule.eventStream
+ excludedAccountTokens =
+ programLevelRule.excludedAccountTokens.map { it.toMutableList() }
+ excludedBusinessAccountTokens =
+ programLevelRule.excludedBusinessAccountTokens.map { it.toMutableList() }
excludedCardTokens =
programLevelRule.excludedCardTokens.map { it.toMutableList() }
name = programLevelRule.name
@@ -2815,6 +2984,13 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
/** Whether the Auth Rule applies to all authorizations on the card program. */
fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel))
@@ -2840,6 +3016,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -2866,6 +3044,64 @@ private constructor(
this.eventStream = eventStream
}
+ /** Account tokens to which the Auth Rule does not apply. */
+ fun excludedAccountTokens(excludedAccountTokens: List) =
+ excludedAccountTokens(JsonField.of(excludedAccountTokens))
+
+ /**
+ * Sets [Builder.excludedAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedAccountTokens] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun excludedAccountTokens(excludedAccountTokens: JsonField>) = apply {
+ this.excludedAccountTokens = excludedAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedAccountToken(excludedAccountToken: String) = apply {
+ excludedAccountTokens =
+ (excludedAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedAccountTokens", it).add(excludedAccountToken)
+ }
+ }
+
+ /** Business account tokens to which the Auth Rule does not apply. */
+ fun excludedBusinessAccountTokens(excludedBusinessAccountTokens: List) =
+ excludedBusinessAccountTokens(JsonField.of(excludedBusinessAccountTokens))
+
+ /**
+ * Sets [Builder.excludedBusinessAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedBusinessAccountTokens] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun excludedBusinessAccountTokens(
+ excludedBusinessAccountTokens: JsonField>
+ ) = apply {
+ this.excludedBusinessAccountTokens =
+ excludedBusinessAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedBusinessAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedBusinessAccountToken(excludedBusinessAccountToken: String) = apply {
+ excludedBusinessAccountTokens =
+ (excludedBusinessAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedBusinessAccountTokens", it)
+ .add(excludedBusinessAccountToken)
+ }
+ }
+
/** Card tokens to which the Auth Rule does not apply. */
fun excludedCardTokens(excludedCardTokens: List) =
excludedCardTokens(JsonField.of(excludedCardTokens))
@@ -2950,6 +3186,10 @@ private constructor(
checkRequired("programLevel", programLevel),
checkRequired("type", type),
eventStream,
+ (excludedAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
+ (excludedBusinessAccountTokens ?: JsonMissing.of()).map {
+ it.toImmutable()
+ },
(excludedCardTokens ?: JsonMissing.of()).map { it.toImmutable() },
name,
additionalProperties.toMutableMap(),
@@ -2967,6 +3207,8 @@ private constructor(
programLevel()
type().validate()
eventStream().ifPresent { it.validate() }
+ excludedAccountTokens()
+ excludedBusinessAccountTokens()
excludedCardTokens()
name()
validated = true
@@ -2992,6 +3234,8 @@ private constructor(
(if (programLevel.asKnown().isPresent) 1 else 0) +
(type.asKnown().getOrNull()?.validity() ?: 0) +
(eventStream.asKnown().getOrNull()?.validity() ?: 0) +
+ (excludedAccountTokens.asKnown().getOrNull()?.size ?: 0) +
+ (excludedBusinessAccountTokens.asKnown().getOrNull()?.size ?: 0) +
(excludedCardTokens.asKnown().getOrNull()?.size ?: 0) +
(if (name.asKnown().isPresent) 1 else 0)
@@ -3011,6 +3255,7 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -3039,6 +3284,10 @@ private constructor(
Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated")
fun isConditionalBlock(): Boolean = conditionalBlock != null
@@ -3056,6 +3305,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean =
conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -3079,6 +3330,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -3099,6 +3354,7 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -3152,6 +3408,12 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -3204,6 +3466,10 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) = typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -3220,7 +3486,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -3232,6 +3499,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -3248,6 +3516,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -3287,6 +3556,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -3319,6 +3593,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -3390,6 +3667,8 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -3429,6 +3708,8 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null ->
+ generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -3446,6 +3727,8 @@ private constructor(
* - `MERCHANT_LOCK`: AUTHORIZATION event stream.
* - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
+ * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
*/
class AuthRuleType
@JsonCreator
@@ -3471,6 +3754,8 @@ private constructor(
@JvmField val CONDITIONAL_ACTION = of("CONDITIONAL_ACTION")
+ @JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -3480,6 +3765,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -3497,6 +3783,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -3517,6 +3804,7 @@ private constructor(
VELOCITY_LIMIT -> Value.VELOCITY_LIMIT
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
else -> Value._UNKNOWN
}
@@ -3535,6 +3823,7 @@ private constructor(
VELOCITY_LIMIT -> Known.VELOCITY_LIMIT
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
+ TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -3602,6 +3891,8 @@ private constructor(
programLevel == other.programLevel &&
type == other.type &&
eventStream == other.eventStream &&
+ excludedAccountTokens == other.excludedAccountTokens &&
+ excludedBusinessAccountTokens == other.excludedBusinessAccountTokens &&
excludedCardTokens == other.excludedCardTokens &&
name == other.name &&
additionalProperties == other.additionalProperties
@@ -3613,6 +3904,8 @@ private constructor(
programLevel,
type,
eventStream,
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
excludedCardTokens,
name,
additionalProperties,
@@ -3622,7 +3915,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "ProgramLevelRule{parameters=$parameters, programLevel=$programLevel, type=$type, eventStream=$eventStream, excludedCardTokens=$excludedCardTokens, name=$name, additionalProperties=$additionalProperties}"
+ "ProgramLevelRule{parameters=$parameters, programLevel=$programLevel, type=$type, eventStream=$eventStream, excludedAccountTokens=$excludedAccountTokens, excludedBusinessAccountTokens=$excludedBusinessAccountTokens, excludedCardTokens=$excludedCardTokens, name=$name, additionalProperties=$additionalProperties}"
}
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
index 56772a9b9..c375bbbb6 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt
@@ -180,6 +180,11 @@ private constructor(
body.parameters(conditionalTokenizationAction)
}
+ /** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */
+ fun parameters(typescriptCode: TypescriptCodeParameters) = apply {
+ body.parameters(typescriptCode)
+ }
+
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
body.additionalProperties(additionalBodyProperties)
}
@@ -454,6 +459,12 @@ private constructor(
Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)
)
+ /**
+ * Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`.
+ */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -540,6 +551,7 @@ private constructor(
null,
private val conditionalAchAction: ConditionalAchActionParameters? = null,
private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -565,6 +577,10 @@ private constructor(
fun conditionalTokenizationAction(): Optional =
Optional.ofNullable(conditionalTokenizationAction)
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
@Deprecated("deprecated") fun isConditionalBlock(): Boolean = conditionalBlock != null
fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
@@ -579,6 +595,8 @@ private constructor(
fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
/** Deprecated: Use CONDITIONAL_ACTION instead. */
@Deprecated("deprecated")
fun asConditionalBlock(): ConditionalBlockParameters =
@@ -601,6 +619,10 @@ private constructor(
fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
@@ -616,6 +638,7 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -667,6 +690,10 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -717,6 +744,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -733,7 +763,8 @@ private constructor(
conditional3dsAction == other.conditional3dsAction &&
conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
conditionalAchAction == other.conditionalAchAction &&
- conditionalTokenizationAction == other.conditionalTokenizationAction
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
}
override fun hashCode(): Int =
@@ -745,6 +776,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -761,6 +793,7 @@ private constructor(
"Parameters{conditionalAchAction=$conditionalAchAction}"
conditionalTokenizationAction != null ->
"Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
_json != null -> "Parameters{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Parameters")
}
@@ -798,6 +831,11 @@ private constructor(
fun ofConditionalTokenizationAction(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
}
/**
@@ -825,6 +863,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
): T
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
/**
* Maps an unknown variant of [Parameters] to a value of type [T].
*
@@ -873,6 +914,9 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Parameters(typescriptCode = it, _json = json)
+ },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -910,6 +954,7 @@ private constructor(
generator.writeObject(value.conditionalAchAction)
value.conditionalTokenizationAction != null ->
generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Parameters")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListVersionsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListVersionsParams.kt
new file mode 100644
index 000000000..ae95ed446
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ListVersionsParams.kt
@@ -0,0 +1,197 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.Params
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Returns all versions of an auth rule, sorted by version number descending (newest first). */
+class AuthRuleV2ListVersionsParams
+private constructor(
+ private val authRuleToken: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun authRuleToken(): Optional = Optional.ofNullable(authRuleToken)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): AuthRuleV2ListVersionsParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AuthRuleV2ListVersionsParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleV2ListVersionsParams]. */
+ class Builder internal constructor() {
+
+ private var authRuleToken: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(authRuleV2ListVersionsParams: AuthRuleV2ListVersionsParams) = apply {
+ authRuleToken = authRuleV2ListVersionsParams.authRuleToken
+ additionalHeaders = authRuleV2ListVersionsParams.additionalHeaders.toBuilder()
+ additionalQueryParams = authRuleV2ListVersionsParams.additionalQueryParams.toBuilder()
+ }
+
+ fun authRuleToken(authRuleToken: String?) = apply { this.authRuleToken = authRuleToken }
+
+ /** Alias for calling [Builder.authRuleToken] with `authRuleToken.orElse(null)`. */
+ fun authRuleToken(authRuleToken: Optional) =
+ authRuleToken(authRuleToken.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [AuthRuleV2ListVersionsParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): AuthRuleV2ListVersionsParams =
+ AuthRuleV2ListVersionsParams(
+ authRuleToken,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> authRuleToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleV2ListVersionsParams &&
+ authRuleToken == other.authRuleToken &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(authRuleToken, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "AuthRuleV2ListVersionsParams{authRuleToken=$authRuleToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
index d4d97eb7b..c55df6a61 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2UpdateParams.kt
@@ -37,8 +37,9 @@ import kotlin.jvm.optionals.getOrNull
/**
* Updates a V2 Auth rule's properties
*
- * If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` is provided, this
- * will replace existing associations with the provided list of entities.
+ * If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
+ * `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, this will replace
+ * existing associations with the provided list of entities.
*/
class AuthRuleV2UpdateParams
private constructor(
@@ -1283,6 +1284,8 @@ private constructor(
class ProgramLevelRule
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
+ private val excludedAccountTokens: JsonField>,
+ private val excludedBusinessAccountTokens: JsonField>,
private val excludedCardTokens: JsonField>,
private val name: JsonField,
private val programLevel: JsonField,
@@ -1292,6 +1295,12 @@ private constructor(
@JsonCreator
private constructor(
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ excludedAccountTokens: JsonField> = JsonMissing.of(),
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ excludedBusinessAccountTokens: JsonField> = JsonMissing.of(),
@JsonProperty("excluded_card_tokens")
@ExcludeMissing
excludedCardTokens: JsonField> = JsonMissing.of(),
@@ -1300,7 +1309,33 @@ private constructor(
@ExcludeMissing
programLevel: JsonField = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
- ) : this(excludedCardTokens, name, programLevel, state, mutableMapOf())
+ ) : this(
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
+ excludedCardTokens,
+ name,
+ programLevel,
+ state,
+ mutableMapOf(),
+ )
+
+ /**
+ * Account tokens to which the Auth Rule does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun excludedAccountTokens(): Optional> =
+ excludedAccountTokens.getOptional("excluded_account_tokens")
+
+ /**
+ * Business account tokens to which the Auth Rule does not apply.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun excludedBusinessAccountTokens(): Optional> =
+ excludedBusinessAccountTokens.getOptional("excluded_business_account_tokens")
/**
* Card tokens to which the Auth Rule does not apply.
@@ -1339,6 +1374,27 @@ private constructor(
*/
fun state(): Optional = state.getOptional("state")
+ /**
+ * Returns the raw JSON value of [excludedAccountTokens].
+ *
+ * Unlike [excludedAccountTokens], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("excluded_account_tokens")
+ @ExcludeMissing
+ fun _excludedAccountTokens(): JsonField> = excludedAccountTokens
+
+ /**
+ * Returns the raw JSON value of [excludedBusinessAccountTokens].
+ *
+ * Unlike [excludedBusinessAccountTokens], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("excluded_business_account_tokens")
+ @ExcludeMissing
+ fun _excludedBusinessAccountTokens(): JsonField> =
+ excludedBusinessAccountTokens
+
/**
* Returns the raw JSON value of [excludedCardTokens].
*
@@ -1394,6 +1450,8 @@ private constructor(
/** A builder for [ProgramLevelRule]. */
class Builder internal constructor() {
+ private var excludedAccountTokens: JsonField>? = null
+ private var excludedBusinessAccountTokens: JsonField>? = null
private var excludedCardTokens: JsonField>? = null
private var name: JsonField = JsonMissing.of()
private var programLevel: JsonField = JsonMissing.of()
@@ -1402,6 +1460,10 @@ private constructor(
@JvmSynthetic
internal fun from(programLevelRule: ProgramLevelRule) = apply {
+ excludedAccountTokens =
+ programLevelRule.excludedAccountTokens.map { it.toMutableList() }
+ excludedBusinessAccountTokens =
+ programLevelRule.excludedBusinessAccountTokens.map { it.toMutableList() }
excludedCardTokens =
programLevelRule.excludedCardTokens.map { it.toMutableList() }
name = programLevelRule.name
@@ -1410,6 +1472,64 @@ private constructor(
additionalProperties = programLevelRule.additionalProperties.toMutableMap()
}
+ /** Account tokens to which the Auth Rule does not apply. */
+ fun excludedAccountTokens(excludedAccountTokens: List) =
+ excludedAccountTokens(JsonField.of(excludedAccountTokens))
+
+ /**
+ * Sets [Builder.excludedAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedAccountTokens] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun excludedAccountTokens(excludedAccountTokens: JsonField>) = apply {
+ this.excludedAccountTokens = excludedAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedAccountToken(excludedAccountToken: String) = apply {
+ excludedAccountTokens =
+ (excludedAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedAccountTokens", it).add(excludedAccountToken)
+ }
+ }
+
+ /** Business account tokens to which the Auth Rule does not apply. */
+ fun excludedBusinessAccountTokens(excludedBusinessAccountTokens: List) =
+ excludedBusinessAccountTokens(JsonField.of(excludedBusinessAccountTokens))
+
+ /**
+ * Sets [Builder.excludedBusinessAccountTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludedBusinessAccountTokens] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun excludedBusinessAccountTokens(
+ excludedBusinessAccountTokens: JsonField>
+ ) = apply {
+ this.excludedBusinessAccountTokens =
+ excludedBusinessAccountTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [excludedBusinessAccountTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludedBusinessAccountToken(excludedBusinessAccountToken: String) = apply {
+ excludedBusinessAccountTokens =
+ (excludedBusinessAccountTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludedBusinessAccountTokens", it)
+ .add(excludedBusinessAccountToken)
+ }
+ }
+
/** Card tokens to which the Auth Rule does not apply. */
fun excludedCardTokens(excludedCardTokens: List) =
excludedCardTokens(JsonField.of(excludedCardTokens))
@@ -1513,6 +1633,10 @@ private constructor(
*/
fun build(): ProgramLevelRule =
ProgramLevelRule(
+ (excludedAccountTokens ?: JsonMissing.of()).map { it.toImmutable() },
+ (excludedBusinessAccountTokens ?: JsonMissing.of()).map {
+ it.toImmutable()
+ },
(excludedCardTokens ?: JsonMissing.of()).map { it.toImmutable() },
name,
programLevel,
@@ -1528,6 +1652,8 @@ private constructor(
return@apply
}
+ excludedAccountTokens()
+ excludedBusinessAccountTokens()
excludedCardTokens()
name()
programLevel()
@@ -1551,7 +1677,9 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (excludedCardTokens.asKnown().getOrNull()?.size ?: 0) +
+ (excludedAccountTokens.asKnown().getOrNull()?.size ?: 0) +
+ (excludedBusinessAccountTokens.asKnown().getOrNull()?.size ?: 0) +
+ (excludedCardTokens.asKnown().getOrNull()?.size ?: 0) +
(if (name.asKnown().isPresent) 1 else 0) +
(if (programLevel.asKnown().isPresent) 1 else 0) +
(state.asKnown().getOrNull()?.validity() ?: 0)
@@ -1694,6 +1822,8 @@ private constructor(
}
return other is ProgramLevelRule &&
+ excludedAccountTokens == other.excludedAccountTokens &&
+ excludedBusinessAccountTokens == other.excludedBusinessAccountTokens &&
excludedCardTokens == other.excludedCardTokens &&
name == other.name &&
programLevel == other.programLevel &&
@@ -1702,13 +1832,21 @@ private constructor(
}
private val hashCode: Int by lazy {
- Objects.hash(excludedCardTokens, name, programLevel, state, additionalProperties)
+ Objects.hash(
+ excludedAccountTokens,
+ excludedBusinessAccountTokens,
+ excludedCardTokens,
+ name,
+ programLevel,
+ state,
+ additionalProperties,
+ )
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "ProgramLevelRule{excludedCardTokens=$excludedCardTokens, name=$name, programLevel=$programLevel, state=$state, additionalProperties=$additionalProperties}"
+ "ProgramLevelRule{excludedAccountTokens=$excludedAccountTokens, excludedBusinessAccountTokens=$excludedBusinessAccountTokens, excludedCardTokens=$excludedCardTokens, name=$name, programLevel=$programLevel, state=$state, additionalProperties=$additionalProperties}"
}
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt
new file mode 100644
index 000000000..c3918b33c
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleVersion.kt
@@ -0,0 +1,923 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.ObjectCodec
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
+import com.lithic.api.core.BaseDeserializer
+import com.lithic.api.core.BaseSerializer
+import com.lithic.api.core.Enum
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.allMaxBy
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.getOrThrow
+import com.lithic.api.errors.LithicInvalidDataException
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class AuthRuleVersion
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val created: JsonField,
+ private val parameters: JsonField,
+ private val state: JsonField,
+ private val version: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("parameters")
+ @ExcludeMissing
+ parameters: JsonField = JsonMissing.of(),
+ @JsonProperty("state")
+ @ExcludeMissing
+ state: JsonField = JsonMissing.of(),
+ @JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(),
+ ) : this(created, parameters, state, version, mutableMapOf())
+
+ /**
+ * Timestamp of when this version was created.
+ *
+ * @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 created(): OffsetDateTime = created.getRequired("created")
+
+ /**
+ * 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 current state of this version.
+ *
+ * @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 state(): AuthRuleVersionState = state.getRequired("state")
+
+ /**
+ * The version of the rule, this is incremented whenever the rule's parameters change.
+ *
+ * @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 version(): Long = version.getRequired("version")
+
+ /**
+ * Returns the raw JSON value of [created].
+ *
+ * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
+
+ /**
+ * 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 [state].
+ *
+ * Unlike [state], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state
+
+ /**
+ * Returns the raw JSON value of [version].
+ *
+ * Unlike [version], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("version") @ExcludeMissing fun _version(): JsonField = version
+
+ @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 [AuthRuleVersion].
+ *
+ * The following fields are required:
+ * ```java
+ * .created()
+ * .parameters()
+ * .state()
+ * .version()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AuthRuleVersion]. */
+ class Builder internal constructor() {
+
+ private var created: JsonField? = null
+ private var parameters: JsonField? = null
+ private var state: JsonField? = null
+ private var version: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(authRuleVersion: AuthRuleVersion) = apply {
+ created = authRuleVersion.created
+ parameters = authRuleVersion.parameters
+ state = authRuleVersion.state
+ version = authRuleVersion.version
+ additionalProperties = authRuleVersion.additionalProperties.toMutableMap()
+ }
+
+ /** Timestamp of when this version was created. */
+ fun created(created: OffsetDateTime) = created(JsonField.of(created))
+
+ /**
+ * Sets [Builder.created] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.created] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun created(created: JsonField) = apply { this.created = created }
+
+ /** 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)`.
+ */
+ @Deprecated("deprecated")
+ 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))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalAchAction(conditionalAchAction)`.
+ */
+ fun parameters(conditionalAchAction: ConditionalAchActionParameters) =
+ parameters(Parameters.ofConditionalAchAction(conditionalAchAction))
+
+ /**
+ * Alias for calling [parameters] with
+ * `Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction)`.
+ */
+ fun parameters(conditionalTokenizationAction: ConditionalTokenizationActionParameters) =
+ parameters(Parameters.ofConditionalTokenizationAction(conditionalTokenizationAction))
+
+ /** Alias for calling [parameters] with `Parameters.ofTypescriptCode(typescriptCode)`. */
+ fun parameters(typescriptCode: TypescriptCodeParameters) =
+ parameters(Parameters.ofTypescriptCode(typescriptCode))
+
+ /** The current state of this version. */
+ fun state(state: AuthRuleVersionState) = state(JsonField.of(state))
+
+ /**
+ * Sets [Builder.state] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.state] with a well-typed [AuthRuleVersionState] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun state(state: JsonField) = apply { this.state = state }
+
+ /** The version of the rule, this is incremented whenever the rule's parameters change. */
+ fun version(version: Long) = version(JsonField.of(version))
+
+ /**
+ * Sets [Builder.version] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.version] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun version(version: JsonField) = apply { this.version = version }
+
+ 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 [AuthRuleVersion].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .created()
+ * .parameters()
+ * .state()
+ * .version()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AuthRuleVersion =
+ AuthRuleVersion(
+ checkRequired("created", created),
+ checkRequired("parameters", parameters),
+ checkRequired("state", state),
+ checkRequired("version", version),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AuthRuleVersion = apply {
+ if (validated) {
+ return@apply
+ }
+
+ created()
+ parameters().validate()
+ state().validate()
+ version()
+ 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 (created.asKnown().isPresent) 1 else 0) +
+ (parameters.asKnown().getOrNull()?.validity() ?: 0) +
+ (state.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (version.asKnown().isPresent) 1 else 0)
+
+ /** Parameters for the Auth Rule */
+ @JsonDeserialize(using = Parameters.Deserializer::class)
+ @JsonSerialize(using = Parameters.Serializer::class)
+ class Parameters
+ private constructor(
+ private val conditionalBlock: ConditionalBlockParameters? = null,
+ private val velocityLimitParams: VelocityLimitParams? = null,
+ private val merchantLock: MerchantLockParameters? = null,
+ private val conditional3dsAction: Conditional3dsActionParameters? = null,
+ private val conditionalAuthorizationAction: ConditionalAuthorizationActionParameters? =
+ null,
+ private val conditionalAchAction: ConditionalAchActionParameters? = null,
+ private val conditionalTokenizationAction: ConditionalTokenizationActionParameters? = null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
+ private val _json: JsonValue? = null,
+ ) {
+
+ /** Deprecated: Use CONDITIONAL_ACTION instead. */
+ @Deprecated("deprecated")
+ fun conditionalBlock(): Optional =
+ Optional.ofNullable(conditionalBlock)
+
+ fun velocityLimitParams(): Optional =
+ Optional.ofNullable(velocityLimitParams)
+
+ fun merchantLock(): Optional = Optional.ofNullable(merchantLock)
+
+ fun conditional3dsAction(): Optional =
+ Optional.ofNullable(conditional3dsAction)
+
+ fun conditionalAuthorizationAction(): Optional =
+ Optional.ofNullable(conditionalAuthorizationAction)
+
+ fun conditionalAchAction(): Optional =
+ Optional.ofNullable(conditionalAchAction)
+
+ fun conditionalTokenizationAction(): Optional =
+ Optional.ofNullable(conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ fun typescriptCode(): Optional =
+ Optional.ofNullable(typescriptCode)
+
+ @Deprecated("deprecated") fun isConditionalBlock(): Boolean = conditionalBlock != null
+
+ fun isVelocityLimitParams(): Boolean = velocityLimitParams != null
+
+ fun isMerchantLock(): Boolean = merchantLock != null
+
+ fun isConditional3dsAction(): Boolean = conditional3dsAction != null
+
+ fun isConditionalAuthorizationAction(): Boolean = conditionalAuthorizationAction != null
+
+ fun isConditionalAchAction(): Boolean = conditionalAchAction != null
+
+ fun isConditionalTokenizationAction(): Boolean = conditionalTokenizationAction != null
+
+ fun isTypescriptCode(): Boolean = typescriptCode != null
+
+ /** Deprecated: Use CONDITIONAL_ACTION instead. */
+ @Deprecated("deprecated")
+ fun asConditionalBlock(): ConditionalBlockParameters =
+ conditionalBlock.getOrThrow("conditionalBlock")
+
+ fun asVelocityLimitParams(): VelocityLimitParams =
+ velocityLimitParams.getOrThrow("velocityLimitParams")
+
+ fun asMerchantLock(): MerchantLockParameters = merchantLock.getOrThrow("merchantLock")
+
+ fun asConditional3dsAction(): Conditional3dsActionParameters =
+ conditional3dsAction.getOrThrow("conditional3dsAction")
+
+ fun asConditionalAuthorizationAction(): ConditionalAuthorizationActionParameters =
+ conditionalAuthorizationAction.getOrThrow("conditionalAuthorizationAction")
+
+ fun asConditionalAchAction(): ConditionalAchActionParameters =
+ conditionalAchAction.getOrThrow("conditionalAchAction")
+
+ fun asConditionalTokenizationAction(): ConditionalTokenizationActionParameters =
+ conditionalTokenizationAction.getOrThrow("conditionalTokenizationAction")
+
+ /** Parameters for defining a TypeScript code rule */
+ fun asTypescriptCode(): TypescriptCodeParameters =
+ typescriptCode.getOrThrow("typescriptCode")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ fun accept(visitor: Visitor): T =
+ when {
+ conditionalBlock != null -> visitor.visitConditionalBlock(conditionalBlock)
+ velocityLimitParams != null -> visitor.visitVelocityLimitParams(velocityLimitParams)
+ merchantLock != null -> visitor.visitMerchantLock(merchantLock)
+ conditional3dsAction != null ->
+ visitor.visitConditional3dsAction(conditional3dsAction)
+ conditionalAuthorizationAction != null ->
+ visitor.visitConditionalAuthorizationAction(conditionalAuthorizationAction)
+ conditionalAchAction != null ->
+ visitor.visitConditionalAchAction(conditionalAchAction)
+ conditionalTokenizationAction != null ->
+ visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
+ else -> visitor.unknown(_json)
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Parameters = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitConditionalBlock(
+ conditionalBlock: ConditionalBlockParameters
+ ) {
+ conditionalBlock.validate()
+ }
+
+ override fun visitVelocityLimitParams(
+ velocityLimitParams: VelocityLimitParams
+ ) {
+ velocityLimitParams.validate()
+ }
+
+ override fun visitMerchantLock(merchantLock: MerchantLockParameters) {
+ merchantLock.validate()
+ }
+
+ override fun visitConditional3dsAction(
+ conditional3dsAction: Conditional3dsActionParameters
+ ) {
+ conditional3dsAction.validate()
+ }
+
+ override fun visitConditionalAuthorizationAction(
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
+ ) {
+ conditionalAuthorizationAction.validate()
+ }
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) {
+ conditionalAchAction.validate()
+ }
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) {
+ conditionalTokenizationAction.validate()
+ }
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.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 =
+ accept(
+ object : Visitor {
+ override fun visitConditionalBlock(
+ conditionalBlock: ConditionalBlockParameters
+ ) = conditionalBlock.validity()
+
+ override fun visitVelocityLimitParams(
+ velocityLimitParams: VelocityLimitParams
+ ) = velocityLimitParams.validity()
+
+ override fun visitMerchantLock(merchantLock: MerchantLockParameters) =
+ merchantLock.validity()
+
+ override fun visitConditional3dsAction(
+ conditional3dsAction: Conditional3dsActionParameters
+ ) = conditional3dsAction.validity()
+
+ override fun visitConditionalAuthorizationAction(
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
+ ) = conditionalAuthorizationAction.validity()
+
+ override fun visitConditionalAchAction(
+ conditionalAchAction: ConditionalAchActionParameters
+ ) = conditionalAchAction.validity()
+
+ override fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = conditionalTokenizationAction.validity()
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Parameters &&
+ conditionalBlock == other.conditionalBlock &&
+ velocityLimitParams == other.velocityLimitParams &&
+ merchantLock == other.merchantLock &&
+ conditional3dsAction == other.conditional3dsAction &&
+ conditionalAuthorizationAction == other.conditionalAuthorizationAction &&
+ conditionalAchAction == other.conditionalAchAction &&
+ conditionalTokenizationAction == other.conditionalTokenizationAction &&
+ typescriptCode == other.typescriptCode
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ conditionalBlock,
+ velocityLimitParams,
+ merchantLock,
+ conditional3dsAction,
+ conditionalAuthorizationAction,
+ conditionalAchAction,
+ conditionalTokenizationAction,
+ typescriptCode,
+ )
+
+ override fun toString(): String =
+ when {
+ conditionalBlock != null -> "Parameters{conditionalBlock=$conditionalBlock}"
+ velocityLimitParams != null ->
+ "Parameters{velocityLimitParams=$velocityLimitParams}"
+ merchantLock != null -> "Parameters{merchantLock=$merchantLock}"
+ conditional3dsAction != null ->
+ "Parameters{conditional3dsAction=$conditional3dsAction}"
+ conditionalAuthorizationAction != null ->
+ "Parameters{conditionalAuthorizationAction=$conditionalAuthorizationAction}"
+ conditionalAchAction != null ->
+ "Parameters{conditionalAchAction=$conditionalAchAction}"
+ conditionalTokenizationAction != null ->
+ "Parameters{conditionalTokenizationAction=$conditionalTokenizationAction}"
+ typescriptCode != null -> "Parameters{typescriptCode=$typescriptCode}"
+ _json != null -> "Parameters{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid Parameters")
+ }
+
+ companion object {
+
+ /** Deprecated: Use CONDITIONAL_ACTION instead. */
+ @Deprecated("deprecated")
+ @JvmStatic
+ fun ofConditionalBlock(conditionalBlock: ConditionalBlockParameters) =
+ Parameters(conditionalBlock = conditionalBlock)
+
+ @JvmStatic
+ fun ofVelocityLimitParams(velocityLimitParams: VelocityLimitParams) =
+ Parameters(velocityLimitParams = velocityLimitParams)
+
+ @JvmStatic
+ fun ofMerchantLock(merchantLock: MerchantLockParameters) =
+ Parameters(merchantLock = merchantLock)
+
+ @JvmStatic
+ fun ofConditional3dsAction(conditional3dsAction: Conditional3dsActionParameters) =
+ Parameters(conditional3dsAction = conditional3dsAction)
+
+ @JvmStatic
+ fun ofConditionalAuthorizationAction(
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
+ ) = Parameters(conditionalAuthorizationAction = conditionalAuthorizationAction)
+
+ @JvmStatic
+ fun ofConditionalAchAction(conditionalAchAction: ConditionalAchActionParameters) =
+ Parameters(conditionalAchAction = conditionalAchAction)
+
+ @JvmStatic
+ fun ofConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ) = Parameters(conditionalTokenizationAction = conditionalTokenizationAction)
+
+ /** Parameters for defining a TypeScript code rule */
+ @JvmStatic
+ fun ofTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ Parameters(typescriptCode = typescriptCode)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [Parameters] to a value of type [T].
+ */
+ interface Visitor {
+
+ /** Deprecated: Use CONDITIONAL_ACTION instead. */
+ @Deprecated("deprecated")
+ fun visitConditionalBlock(conditionalBlock: ConditionalBlockParameters): T
+
+ fun visitVelocityLimitParams(velocityLimitParams: VelocityLimitParams): T
+
+ fun visitMerchantLock(merchantLock: MerchantLockParameters): T
+
+ fun visitConditional3dsAction(conditional3dsAction: Conditional3dsActionParameters): T
+
+ fun visitConditionalAuthorizationAction(
+ conditionalAuthorizationAction: ConditionalAuthorizationActionParameters
+ ): T
+
+ fun visitConditionalAchAction(conditionalAchAction: ConditionalAchActionParameters): T
+
+ fun visitConditionalTokenizationAction(
+ conditionalTokenizationAction: ConditionalTokenizationActionParameters
+ ): T
+
+ /** Parameters for defining a TypeScript code rule */
+ fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters): T
+
+ /**
+ * Maps an unknown variant of [Parameters] to a value of type [T].
+ *
+ * An instance of [Parameters] 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 Parameters: $json")
+ }
+ }
+
+ internal class Deserializer : BaseDeserializer(Parameters::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): Parameters {
+ val json = JsonValue.fromJsonNode(node)
+
+ val bestMatches =
+ sequenceOf(
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(conditionalBlock = it, _json = json) },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Parameters(velocityLimitParams = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Parameters(merchantLock = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(conditional3dsAction = it, _json = json) },
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalAuthorizationAction = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(conditionalAchAction = it, _json = json) },
+ tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let {
+ Parameters(conditionalTokenizationAction = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Parameters(typescriptCode = 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 boolean).
+ 0 -> Parameters(_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(Parameters::class) {
+
+ override fun serialize(
+ value: Parameters,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.conditionalBlock != null -> generator.writeObject(value.conditionalBlock)
+ value.velocityLimitParams != null ->
+ generator.writeObject(value.velocityLimitParams)
+ value.merchantLock != null -> generator.writeObject(value.merchantLock)
+ value.conditional3dsAction != null ->
+ generator.writeObject(value.conditional3dsAction)
+ value.conditionalAuthorizationAction != null ->
+ generator.writeObject(value.conditionalAuthorizationAction)
+ value.conditionalAchAction != null ->
+ generator.writeObject(value.conditionalAchAction)
+ value.conditionalTokenizationAction != null ->
+ generator.writeObject(value.conditionalTokenizationAction)
+ value.typescriptCode != null -> generator.writeObject(value.typescriptCode)
+ value._json != null -> generator.writeObject(value._json)
+ else -> throw IllegalStateException("Invalid Parameters")
+ }
+ }
+ }
+ }
+
+ /** The current state of this version. */
+ class AuthRuleVersionState
+ @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 ACTIVE = of("ACTIVE")
+
+ @JvmField val SHADOW = of("SHADOW")
+
+ @JvmField val INACTIVE = of("INACTIVE")
+
+ @JvmStatic fun of(value: String) = AuthRuleVersionState(JsonField.of(value))
+ }
+
+ /** An enum containing [AuthRuleVersionState]'s known values. */
+ enum class Known {
+ ACTIVE,
+ SHADOW,
+ INACTIVE,
+ }
+
+ /**
+ * An enum containing [AuthRuleVersionState]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [AuthRuleVersionState] 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 {
+ ACTIVE,
+ SHADOW,
+ INACTIVE,
+ /**
+ * An enum member indicating that [AuthRuleVersionState] 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) {
+ ACTIVE -> Value.ACTIVE
+ SHADOW -> Value.SHADOW
+ INACTIVE -> Value.INACTIVE
+ 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) {
+ ACTIVE -> Known.ACTIVE
+ SHADOW -> Known.SHADOW
+ INACTIVE -> Known.INACTIVE
+ else -> throw LithicInvalidDataException("Unknown AuthRuleVersionState: $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(): AuthRuleVersionState = 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 AuthRuleVersionState && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthRuleVersion &&
+ created == other.created &&
+ parameters == other.parameters &&
+ state == other.state &&
+ version == other.version &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(created, parameters, state, version, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AuthRuleVersion{created=$created, parameters=$parameters, state=$state, version=$version, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
index 558bc6b8d..ff370c130 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRulesBacktestReportCreatedWebhookEvent.kt
@@ -22,7 +22,7 @@ class AuthRulesBacktestReportCreatedWebhookEvent
private constructor(
private val backtestToken: JsonField,
private val results: JsonField,
- private val simulationParameters: JsonField,
+ private val simulationParameters: JsonField,
private val eventType: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -37,7 +37,8 @@ private constructor(
results: JsonField = JsonMissing.of(),
@JsonProperty("simulation_parameters")
@ExcludeMissing
- simulationParameters: JsonField = JsonMissing.of(),
+ simulationParameters: JsonField =
+ JsonMissing.of(),
@JsonProperty("event_type")
@ExcludeMissing
eventType: JsonField = JsonMissing.of(),
@@ -68,7 +69,7 @@ private constructor(
* @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 simulationParameters(): BacktestResults.SimulationParameters =
+ fun simulationParameters(): BacktestResults.BacktestSimulationParameters =
simulationParameters.getRequired("simulation_parameters")
/**
@@ -105,7 +106,7 @@ private constructor(
*/
@JsonProperty("simulation_parameters")
@ExcludeMissing
- fun _simulationParameters(): JsonField =
+ fun _simulationParameters(): JsonField =
simulationParameters
/**
@@ -149,7 +150,8 @@ private constructor(
private var backtestToken: JsonField? = null
private var results: JsonField