diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 620a05d9..e7d7ae23 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 124b9841..486a203f 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 4f6a4f90..cb037391 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: 189
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6eebc524f3f5b6499a79ef544e150cc49ea1dc1e1c76a5392079ca5a83e78100.yml
+openapi_spec_hash: 500c46c1194a128c404e17f7a5bff676
+config_hash: 7daa8d0d03697920c0c1ca18ce6d4594
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afbe3e6a..9f98b865 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,28 @@
# Changelog
+## 0.120.0 (2026-03-10)
+
+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 loan_tape_date field to statement line items ([be3f3fb](https://github.com/lithic-com/lithic-java/commit/be3f3fb90c7492fc1a6707f217c4fc1bf8e45211))
+* **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))
+
+
+### Bug Fixes
+
+* **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))
+
+
+### Chores
+
+* **internal:** codegen related update ([10b1473](https://github.com/lithic-com/lithic-java/commit/10b14732a71e84708c2da1234a47664b19354c97))
+
## 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 cd00fb36..04ebd7e9 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)
@@ -11,18 +11,9 @@ The Lithic Java SDK provides convenient access to the [Lithic REST API](https://
The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
-## MCP Server
-
-Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
-
-[](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)
-[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)
-
-> Note: You may need to set environment variables in your MCP client.
-
-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 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.119.0")
+implementation("com.lithic.api:lithic-java:0.120.0")
```
### Maven
@@ -42,7 +33,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 322e98c9..a704d259 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 5c62db05..6dd840a3 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 720abfe6..d5ee8d11 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 10e87732..97d63df6 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 411eeb78..f9808009 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 733b9370..1a3efdc5 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 68f30828..798daf0c 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 cc509dfd..1f14a7e6 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 29731923..ccf10fd8 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 eb2aa72b..efe50186 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
@@ -424,6 +424,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))
@@ -450,6 +452,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -482,6 +485,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an unknown
@@ -518,6 +522,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
}
@@ -552,6 +557,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 93a1516f..c69e9261 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")
}
@@ -1054,6 +1100,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))
@@ -1080,6 +1128,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -1114,6 +1163,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an
@@ -1150,6 +1200,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
}
@@ -1184,6 +1235,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 8691ebef..1d2928e2 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(
@@ -1076,6 +1122,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))
@@ -1102,6 +1150,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
}
@@ -1136,6 +1185,7 @@ private constructor(
MANAGEMENT_FEE,
MANAGEMENT_REWARD,
MANAGEMENT_DISBURSEMENT,
+ HOLD,
PROGRAM_FUNDING,
/**
* An enum member indicating that [TransactionCategory] was instantiated with an
@@ -1172,6 +1222,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
}
@@ -1206,6 +1257,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 1d805631..46d18c7d 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
@@ -196,6 +196,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 value).
@@ -601,6 +603,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))
@@ -910,6 +914,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 +1019,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 +1046,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 +1064,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 +1088,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 +1108,7 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -1138,6 +1160,10 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -1188,6 +1214,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1204,7 +1233,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 +1246,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -1232,6 +1263,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 +1301,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 +1338,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 +1397,8 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -1395,6 +1437,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 +1469,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 +1503,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 +1526,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 +1542,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 +1575,9 @@ private constructor(
*
* The following fields are required:
* ```java
+ * .error()
* .parameters()
+ * .state()
* .version()
* ```
*/
@@ -1500,17 +1587,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 +1687,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 +1754,9 @@ private constructor(
*
* The following fields are required:
* ```java
+ * .error()
* .parameters()
+ * .state()
* .version()
* ```
*
@@ -1626,7 +1764,9 @@ private constructor(
*/
fun build(): DraftVersion =
DraftVersion(
+ checkRequired("error", error),
checkRequired("parameters", parameters),
+ checkRequired("state", state),
checkRequired("version", version),
additionalProperties.toMutableMap(),
)
@@ -1639,7 +1779,9 @@ private constructor(
return@apply
}
+ error()
parameters().validate()
+ state().validate()
version()
validated = true
}
@@ -1660,7 +1802,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 +1821,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 +1848,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 +1866,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 +1890,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 +1910,7 @@ private constructor(
visitor.visitConditionalAchAction(conditionalAchAction)
conditionalTokenizationAction != null ->
visitor.visitConditionalTokenizationAction(conditionalTokenizationAction)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -1806,6 +1962,10 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -1856,6 +2016,9 @@ private constructor(
conditionalTokenizationAction: ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(typescriptCode: TypescriptCodeParameters) =
+ typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -1872,7 +2035,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 +2048,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -1900,6 +2065,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 +2103,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 +2140,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 +2199,8 @@ private constructor(
?.let {
Parameters(conditionalTokenizationAction = it, _json = json)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -2063,6 +2239,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 +2247,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 +2555,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 +2581,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 +2592,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -2280,6 +2609,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 +2629,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 +2648,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")
}
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 ff88bcb1..e8820e62 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")
}
@@ -2608,6 +2720,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
@@ -2815,6 +2929,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 +2961,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))
@@ -3011,6 +3134,7 @@ private constructor(
private val conditionalTokenizationAction:
ConditionalTokenizationActionParameters? =
null,
+ private val typescriptCode: TypescriptCodeParameters? = null,
private val _json: JsonValue? = null,
) {
@@ -3039,6 +3163,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 +3184,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 +3209,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 +3233,7 @@ private constructor(
visitor.visitConditionalTokenizationAction(
conditionalTokenizationAction
)
+ typescriptCode != null -> visitor.visitTypescriptCode(typescriptCode)
else -> visitor.unknown(_json)
}
@@ -3152,6 +3287,12 @@ private constructor(
) {
conditionalTokenizationAction.validate()
}
+
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) {
+ typescriptCode.validate()
+ }
}
)
validated = true
@@ -3204,6 +3345,10 @@ private constructor(
ConditionalTokenizationActionParameters
) = conditionalTokenizationAction.validity()
+ override fun visitTypescriptCode(
+ typescriptCode: TypescriptCodeParameters
+ ) = typescriptCode.validity()
+
override fun unknown(json: JsonValue?) = 0
}
)
@@ -3220,7 +3365,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 +3378,7 @@ private constructor(
conditionalAuthorizationAction,
conditionalAchAction,
conditionalTokenizationAction,
+ typescriptCode,
)
override fun toString(): String =
@@ -3248,6 +3395,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 +3435,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 +3472,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 +3546,8 @@ private constructor(
_json = json,
)
},
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { Parameters(typescriptCode = it, _json = json) },
)
.filterNotNull()
.allMaxBy { it.validity() }
@@ -3429,6 +3587,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 +3606,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 +3633,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 +3644,7 @@ private constructor(
VELOCITY_LIMIT,
MERCHANT_LOCK,
CONDITIONAL_ACTION,
+ TYPESCRIPT_CODE,
}
/**
@@ -3497,6 +3662,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 +3683,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 +3702,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")
}
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 56772a9b..c375bbbb 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/FinancialAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt
index 1980c5a5..cc76be9c 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt
@@ -1571,6 +1571,8 @@ private constructor(
@JvmField val PROGRAM_BANK_ACCOUNTS_PAYABLE = of("PROGRAM_BANK_ACCOUNTS_PAYABLE")
+ @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT")
+
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
@@ -1586,6 +1588,7 @@ private constructor(
PROGRAM_RECEIVABLES,
COLLECTION,
PROGRAM_BANK_ACCOUNTS_PAYABLE,
+ EARLY_DIRECT_DEPOSIT_FLOAT,
}
/**
@@ -1608,6 +1611,7 @@ private constructor(
PROGRAM_RECEIVABLES,
COLLECTION,
PROGRAM_BANK_ACCOUNTS_PAYABLE,
+ EARLY_DIRECT_DEPOSIT_FLOAT,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -1631,6 +1635,7 @@ private constructor(
PROGRAM_RECEIVABLES -> Value.PROGRAM_RECEIVABLES
COLLECTION -> Value.COLLECTION
PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE
+ EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT
else -> Value._UNKNOWN
}
@@ -1655,6 +1660,7 @@ private constructor(
PROGRAM_RECEIVABLES -> Known.PROGRAM_RECEIVABLES
COLLECTION -> Known.COLLECTION
PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE
+ EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT
else -> throw LithicInvalidDataException("Unknown Type: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt
index e82603d1..fb45c625 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountListParams.kt
@@ -240,6 +240,8 @@ private constructor(
@JvmField val SECURITY = of("SECURITY")
+ @JvmField val EARLY_DIRECT_DEPOSIT_FLOAT = of("EARLY_DIRECT_DEPOSIT_FLOAT")
+
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
@@ -249,6 +251,7 @@ private constructor(
OPERATING,
RESERVE,
SECURITY,
+ EARLY_DIRECT_DEPOSIT_FLOAT,
}
/**
@@ -265,6 +268,7 @@ private constructor(
OPERATING,
RESERVE,
SECURITY,
+ EARLY_DIRECT_DEPOSIT_FLOAT,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -282,6 +286,7 @@ private constructor(
OPERATING -> Value.OPERATING
RESERVE -> Value.RESERVE
SECURITY -> Value.SECURITY
+ EARLY_DIRECT_DEPOSIT_FLOAT -> Value.EARLY_DIRECT_DEPOSIT_FLOAT
else -> Value._UNKNOWN
}
@@ -300,6 +305,7 @@ private constructor(
OPERATING -> Known.OPERATING
RESERVE -> Known.RESERVE
SECURITY -> Known.SECURITY
+ EARLY_DIRECT_DEPOSIT_FLOAT -> Known.EARLY_DIRECT_DEPOSIT_FLOAT
else -> throw LithicInvalidDataException("Unknown Type: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt
new file mode 100644
index 00000000..44b397dc
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Hold.kt
@@ -0,0 +1,1066 @@
+// 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.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.checkKnown
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+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
+
+/**
+ * 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.
+ */
+class Hold
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val created: JsonField,
+ private val status: JsonField,
+ private val updated: JsonField,
+ private val currency: JsonField,
+ private val events: JsonField>,
+ private val expirationDatetime: JsonField,
+ private val family: JsonField,
+ private val financialAccountToken: JsonField,
+ private val pendingAmount: JsonField,
+ private val result: JsonField,
+ private val userDefinedId: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
+ @ExcludeMissing
+ updated: JsonField = JsonMissing.of(),
+ @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(),
+ @JsonProperty("events")
+ @ExcludeMissing
+ events: JsonField> = JsonMissing.of(),
+ @JsonProperty("expiration_datetime")
+ @ExcludeMissing
+ expirationDatetime: JsonField = JsonMissing.of(),
+ @JsonProperty("family") @ExcludeMissing family: JsonField = JsonMissing.of(),
+ @JsonProperty("financial_account_token")
+ @ExcludeMissing
+ financialAccountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("pending_amount")
+ @ExcludeMissing
+ pendingAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("result")
+ @ExcludeMissing
+ result: JsonField = JsonMissing.of(),
+ @JsonProperty("user_defined_id")
+ @ExcludeMissing
+ userDefinedId: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ created,
+ status,
+ updated,
+ currency,
+ events,
+ expirationDatetime,
+ family,
+ financialAccountToken,
+ pendingAmount,
+ result,
+ userDefinedId,
+ mutableMapOf(),
+ )
+
+ /**
+ * Unique identifier for the transaction
+ *
+ * @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 token(): String = token.getRequired("token")
+
+ /**
+ * ISO 8601 timestamp of when the transaction 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")
+
+ /**
+ * Status of a hold transaction
+ *
+ * @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 status(): HoldStatus = status.getRequired("status")
+
+ /**
+ * ISO 8601 timestamp of when the transaction was last updated
+ *
+ * @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 updated(): OffsetDateTime = updated.getRequired("updated")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun currency(): Optional = currency.getOptional("currency")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun events(): Optional> = events.getOptional("events")
+
+ /**
+ * When the hold will auto-expire if not resolved
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expirationDatetime(): Optional =
+ expirationDatetime.getOptional("expiration_datetime")
+
+ /**
+ * HOLD - Hold Transaction
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun family(): Optional = family.getOptional("family")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun financialAccountToken(): Optional =
+ financialAccountToken.getOptional("financial_account_token")
+
+ /**
+ * Current pending amount (0 when resolved)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun pendingAmount(): Optional = pendingAmount.getOptional("pending_amount")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun result(): Optional = result.getOptional("result")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userDefinedId(): Optional = userDefinedId.getOptional("user_defined_id")
+
+ /**
+ * Returns the raw JSON value of [token].
+ *
+ * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token
+
+ /**
+ * 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 [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [updated].
+ *
+ * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated
+
+ /**
+ * Returns the raw JSON value of [currency].
+ *
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
+
+ /**
+ * Returns the raw JSON value of [events].
+ *
+ * Unlike [events], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("events") @ExcludeMissing fun _events(): JsonField> = events
+
+ /**
+ * Returns the raw JSON value of [expirationDatetime].
+ *
+ * Unlike [expirationDatetime], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("expiration_datetime")
+ @ExcludeMissing
+ fun _expirationDatetime(): JsonField = expirationDatetime
+
+ /**
+ * Returns the raw JSON value of [family].
+ *
+ * Unlike [family], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("family") @ExcludeMissing fun _family(): JsonField = family
+
+ /**
+ * Returns the raw JSON value of [financialAccountToken].
+ *
+ * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("financial_account_token")
+ @ExcludeMissing
+ fun _financialAccountToken(): JsonField = financialAccountToken
+
+ /**
+ * Returns the raw JSON value of [pendingAmount].
+ *
+ * Unlike [pendingAmount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("pending_amount")
+ @ExcludeMissing
+ fun _pendingAmount(): JsonField = pendingAmount
+
+ /**
+ * Returns the raw JSON value of [result].
+ *
+ * Unlike [result], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("result") @ExcludeMissing fun _result(): JsonField = result
+
+ /**
+ * Returns the raw JSON value of [userDefinedId].
+ *
+ * Unlike [userDefinedId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("user_defined_id")
+ @ExcludeMissing
+ fun _userDefinedId(): JsonField = userDefinedId
+
+ @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 [Hold].
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .created()
+ * .status()
+ * .updated()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Hold]. */
+ class Builder internal constructor() {
+
+ private var token: JsonField? = null
+ private var created: JsonField? = null
+ private var status: JsonField? = null
+ private var updated: JsonField? = null
+ private var currency: JsonField = JsonMissing.of()
+ private var events: JsonField>? = null
+ private var expirationDatetime: JsonField = JsonMissing.of()
+ private var family: JsonField = JsonMissing.of()
+ private var financialAccountToken: JsonField = JsonMissing.of()
+ private var pendingAmount: JsonField = JsonMissing.of()
+ private var result: JsonField = JsonMissing.of()
+ private var userDefinedId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(hold: Hold) = apply {
+ token = hold.token
+ created = hold.created
+ status = hold.status
+ updated = hold.updated
+ currency = hold.currency
+ events = hold.events.map { it.toMutableList() }
+ expirationDatetime = hold.expirationDatetime
+ family = hold.family
+ financialAccountToken = hold.financialAccountToken
+ pendingAmount = hold.pendingAmount
+ result = hold.result
+ userDefinedId = hold.userDefinedId
+ additionalProperties = hold.additionalProperties.toMutableMap()
+ }
+
+ /** Unique identifier for the transaction */
+ fun token(token: String) = token(JsonField.of(token))
+
+ /**
+ * Sets [Builder.token] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.token] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun token(token: JsonField) = apply { this.token = token }
+
+ /** ISO 8601 timestamp of when the transaction 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 }
+
+ /** Status of a hold transaction */
+ fun status(status: HoldStatus) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [HoldStatus] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ /** ISO 8601 timestamp of when the transaction was last updated */
+ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated))
+
+ /**
+ * Sets [Builder.updated] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.updated] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun updated(updated: JsonField) = apply { this.updated = updated }
+
+ fun currency(currency: String) = currency(JsonField.of(currency))
+
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ fun events(events: List) = events(JsonField.of(events))
+
+ /**
+ * Sets [Builder.events] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.events] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun events(events: JsonField>) = apply {
+ this.events = events.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [HoldEvent] to [events].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addEvent(event: HoldEvent) = apply {
+ events =
+ (events ?: JsonField.of(mutableListOf())).also {
+ checkKnown("events", it).add(event)
+ }
+ }
+
+ /** When the hold will auto-expire if not resolved */
+ fun expirationDatetime(expirationDatetime: OffsetDateTime?) =
+ expirationDatetime(JsonField.ofNullable(expirationDatetime))
+
+ /**
+ * Alias for calling [Builder.expirationDatetime] with `expirationDatetime.orElse(null)`.
+ */
+ fun expirationDatetime(expirationDatetime: Optional) =
+ expirationDatetime(expirationDatetime.getOrNull())
+
+ /**
+ * Sets [Builder.expirationDatetime] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expirationDatetime] with a well-typed [OffsetDateTime]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun expirationDatetime(expirationDatetime: JsonField) = apply {
+ this.expirationDatetime = expirationDatetime
+ }
+
+ /** HOLD - Hold Transaction */
+ fun family(family: Family) = family(JsonField.of(family))
+
+ /**
+ * Sets [Builder.family] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.family] with a well-typed [Family] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun family(family: JsonField) = apply { this.family = family }
+
+ fun financialAccountToken(financialAccountToken: String) =
+ financialAccountToken(JsonField.of(financialAccountToken))
+
+ /**
+ * Sets [Builder.financialAccountToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.financialAccountToken] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun financialAccountToken(financialAccountToken: JsonField) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /** Current pending amount (0 when resolved) */
+ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount))
+
+ /**
+ * Sets [Builder.pendingAmount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pendingAmount] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun pendingAmount(pendingAmount: JsonField) = apply {
+ this.pendingAmount = pendingAmount
+ }
+
+ fun result(result: TransactionResult) = result(JsonField.of(result))
+
+ /**
+ * Sets [Builder.result] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.result] with a well-typed [TransactionResult] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun result(result: JsonField) = apply { this.result = result }
+
+ fun userDefinedId(userDefinedId: String?) =
+ userDefinedId(JsonField.ofNullable(userDefinedId))
+
+ /** Alias for calling [Builder.userDefinedId] with `userDefinedId.orElse(null)`. */
+ fun userDefinedId(userDefinedId: Optional) =
+ userDefinedId(userDefinedId.getOrNull())
+
+ /**
+ * Sets [Builder.userDefinedId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userDefinedId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun userDefinedId(userDefinedId: JsonField) = apply {
+ this.userDefinedId = userDefinedId
+ }
+
+ 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 [Hold].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .created()
+ * .status()
+ * .updated()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Hold =
+ Hold(
+ checkRequired("token", token),
+ checkRequired("created", created),
+ checkRequired("status", status),
+ checkRequired("updated", updated),
+ currency,
+ (events ?: JsonMissing.of()).map { it.toImmutable() },
+ expirationDatetime,
+ family,
+ financialAccountToken,
+ pendingAmount,
+ result,
+ userDefinedId,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Hold = apply {
+ if (validated) {
+ return@apply
+ }
+
+ token()
+ created()
+ status().validate()
+ updated()
+ currency()
+ events().ifPresent { it.forEach { it.validate() } }
+ expirationDatetime()
+ family().ifPresent { it.validate() }
+ financialAccountToken()
+ pendingAmount()
+ result().ifPresent { it.validate() }
+ userDefinedId()
+ 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 (token.asKnown().isPresent) 1 else 0) +
+ (if (created.asKnown().isPresent) 1 else 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (updated.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0) +
+ (events.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (expirationDatetime.asKnown().isPresent) 1 else 0) +
+ (family.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (financialAccountToken.asKnown().isPresent) 1 else 0) +
+ (if (pendingAmount.asKnown().isPresent) 1 else 0) +
+ (result.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (userDefinedId.asKnown().isPresent) 1 else 0)
+
+ /** Status of a hold transaction */
+ class HoldStatus @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 SETTLED = of("SETTLED")
+
+ @JvmField val EXPIRED = of("EXPIRED")
+
+ @JvmField val VOIDED = of("VOIDED")
+
+ @JvmField val DECLINED = of("DECLINED")
+
+ @JvmField val REVERSED = of("REVERSED")
+
+ @JvmField val CANCELED = of("CANCELED")
+
+ @JvmField val RETURNED = of("RETURNED")
+
+ @JvmStatic fun of(value: String) = HoldStatus(JsonField.of(value))
+ }
+
+ /** An enum containing [HoldStatus]'s known values. */
+ enum class Known {
+ PENDING,
+ SETTLED,
+ EXPIRED,
+ VOIDED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
+ }
+
+ /**
+ * An enum containing [HoldStatus]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [HoldStatus] 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,
+ SETTLED,
+ EXPIRED,
+ VOIDED,
+ DECLINED,
+ REVERSED,
+ CANCELED,
+ RETURNED,
+ /**
+ * An enum member indicating that [HoldStatus] 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
+ SETTLED -> Value.SETTLED
+ EXPIRED -> Value.EXPIRED
+ VOIDED -> Value.VOIDED
+ DECLINED -> Value.DECLINED
+ REVERSED -> Value.REVERSED
+ CANCELED -> Value.CANCELED
+ RETURNED -> Value.RETURNED
+ 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
+ SETTLED -> Known.SETTLED
+ EXPIRED -> Known.EXPIRED
+ VOIDED -> Known.VOIDED
+ DECLINED -> Known.DECLINED
+ REVERSED -> Known.REVERSED
+ CANCELED -> Known.CANCELED
+ RETURNED -> Known.RETURNED
+ else -> throw LithicInvalidDataException("Unknown HoldStatus: $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(): HoldStatus = 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 HoldStatus && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** HOLD - Hold Transaction */
+ class Family @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 HOLD = of("HOLD")
+
+ @JvmStatic fun of(value: String) = Family(JsonField.of(value))
+ }
+
+ /** An enum containing [Family]'s known values. */
+ enum class Known {
+ HOLD
+ }
+
+ /**
+ * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Family] 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 {
+ HOLD,
+ /** An enum member indicating that [Family] 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) {
+ HOLD -> Value.HOLD
+ 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) {
+ HOLD -> Known.HOLD
+ else -> throw LithicInvalidDataException("Unknown Family: $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(): Family = 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 Family && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ class TransactionResult @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 APPROVED = of("APPROVED")
+
+ @JvmField val DECLINED = of("DECLINED")
+
+ @JvmStatic fun of(value: String) = TransactionResult(JsonField.of(value))
+ }
+
+ /** An enum containing [TransactionResult]'s known values. */
+ enum class Known {
+ APPROVED,
+ DECLINED,
+ }
+
+ /**
+ * An enum containing [TransactionResult]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [TransactionResult] 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 {
+ APPROVED,
+ DECLINED,
+ /**
+ * An enum member indicating that [TransactionResult] 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) {
+ APPROVED -> Value.APPROVED
+ DECLINED -> Value.DECLINED
+ 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) {
+ APPROVED -> Known.APPROVED
+ DECLINED -> Known.DECLINED
+ else -> throw LithicInvalidDataException("Unknown TransactionResult: $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(): TransactionResult = 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 TransactionResult && 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 Hold &&
+ token == other.token &&
+ created == other.created &&
+ status == other.status &&
+ updated == other.updated &&
+ currency == other.currency &&
+ events == other.events &&
+ expirationDatetime == other.expirationDatetime &&
+ family == other.family &&
+ financialAccountToken == other.financialAccountToken &&
+ pendingAmount == other.pendingAmount &&
+ result == other.result &&
+ userDefinedId == other.userDefinedId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ token,
+ created,
+ status,
+ updated,
+ currency,
+ events,
+ expirationDatetime,
+ family,
+ financialAccountToken,
+ pendingAmount,
+ result,
+ userDefinedId,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Hold{token=$token, created=$created, status=$status, updated=$updated, currency=$currency, events=$events, expirationDatetime=$expirationDatetime, family=$family, financialAccountToken=$financialAccountToken, pendingAmount=$pendingAmount, result=$result, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt
new file mode 100644
index 00000000..8ff7ac50
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldCreateParams.kt
@@ -0,0 +1,742 @@
+// 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.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.Params
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+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
+
+/**
+ * Create a hold on a financial account. Holds reserve funds by moving them from available to
+ * pending balance. They can be resolved via settlement (linked to a payment or book transfer),
+ * voiding, or expiration.
+ */
+class HoldCreateParams
+private constructor(
+ private val financialAccountToken: String?,
+ private val body: CreateHoldRequest,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken)
+
+ /**
+ * Amount to hold in cents
+ *
+ * @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 amount(): Long = body.amount()
+
+ /**
+ * Customer-provided token for idempotency. Becomes the hold token.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun token(): Optional = body.token()
+
+ /**
+ * When the hold should auto-expire
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expirationDatetime(): Optional = body.expirationDatetime()
+
+ /**
+ * Reason for the hold
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun memo(): Optional = body.memo()
+
+ /**
+ * User-provided identifier for the hold
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userDefinedId(): Optional = body.userDefinedId()
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _amount(): JsonField = body._amount()
+
+ /**
+ * Returns the raw JSON value of [token].
+ *
+ * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _token(): JsonField = body._token()
+
+ /**
+ * Returns the raw JSON value of [expirationDatetime].
+ *
+ * Unlike [expirationDatetime], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ fun _expirationDatetime(): JsonField = body._expirationDatetime()
+
+ /**
+ * Returns the raw JSON value of [memo].
+ *
+ * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _memo(): JsonField = body._memo()
+
+ /**
+ * Returns the raw JSON value of [userDefinedId].
+ *
+ * Unlike [userDefinedId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _userDefinedId(): JsonField = body._userDefinedId()
+
+ fun _additionalBodyProperties(): Map = body._additionalProperties()
+
+ /** 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 {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [HoldCreateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [HoldCreateParams]. */
+ class Builder internal constructor() {
+
+ private var financialAccountToken: String? = null
+ private var body: CreateHoldRequest.Builder = CreateHoldRequest.builder()
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(holdCreateParams: HoldCreateParams) = apply {
+ financialAccountToken = holdCreateParams.financialAccountToken
+ body = holdCreateParams.body.toBuilder()
+ additionalHeaders = holdCreateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = holdCreateParams.additionalQueryParams.toBuilder()
+ }
+
+ fun financialAccountToken(financialAccountToken: String?) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /**
+ * Alias for calling [Builder.financialAccountToken] with
+ * `financialAccountToken.orElse(null)`.
+ */
+ fun financialAccountToken(financialAccountToken: Optional) =
+ financialAccountToken(financialAccountToken.getOrNull())
+
+ /**
+ * Sets the entire request body.
+ *
+ * This is generally only useful if you are already constructing the body separately.
+ * Otherwise, it's more convenient to use the top-level setters instead:
+ * - [amount]
+ * - [token]
+ * - [expirationDatetime]
+ * - [memo]
+ * - [userDefinedId]
+ * - etc.
+ */
+ fun body(body: CreateHoldRequest) = apply { this.body = body.toBuilder() }
+
+ /** Amount to hold in cents */
+ fun amount(amount: Long) = apply { body.amount(amount) }
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { body.amount(amount) }
+
+ /** Customer-provided token for idempotency. Becomes the hold token. */
+ fun token(token: String) = apply { body.token(token) }
+
+ /**
+ * Sets [Builder.token] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.token] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun token(token: JsonField) = apply { body.token(token) }
+
+ /** When the hold should auto-expire */
+ fun expirationDatetime(expirationDatetime: OffsetDateTime) = apply {
+ body.expirationDatetime(expirationDatetime)
+ }
+
+ /**
+ * Sets [Builder.expirationDatetime] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expirationDatetime] with a well-typed [OffsetDateTime]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun expirationDatetime(expirationDatetime: JsonField) = apply {
+ body.expirationDatetime(expirationDatetime)
+ }
+
+ /** Reason for the hold */
+ fun memo(memo: String?) = apply { body.memo(memo) }
+
+ /** Alias for calling [Builder.memo] with `memo.orElse(null)`. */
+ fun memo(memo: Optional) = memo(memo.getOrNull())
+
+ /**
+ * Sets [Builder.memo] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.memo] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun memo(memo: JsonField) = apply { body.memo(memo) }
+
+ /** User-provided identifier for the hold */
+ fun userDefinedId(userDefinedId: String) = apply { body.userDefinedId(userDefinedId) }
+
+ /**
+ * Sets [Builder.userDefinedId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userDefinedId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun userDefinedId(userDefinedId: JsonField) = apply {
+ body.userDefinedId(userDefinedId)
+ }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ body.additionalProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ body.putAdditionalProperty(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ body.putAllAdditionalProperties(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ body.removeAllAdditionalProperties(keys)
+ }
+
+ 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 [HoldCreateParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): HoldCreateParams =
+ HoldCreateParams(
+ financialAccountToken,
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): CreateHoldRequest = body
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> financialAccountToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ /** Request to create a new hold on a financial account */
+ class CreateHoldRequest
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val amount: JsonField,
+ private val token: JsonField,
+ private val expirationDatetime: JsonField,
+ private val memo: JsonField,
+ private val userDefinedId: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("expiration_datetime")
+ @ExcludeMissing
+ expirationDatetime: JsonField = JsonMissing.of(),
+ @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(),
+ @JsonProperty("user_defined_id")
+ @ExcludeMissing
+ userDefinedId: JsonField = JsonMissing.of(),
+ ) : this(amount, token, expirationDatetime, memo, userDefinedId, mutableMapOf())
+
+ /**
+ * Amount to hold in cents
+ *
+ * @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 amount(): Long = amount.getRequired("amount")
+
+ /**
+ * Customer-provided token for idempotency. Becomes the hold token.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun token(): Optional = token.getOptional("token")
+
+ /**
+ * When the hold should auto-expire
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expirationDatetime(): Optional =
+ expirationDatetime.getOptional("expiration_datetime")
+
+ /**
+ * Reason for the hold
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun memo(): Optional = memo.getOptional("memo")
+
+ /**
+ * User-provided identifier for the hold
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userDefinedId(): Optional = userDefinedId.getOptional("user_defined_id")
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [token].
+ *
+ * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token
+
+ /**
+ * Returns the raw JSON value of [expirationDatetime].
+ *
+ * Unlike [expirationDatetime], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("expiration_datetime")
+ @ExcludeMissing
+ fun _expirationDatetime(): JsonField = expirationDatetime
+
+ /**
+ * Returns the raw JSON value of [memo].
+ *
+ * Unlike [memo], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("memo") @ExcludeMissing fun _memo(): JsonField = memo
+
+ /**
+ * Returns the raw JSON value of [userDefinedId].
+ *
+ * Unlike [userDefinedId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("user_defined_id")
+ @ExcludeMissing
+ fun _userDefinedId(): JsonField = userDefinedId
+
+ @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 [CreateHoldRequest].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CreateHoldRequest]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var token: JsonField = JsonMissing.of()
+ private var expirationDatetime: JsonField = JsonMissing.of()
+ private var memo: JsonField = JsonMissing.of()
+ private var userDefinedId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(createHoldRequest: CreateHoldRequest) = apply {
+ amount = createHoldRequest.amount
+ token = createHoldRequest.token
+ expirationDatetime = createHoldRequest.expirationDatetime
+ memo = createHoldRequest.memo
+ userDefinedId = createHoldRequest.userDefinedId
+ additionalProperties = createHoldRequest.additionalProperties.toMutableMap()
+ }
+
+ /** Amount to hold in cents */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /** Customer-provided token for idempotency. Becomes the hold token. */
+ fun token(token: String) = token(JsonField.of(token))
+
+ /**
+ * Sets [Builder.token] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.token] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun token(token: JsonField) = apply { this.token = token }
+
+ /** When the hold should auto-expire */
+ fun expirationDatetime(expirationDatetime: OffsetDateTime) =
+ expirationDatetime(JsonField.of(expirationDatetime))
+
+ /**
+ * Sets [Builder.expirationDatetime] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expirationDatetime] with a well-typed
+ * [OffsetDateTime] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun expirationDatetime(expirationDatetime: JsonField) = apply {
+ this.expirationDatetime = expirationDatetime
+ }
+
+ /** Reason for the hold */
+ fun memo(memo: String?) = memo(JsonField.ofNullable(memo))
+
+ /** Alias for calling [Builder.memo] with `memo.orElse(null)`. */
+ fun memo(memo: Optional) = memo(memo.getOrNull())
+
+ /**
+ * Sets [Builder.memo] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.memo] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun memo(memo: JsonField) = apply { this.memo = memo }
+
+ /** User-provided identifier for the hold */
+ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId))
+
+ /**
+ * Sets [Builder.userDefinedId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userDefinedId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun userDefinedId(userDefinedId: JsonField) = apply {
+ this.userDefinedId = userDefinedId
+ }
+
+ 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 [CreateHoldRequest].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CreateHoldRequest =
+ CreateHoldRequest(
+ checkRequired("amount", amount),
+ token,
+ expirationDatetime,
+ memo,
+ userDefinedId,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CreateHoldRequest = apply {
+ if (validated) {
+ return@apply
+ }
+
+ amount()
+ token()
+ expirationDatetime()
+ memo()
+ userDefinedId()
+ 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 (amount.asKnown().isPresent) 1 else 0) +
+ (if (token.asKnown().isPresent) 1 else 0) +
+ (if (expirationDatetime.asKnown().isPresent) 1 else 0) +
+ (if (memo.asKnown().isPresent) 1 else 0) +
+ (if (userDefinedId.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CreateHoldRequest &&
+ amount == other.amount &&
+ token == other.token &&
+ expirationDatetime == other.expirationDatetime &&
+ memo == other.memo &&
+ userDefinedId == other.userDefinedId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ amount,
+ token,
+ expirationDatetime,
+ memo,
+ userDefinedId,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CreateHoldRequest{amount=$amount, token=$token, expirationDatetime=$expirationDatetime, memo=$memo, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is HoldCreateParams &&
+ financialAccountToken == other.financialAccountToken &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(financialAccountToken, body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "HoldCreateParams{financialAccountToken=$financialAccountToken, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt
new file mode 100644
index 00000000..0c877899
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/HoldEvent.kt
@@ -0,0 +1,892 @@
+// 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.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.checkKnown
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+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
+
+/** Event representing a lifecycle change to a hold */
+class HoldEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val amount: JsonField,
+ private val created: JsonField,
+ private val detailedResults: JsonField>,
+ private val memo: JsonField,
+ private val result: JsonField,
+ private val settlingTransactionToken: JsonField,
+ private val type: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("detailed_results")
+ @ExcludeMissing
+ detailedResults: JsonField> = JsonMissing.of(),
+ @JsonProperty("memo") @ExcludeMissing memo: JsonField = JsonMissing.of(),
+ @JsonProperty("result")
+ @ExcludeMissing
+ result: JsonField = JsonMissing.of(),
+ @JsonProperty("settling_transaction_token")
+ @ExcludeMissing
+ settlingTransactionToken: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ amount,
+ created,
+ detailedResults,
+ memo,
+ result,
+ settlingTransactionToken,
+ type,
+ mutableMapOf(),
+ )
+
+ /**
+ * @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 token(): String = token.getRequired("token")
+
+ /**
+ * Amount in cents
+ *
+ * @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 amount(): Long = amount.getRequired("amount")
+
+ /**
+ * @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")
+
+ /**
+ * @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 detailedResults(): List = detailedResults.getRequired("detailed_results")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun memo(): Optional = memo.getOptional("memo")
+
+ /**
+ * @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 result(): TransactionResult = result.getRequired("result")
+
+ /**
+ * Transaction token of the payment that settled this hold (only populated for HOLD_SETTLED
+ * events)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun settlingTransactionToken(): Optional