diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b4da64f27..4a1242df8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.132.0" + ".": "0.133.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a57158191..fa1ea91c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 214 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-59c09c7355b21b663e001d2ee1086ebd0a70d9b5433823282bca296eedff9eb0.yml -openapi_spec_hash: d9c3b932c810809abc6e973d662ad376 -config_hash: 337a99d8cc30006358b7bc2531401669 +configured_endpoints: 215 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-113e179e6007c80abd835ff26bfdce4dd24beee5174678687431cb672ce06be8.yml +openapi_spec_hash: 0f42308e15d062d48e3d4857c39ac749 +config_hash: f6d04d790aaddf639fc04b7f0092e7ec diff --git a/CHANGELOG.md b/CHANGELOG.md index e62e0e027..2bdd045bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## 0.133.0 (2026-08-14) + +Full Changelog: [v0.132.0...v0.133.0](https://github.com/lithic-com/lithic-java/compare/v0.132.0...v0.133.0) + +### Features + +* **api:** add blockchain_addresses field to FinancialAccount and webhook events ([3ac1807](https://github.com/lithic-com/lithic-java/commit/3ac18071466c0d8e43570f4cdf878ec1a506a40c)) +* **api:** add blockchain_recipients create endpoint ([0188b4a](https://github.com/lithic-com/lithic-java/commit/0188b4ae0bc6b0df2b453cca67ddd0a1cd37c47d)) +* **api:** add claimToken field to disputes/webhooks, claim filter, write_off_reversed action ([6c4513a](https://github.com/lithic-com/lithic-java/commit/6c4513ac0ce50e18378690069181fa6e865f3808)) +* **api:** add limitCashAmount/limitCashCount fields to VelocityLimitParams ([9507834](https://github.com/lithic-com/lithic-java/commit/9507834f2c34614684d100e960b40a1dca2ce9c5)) +* **api:** add PROGRAM scope to AchPayment/CardTransaction, entity types to Case ([cd6e1c3](https://github.com/lithic-com/lithic-java/commit/cd6e1c3244d56d6c37ea9806d4de572a19ca5244)) +* **api:** add stablecoin event types to FinancialEvent/Payment/StatementLineItems ([46fa6f1](https://github.com/lithic-com/lithic-java/commit/46fa6f1495cab9c378cf03932090cb6710fff7ed)) +* **api:** add STABLECOIN method to Payment and related responses ([5c383bd](https://github.com/lithic-com/lithic-java/commit/5c383bd94b665fc89aa5d1bc1dbe298329a8cc57)) +* **api:** Add STABLECOIN to approvals request and transfer type enums ([3b3dd7a](https://github.com/lithic-com/lithic-java/commit/3b3dd7ae05e57fd7d4112db5dab1a752cdacbe72)) + + +### Bug Fixes + +* **docs:** link the javadoc badge so the version stays current after release ([d886c69](https://github.com/lithic-com/lithic-java/commit/d886c69a4a93db7f6ebe88a914cacd67fa942b50)) +* **types:** make methodAttributes optional in Payment models, add STABLECOIN method ([6af3f53](https://github.com/lithic-com/lithic-java/commit/6af3f53be4b1d6ee4181049af0e232d011a975db)) + + +### Chores + +* **internal:** codegen related update ([39e4623](https://github.com/lithic-com/lithic-java/commit/39e4623d63b58bc9f048cc6a2592e657cf1706b8)) + + +### Documentation + +* **api:** update CVV field descriptions to note AMEX uses 4 digits ([2892515](https://github.com/lithic-com/lithic-java/commit/28925154b2b09da8cfc8e8a01d38886698df0156)) + ## 0.132.0 (2026-08-03) Full Changelog: [v0.131.0...v0.132.0](https://github.com/lithic-com/lithic-java/compare/v0.131.0...v0.132.0) diff --git a/README.md b/README.md index e0cf94193..6843416bd 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.132.0) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.132.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.132.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.133.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.133.0) @@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.132.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.133.0). @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.132.0") +implementation("com.lithic.api:lithic-java:0.133.0") ``` ### Maven @@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.132.0") com.lithic.api lithic-java - 0.132.0 + 0.133.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 3f9804eaf..9d85f0e19 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.132.0" // x-release-please-version + version = "0.133.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 18a13ed98..c05b467c4 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 @@ -14,6 +14,7 @@ import com.lithic.api.services.blocking.AccountService import com.lithic.api.services.blocking.AuthRuleService import com.lithic.api.services.blocking.AuthStreamEnrollmentService import com.lithic.api.services.blocking.BalanceService +import com.lithic.api.services.blocking.BlockchainRecipientService import com.lithic.api.services.blocking.BookTransferService import com.lithic.api.services.blocking.CardAuthorizationService import com.lithic.api.services.blocking.CardBulkOrderService @@ -120,6 +121,8 @@ interface LithicClient { fun externalBankAccounts(): ExternalBankAccountService + fun blockchainRecipients(): BlockchainRecipientService + fun payments(): PaymentService fun threeDS(): ThreeDSService @@ -232,6 +235,8 @@ interface LithicClient { fun externalBankAccounts(): ExternalBankAccountService.WithRawResponse + fun blockchainRecipients(): BlockchainRecipientService.WithRawResponse + fun payments(): PaymentService.WithRawResponse fun threeDS(): ThreeDSService.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 73317d5c8..00d01ba85 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 @@ -13,6 +13,7 @@ import com.lithic.api.services.async.AccountServiceAsync import com.lithic.api.services.async.AuthRuleServiceAsync import com.lithic.api.services.async.AuthStreamEnrollmentServiceAsync import com.lithic.api.services.async.BalanceServiceAsync +import com.lithic.api.services.async.BlockchainRecipientServiceAsync import com.lithic.api.services.async.BookTransferServiceAsync import com.lithic.api.services.async.CardAuthorizationServiceAsync import com.lithic.api.services.async.CardBulkOrderServiceAsync @@ -120,6 +121,8 @@ interface LithicClientAsync { fun externalBankAccounts(): ExternalBankAccountServiceAsync + fun blockchainRecipients(): BlockchainRecipientServiceAsync + fun payments(): PaymentServiceAsync fun threeDS(): ThreeDSServiceAsync @@ -235,6 +238,8 @@ interface LithicClientAsync { fun externalBankAccounts(): ExternalBankAccountServiceAsync.WithRawResponse + fun blockchainRecipients(): BlockchainRecipientServiceAsync.WithRawResponse + fun payments(): PaymentServiceAsync.WithRawResponse fun threeDS(): ThreeDSServiceAsync.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 52e8a4e5c..3078c82cf 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 @@ -29,6 +29,8 @@ import com.lithic.api.services.async.AuthStreamEnrollmentServiceAsync import com.lithic.api.services.async.AuthStreamEnrollmentServiceAsyncImpl import com.lithic.api.services.async.BalanceServiceAsync import com.lithic.api.services.async.BalanceServiceAsyncImpl +import com.lithic.api.services.async.BlockchainRecipientServiceAsync +import com.lithic.api.services.async.BlockchainRecipientServiceAsyncImpl import com.lithic.api.services.async.BookTransferServiceAsync import com.lithic.api.services.async.BookTransferServiceAsyncImpl import com.lithic.api.services.async.CardAuthorizationServiceAsync @@ -183,6 +185,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl ExternalBankAccountServiceAsyncImpl(clientOptionsWithUserAgent) } + private val blockchainRecipients: BlockchainRecipientServiceAsync by lazy { + BlockchainRecipientServiceAsyncImpl(clientOptionsWithUserAgent) + } + private val payments: PaymentServiceAsync by lazy { PaymentServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -295,6 +301,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun externalBankAccounts(): ExternalBankAccountServiceAsync = externalBankAccounts + override fun blockchainRecipients(): BlockchainRecipientServiceAsync = blockchainRecipients + override fun payments(): PaymentServiceAsync = payments override fun threeDS(): ThreeDSServiceAsync = threeDS @@ -422,6 +430,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl ExternalBankAccountServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val blockchainRecipients: BlockchainRecipientServiceAsync.WithRawResponse by lazy { + BlockchainRecipientServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val payments: PaymentServiceAsync.WithRawResponse by lazy { PaymentServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -542,6 +554,9 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun externalBankAccounts(): ExternalBankAccountServiceAsync.WithRawResponse = externalBankAccounts + override fun blockchainRecipients(): BlockchainRecipientServiceAsync.WithRawResponse = + blockchainRecipients + override fun payments(): PaymentServiceAsync.WithRawResponse = payments override fun threeDS(): ThreeDSServiceAsync.WithRawResponse = threeDS 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 bb2ee7ddd..bacca4e62 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 @@ -29,6 +29,8 @@ import com.lithic.api.services.blocking.AuthStreamEnrollmentService import com.lithic.api.services.blocking.AuthStreamEnrollmentServiceImpl import com.lithic.api.services.blocking.BalanceService import com.lithic.api.services.blocking.BalanceServiceImpl +import com.lithic.api.services.blocking.BlockchainRecipientService +import com.lithic.api.services.blocking.BlockchainRecipientServiceImpl import com.lithic.api.services.blocking.BookTransferService import com.lithic.api.services.blocking.BookTransferServiceImpl import com.lithic.api.services.blocking.CardAuthorizationService @@ -174,6 +176,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient ExternalBankAccountServiceImpl(clientOptionsWithUserAgent) } + private val blockchainRecipients: BlockchainRecipientService by lazy { + BlockchainRecipientServiceImpl(clientOptionsWithUserAgent) + } + private val payments: PaymentService by lazy { PaymentServiceImpl(clientOptionsWithUserAgent) } private val threeDS: ThreeDSService by lazy { ThreeDSServiceImpl(clientOptionsWithUserAgent) } @@ -275,6 +281,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun externalBankAccounts(): ExternalBankAccountService = externalBankAccounts + override fun blockchainRecipients(): BlockchainRecipientService = blockchainRecipients + override fun payments(): PaymentService = payments override fun threeDS(): ThreeDSService = threeDS @@ -401,6 +409,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient ExternalBankAccountServiceImpl.WithRawResponseImpl(clientOptions) } + private val blockchainRecipients: BlockchainRecipientService.WithRawResponse by lazy { + BlockchainRecipientServiceImpl.WithRawResponseImpl(clientOptions) + } + private val payments: PaymentService.WithRawResponse by lazy { PaymentServiceImpl.WithRawResponseImpl(clientOptions) } @@ -521,6 +533,9 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun externalBankAccounts(): ExternalBankAccountService.WithRawResponse = externalBankAccounts + override fun blockchainRecipients(): BlockchainRecipientService.WithRawResponse = + blockchainRecipients + override fun payments(): PaymentService.WithRawResponse = payments override fun threeDS(): ThreeDSService.WithRawResponse = threeDS diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AchPaymentUpdateAction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AchPaymentUpdateAction.kt index c4a6a5e6c..70e3bc0f3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AchPaymentUpdateAction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AchPaymentUpdateAction.kt @@ -862,12 +862,15 @@ private constructor( @JvmField val FINANCIAL_ACCOUNT = of("FINANCIAL_ACCOUNT") + @JvmField val PROGRAM = of("PROGRAM") + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) } /** An enum containing [Scope]'s known values. */ enum class Known { - FINANCIAL_ACCOUNT + FINANCIAL_ACCOUNT, + PROGRAM, } /** @@ -881,6 +884,7 @@ private constructor( */ enum class Value { FINANCIAL_ACCOUNT, + PROGRAM, /** * An enum member indicating that [Scope] was instantiated with an unknown value. */ @@ -897,6 +901,7 @@ private constructor( fun value(): Value = when (this) { FINANCIAL_ACCOUNT -> Value.FINANCIAL_ACCOUNT + PROGRAM -> Value.PROGRAM else -> Value._UNKNOWN } @@ -912,6 +917,7 @@ private constructor( fun known(): Known = when (this) { FINANCIAL_ACCOUNT -> Known.FINANCIAL_ACCOUNT + PROGRAM -> Known.PROGRAM else -> throw LithicInvalidDataException("Unknown Scope: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipient.kt new file mode 100644 index 000000000..d6b6ffc82 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipient.kt @@ -0,0 +1,990 @@ +// 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.checkRequired +import com.lithic.api.errors.LithicInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class BlockchainRecipient +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val token: JsonField, + private val accountToken: JsonField, + private val addressTag: JsonField, + private val chain: JsonField, + private val created: JsonField, + private val externalId: JsonField, + private val name: JsonField, + private val owner: JsonField, + private val ownerType: JsonField, + private val programId: JsonField, + private val state: JsonField, + private val updated: JsonField, + private val verificationState: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(), + @JsonProperty("account_token") + @ExcludeMissing + accountToken: JsonField = JsonMissing.of(), + @JsonProperty("address_tag") + @ExcludeMissing + addressTag: JsonField = JsonMissing.of(), + @JsonProperty("chain") @ExcludeMissing chain: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + created: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("owner") @ExcludeMissing owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + ownerType: JsonField = JsonMissing.of(), + @JsonProperty("program_id") @ExcludeMissing programId: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("updated") + @ExcludeMissing + updated: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") + @ExcludeMissing + verificationState: JsonField = JsonMissing.of(), + ) : this( + token, + accountToken, + addressTag, + chain, + created, + externalId, + name, + owner, + ownerType, + programId, + state, + updated, + verificationState, + mutableMapOf(), + ) + + /** + * A globally unique identifier for this blockchain recipient + * + * @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") + + /** + * The financial account the blockchain recipient belongs to + * + * @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 accountToken(): String = accountToken.getRequired("account_token") + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer within + * a shared address + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun addressTag(): Optional = addressTag.getOptional("address_tag") + + /** + * The blockchain network that the address belongs to + * + * @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 chain(): String = chain.getRequired("chain") + + /** + * An ISO 8601 string representing when this blockchain recipient 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") + + /** + * The identifier the recipient is registered under with the payment provider + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + + /** + * The nickname for this blockchain recipient + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Legal name of the business or individual who owns the blockchain address + * + * @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 owner(): String = owner.getRequired("owner") + + /** + * Owner Type + * + * @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 ownerType(): OwnerType = ownerType.getRequired("owner_type") + + /** + * Globally unique identifier for the program the blockchain recipient is associated with + * + * @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 programId(): String = programId.getRequired("program_id") + + /** + * Account State + * + * @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") + + /** + * An ISO 8601 string representing when this blockchain recipient 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") + + /** + * Verification State + * + * @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 verificationState(): VerificationState = verificationState.getRequired("verification_state") + + /** + * 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 [accountToken]. + * + * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_token") + @ExcludeMissing + fun _accountToken(): JsonField = accountToken + + /** + * Returns the raw JSON value of [addressTag]. + * + * Unlike [addressTag], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address_tag") @ExcludeMissing fun _addressTag(): JsonField = addressTag + + /** + * Returns the raw JSON value of [chain]. + * + * Unlike [chain], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("chain") @ExcludeMissing fun _chain(): JsonField = chain + + /** + * 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 [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId(): JsonField = externalId + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [owner]. + * + * Unlike [owner], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("owner") @ExcludeMissing fun _owner(): JsonField = owner + + /** + * Returns the raw JSON value of [ownerType]. + * + * Unlike [ownerType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType(): JsonField = ownerType + + /** + * Returns the raw JSON value of [programId]. + * + * Unlike [programId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("program_id") @ExcludeMissing fun _programId(): JsonField = programId + + /** + * 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 [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 [verificationState]. + * + * Unlike [verificationState], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("verification_state") + @ExcludeMissing + fun _verificationState(): JsonField = verificationState + + @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 [BlockchainRecipient]. + * + * The following fields are required: + * ```java + * .token() + * .accountToken() + * .addressTag() + * .chain() + * .created() + * .externalId() + * .name() + * .owner() + * .ownerType() + * .programId() + * .state() + * .updated() + * .verificationState() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainRecipient]. */ + class Builder internal constructor() { + + private var token: JsonField? = null + private var accountToken: JsonField? = null + private var addressTag: JsonField? = null + private var chain: JsonField? = null + private var created: JsonField? = null + private var externalId: JsonField? = null + private var name: JsonField? = null + private var owner: JsonField? = null + private var ownerType: JsonField? = null + private var programId: JsonField? = null + private var state: JsonField? = null + private var updated: JsonField? = null + private var verificationState: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(blockchainRecipient: BlockchainRecipient) = apply { + token = blockchainRecipient.token + accountToken = blockchainRecipient.accountToken + addressTag = blockchainRecipient.addressTag + chain = blockchainRecipient.chain + created = blockchainRecipient.created + externalId = blockchainRecipient.externalId + name = blockchainRecipient.name + owner = blockchainRecipient.owner + ownerType = blockchainRecipient.ownerType + programId = blockchainRecipient.programId + state = blockchainRecipient.state + updated = blockchainRecipient.updated + verificationState = blockchainRecipient.verificationState + additionalProperties = blockchainRecipient.additionalProperties.toMutableMap() + } + + /** A globally unique identifier for this blockchain recipient */ + 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 } + + /** The financial account the blockchain recipient belongs to */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Sets [Builder.accountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.accountToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer + * within a shared address + */ + fun addressTag(addressTag: String?) = addressTag(JsonField.ofNullable(addressTag)) + + /** Alias for calling [Builder.addressTag] with `addressTag.orElse(null)`. */ + fun addressTag(addressTag: Optional) = addressTag(addressTag.getOrNull()) + + /** + * Sets [Builder.addressTag] to an arbitrary JSON value. + * + * You should usually call [Builder.addressTag] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun addressTag(addressTag: JsonField) = apply { this.addressTag = addressTag } + + /** The blockchain network that the address belongs to */ + fun chain(chain: String) = chain(JsonField.of(chain)) + + /** + * Sets [Builder.chain] to an arbitrary JSON value. + * + * You should usually call [Builder.chain] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun chain(chain: JsonField) = apply { this.chain = chain } + + /** An ISO 8601 string representing when this blockchain recipient 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 } + + /** The identifier the recipient is registered under with the payment provider */ + fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + + /** The nickname for this blockchain recipient */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Legal name of the business or individual who owns the blockchain address */ + fun owner(owner: String) = owner(JsonField.of(owner)) + + /** + * Sets [Builder.owner] to an arbitrary JSON value. + * + * You should usually call [Builder.owner] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun owner(owner: JsonField) = apply { this.owner = owner } + + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** + * Sets [Builder.ownerType] to an arbitrary JSON value. + * + * You should usually call [Builder.ownerType] with a well-typed [OwnerType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + + /** + * Globally unique identifier for the program the blockchain recipient is associated with + */ + fun programId(programId: String) = programId(JsonField.of(programId)) + + /** + * Sets [Builder.programId] to an arbitrary JSON value. + * + * You should usually call [Builder.programId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun programId(programId: JsonField) = apply { this.programId = programId } + + /** Account State */ + 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 } + + /** An ISO 8601 string representing when this blockchain recipient 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 } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** + * Sets [Builder.verificationState] to an arbitrary JSON value. + * + * You should usually call [Builder.verificationState] with a well-typed [VerificationState] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } + + 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 [BlockchainRecipient]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .token() + * .accountToken() + * .addressTag() + * .chain() + * .created() + * .externalId() + * .name() + * .owner() + * .ownerType() + * .programId() + * .state() + * .updated() + * .verificationState() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BlockchainRecipient = + BlockchainRecipient( + checkRequired("token", token), + checkRequired("accountToken", accountToken), + checkRequired("addressTag", addressTag), + checkRequired("chain", chain), + checkRequired("created", created), + checkRequired("externalId", externalId), + checkRequired("name", name), + checkRequired("owner", owner), + checkRequired("ownerType", ownerType), + checkRequired("programId", programId), + checkRequired("state", state), + checkRequired("updated", updated), + checkRequired("verificationState", verificationState), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): BlockchainRecipient = apply { + if (validated) { + return@apply + } + + token() + accountToken() + addressTag() + chain() + created() + externalId() + name() + owner() + ownerType().validate() + programId() + state().validate() + updated() + verificationState().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (token.asKnown().isPresent) 1 else 0) + + (if (accountToken.asKnown().isPresent) 1 else 0) + + (if (addressTag.asKnown().isPresent) 1 else 0) + + (if (chain.asKnown().isPresent) 1 else 0) + + (if (created.asKnown().isPresent) 1 else 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (owner.asKnown().isPresent) 1 else 0) + + (ownerType.asKnown().getOrNull()?.validity() ?: 0) + + (if (programId.asKnown().isPresent) 1 else 0) + + (state.asKnown().getOrNull()?.validity() ?: 0) + + (if (updated.asKnown().isPresent) 1 else 0) + + (verificationState.asKnown().getOrNull()?.validity() ?: 0) + + /** Account State */ + 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 ENABLED = of("ENABLED") + + @JvmField val CLOSED = of("CLOSED") + + @JvmField val PAUSED = of("PAUSED") + + @JvmStatic fun of(value: String) = State(JsonField.of(value)) + } + + /** An enum containing [State]'s known values. */ + enum class Known { + ENABLED, + CLOSED, + PAUSED, + } + + /** + * 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 { + ENABLED, + CLOSED, + PAUSED, + /** 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) { + ENABLED -> Value.ENABLED + CLOSED -> Value.CLOSED + PAUSED -> Value.PAUSED + 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) { + ENABLED -> Known.ENABLED + CLOSED -> Known.CLOSED + PAUSED -> Known.PAUSED + 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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + 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() + } + + /** Verification State */ + class VerificationState @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 ENABLED = of("ENABLED") + + @JvmField val FAILED_VERIFICATION = of("FAILED_VERIFICATION") + + @JvmField val INSUFFICIENT_FUNDS = of("INSUFFICIENT_FUNDS") + + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) + } + + /** An enum containing [VerificationState]'s known values. */ + enum class Known { + PENDING, + ENABLED, + FAILED_VERIFICATION, + INSUFFICIENT_FUNDS, + } + + /** + * An enum containing [VerificationState]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [VerificationState] 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, + ENABLED, + FAILED_VERIFICATION, + INSUFFICIENT_FUNDS, + /** + * An enum member indicating that [VerificationState] 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 + ENABLED -> Value.ENABLED + FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + 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 + ENABLED -> Known.ENABLED + FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + else -> throw LithicInvalidDataException("Unknown VerificationState: $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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): VerificationState = 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 VerificationState && 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 BlockchainRecipient && + token == other.token && + accountToken == other.accountToken && + addressTag == other.addressTag && + chain == other.chain && + created == other.created && + externalId == other.externalId && + name == other.name && + owner == other.owner && + ownerType == other.ownerType && + programId == other.programId && + state == other.state && + updated == other.updated && + verificationState == other.verificationState && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + token, + accountToken, + addressTag, + chain, + created, + externalId, + name, + owner, + ownerType, + programId, + state, + updated, + verificationState, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "BlockchainRecipient{token=$token, accountToken=$accountToken, addressTag=$addressTag, chain=$chain, created=$created, externalId=$externalId, name=$name, owner=$owner, ownerType=$ownerType, programId=$programId, state=$state, updated=$updated, verificationState=$verificationState, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientCreateParams.kt new file mode 100644 index 000000000..15353521d --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientCreateParams.kt @@ -0,0 +1,869 @@ +// 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.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Register a blockchain address as a withdrawal destination for a financial account + * + * The recipient is created with a `PENDING` verification state and cannot receive a payout until + * screening of the address completes. Registering an address that is already registered to the same + * financial account returns the existing recipient and its current verification state, rather than + * creating a second one + */ +class BlockchainRecipientCreateParams +private constructor( + private val body: BlockchainRecipientRequest, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The financial account the blockchain recipient belongs to + * + * @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 accountToken(): String = body.accountToken() + + /** + * The blockchain address funds will be withdrawn to + * + * @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 address(): String = body.address() + + /** + * The blockchain network that the address belongs to + * + * @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 chain(): String = body.chain() + + /** + * Legal name of the business or individual who owns the blockchain address + * + * @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 owner(): String = body.owner() + + /** + * Owner Type + * + * @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 ownerType(): OwnerType = body.ownerType() + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer within + * a shared address + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun addressTag(): Optional = body.addressTag() + + /** + * The nickname for this blockchain recipient + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = body.name() + + /** + * Returns the raw JSON value of [accountToken]. + * + * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountToken(): JsonField = body._accountToken() + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _address(): JsonField = body._address() + + /** + * Returns the raw JSON value of [chain]. + * + * Unlike [chain], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _chain(): JsonField = body._chain() + + /** + * Returns the raw JSON value of [owner]. + * + * Unlike [owner], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _owner(): JsonField = body._owner() + + /** + * Returns the raw JSON value of [ownerType]. + * + * Unlike [ownerType], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _ownerType(): JsonField = body._ownerType() + + /** + * Returns the raw JSON value of [addressTag]. + * + * Unlike [addressTag], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _addressTag(): JsonField = body._addressTag() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + 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 + * [BlockchainRecipientCreateParams]. + * + * The following fields are required: + * ```java + * .accountToken() + * .address() + * .chain() + * .owner() + * .ownerType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainRecipientCreateParams]. */ + class Builder internal constructor() { + + private var body: BlockchainRecipientRequest.Builder = BlockchainRecipientRequest.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(blockchainRecipientCreateParams: BlockchainRecipientCreateParams) = + apply { + body = blockchainRecipientCreateParams.body.toBuilder() + additionalHeaders = blockchainRecipientCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = + blockchainRecipientCreateParams.additionalQueryParams.toBuilder() + } + + /** + * 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: + * - [accountToken] + * - [address] + * - [chain] + * - [owner] + * - [ownerType] + * - etc. + */ + fun body(body: BlockchainRecipientRequest) = apply { this.body = body.toBuilder() } + + /** The financial account the blockchain recipient belongs to */ + fun accountToken(accountToken: String) = apply { body.accountToken(accountToken) } + + /** + * Sets [Builder.accountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.accountToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountToken(accountToken: JsonField) = apply { + body.accountToken(accountToken) + } + + /** The blockchain address funds will be withdrawn to */ + fun address(address: String) = apply { body.address(address) } + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun address(address: JsonField) = apply { body.address(address) } + + /** The blockchain network that the address belongs to */ + fun chain(chain: String) = apply { body.chain(chain) } + + /** + * Sets [Builder.chain] to an arbitrary JSON value. + * + * You should usually call [Builder.chain] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun chain(chain: JsonField) = apply { body.chain(chain) } + + /** Legal name of the business or individual who owns the blockchain address */ + fun owner(owner: String) = apply { body.owner(owner) } + + /** + * Sets [Builder.owner] to an arbitrary JSON value. + * + * You should usually call [Builder.owner] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun owner(owner: JsonField) = apply { body.owner(owner) } + + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = apply { body.ownerType(ownerType) } + + /** + * Sets [Builder.ownerType] to an arbitrary JSON value. + * + * You should usually call [Builder.ownerType] with a well-typed [OwnerType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun ownerType(ownerType: JsonField) = apply { body.ownerType(ownerType) } + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer + * within a shared address + */ + fun addressTag(addressTag: String) = apply { body.addressTag(addressTag) } + + /** + * Sets [Builder.addressTag] to an arbitrary JSON value. + * + * You should usually call [Builder.addressTag] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun addressTag(addressTag: JsonField) = apply { body.addressTag(addressTag) } + + /** The nickname for this blockchain recipient */ + fun name(name: String) = apply { body.name(name) } + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + 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 [BlockchainRecipientCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountToken() + * .address() + * .chain() + * .owner() + * .ownerType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BlockchainRecipientCreateParams = + BlockchainRecipientCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): BlockchainRecipientRequest = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class BlockchainRecipientRequest + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val accountToken: JsonField, + private val address: JsonField, + private val chain: JsonField, + private val owner: JsonField, + private val ownerType: JsonField, + private val addressTag: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("account_token") + @ExcludeMissing + accountToken: JsonField = JsonMissing.of(), + @JsonProperty("address") @ExcludeMissing address: JsonField = JsonMissing.of(), + @JsonProperty("chain") @ExcludeMissing chain: JsonField = JsonMissing.of(), + @JsonProperty("owner") @ExcludeMissing owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + ownerType: JsonField = JsonMissing.of(), + @JsonProperty("address_tag") + @ExcludeMissing + addressTag: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(accountToken, address, chain, owner, ownerType, addressTag, name, mutableMapOf()) + + /** + * The financial account the blockchain recipient belongs to + * + * @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 accountToken(): String = accountToken.getRequired("account_token") + + /** + * The blockchain address funds will be withdrawn to + * + * @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 address(): String = address.getRequired("address") + + /** + * The blockchain network that the address belongs to + * + * @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 chain(): String = chain.getRequired("chain") + + /** + * Legal name of the business or individual who owns the blockchain address + * + * @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 owner(): String = owner.getRequired("owner") + + /** + * Owner Type + * + * @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 ownerType(): OwnerType = ownerType.getRequired("owner_type") + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer + * within a shared address + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun addressTag(): Optional = addressTag.getOptional("address_tag") + + /** + * The nickname for this blockchain recipient + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Returns the raw JSON value of [accountToken]. + * + * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("account_token") + @ExcludeMissing + fun _accountToken(): JsonField = accountToken + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField = address + + /** + * Returns the raw JSON value of [chain]. + * + * Unlike [chain], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("chain") @ExcludeMissing fun _chain(): JsonField = chain + + /** + * Returns the raw JSON value of [owner]. + * + * Unlike [owner], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("owner") @ExcludeMissing fun _owner(): JsonField = owner + + /** + * Returns the raw JSON value of [ownerType]. + * + * Unlike [ownerType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("owner_type") + @ExcludeMissing + fun _ownerType(): JsonField = ownerType + + /** + * Returns the raw JSON value of [addressTag]. + * + * Unlike [addressTag], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address_tag") + @ExcludeMissing + fun _addressTag(): JsonField = addressTag + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @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 + * [BlockchainRecipientRequest]. + * + * The following fields are required: + * ```java + * .accountToken() + * .address() + * .chain() + * .owner() + * .ownerType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainRecipientRequest]. */ + class Builder internal constructor() { + + private var accountToken: JsonField? = null + private var address: JsonField? = null + private var chain: JsonField? = null + private var owner: JsonField? = null + private var ownerType: JsonField? = null + private var addressTag: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(blockchainRecipientRequest: BlockchainRecipientRequest) = apply { + accountToken = blockchainRecipientRequest.accountToken + address = blockchainRecipientRequest.address + chain = blockchainRecipientRequest.chain + owner = blockchainRecipientRequest.owner + ownerType = blockchainRecipientRequest.ownerType + addressTag = blockchainRecipientRequest.addressTag + name = blockchainRecipientRequest.name + additionalProperties = + blockchainRecipientRequest.additionalProperties.toMutableMap() + } + + /** The financial account the blockchain recipient belongs to */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Sets [Builder.accountToken] to an arbitrary JSON value. + * + * You should usually call [Builder.accountToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** The blockchain address funds will be withdrawn to */ + fun address(address: String) = address(JsonField.of(address)) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField) = apply { this.address = address } + + /** The blockchain network that the address belongs to */ + fun chain(chain: String) = chain(JsonField.of(chain)) + + /** + * Sets [Builder.chain] to an arbitrary JSON value. + * + * You should usually call [Builder.chain] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun chain(chain: JsonField) = apply { this.chain = chain } + + /** Legal name of the business or individual who owns the blockchain address */ + fun owner(owner: String) = owner(JsonField.of(owner)) + + /** + * Sets [Builder.owner] to an arbitrary JSON value. + * + * You should usually call [Builder.owner] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun owner(owner: JsonField) = apply { this.owner = owner } + + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** + * Sets [Builder.ownerType] to an arbitrary JSON value. + * + * You should usually call [Builder.ownerType] with a well-typed [OwnerType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + + /** + * An optional tag or memo used by some chains to identify the destination of a transfer + * within a shared address + */ + fun addressTag(addressTag: String) = addressTag(JsonField.of(addressTag)) + + /** + * Sets [Builder.addressTag] to an arbitrary JSON value. + * + * You should usually call [Builder.addressTag] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun addressTag(addressTag: JsonField) = apply { this.addressTag = addressTag } + + /** The nickname for this blockchain recipient */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + 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 [BlockchainRecipientRequest]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountToken() + * .address() + * .chain() + * .owner() + * .ownerType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BlockchainRecipientRequest = + BlockchainRecipientRequest( + checkRequired("accountToken", accountToken), + checkRequired("address", address), + checkRequired("chain", chain), + checkRequired("owner", owner), + checkRequired("ownerType", ownerType), + addressTag, + name, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): BlockchainRecipientRequest = apply { + if (validated) { + return@apply + } + + accountToken() + address() + chain() + owner() + ownerType().validate() + addressTag() + name() + 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 (accountToken.asKnown().isPresent) 1 else 0) + + (if (address.asKnown().isPresent) 1 else 0) + + (if (chain.asKnown().isPresent) 1 else 0) + + (if (owner.asKnown().isPresent) 1 else 0) + + (ownerType.asKnown().getOrNull()?.validity() ?: 0) + + (if (addressTag.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BlockchainRecipientRequest && + accountToken == other.accountToken && + address == other.address && + chain == other.chain && + owner == other.owner && + ownerType == other.ownerType && + addressTag == other.addressTag && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountToken, + address, + chain, + owner, + ownerType, + addressTag, + name, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "BlockchainRecipientRequest{accountToken=$accountToken, address=$address, chain=$chain, owner=$owner, ownerType=$ownerType, addressTag=$addressTag, name=$name, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BlockchainRecipientCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "BlockchainRecipientCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt index 3a5dc5710..86cb54599 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt @@ -434,7 +434,7 @@ private constructor( fun substatus(): Optional = substatus.getOptional("substatus") /** - * Three digit cvv printed on the back of the card. + * Three or four digit CVV printed on the card. Amex cards use four digit CVVs * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1241,7 +1241,7 @@ private constructor( this.substatus = substatus } - /** Three digit cvv printed on the back of the card. */ + /** Three or four digit CVV printed on the card. Amex cards use four digit CVVs */ fun cvv(cvv: String) = cvv(JsonField.of(cvv)) /** diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt index 52b12b4bc..e165eba49 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardTransactionUpdateAction.kt @@ -866,6 +866,8 @@ private constructor( @JvmField val ACCOUNT = of("ACCOUNT") + @JvmField val PROGRAM = of("PROGRAM") + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) } @@ -873,6 +875,7 @@ private constructor( enum class Known { CARD, ACCOUNT, + PROGRAM, } /** @@ -887,6 +890,7 @@ private constructor( enum class Value { CARD, ACCOUNT, + PROGRAM, /** * An enum member indicating that [Scope] was instantiated with an unknown value. */ @@ -904,6 +908,7 @@ private constructor( when (this) { CARD -> Value.CARD ACCOUNT -> Value.ACCOUNT + PROGRAM -> Value.PROGRAM else -> Value._UNKNOWN } @@ -920,6 +925,7 @@ private constructor( when (this) { CARD -> Known.CARD ACCOUNT -> Known.ACCOUNT + PROGRAM -> Known.PROGRAM else -> throw LithicInvalidDataException("Unknown Scope: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CaseEntity.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CaseEntity.kt index 62944dff2..b04662a78 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CaseEntity.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CaseEntity.kt @@ -15,6 +15,7 @@ import com.lithic.api.core.checkRequired import com.lithic.api.errors.LithicInvalidDataException import java.util.Collections import java.util.Objects +import java.util.Optional import kotlin.jvm.optionals.getOrNull /** The entity a case is associated with */ @@ -37,17 +38,21 @@ private constructor( ) : this(entityToken, entityType, mutableMapOf()) /** - * Globally unique identifier for the associated entity + * Globally unique identifier for the associated entity: the card token for `CARD`, the account + * token for `ACCOUNT`, and the financial account token for `FINANCIAL_ACCOUNT`. Null for + * `PROGRAM`, which is not scoped to an individual entity * - * @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). + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun entityToken(): String = entityToken.getRequired("entity_token") + fun entityToken(): Optional = entityToken.getOptional("entity_token") /** * The type of entity a case is associated with: * - `CARD` - The case is associated with a card * - `ACCOUNT` - The case is associated with an account + * - `FINANCIAL_ACCOUNT` - The case is associated with a financial account + * - `PROGRAM` - The case is associated with the whole program * * @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). @@ -112,8 +117,15 @@ private constructor( additionalProperties = caseEntity.additionalProperties.toMutableMap() } - /** Globally unique identifier for the associated entity */ - fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) + /** + * Globally unique identifier for the associated entity: the card token for `CARD`, the + * account token for `ACCOUNT`, and the financial account token for `FINANCIAL_ACCOUNT`. + * Null for `PROGRAM`, which is not scoped to an individual entity + */ + fun entityToken(entityToken: String?) = entityToken(JsonField.ofNullable(entityToken)) + + /** Alias for calling [Builder.entityToken] with `entityToken.orElse(null)`. */ + fun entityToken(entityToken: Optional) = entityToken(entityToken.getOrNull()) /** * Sets [Builder.entityToken] to an arbitrary JSON value. @@ -128,6 +140,8 @@ private constructor( * The type of entity a case is associated with: * - `CARD` - The case is associated with a card * - `ACCOUNT` - The case is associated with an account + * - `FINANCIAL_ACCOUNT` - The case is associated with a financial account + * - `PROGRAM` - The case is associated with the whole program */ fun entityType(entityType: EntityType2) = entityType(JsonField.of(entityType)) @@ -222,6 +236,8 @@ private constructor( * The type of entity a case is associated with: * - `CARD` - The case is associated with a card * - `ACCOUNT` - The case is associated with an account + * - `FINANCIAL_ACCOUNT` - The case is associated with a financial account + * - `PROGRAM` - The case is associated with the whole program */ class EntityType2 @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -242,6 +258,10 @@ private constructor( @JvmField val ACCOUNT = of("ACCOUNT") + @JvmField val FINANCIAL_ACCOUNT = of("FINANCIAL_ACCOUNT") + + @JvmField val PROGRAM = of("PROGRAM") + @JvmStatic fun of(value: String) = EntityType2(JsonField.of(value)) } @@ -249,6 +269,8 @@ private constructor( enum class Known { CARD, ACCOUNT, + FINANCIAL_ACCOUNT, + PROGRAM, } /** @@ -263,6 +285,8 @@ private constructor( enum class Value { CARD, ACCOUNT, + FINANCIAL_ACCOUNT, + PROGRAM, /** * An enum member indicating that [EntityType2] was instantiated with an unknown value. */ @@ -280,6 +304,8 @@ private constructor( when (this) { CARD -> Value.CARD ACCOUNT -> Value.ACCOUNT + FINANCIAL_ACCOUNT -> Value.FINANCIAL_ACCOUNT + PROGRAM -> Value.PROGRAM else -> Value._UNKNOWN } @@ -296,6 +322,8 @@ private constructor( when (this) { CARD -> Known.CARD ACCOUNT -> Known.ACCOUNT + FINANCIAL_ACCOUNT -> Known.FINANCIAL_ACCOUNT + PROGRAM -> Known.PROGRAM else -> throw LithicInvalidDataException("Unknown EntityType2: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt index cff15494e..c2df95b12 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEvent.kt @@ -29,6 +29,7 @@ private constructor( private val accountToken: JsonField, private val cardToken: JsonField, private val caseId: JsonField, + private val claimToken: JsonField, private val created: JsonField, private val currency: JsonField, private val disposition: JsonField, @@ -51,6 +52,9 @@ private constructor( accountToken: JsonField = JsonMissing.of(), @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(), @JsonProperty("case_id") @ExcludeMissing caseId: JsonField = JsonMissing.of(), + @JsonProperty("claim_token") + @ExcludeMissing + claimToken: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing created: JsonField = JsonMissing.of(), @@ -85,6 +89,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -105,6 +110,7 @@ private constructor( .accountToken(accountToken) .cardToken(cardToken) .caseId(caseId) + .claimToken(claimToken) .created(created) .currency(currency) .disposition(disposition) @@ -149,6 +155,15 @@ private constructor( */ fun caseId(): Optional = caseId.getOptional("case_id") + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun claimToken(): Optional = claimToken.getOptional("claim_token") + /** * When the dispute was created. * @@ -268,6 +283,13 @@ private constructor( */ @JsonProperty("case_id") @ExcludeMissing fun _caseId(): JsonField = caseId + /** + * Returns the raw JSON value of [claimToken]. + * + * Unlike [claimToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("claim_token") @ExcludeMissing fun _claimToken(): JsonField = claimToken + /** * Returns the raw JSON value of [created]. * @@ -377,6 +399,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -400,6 +423,7 @@ private constructor( private var accountToken: JsonField? = null private var cardToken: JsonField? = null private var caseId: JsonField? = null + private var claimToken: JsonField? = null private var created: JsonField? = null private var currency: JsonField? = null private var disposition: JsonField? = null @@ -421,6 +445,7 @@ private constructor( accountToken = disputeTransactionCreatedWebhookEvent.accountToken cardToken = disputeTransactionCreatedWebhookEvent.cardToken caseId = disputeTransactionCreatedWebhookEvent.caseId + claimToken = disputeTransactionCreatedWebhookEvent.claimToken created = disputeTransactionCreatedWebhookEvent.created currency = disputeTransactionCreatedWebhookEvent.currency disposition = disputeTransactionCreatedWebhookEvent.disposition @@ -487,6 +512,24 @@ private constructor( */ fun caseId(caseId: JsonField) = apply { this.caseId = caseId } + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + */ + fun claimToken(claimToken: String?) = claimToken(JsonField.ofNullable(claimToken)) + + /** Alias for calling [Builder.claimToken] with `claimToken.orElse(null)`. */ + fun claimToken(claimToken: Optional) = claimToken(claimToken.getOrNull()) + + /** + * Sets [Builder.claimToken] to an arbitrary JSON value. + * + * You should usually call [Builder.claimToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun claimToken(claimToken: JsonField) = apply { this.claimToken = claimToken } + /** When the dispute was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -685,6 +728,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -706,6 +750,7 @@ private constructor( checkRequired("accountToken", accountToken), checkRequired("cardToken", cardToken), checkRequired("caseId", caseId), + checkRequired("claimToken", claimToken), checkRequired("created", created), checkRequired("currency", currency), checkRequired("disposition", disposition), @@ -740,6 +785,7 @@ private constructor( accountToken() cardToken() caseId() + claimToken() created() currency() disposition().ifPresent { it.validate() } @@ -773,6 +819,7 @@ private constructor( (if (accountToken.asKnown().isPresent) 1 else 0) + (if (cardToken.asKnown().isPresent) 1 else 0) + (if (caseId.asKnown().isPresent) 1 else 0) + + (if (claimToken.asKnown().isPresent) 1 else 0) + (if (created.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (disposition.asKnown().getOrNull()?.validity() ?: 0) + @@ -926,6 +973,7 @@ private constructor( accountToken == other.accountToken && cardToken == other.cardToken && caseId == other.caseId && + claimToken == other.claimToken && created == other.created && currency == other.currency && disposition == other.disposition && @@ -946,6 +994,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -964,5 +1013,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DisputeTransactionCreatedWebhookEvent{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, eventType=$eventType, additionalProperties=$additionalProperties}" + "DisputeTransactionCreatedWebhookEvent{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, claimToken=$claimToken, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt index bd1984283..3cc9f3c69 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEvent.kt @@ -29,6 +29,7 @@ private constructor( private val accountToken: JsonField, private val cardToken: JsonField, private val caseId: JsonField, + private val claimToken: JsonField, private val created: JsonField, private val currency: JsonField, private val disposition: JsonField, @@ -51,6 +52,9 @@ private constructor( accountToken: JsonField = JsonMissing.of(), @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(), @JsonProperty("case_id") @ExcludeMissing caseId: JsonField = JsonMissing.of(), + @JsonProperty("claim_token") + @ExcludeMissing + claimToken: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing created: JsonField = JsonMissing.of(), @@ -85,6 +89,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -105,6 +110,7 @@ private constructor( .accountToken(accountToken) .cardToken(cardToken) .caseId(caseId) + .claimToken(claimToken) .created(created) .currency(currency) .disposition(disposition) @@ -149,6 +155,15 @@ private constructor( */ fun caseId(): Optional = caseId.getOptional("case_id") + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun claimToken(): Optional = claimToken.getOptional("claim_token") + /** * When the dispute was created. * @@ -268,6 +283,13 @@ private constructor( */ @JsonProperty("case_id") @ExcludeMissing fun _caseId(): JsonField = caseId + /** + * Returns the raw JSON value of [claimToken]. + * + * Unlike [claimToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("claim_token") @ExcludeMissing fun _claimToken(): JsonField = claimToken + /** * Returns the raw JSON value of [created]. * @@ -377,6 +399,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -400,6 +423,7 @@ private constructor( private var accountToken: JsonField? = null private var cardToken: JsonField? = null private var caseId: JsonField? = null + private var claimToken: JsonField? = null private var created: JsonField? = null private var currency: JsonField? = null private var disposition: JsonField? = null @@ -421,6 +445,7 @@ private constructor( accountToken = disputeTransactionUpdatedWebhookEvent.accountToken cardToken = disputeTransactionUpdatedWebhookEvent.cardToken caseId = disputeTransactionUpdatedWebhookEvent.caseId + claimToken = disputeTransactionUpdatedWebhookEvent.claimToken created = disputeTransactionUpdatedWebhookEvent.created currency = disputeTransactionUpdatedWebhookEvent.currency disposition = disputeTransactionUpdatedWebhookEvent.disposition @@ -487,6 +512,24 @@ private constructor( */ fun caseId(caseId: JsonField) = apply { this.caseId = caseId } + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + */ + fun claimToken(claimToken: String?) = claimToken(JsonField.ofNullable(claimToken)) + + /** Alias for calling [Builder.claimToken] with `claimToken.orElse(null)`. */ + fun claimToken(claimToken: Optional) = claimToken(claimToken.getOrNull()) + + /** + * Sets [Builder.claimToken] to an arbitrary JSON value. + * + * You should usually call [Builder.claimToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun claimToken(claimToken: JsonField) = apply { this.claimToken = claimToken } + /** When the dispute was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -685,6 +728,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -706,6 +750,7 @@ private constructor( checkRequired("accountToken", accountToken), checkRequired("cardToken", cardToken), checkRequired("caseId", caseId), + checkRequired("claimToken", claimToken), checkRequired("created", created), checkRequired("currency", currency), checkRequired("disposition", disposition), @@ -740,6 +785,7 @@ private constructor( accountToken() cardToken() caseId() + claimToken() created() currency() disposition().ifPresent { it.validate() } @@ -773,6 +819,7 @@ private constructor( (if (accountToken.asKnown().isPresent) 1 else 0) + (if (cardToken.asKnown().isPresent) 1 else 0) + (if (caseId.asKnown().isPresent) 1 else 0) + + (if (claimToken.asKnown().isPresent) 1 else 0) + (if (created.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (disposition.asKnown().getOrNull()?.validity() ?: 0) + @@ -926,6 +973,7 @@ private constructor( accountToken == other.accountToken && cardToken == other.cardToken && caseId == other.caseId && + claimToken == other.claimToken && created == other.created && currency == other.currency && disposition == other.disposition && @@ -946,6 +994,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -964,5 +1013,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DisputeTransactionUpdatedWebhookEvent{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, eventType=$eventType, additionalProperties=$additionalProperties}" + "DisputeTransactionUpdatedWebhookEvent{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, claimToken=$claimToken, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt index f28270bf9..3f2a50c22 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeV2.kt @@ -39,6 +39,7 @@ private constructor( private val accountToken: JsonField, private val cardToken: JsonField, private val caseId: JsonField, + private val claimToken: JsonField, private val created: JsonField, private val currency: JsonField, private val disposition: JsonField, @@ -60,6 +61,9 @@ private constructor( accountToken: JsonField = JsonMissing.of(), @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(), @JsonProperty("case_id") @ExcludeMissing caseId: JsonField = JsonMissing.of(), + @JsonProperty("claim_token") + @ExcludeMissing + claimToken: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing created: JsonField = JsonMissing.of(), @@ -85,6 +89,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -130,6 +135,15 @@ private constructor( */ fun caseId(): Optional = caseId.getOptional("case_id") + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun claimToken(): Optional = claimToken.getOptional("claim_token") + /** * When the dispute was created. * @@ -241,6 +255,13 @@ private constructor( */ @JsonProperty("case_id") @ExcludeMissing fun _caseId(): JsonField = caseId + /** + * Returns the raw JSON value of [claimToken]. + * + * Unlike [claimToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("claim_token") @ExcludeMissing fun _claimToken(): JsonField = claimToken + /** * Returns the raw JSON value of [created]. * @@ -342,6 +363,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -364,6 +386,7 @@ private constructor( private var accountToken: JsonField? = null private var cardToken: JsonField? = null private var caseId: JsonField? = null + private var claimToken: JsonField? = null private var created: JsonField? = null private var currency: JsonField? = null private var disposition: JsonField? = null @@ -382,6 +405,7 @@ private constructor( accountToken = disputeV2.accountToken cardToken = disputeV2.cardToken caseId = disputeV2.caseId + claimToken = disputeV2.claimToken created = disputeV2.created currency = disputeV2.currency disposition = disputeV2.disposition @@ -446,6 +470,24 @@ private constructor( */ fun caseId(caseId: JsonField) = apply { this.caseId = caseId } + /** + * Token for the claim this dispute was filed under, in UUID format. Null for disputes not + * initiated through the Dispute Intake API. + */ + fun claimToken(claimToken: String?) = claimToken(JsonField.ofNullable(claimToken)) + + /** Alias for calling [Builder.claimToken] with `claimToken.orElse(null)`. */ + fun claimToken(claimToken: Optional) = claimToken(claimToken.getOrNull()) + + /** + * Sets [Builder.claimToken] to an arbitrary JSON value. + * + * You should usually call [Builder.claimToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun claimToken(claimToken: JsonField) = apply { this.claimToken = claimToken } + /** When the dispute was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -627,6 +669,7 @@ private constructor( * .accountToken() * .cardToken() * .caseId() + * .claimToken() * .created() * .currency() * .disposition() @@ -647,6 +690,7 @@ private constructor( checkRequired("accountToken", accountToken), checkRequired("cardToken", cardToken), checkRequired("caseId", caseId), + checkRequired("claimToken", claimToken), checkRequired("created", created), checkRequired("currency", currency), checkRequired("disposition", disposition), @@ -680,6 +724,7 @@ private constructor( accountToken() cardToken() caseId() + claimToken() created() currency() disposition().ifPresent { it.validate() } @@ -712,6 +757,7 @@ private constructor( (if (accountToken.asKnown().isPresent) 1 else 0) + (if (cardToken.asKnown().isPresent) 1 else 0) + (if (caseId.asKnown().isPresent) 1 else 0) + + (if (claimToken.asKnown().isPresent) 1 else 0) + (if (created.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (disposition.asKnown().getOrNull()?.validity() ?: 0) + @@ -3477,6 +3523,8 @@ private constructor( @JvmField val WRITTEN_OFF = of("WRITTEN_OFF") + @JvmField val WRITE_OFF_REVERSED = of("WRITE_OFF_REVERSED") + @JvmStatic fun of(value: String) = Action(JsonField.of(value)) } @@ -3485,6 +3533,7 @@ private constructor( PROVISIONAL_CREDIT_GRANTED, PROVISIONAL_CREDIT_REVERSED, WRITTEN_OFF, + WRITE_OFF_REVERSED, } /** @@ -3500,6 +3549,7 @@ private constructor( PROVISIONAL_CREDIT_GRANTED, PROVISIONAL_CREDIT_REVERSED, WRITTEN_OFF, + WRITE_OFF_REVERSED, /** * An enum member indicating that [Action] was instantiated with an unknown * value. @@ -3519,6 +3569,7 @@ private constructor( PROVISIONAL_CREDIT_GRANTED -> Value.PROVISIONAL_CREDIT_GRANTED PROVISIONAL_CREDIT_REVERSED -> Value.PROVISIONAL_CREDIT_REVERSED WRITTEN_OFF -> Value.WRITTEN_OFF + WRITE_OFF_REVERSED -> Value.WRITE_OFF_REVERSED else -> Value._UNKNOWN } @@ -3536,6 +3587,7 @@ private constructor( PROVISIONAL_CREDIT_GRANTED -> Known.PROVISIONAL_CREDIT_GRANTED PROVISIONAL_CREDIT_REVERSED -> Known.PROVISIONAL_CREDIT_REVERSED WRITTEN_OFF -> Known.WRITTEN_OFF + WRITE_OFF_REVERSED -> Known.WRITE_OFF_REVERSED else -> throw LithicInvalidDataException("Unknown Action: $value") } @@ -5014,6 +5066,7 @@ private constructor( accountToken == other.accountToken && cardToken == other.cardToken && caseId == other.caseId && + claimToken == other.claimToken && created == other.created && currency == other.currency && disposition == other.disposition && @@ -5033,6 +5086,7 @@ private constructor( accountToken, cardToken, caseId, + claimToken, created, currency, disposition, @@ -5050,5 +5104,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DisputeV2{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, additionalProperties=$additionalProperties}" + "DisputeV2{token=$token, accountToken=$accountToken, cardToken=$cardToken, caseId=$caseId, claimToken=$claimToken, created=$created, currency=$currency, disposition=$disposition, events=$events, liabilityAllocation=$liabilityAllocation, merchant=$merchant, network=$network, status=$status, transactionSeries=$transactionSeries, updated=$updated, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListParams.kt index 7a6bd5656..3310c8f48 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputesV2ListParams.kt @@ -17,6 +17,7 @@ private constructor( private val accountToken: String?, private val begin: OffsetDateTime?, private val cardToken: String?, + private val claimToken: String?, private val disputedTransactionToken: String?, private val end: OffsetDateTime?, private val endingBefore: String?, @@ -35,6 +36,12 @@ private constructor( /** Filter by card token. */ fun cardToken(): Optional = Optional.ofNullable(cardToken) + /** + * Filter by the token of the claim the dispute was filed under. Returns the disputes created + * from that claim's disputed transaction events. + */ + fun claimToken(): Optional = Optional.ofNullable(claimToken) + /** * Filter by the token of the transaction being disputed. Corresponds with * transaction_series.related_transaction_token in the Dispute. @@ -81,6 +88,7 @@ private constructor( private var accountToken: String? = null private var begin: OffsetDateTime? = null private var cardToken: String? = null + private var claimToken: String? = null private var disputedTransactionToken: String? = null private var end: OffsetDateTime? = null private var endingBefore: String? = null @@ -94,6 +102,7 @@ private constructor( accountToken = disputesV2ListParams.accountToken begin = disputesV2ListParams.begin cardToken = disputesV2ListParams.cardToken + claimToken = disputesV2ListParams.claimToken disputedTransactionToken = disputesV2ListParams.disputedTransactionToken end = disputesV2ListParams.end endingBefore = disputesV2ListParams.endingBefore @@ -121,6 +130,15 @@ private constructor( /** Alias for calling [Builder.cardToken] with `cardToken.orElse(null)`. */ fun cardToken(cardToken: Optional) = cardToken(cardToken.getOrNull()) + /** + * Filter by the token of the claim the dispute was filed under. Returns the disputes + * created from that claim's disputed transaction events. + */ + fun claimToken(claimToken: String?) = apply { this.claimToken = claimToken } + + /** Alias for calling [Builder.claimToken] with `claimToken.orElse(null)`. */ + fun claimToken(claimToken: Optional) = claimToken(claimToken.getOrNull()) + /** * Filter by the token of the transaction being disputed. Corresponds with * transaction_series.related_transaction_token in the Dispute. @@ -282,6 +300,7 @@ private constructor( accountToken, begin, cardToken, + claimToken, disputedTransactionToken, end, endingBefore, @@ -300,6 +319,7 @@ private constructor( accountToken?.let { put("account_token", it) } begin?.let { put("begin", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } cardToken?.let { put("card_token", it) } + claimToken?.let { put("claim_token", it) } disputedTransactionToken?.let { put("disputed_transaction_token", it) } end?.let { put("end", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } endingBefore?.let { put("ending_before", it) } @@ -318,6 +338,7 @@ private constructor( accountToken == other.accountToken && begin == other.begin && cardToken == other.cardToken && + claimToken == other.claimToken && disputedTransactionToken == other.disputedTransactionToken && end == other.end && endingBefore == other.endingBefore && @@ -332,6 +353,7 @@ private constructor( accountToken, begin, cardToken, + claimToken, disputedTransactionToken, end, endingBefore, @@ -342,5 +364,5 @@ private constructor( ) override fun toString() = - "DisputesV2ListParams{accountToken=$accountToken, begin=$begin, cardToken=$cardToken, disputedTransactionToken=$disputedTransactionToken, end=$end, endingBefore=$endingBefore, pageSize=$pageSize, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DisputesV2ListParams{accountToken=$accountToken, begin=$begin, cardToken=$cardToken, claimToken=$claimToken, disputedTransactionToken=$disputedTransactionToken, end=$end, endingBefore=$endingBefore, pageSize=$pageSize, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 74626780e..adde279ae 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 @@ -12,6 +12,7 @@ import com.lithic.api.core.JsonField import com.lithic.api.core.JsonMissing import com.lithic.api.core.JsonValue 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 @@ -34,6 +35,7 @@ private constructor( private val updated: JsonField, private val userDefinedStatus: JsonField, private val accountNumber: JsonField, + private val blockchainAddresses: JsonField, private val routingNumber: JsonField, private val additionalProperties: MutableMap, ) { @@ -70,6 +72,9 @@ private constructor( @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_addresses") + @ExcludeMissing + blockchainAddresses: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), @@ -86,6 +91,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, mutableMapOf(), ) @@ -173,6 +179,16 @@ private constructor( */ fun accountNumber(): Optional = accountNumber.getOptional("account_number") + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full name + * of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainAddresses(): Optional = + blockchainAddresses.getOptional("blockchain_addresses") + /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -279,6 +295,16 @@ private constructor( @ExcludeMissing fun _accountNumber(): JsonField = accountNumber + /** + * Returns the raw JSON value of [blockchainAddresses]. + * + * Unlike [blockchainAddresses], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("blockchain_addresses") + @ExcludeMissing + fun _blockchainAddresses(): JsonField = blockchainAddresses + /** * Returns the raw JSON value of [routingNumber]. * @@ -338,6 +364,7 @@ private constructor( private var updated: JsonField? = null private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() + private var blockchainAddresses: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -355,6 +382,7 @@ private constructor( updated = financialAccount.updated userDefinedStatus = financialAccount.userDefinedStatus accountNumber = financialAccount.accountNumber + blockchainAddresses = financialAccount.blockchainAddresses routingNumber = financialAccount.routingNumber additionalProperties = financialAccount.additionalProperties.toMutableMap() } @@ -534,6 +562,30 @@ private constructor( this.accountNumber = accountNumber } + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full + * name of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + */ + fun blockchainAddresses(blockchainAddresses: BlockchainAddresses?) = + blockchainAddresses(JsonField.ofNullable(blockchainAddresses)) + + /** + * Alias for calling [Builder.blockchainAddresses] with `blockchainAddresses.orElse(null)`. + */ + fun blockchainAddresses(blockchainAddresses: Optional) = + blockchainAddresses(blockchainAddresses.getOrNull()) + + /** + * Sets [Builder.blockchainAddresses] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainAddresses] with a well-typed + * [BlockchainAddresses] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun blockchainAddresses(blockchainAddresses: JsonField) = apply { + this.blockchainAddresses = blockchainAddresses + } + fun routingNumber(routingNumber: String?) = routingNumber(JsonField.ofNullable(routingNumber)) @@ -607,6 +659,7 @@ private constructor( checkRequired("updated", updated), checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, + blockchainAddresses, routingNumber, additionalProperties.toMutableMap(), ) @@ -639,6 +692,7 @@ private constructor( updated() userDefinedStatus() accountNumber() + blockchainAddresses().ifPresent { it.validate() } routingNumber() validated = true } @@ -670,6 +724,7 @@ private constructor( (if (updated.asKnown().isPresent) 1 else 0) + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (blockchainAddresses.asKnown().getOrNull()?.validity() ?: 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) class FinancialAccountCreditConfig @@ -1776,6 +1831,120 @@ private constructor( override fun toString() = value.toString() } + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full name + * of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + */ + class BlockchainAddresses + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [BlockchainAddresses]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainAddresses]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(blockchainAddresses: BlockchainAddresses) = apply { + additionalProperties = blockchainAddresses.additionalProperties.toMutableMap() + } + + 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 [BlockchainAddresses]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): BlockchainAddresses = + BlockchainAddresses(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): BlockchainAddresses = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BlockchainAddresses && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "BlockchainAddresses{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1794,6 +1963,7 @@ private constructor( updated == other.updated && userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && + blockchainAddresses == other.blockchainAddresses && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties } @@ -1812,6 +1982,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, additionalProperties, ) @@ -1820,5 +1991,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccount{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" + "FinancialAccount{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, blockchainAddresses=$blockchainAddresses, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt index 1e252bc70..d6d9b5a6f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEvent.kt @@ -34,6 +34,7 @@ private constructor( private val updated: JsonField, private val userDefinedStatus: JsonField, private val accountNumber: JsonField, + private val blockchainAddresses: JsonField, private val routingNumber: JsonField, private val eventType: JsonField, private val additionalProperties: MutableMap, @@ -74,6 +75,9 @@ private constructor( @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_addresses") + @ExcludeMissing + blockchainAddresses: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), @@ -93,6 +97,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, eventType, mutableMapOf(), @@ -112,6 +117,7 @@ private constructor( .updated(updated) .userDefinedStatus(userDefinedStatus) .accountNumber(accountNumber) + .blockchainAddresses(blockchainAddresses) .routingNumber(routingNumber) .build() @@ -199,6 +205,16 @@ private constructor( */ fun accountNumber(): Optional = accountNumber.getOptional("account_number") + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full name + * of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainAddresses(): Optional = + blockchainAddresses.getOptional("blockchain_addresses") + /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -314,6 +330,17 @@ private constructor( @ExcludeMissing fun _accountNumber(): JsonField = accountNumber + /** + * Returns the raw JSON value of [blockchainAddresses]. + * + * Unlike [blockchainAddresses], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("blockchain_addresses") + @ExcludeMissing + fun _blockchainAddresses(): JsonField = + blockchainAddresses + /** * Returns the raw JSON value of [routingNumber]. * @@ -383,6 +410,8 @@ private constructor( private var updated: JsonField? = null private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() + private var blockchainAddresses: JsonField = + JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() private var eventType: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -403,6 +432,7 @@ private constructor( updated = financialAccountCreatedWebhookEvent.updated userDefinedStatus = financialAccountCreatedWebhookEvent.userDefinedStatus accountNumber = financialAccountCreatedWebhookEvent.accountNumber + blockchainAddresses = financialAccountCreatedWebhookEvent.blockchainAddresses routingNumber = financialAccountCreatedWebhookEvent.routingNumber eventType = financialAccountCreatedWebhookEvent.eventType additionalProperties = @@ -588,6 +618,31 @@ private constructor( this.accountNumber = accountNumber } + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full + * name of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + */ + fun blockchainAddresses(blockchainAddresses: FinancialAccount.BlockchainAddresses?) = + blockchainAddresses(JsonField.ofNullable(blockchainAddresses)) + + /** + * Alias for calling [Builder.blockchainAddresses] with `blockchainAddresses.orElse(null)`. + */ + fun blockchainAddresses( + blockchainAddresses: Optional + ) = blockchainAddresses(blockchainAddresses.getOrNull()) + + /** + * Sets [Builder.blockchainAddresses] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainAddresses] with a well-typed + * [FinancialAccount.BlockchainAddresses] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun blockchainAddresses( + blockchainAddresses: JsonField + ) = apply { this.blockchainAddresses = blockchainAddresses } + fun routingNumber(routingNumber: String?) = routingNumber(JsonField.ofNullable(routingNumber)) @@ -674,6 +729,7 @@ private constructor( checkRequired("updated", updated), checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, + blockchainAddresses, routingNumber, checkRequired("eventType", eventType), additionalProperties.toMutableMap(), @@ -707,6 +763,7 @@ private constructor( updated() userDefinedStatus() accountNumber() + blockchainAddresses().ifPresent { it.validate() } routingNumber() eventType().validate() validated = true @@ -739,6 +796,7 @@ private constructor( (if (updated.asKnown().isPresent) 1 else 0) + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (blockchainAddresses.asKnown().getOrNull()?.validity() ?: 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) @@ -891,6 +949,7 @@ private constructor( updated == other.updated && userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && + blockchainAddresses == other.blockchainAddresses && routingNumber == other.routingNumber && eventType == other.eventType && additionalProperties == other.additionalProperties @@ -910,6 +969,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, eventType, additionalProperties, @@ -919,5 +979,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccountCreatedWebhookEvent{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" + "FinancialAccountCreatedWebhookEvent{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, blockchainAddresses=$blockchainAddresses, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt index 48d29c4ca..7c46e82a3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEvent.kt @@ -34,6 +34,7 @@ private constructor( private val updated: JsonField, private val userDefinedStatus: JsonField, private val accountNumber: JsonField, + private val blockchainAddresses: JsonField, private val routingNumber: JsonField, private val eventType: JsonField, private val additionalProperties: MutableMap, @@ -74,6 +75,9 @@ private constructor( @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_addresses") + @ExcludeMissing + blockchainAddresses: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), @@ -93,6 +97,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, eventType, mutableMapOf(), @@ -112,6 +117,7 @@ private constructor( .updated(updated) .userDefinedStatus(userDefinedStatus) .accountNumber(accountNumber) + .blockchainAddresses(blockchainAddresses) .routingNumber(routingNumber) .build() @@ -199,6 +205,16 @@ private constructor( */ fun accountNumber(): Optional = accountNumber.getOptional("account_number") + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full name + * of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainAddresses(): Optional = + blockchainAddresses.getOptional("blockchain_addresses") + /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -314,6 +330,17 @@ private constructor( @ExcludeMissing fun _accountNumber(): JsonField = accountNumber + /** + * Returns the raw JSON value of [blockchainAddresses]. + * + * Unlike [blockchainAddresses], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("blockchain_addresses") + @ExcludeMissing + fun _blockchainAddresses(): JsonField = + blockchainAddresses + /** * Returns the raw JSON value of [routingNumber]. * @@ -383,6 +410,8 @@ private constructor( private var updated: JsonField? = null private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() + private var blockchainAddresses: JsonField = + JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() private var eventType: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -403,6 +432,7 @@ private constructor( updated = financialAccountUpdatedWebhookEvent.updated userDefinedStatus = financialAccountUpdatedWebhookEvent.userDefinedStatus accountNumber = financialAccountUpdatedWebhookEvent.accountNumber + blockchainAddresses = financialAccountUpdatedWebhookEvent.blockchainAddresses routingNumber = financialAccountUpdatedWebhookEvent.routingNumber eventType = financialAccountUpdatedWebhookEvent.eventType additionalProperties = @@ -588,6 +618,31 @@ private constructor( this.accountNumber = accountNumber } + /** + * Provisioned blockchain deposit addresses for this financial account, keyed by the full + * name of the blockchain network that each address belongs to (e.g. `ETHEREUM`) + */ + fun blockchainAddresses(blockchainAddresses: FinancialAccount.BlockchainAddresses?) = + blockchainAddresses(JsonField.ofNullable(blockchainAddresses)) + + /** + * Alias for calling [Builder.blockchainAddresses] with `blockchainAddresses.orElse(null)`. + */ + fun blockchainAddresses( + blockchainAddresses: Optional + ) = blockchainAddresses(blockchainAddresses.getOrNull()) + + /** + * Sets [Builder.blockchainAddresses] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainAddresses] with a well-typed + * [FinancialAccount.BlockchainAddresses] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun blockchainAddresses( + blockchainAddresses: JsonField + ) = apply { this.blockchainAddresses = blockchainAddresses } + fun routingNumber(routingNumber: String?) = routingNumber(JsonField.ofNullable(routingNumber)) @@ -674,6 +729,7 @@ private constructor( checkRequired("updated", updated), checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, + blockchainAddresses, routingNumber, checkRequired("eventType", eventType), additionalProperties.toMutableMap(), @@ -707,6 +763,7 @@ private constructor( updated() userDefinedStatus() accountNumber() + blockchainAddresses().ifPresent { it.validate() } routingNumber() eventType().validate() validated = true @@ -739,6 +796,7 @@ private constructor( (if (updated.asKnown().isPresent) 1 else 0) + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (blockchainAddresses.asKnown().getOrNull()?.validity() ?: 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) @@ -891,6 +949,7 @@ private constructor( updated == other.updated && userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && + blockchainAddresses == other.blockchainAddresses && routingNumber == other.routingNumber && eventType == other.eventType && additionalProperties == other.additionalProperties @@ -910,6 +969,7 @@ private constructor( updated, userDefinedStatus, accountNumber, + blockchainAddresses, routingNumber, eventType, additionalProperties, @@ -919,5 +979,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccountUpdatedWebhookEvent{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" + "FinancialAccountUpdatedWebhookEvent{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, status=$status, substatus=$substatus, type=$type, updated=$updated, userDefinedStatus=$userDefinedStatus, accountNumber=$accountNumber, blockchainAddresses=$blockchainAddresses, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt index 02efa0c00..d7f28b871 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt @@ -631,10 +631,16 @@ private constructor( @JvmField val STABLECOIN_RECEIVED = of("STABLECOIN_RECEIVED") + @JvmField val STABLECOIN_INITIATED = of("STABLECOIN_INITIATED") + @JvmField val STABLECOIN_REVIEWED = of("STABLECOIN_REVIEWED") + @JvmField val STABLECOIN_SENT = of("STABLECOIN_SENT") + @JvmField val STABLECOIN_SETTLED = of("STABLECOIN_SETTLED") + @JvmField val STABLECOIN_REJECTED = of("STABLECOIN_REJECTED") + @JvmStatic fun of(value: String) = FinancialEventType(JsonField.of(value)) } @@ -731,8 +737,11 @@ private constructor( MONTHLY_REVERSAL, ACCOUNT_TO_ACCOUNT, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, } /** @@ -836,8 +845,11 @@ private constructor( MONTHLY_REVERSAL, ACCOUNT_TO_ACCOUNT, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, /** * An enum member indicating that [FinancialEventType] was instantiated with an unknown * value. @@ -945,8 +957,11 @@ private constructor( MONTHLY_REVERSAL -> Value.MONTHLY_REVERSAL ACCOUNT_TO_ACCOUNT -> Value.ACCOUNT_TO_ACCOUNT STABLECOIN_RECEIVED -> Value.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Value.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Value.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Value.STABLECOIN_SENT STABLECOIN_SETTLED -> Value.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Value.STABLECOIN_REJECTED else -> Value._UNKNOWN } @@ -1052,8 +1067,11 @@ private constructor( MONTHLY_REVERSAL -> Known.MONTHLY_REVERSAL ACCOUNT_TO_ACCOUNT -> Known.ACCOUNT_TO_ACCOUNT STABLECOIN_RECEIVED -> Known.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Known.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Known.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Known.STABLECOIN_SENT STABLECOIN_SETTLED -> Known.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Known.STABLECOIN_REJECTED else -> throw LithicInvalidDataException("Unknown FinancialEventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index 78771264d..4407e0011 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt @@ -54,6 +54,7 @@ private constructor( private val source: JsonField, private val status: JsonField, private val updated: JsonField, + private val blockchainRecipientToken: JsonField, private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, @@ -108,6 +109,9 @@ private constructor( @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @JsonProperty("expected_release_date") @ExcludeMissing @@ -138,6 +142,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -285,6 +290,15 @@ private constructor( */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + /** * Currency of the transaction in ISO 4217 format * @@ -468,6 +482,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + /** * Returns the raw JSON value of [currency]. * @@ -579,6 +603,7 @@ private constructor( private var source: JsonField? = null private var status: JsonField? = null private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() @@ -606,6 +631,7 @@ private constructor( source = payment.source status = payment.status updated = payment.updated + blockchainRecipientToken = payment.blockchainRecipientToken currency = payment.currency expectedReleaseDate = payment.expectedReleaseDate externalBankAccountToken = payment.externalBankAccountToken @@ -760,6 +786,12 @@ private constructor( fun methodAttributes(wire: MethodAttributes.WireMethodAttributes) = methodAttributes(MethodAttributes.ofWire(wire)) + /** + * Alias for calling [methodAttributes] with `MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(MethodAttributes.ofStablecoin(stablecoin)) + /** Pending amount in cents */ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -857,6 +889,28 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + /** Currency of the transaction in ISO 4217 format */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -1021,6 +1075,7 @@ private constructor( checkRequired("source", source), checkRequired("status", status), checkRequired("updated", updated), + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1063,6 +1118,7 @@ private constructor( source().validate() status().validate() updated() + blockchainRecipientToken() currency() expectedReleaseDate() externalBankAccountToken() @@ -1104,6 +1160,7 @@ private constructor( (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + @@ -1645,8 +1702,16 @@ private constructor( * Stablecoin events: * * `STABLECOIN_RECEIVED` - Stablecoin pay-in received on-chain and pending release to * available balance. - * * `STABLECOIN_REVIEWED` - Stablecoin pay-in has completed the review process. - * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance. + * * `STABLECOIN_INITIATED` - Stablecoin withdrawal initiated, with the funds placed on + * hold. + * * `STABLECOIN_REVIEWED` - Stablecoin pay-in or withdrawal has completed the review + * process. + * * `STABLECOIN_SENT` - Stablecoin withdrawal accepted for on-chain submission to the + * destination address, and pending confirmation. + * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance, or + * stablecoin withdrawal confirmed on-chain. + * * `STABLECOIN_REJECTED` - Stablecoin withdrawal failed and the hold placed at initiation + * has been reversed. * * @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). @@ -1664,7 +1729,9 @@ private constructor( /** * Payment event external ID. For ACH transactions, this is the ACH trace number. For - * inbound wire transfers, this is the IMAD (Input Message Accountability Data). + * inbound wire transfers, this is the IMAD (Input Message Accountability Data). For + * stablecoin payments, this is the on-chain transaction hash of the transfer; it is present + * on events that reflect on-chain activity and null on internal lifecycle events. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1885,8 +1952,16 @@ private constructor( * Stablecoin events: * * `STABLECOIN_RECEIVED` - Stablecoin pay-in received on-chain and pending release to * available balance. - * * `STABLECOIN_REVIEWED` - Stablecoin pay-in has completed the review process. - * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance. + * * `STABLECOIN_INITIATED` - Stablecoin withdrawal initiated, with the funds placed on + * hold. + * * `STABLECOIN_REVIEWED` - Stablecoin pay-in or withdrawal has completed the review + * process. + * * `STABLECOIN_SENT` - Stablecoin withdrawal accepted for on-chain submission to the + * destination address, and pending confirmation. + * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance, or + * stablecoin withdrawal confirmed on-chain. + * * `STABLECOIN_REJECTED` - Stablecoin withdrawal failed and the hold placed at + * initiation has been reversed. */ fun type(type: PaymentEventType) = type(JsonField.of(type)) @@ -1928,7 +2003,10 @@ private constructor( /** * Payment event external ID. For ACH transactions, this is the ACH trace number. For - * inbound wire transfers, this is the IMAD (Input Message Accountability Data). + * inbound wire transfers, this is the IMAD (Input Message Accountability Data). For + * stablecoin payments, this is the on-chain transaction hash of the transfer; it is + * present on events that reflect on-chain activity and null on internal lifecycle + * events. */ fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) @@ -2237,8 +2315,16 @@ private constructor( * Stablecoin events: * * `STABLECOIN_RECEIVED` - Stablecoin pay-in received on-chain and pending release to * available balance. - * * `STABLECOIN_REVIEWED` - Stablecoin pay-in has completed the review process. - * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance. + * * `STABLECOIN_INITIATED` - Stablecoin withdrawal initiated, with the funds placed on + * hold. + * * `STABLECOIN_REVIEWED` - Stablecoin pay-in or withdrawal has completed the review + * process. + * * `STABLECOIN_SENT` - Stablecoin withdrawal accepted for on-chain submission to the + * destination address, and pending confirmation. + * * `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance, or + * stablecoin withdrawal confirmed on-chain. + * * `STABLECOIN_REJECTED` - Stablecoin withdrawal failed and the hold placed at initiation + * has been reversed. */ class PaymentEventType @JsonCreator @@ -2302,10 +2388,16 @@ private constructor( @JvmField val STABLECOIN_RECEIVED = of("STABLECOIN_RECEIVED") + @JvmField val STABLECOIN_INITIATED = of("STABLECOIN_INITIATED") + @JvmField val STABLECOIN_REVIEWED = of("STABLECOIN_REVIEWED") + @JvmField val STABLECOIN_SENT = of("STABLECOIN_SENT") + @JvmField val STABLECOIN_SETTLED = of("STABLECOIN_SETTLED") + @JvmField val STABLECOIN_REJECTED = of("STABLECOIN_REJECTED") + @JvmStatic fun of(value: String) = PaymentEventType(JsonField.of(value)) } @@ -2334,8 +2426,11 @@ private constructor( WIRE_RETURN_OUTBOUND_SETTLED, WIRE_RETURN_OUTBOUND_REJECTED, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, } /** @@ -2372,8 +2467,11 @@ private constructor( WIRE_RETURN_OUTBOUND_SETTLED, WIRE_RETURN_OUTBOUND_REJECTED, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, /** * An enum member indicating that [PaymentEventType] was instantiated with an * unknown value. @@ -2413,8 +2511,11 @@ private constructor( WIRE_RETURN_OUTBOUND_SETTLED -> Value.WIRE_RETURN_OUTBOUND_SETTLED WIRE_RETURN_OUTBOUND_REJECTED -> Value.WIRE_RETURN_OUTBOUND_REJECTED STABLECOIN_RECEIVED -> Value.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Value.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Value.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Value.STABLECOIN_SENT STABLECOIN_SETTLED -> Value.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Value.STABLECOIN_REJECTED else -> Value._UNKNOWN } @@ -2452,8 +2553,11 @@ private constructor( WIRE_RETURN_OUTBOUND_SETTLED -> Known.WIRE_RETURN_OUTBOUND_SETTLED WIRE_RETURN_OUTBOUND_REJECTED -> Known.WIRE_RETURN_OUTBOUND_REJECTED STABLECOIN_RECEIVED -> Known.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Known.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Known.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Known.STABLECOIN_SENT STABLECOIN_SETTLED -> Known.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Known.STABLECOIN_REJECTED else -> throw LithicInvalidDataException("Unknown PaymentEventType: $value") } @@ -2879,6 +2983,8 @@ private constructor( @JvmField val WIRE = of("WIRE") + @JvmField val STABLECOIN = of("STABLECOIN") + @JvmStatic fun of(value: String) = Method(JsonField.of(value)) } @@ -2887,6 +2993,7 @@ private constructor( ACH_NEXT_DAY, ACH_SAME_DAY, WIRE, + STABLECOIN, } /** @@ -2902,6 +3009,7 @@ private constructor( ACH_NEXT_DAY, ACH_SAME_DAY, WIRE, + STABLECOIN, /** An enum member indicating that [Method] was instantiated with an unknown value. */ _UNKNOWN, } @@ -2918,6 +3026,7 @@ private constructor( ACH_NEXT_DAY -> Value.ACH_NEXT_DAY ACH_SAME_DAY -> Value.ACH_SAME_DAY WIRE -> Value.WIRE + STABLECOIN -> Value.STABLECOIN else -> Value._UNKNOWN } @@ -2935,6 +3044,7 @@ private constructor( ACH_NEXT_DAY -> Known.ACH_NEXT_DAY ACH_SAME_DAY -> Known.ACH_SAME_DAY WIRE -> Known.WIRE + STABLECOIN -> Known.STABLECOIN else -> throw LithicInvalidDataException("Unknown Method: $value") } @@ -3006,6 +3116,7 @@ private constructor( private constructor( private val ach: AchMethodAttributes? = null, private val wire: WireMethodAttributes? = null, + private val stablecoin: StablecoinMethodAttributes? = null, private val _json: JsonValue? = null, ) { @@ -3013,14 +3124,20 @@ private constructor( fun wire(): Optional = Optional.ofNullable(wire) + fun stablecoin(): Optional = Optional.ofNullable(stablecoin) + fun isAch(): Boolean = ach != null fun isWire(): Boolean = wire != null + fun isStablecoin(): Boolean = stablecoin != null + fun asAch(): AchMethodAttributes = ach.getOrThrow("ach") fun asWire(): WireMethodAttributes = wire.getOrThrow("wire") + fun asStablecoin(): StablecoinMethodAttributes = stablecoin.getOrThrow("stablecoin") + fun _json(): Optional = Optional.ofNullable(_json) /** @@ -3056,6 +3173,7 @@ private constructor( when { ach != null -> visitor.visitAch(ach) wire != null -> visitor.visitWire(wire) + stablecoin != null -> visitor.visitStablecoin(stablecoin) else -> visitor.unknown(_json) } @@ -3084,6 +3202,10 @@ private constructor( override fun visitWire(wire: WireMethodAttributes) { wire.validate() } + + override fun visitStablecoin(stablecoin: StablecoinMethodAttributes) { + stablecoin.validate() + } } ) validated = true @@ -3111,6 +3233,9 @@ private constructor( override fun visitWire(wire: WireMethodAttributes) = wire.validity() + override fun visitStablecoin(stablecoin: StablecoinMethodAttributes) = + stablecoin.validity() + override fun unknown(json: JsonValue?) = 0 } ) @@ -3120,15 +3245,19 @@ private constructor( return true } - return other is MethodAttributes && ach == other.ach && wire == other.wire + return other is MethodAttributes && + ach == other.ach && + wire == other.wire && + stablecoin == other.stablecoin } - override fun hashCode(): Int = Objects.hash(ach, wire) + override fun hashCode(): Int = Objects.hash(ach, wire, stablecoin) override fun toString(): String = when { ach != null -> "MethodAttributes{ach=$ach}" wire != null -> "MethodAttributes{wire=$wire}" + stablecoin != null -> "MethodAttributes{stablecoin=$stablecoin}" _json != null -> "MethodAttributes{_unknown=$_json}" else -> throw IllegalStateException("Invalid MethodAttributes") } @@ -3138,6 +3267,10 @@ private constructor( @JvmStatic fun ofAch(ach: AchMethodAttributes) = MethodAttributes(ach = ach) @JvmStatic fun ofWire(wire: WireMethodAttributes) = MethodAttributes(wire = wire) + + @JvmStatic + fun ofStablecoin(stablecoin: StablecoinMethodAttributes) = + MethodAttributes(stablecoin = stablecoin) } /** @@ -3150,6 +3283,8 @@ private constructor( fun visitWire(wire: WireMethodAttributes): T + fun visitStablecoin(stablecoin: StablecoinMethodAttributes): T + /** * Maps an unknown variant of [MethodAttributes] to a value of type [T]. * @@ -3178,6 +3313,8 @@ private constructor( tryDeserialize(node, jacksonTypeRef())?.let { MethodAttributes(wire = it, _json = json) }, + tryDeserialize(node, jacksonTypeRef()) + ?.let { MethodAttributes(stablecoin = it, _json = json) }, ) .filterNotNull() .allMaxBy { it.validity() } @@ -3205,6 +3342,7 @@ private constructor( when { value.ach != null -> generator.writeObject(value.ach) value.wire != null -> generator.writeObject(value.wire) + value.stablecoin != null -> generator.writeObject(value.stablecoin) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid MethodAttributes") } @@ -4590,6 +4728,239 @@ private constructor( override fun toString() = "WireMethodAttributes{wireMessageType=$wireMessageType, wireNetwork=$wireNetwork, creditor=$creditor, debtor=$debtor, messageId=$messageId, remittanceInformation=$remittanceInformation, additionalProperties=$additionalProperties}" } + + class StablecoinMethodAttributes + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val chain: JsonField, + private val transactionHash: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("chain") @ExcludeMissing chain: JsonField = JsonMissing.of(), + @JsonProperty("transaction_hash") + @ExcludeMissing + transactionHash: JsonField = JsonMissing.of(), + ) : this(chain, transactionHash, mutableMapOf()) + + /** + * Blockchain the stablecoin transfer settled on + * + * @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 chain(): String = chain.getRequired("chain") + + /** + * On-chain transaction hash of the transfer. Null until the transfer has settled on + * chain + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun transactionHash(): Optional = + transactionHash.getOptional("transaction_hash") + + /** + * Returns the raw JSON value of [chain]. + * + * Unlike [chain], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("chain") @ExcludeMissing fun _chain(): JsonField = chain + + /** + * Returns the raw JSON value of [transactionHash]. + * + * Unlike [transactionHash], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_hash") + @ExcludeMissing + fun _transactionHash(): JsonField = transactionHash + + @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 + * [StablecoinMethodAttributes]. + * + * The following fields are required: + * ```java + * .chain() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [StablecoinMethodAttributes]. */ + class Builder internal constructor() { + + private var chain: JsonField? = null + private var transactionHash: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(stablecoinMethodAttributes: StablecoinMethodAttributes) = apply { + chain = stablecoinMethodAttributes.chain + transactionHash = stablecoinMethodAttributes.transactionHash + additionalProperties = + stablecoinMethodAttributes.additionalProperties.toMutableMap() + } + + /** Blockchain the stablecoin transfer settled on */ + fun chain(chain: String) = chain(JsonField.of(chain)) + + /** + * Sets [Builder.chain] to an arbitrary JSON value. + * + * You should usually call [Builder.chain] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun chain(chain: JsonField) = apply { this.chain = chain } + + /** + * On-chain transaction hash of the transfer. Null until the transfer has settled on + * chain + */ + fun transactionHash(transactionHash: String?) = + transactionHash(JsonField.ofNullable(transactionHash)) + + /** + * Alias for calling [Builder.transactionHash] with `transactionHash.orElse(null)`. + */ + fun transactionHash(transactionHash: Optional) = + transactionHash(transactionHash.getOrNull()) + + /** + * Sets [Builder.transactionHash] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionHash] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun transactionHash(transactionHash: JsonField) = apply { + this.transactionHash = transactionHash + } + + 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 [StablecoinMethodAttributes]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .chain() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): StablecoinMethodAttributes = + StablecoinMethodAttributes( + checkRequired("chain", chain), + transactionHash, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws LithicInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): StablecoinMethodAttributes = apply { + if (validated) { + return@apply + } + + chain() + transactionHash() + 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 (chain.asKnown().isPresent) 1 else 0) + + (if (transactionHash.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is StablecoinMethodAttributes && + chain == other.chain && + transactionHash == other.transactionHash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(chain, transactionHash, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "StablecoinMethodAttributes{chain=$chain, transactionHash=$transactionHash, additionalProperties=$additionalProperties}" + } } /** Account tokens related to a payment transaction */ @@ -5418,6 +5789,8 @@ private constructor( @JvmField val WIRE_INBOUND_DRAWDOWN_REQUEST = of("WIRE_INBOUND_DRAWDOWN_REQUEST") + @JvmField val STABLECOIN = of("STABLECOIN") + @JvmStatic fun of(value: String) = TransferType(JsonField.of(value)) } @@ -5432,6 +5805,7 @@ private constructor( WIRE_OUTBOUND_PAYMENT, WIRE_OUTBOUND_ADMIN, WIRE_INBOUND_DRAWDOWN_REQUEST, + STABLECOIN, } /** @@ -5453,6 +5827,7 @@ private constructor( WIRE_OUTBOUND_PAYMENT, WIRE_OUTBOUND_ADMIN, WIRE_INBOUND_DRAWDOWN_REQUEST, + STABLECOIN, /** * An enum member indicating that [TransferType] was instantiated with an unknown value. */ @@ -5477,6 +5852,7 @@ private constructor( WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN WIRE_INBOUND_DRAWDOWN_REQUEST -> Value.WIRE_INBOUND_DRAWDOWN_REQUEST + STABLECOIN -> Value.STABLECOIN else -> Value._UNKNOWN } @@ -5500,6 +5876,7 @@ private constructor( WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN WIRE_INBOUND_DRAWDOWN_REQUEST -> Known.WIRE_INBOUND_DRAWDOWN_REQUEST + STABLECOIN -> Known.STABLECOIN else -> throw LithicInvalidDataException("Unknown TransferType: $value") } @@ -5587,6 +5964,7 @@ private constructor( source == other.source && status == other.status && updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && @@ -5615,6 +5993,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -5628,5 +6007,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Payment{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "Payment{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt index 5dd180722..768b8dd27 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt @@ -42,6 +42,7 @@ private constructor( private val source: JsonField, private val status: JsonField, private val updated: JsonField, + private val blockchainRecipientToken: JsonField, private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, @@ -103,6 +104,9 @@ private constructor( @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @JsonProperty("expected_release_date") @ExcludeMissing @@ -136,6 +140,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -165,6 +170,7 @@ private constructor( .source(source) .status(status) .updated(updated) + .blockchainRecipientToken(blockchainRecipientToken) .currency(currency) .expectedReleaseDate(expectedReleaseDate) .externalBankAccountToken(externalBankAccountToken) @@ -312,6 +318,15 @@ private constructor( */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + /** * Currency of the transaction in ISO 4217 format * @@ -511,6 +526,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + /** * Returns the raw JSON value of [currency]. * @@ -629,6 +654,7 @@ private constructor( private var source: JsonField? = null private var status: JsonField? = null private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() @@ -657,6 +683,7 @@ private constructor( source = paymentCreateResponse.source status = paymentCreateResponse.status updated = paymentCreateResponse.updated + blockchainRecipientToken = paymentCreateResponse.blockchainRecipientToken currency = paymentCreateResponse.currency expectedReleaseDate = paymentCreateResponse.expectedReleaseDate externalBankAccountToken = paymentCreateResponse.externalBankAccountToken @@ -818,6 +845,13 @@ private constructor( fun methodAttributes(wire: Payment.MethodAttributes.WireMethodAttributes) = methodAttributes(Payment.MethodAttributes.ofWire(wire)) + /** + * Alias for calling [methodAttributes] with + * `Payment.MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: Payment.MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofStablecoin(stablecoin)) + /** Pending amount in cents */ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -917,6 +951,28 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + /** Currency of the transaction in ISO 4217 format */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -1093,6 +1149,7 @@ private constructor( checkRequired("source", source), checkRequired("status", status), checkRequired("updated", updated), + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1136,6 +1193,7 @@ private constructor( source().validate() status().validate() updated() + blockchainRecipientToken() currency() expectedReleaseDate() externalBankAccountToken() @@ -1178,6 +1236,7 @@ private constructor( (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + @@ -1209,6 +1268,7 @@ private constructor( source == other.source && status == other.status && updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && @@ -1238,6 +1298,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1252,5 +1313,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentCreateResponse{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentCreateResponse{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt index e417fc59f..4ff415e87 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt @@ -42,6 +42,7 @@ private constructor( private val source: JsonField, private val status: JsonField, private val updated: JsonField, + private val blockchainRecipientToken: JsonField, private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, @@ -103,6 +104,9 @@ private constructor( @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @JsonProperty("expected_release_date") @ExcludeMissing @@ -136,6 +140,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -165,6 +170,7 @@ private constructor( .source(source) .status(status) .updated(updated) + .blockchainRecipientToken(blockchainRecipientToken) .currency(currency) .expectedReleaseDate(expectedReleaseDate) .externalBankAccountToken(externalBankAccountToken) @@ -312,6 +318,15 @@ private constructor( */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + /** * Currency of the transaction in ISO 4217 format * @@ -511,6 +526,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + /** * Returns the raw JSON value of [currency]. * @@ -629,6 +654,7 @@ private constructor( private var source: JsonField? = null private var status: JsonField? = null private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() @@ -657,6 +683,7 @@ private constructor( source = paymentRetryResponse.source status = paymentRetryResponse.status updated = paymentRetryResponse.updated + blockchainRecipientToken = paymentRetryResponse.blockchainRecipientToken currency = paymentRetryResponse.currency expectedReleaseDate = paymentRetryResponse.expectedReleaseDate externalBankAccountToken = paymentRetryResponse.externalBankAccountToken @@ -818,6 +845,13 @@ private constructor( fun methodAttributes(wire: Payment.MethodAttributes.WireMethodAttributes) = methodAttributes(Payment.MethodAttributes.ofWire(wire)) + /** + * Alias for calling [methodAttributes] with + * `Payment.MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: Payment.MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofStablecoin(stablecoin)) + /** Pending amount in cents */ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -917,6 +951,28 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + /** Currency of the transaction in ISO 4217 format */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -1093,6 +1149,7 @@ private constructor( checkRequired("source", source), checkRequired("status", status), checkRequired("updated", updated), + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1136,6 +1193,7 @@ private constructor( source().validate() status().validate() updated() + blockchainRecipientToken() currency() expectedReleaseDate() externalBankAccountToken() @@ -1178,6 +1236,7 @@ private constructor( (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + @@ -1209,6 +1268,7 @@ private constructor( source == other.source && status == other.status && updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && @@ -1238,6 +1298,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1252,5 +1313,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentRetryResponse{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentRetryResponse{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt index 9268b7ee9..9519b8629 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEvent.kt @@ -43,6 +43,7 @@ private constructor( private val source: JsonField, private val status: JsonField, private val updated: JsonField, + private val blockchainRecipientToken: JsonField, private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, @@ -104,6 +105,9 @@ private constructor( @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @JsonProperty("expected_release_date") @ExcludeMissing @@ -139,6 +143,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -168,6 +173,7 @@ private constructor( .source(source) .status(status) .updated(updated) + .blockchainRecipientToken(blockchainRecipientToken) .currency(currency) .expectedReleaseDate(expectedReleaseDate) .externalBankAccountToken(externalBankAccountToken) @@ -315,6 +321,15 @@ private constructor( */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + /** * Currency of the transaction in ISO 4217 format * @@ -514,6 +529,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + /** * Returns the raw JSON value of [currency]. * @@ -634,6 +659,7 @@ private constructor( private var source: JsonField? = null private var status: JsonField? = null private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() @@ -664,6 +690,8 @@ private constructor( source = paymentTransactionCreatedWebhookEvent.source status = paymentTransactionCreatedWebhookEvent.status updated = paymentTransactionCreatedWebhookEvent.updated + blockchainRecipientToken = + paymentTransactionCreatedWebhookEvent.blockchainRecipientToken currency = paymentTransactionCreatedWebhookEvent.currency expectedReleaseDate = paymentTransactionCreatedWebhookEvent.expectedReleaseDate externalBankAccountToken = @@ -827,6 +855,13 @@ private constructor( fun methodAttributes(wire: Payment.MethodAttributes.WireMethodAttributes) = methodAttributes(Payment.MethodAttributes.ofWire(wire)) + /** + * Alias for calling [methodAttributes] with + * `Payment.MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: Payment.MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofStablecoin(stablecoin)) + /** Pending amount in cents */ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -926,6 +961,28 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + /** Currency of the transaction in ISO 4217 format */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -1104,6 +1161,7 @@ private constructor( checkRequired("source", source), checkRequired("status", status), checkRequired("updated", updated), + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1147,6 +1205,7 @@ private constructor( source().validate() status().validate() updated() + blockchainRecipientToken() currency() expectedReleaseDate() externalBankAccountToken() @@ -1189,6 +1248,7 @@ private constructor( (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + @@ -1351,6 +1411,7 @@ private constructor( source == other.source && status == other.status && updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && @@ -1380,6 +1441,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1394,5 +1456,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentTransactionCreatedWebhookEvent{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, eventType=$eventType, additionalProperties=$additionalProperties}" + "PaymentTransactionCreatedWebhookEvent{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt index 1670c6fb5..a6aedd993 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEvent.kt @@ -43,6 +43,7 @@ private constructor( private val source: JsonField, private val status: JsonField, private val updated: JsonField, + private val blockchainRecipientToken: JsonField, private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, @@ -104,6 +105,9 @@ private constructor( @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + blockchainRecipientToken: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), @JsonProperty("expected_release_date") @ExcludeMissing @@ -139,6 +143,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -168,6 +173,7 @@ private constructor( .source(source) .status(status) .updated(updated) + .blockchainRecipientToken(blockchainRecipientToken) .currency(currency) .expectedReleaseDate(expectedReleaseDate) .externalBankAccountToken(externalBankAccountToken) @@ -315,6 +321,15 @@ private constructor( */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** + * Token of the blockchain recipient the payout is sent to + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun blockchainRecipientToken(): Optional = + blockchainRecipientToken.getOptional("blockchain_recipient_token") + /** * Currency of the transaction in ISO 4217 format * @@ -514,6 +529,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [blockchainRecipientToken]. + * + * Unlike [blockchainRecipientToken], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("blockchain_recipient_token") + @ExcludeMissing + fun _blockchainRecipientToken(): JsonField = blockchainRecipientToken + /** * Returns the raw JSON value of [currency]. * @@ -634,6 +659,7 @@ private constructor( private var source: JsonField? = null private var status: JsonField? = null private var updated: JsonField? = null + private var blockchainRecipientToken: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() @@ -664,6 +690,8 @@ private constructor( source = paymentTransactionUpdatedWebhookEvent.source status = paymentTransactionUpdatedWebhookEvent.status updated = paymentTransactionUpdatedWebhookEvent.updated + blockchainRecipientToken = + paymentTransactionUpdatedWebhookEvent.blockchainRecipientToken currency = paymentTransactionUpdatedWebhookEvent.currency expectedReleaseDate = paymentTransactionUpdatedWebhookEvent.expectedReleaseDate externalBankAccountToken = @@ -827,6 +855,13 @@ private constructor( fun methodAttributes(wire: Payment.MethodAttributes.WireMethodAttributes) = methodAttributes(Payment.MethodAttributes.ofWire(wire)) + /** + * Alias for calling [methodAttributes] with + * `Payment.MethodAttributes.ofStablecoin(stablecoin)`. + */ + fun methodAttributes(stablecoin: Payment.MethodAttributes.StablecoinMethodAttributes) = + methodAttributes(Payment.MethodAttributes.ofStablecoin(stablecoin)) + /** Pending amount in cents */ fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -926,6 +961,28 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Token of the blockchain recipient the payout is sent to */ + fun blockchainRecipientToken(blockchainRecipientToken: String?) = + blockchainRecipientToken(JsonField.ofNullable(blockchainRecipientToken)) + + /** + * Alias for calling [Builder.blockchainRecipientToken] with + * `blockchainRecipientToken.orElse(null)`. + */ + fun blockchainRecipientToken(blockchainRecipientToken: Optional) = + blockchainRecipientToken(blockchainRecipientToken.getOrNull()) + + /** + * Sets [Builder.blockchainRecipientToken] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainRecipientToken] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun blockchainRecipientToken(blockchainRecipientToken: JsonField) = apply { + this.blockchainRecipientToken = blockchainRecipientToken + } + /** Currency of the transaction in ISO 4217 format */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -1104,6 +1161,7 @@ private constructor( checkRequired("source", source), checkRequired("status", status), checkRequired("updated", updated), + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1147,6 +1205,7 @@ private constructor( source().validate() status().validate() updated() + blockchainRecipientToken() currency() expectedReleaseDate() externalBankAccountToken() @@ -1189,6 +1248,7 @@ private constructor( (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (blockchainRecipientToken.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + @@ -1351,6 +1411,7 @@ private constructor( source == other.source && status == other.status && updated == other.updated && + blockchainRecipientToken == other.blockchainRecipientToken && currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && @@ -1380,6 +1441,7 @@ private constructor( source, status, updated, + blockchainRecipientToken, currency, expectedReleaseDate, externalBankAccountToken, @@ -1394,5 +1456,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentTransactionUpdatedWebhookEvent{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, eventType=$eventType, additionalProperties=$additionalProperties}" + "PaymentTransactionUpdatedWebhookEvent{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, blockchainRecipientToken=$blockchainRecipientToken, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, tags=$tags, type=$type, userDefinedId=$userDefinedId, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt index 4bce77220..7fc41b0d8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt @@ -1409,10 +1409,16 @@ private constructor( @JvmField val STABLECOIN_RECEIVED = of("STABLECOIN_RECEIVED") + @JvmField val STABLECOIN_INITIATED = of("STABLECOIN_INITIATED") + @JvmField val STABLECOIN_REVIEWED = of("STABLECOIN_REVIEWED") + @JvmField val STABLECOIN_SENT = of("STABLECOIN_SENT") + @JvmField val STABLECOIN_SETTLED = of("STABLECOIN_SETTLED") + @JvmField val STABLECOIN_REJECTED = of("STABLECOIN_REJECTED") + @JvmStatic fun of(value: String) = FinancialEventType(JsonField.of(value)) } @@ -1509,8 +1515,11 @@ private constructor( MONTHLY_REVERSAL, ACCOUNT_TO_ACCOUNT, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, } /** @@ -1616,8 +1625,11 @@ private constructor( MONTHLY_REVERSAL, ACCOUNT_TO_ACCOUNT, STABLECOIN_RECEIVED, + STABLECOIN_INITIATED, STABLECOIN_REVIEWED, + STABLECOIN_SENT, STABLECOIN_SETTLED, + STABLECOIN_REJECTED, /** * An enum member indicating that [FinancialEventType] was instantiated with an * unknown value. @@ -1725,8 +1737,11 @@ private constructor( MONTHLY_REVERSAL -> Value.MONTHLY_REVERSAL ACCOUNT_TO_ACCOUNT -> Value.ACCOUNT_TO_ACCOUNT STABLECOIN_RECEIVED -> Value.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Value.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Value.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Value.STABLECOIN_SENT STABLECOIN_SETTLED -> Value.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Value.STABLECOIN_REJECTED else -> Value._UNKNOWN } @@ -1832,8 +1847,11 @@ private constructor( MONTHLY_REVERSAL -> Known.MONTHLY_REVERSAL ACCOUNT_TO_ACCOUNT -> Known.ACCOUNT_TO_ACCOUNT STABLECOIN_RECEIVED -> Known.STABLECOIN_RECEIVED + STABLECOIN_INITIATED -> Known.STABLECOIN_INITIATED STABLECOIN_REVIEWED -> Known.STABLECOIN_REVIEWED + STABLECOIN_SENT -> Known.STABLECOIN_SENT STABLECOIN_SETTLED -> Known.STABLECOIN_SETTLED + STABLECOIN_REJECTED -> Known.STABLECOIN_REJECTED else -> throw LithicInvalidDataException("Unknown FinancialEventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt index 5602cccc7..86b6c8987 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TokenizationSimulateParams.kt @@ -33,7 +33,7 @@ private constructor( ) : Params { /** - * The three digit cvv for the card. + * The three or four digit CVV for the card. AMEX cards use four digit CVVs. * * @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). @@ -213,7 +213,7 @@ private constructor( */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** The three digit cvv for the card. */ + /** The three or four digit CVV for the card. AMEX cards use four digit CVVs. */ fun cvv(cvv: String) = apply { body.cvv(cvv) } /** @@ -519,7 +519,7 @@ private constructor( ) /** - * The three digit cvv for the card. + * The three or four digit CVV for the card. AMEX cards use four digit CVVs. * * @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). @@ -713,7 +713,7 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } - /** The three digit cvv for the card. */ + /** The three or four digit CVV for the card. AMEX cards use four digit CVVs. */ fun cvv(cvv: String) = cvv(JsonField.of(cvv)) /** diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionMonitoringCaseListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionMonitoringCaseListParams.kt index 8c5b0ca7e..b8d07a346 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionMonitoringCaseListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransactionMonitoringCaseListParams.kt @@ -62,7 +62,11 @@ private constructor( */ fun endingBefore(): Optional = Optional.ofNullable(endingBefore) - /** Only return cases associated with the provided entity. */ + /** + * Only return cases associated with the provided entity. Accepts a card, account, or financial + * account token. Cases with a `PROGRAM` entity have no entity token and are never returned by + * this filter. + */ fun entityToken(): Optional = Optional.ofNullable(entityToken) /** Page size (for pagination). */ @@ -199,7 +203,11 @@ private constructor( /** Alias for calling [Builder.endingBefore] with `endingBefore.orElse(null)`. */ fun endingBefore(endingBefore: Optional) = endingBefore(endingBefore.getOrNull()) - /** Only return cases associated with the provided entity. */ + /** + * Only return cases associated with the provided entity. Accepts a card, account, or + * financial account token. Cases with a `PROGRAM` entity have no entity token and are never + * returned by this filter. + */ fun entityToken(entityToken: String?) = apply { this.entityToken = entityToken } /** Alias for calling [Builder.entityToken] with `entityToken.orElse(null)`. */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt index 538d9d889..e45b8e0fc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResultsResponse.kt @@ -10109,6 +10109,8 @@ private constructor( @JvmField val ACCOUNT = of("ACCOUNT") + @JvmField val PROGRAM = of("PROGRAM") + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) } @@ -10116,6 +10118,7 @@ private constructor( enum class Known { CARD, ACCOUNT, + PROGRAM, } /** @@ -10130,6 +10133,7 @@ private constructor( enum class Value { CARD, ACCOUNT, + PROGRAM, /** * An enum member indicating that [Scope] was instantiated with an unknown * value. @@ -10148,6 +10152,7 @@ private constructor( when (this) { CARD -> Value.CARD ACCOUNT -> Value.ACCOUNT + PROGRAM -> Value.PROGRAM else -> Value._UNKNOWN } @@ -10164,6 +10169,7 @@ private constructor( when (this) { CARD -> Known.CARD ACCOUNT -> Known.ACCOUNT + PROGRAM -> Known.PROGRAM else -> throw LithicInvalidDataException("Unknown Scope: $value") } @@ -12181,12 +12187,15 @@ private constructor( @JvmField val FINANCIAL_ACCOUNT = of("FINANCIAL_ACCOUNT") + @JvmField val PROGRAM = of("PROGRAM") + @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) } /** An enum containing [Scope]'s known values. */ enum class Known { - FINANCIAL_ACCOUNT + FINANCIAL_ACCOUNT, + PROGRAM, } /** @@ -12200,6 +12209,7 @@ private constructor( */ enum class Value { FINANCIAL_ACCOUNT, + PROGRAM, /** * An enum member indicating that [Scope] was instantiated with an unknown * value. @@ -12217,6 +12227,7 @@ private constructor( fun value(): Value = when (this) { FINANCIAL_ACCOUNT -> Value.FINANCIAL_ACCOUNT + PROGRAM -> Value.PROGRAM else -> Value._UNKNOWN } @@ -12232,6 +12243,7 @@ private constructor( fun known(): Known = when (this) { FINANCIAL_ACCOUNT -> Known.FINANCIAL_ACCOUNT + PROGRAM -> Known.PROGRAM else -> throw LithicInvalidDataException("Unknown Scope: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt index 58113d288..b5c0d3e10 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt @@ -25,6 +25,8 @@ private constructor( private val scope: JsonField, private val filters: JsonField, private val limitAmount: JsonField, + private val limitCashAmount: JsonField, + private val limitCashCount: JsonField, private val limitCount: JsonField, private val additionalProperties: MutableMap, ) { @@ -41,8 +43,23 @@ private constructor( @JsonProperty("limit_amount") @ExcludeMissing limitAmount: JsonField = JsonMissing.of(), + @JsonProperty("limit_cash_amount") + @ExcludeMissing + limitCashAmount: JsonField = JsonMissing.of(), + @JsonProperty("limit_cash_count") + @ExcludeMissing + limitCashCount: JsonField = JsonMissing.of(), @JsonProperty("limit_count") @ExcludeMissing limitCount: JsonField = JsonMissing.of(), - ) : this(period, scope, filters, limitAmount, limitCount, mutableMapOf()) + ) : this( + period, + scope, + filters, + limitAmount, + limitCashAmount, + limitCashCount, + limitCount, + mutableMapOf(), + ) /** * Velocity over the current day since 00:00 / 12 AM in Eastern Time @@ -75,6 +92,29 @@ private constructor( */ fun limitAmount(): Optional = limitAmount.getOptional("limit_amount") + /** + * The maximum amount of cash spend velocity allowed in the period in minor units (the smallest + * unit of a currency, e.g. cents for USD). Cash spend covers ATM withdrawals, cash + * disbursements, and purchases with cashback. Transactions exceeding this limit will be + * declined. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun limitCashAmount(): Optional = limitCashAmount.getOptional("limit_cash_amount") + + /** + * The number of cash spend velocity impacting transactions may not exceed this limit in the + * period. Transactions exceeding this limit will be declined. A cash velocity impacting + * transaction is an ATM withdrawal, cash disbursement, or purchase with cashback that has been + * authorized, and optionally settled, or a force post (a transaction that settled without prior + * authorization). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun limitCashCount(): Optional = limitCashCount.getOptional("limit_cash_count") + /** * The number of spend velocity impacting transactions may not exceed this limit in the period. * Transactions exceeding this limit will be declined. A spend velocity impacting transaction is @@ -116,6 +156,24 @@ private constructor( */ @JsonProperty("limit_amount") @ExcludeMissing fun _limitAmount(): JsonField = limitAmount + /** + * Returns the raw JSON value of [limitCashAmount]. + * + * Unlike [limitCashAmount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("limit_cash_amount") + @ExcludeMissing + fun _limitCashAmount(): JsonField = limitCashAmount + + /** + * Returns the raw JSON value of [limitCashCount]. + * + * Unlike [limitCashCount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("limit_cash_count") + @ExcludeMissing + fun _limitCashCount(): JsonField = limitCashCount + /** * Returns the raw JSON value of [limitCount]. * @@ -156,6 +214,8 @@ private constructor( private var scope: JsonField? = null private var filters: JsonField = JsonMissing.of() private var limitAmount: JsonField = JsonMissing.of() + private var limitCashAmount: JsonField = JsonMissing.of() + private var limitCashCount: JsonField = JsonMissing.of() private var limitCount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -165,6 +225,8 @@ private constructor( scope = velocityLimitParams.scope filters = velocityLimitParams.filters limitAmount = velocityLimitParams.limitAmount + limitCashAmount = velocityLimitParams.limitCashAmount + limitCashCount = velocityLimitParams.limitCashCount limitCount = velocityLimitParams.limitCount additionalProperties = velocityLimitParams.additionalProperties.toMutableMap() } @@ -262,6 +324,69 @@ private constructor( */ fun limitAmount(limitAmount: JsonField) = apply { this.limitAmount = limitAmount } + /** + * The maximum amount of cash spend velocity allowed in the period in minor units (the + * smallest unit of a currency, e.g. cents for USD). Cash spend covers ATM withdrawals, cash + * disbursements, and purchases with cashback. Transactions exceeding this limit will be + * declined. + */ + fun limitCashAmount(limitCashAmount: Long?) = + limitCashAmount(JsonField.ofNullable(limitCashAmount)) + + /** + * Alias for [Builder.limitCashAmount]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limitCashAmount(limitCashAmount: Long) = limitCashAmount(limitCashAmount as Long?) + + /** Alias for calling [Builder.limitCashAmount] with `limitCashAmount.orElse(null)`. */ + fun limitCashAmount(limitCashAmount: Optional) = + limitCashAmount(limitCashAmount.getOrNull()) + + /** + * Sets [Builder.limitCashAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.limitCashAmount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun limitCashAmount(limitCashAmount: JsonField) = apply { + this.limitCashAmount = limitCashAmount + } + + /** + * The number of cash spend velocity impacting transactions may not exceed this limit in the + * period. Transactions exceeding this limit will be declined. A cash velocity impacting + * transaction is an ATM withdrawal, cash disbursement, or purchase with cashback that has + * been authorized, and optionally settled, or a force post (a transaction that settled + * without prior authorization). + */ + fun limitCashCount(limitCashCount: Long?) = + limitCashCount(JsonField.ofNullable(limitCashCount)) + + /** + * Alias for [Builder.limitCashCount]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limitCashCount(limitCashCount: Long) = limitCashCount(limitCashCount as Long?) + + /** Alias for calling [Builder.limitCashCount] with `limitCashCount.orElse(null)`. */ + fun limitCashCount(limitCashCount: Optional) = + limitCashCount(limitCashCount.getOrNull()) + + /** + * Sets [Builder.limitCashCount] to an arbitrary JSON value. + * + * You should usually call [Builder.limitCashCount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun limitCashCount(limitCashCount: JsonField) = apply { + this.limitCashCount = limitCashCount + } + /** * The number of spend velocity impacting transactions may not exceed this limit in the * period. Transactions exceeding this limit will be declined. A spend velocity impacting @@ -326,6 +451,8 @@ private constructor( checkRequired("scope", scope), filters, limitAmount, + limitCashAmount, + limitCashCount, limitCount, additionalProperties.toMutableMap(), ) @@ -350,6 +477,8 @@ private constructor( scope().validate() filters().ifPresent { it.validate() } limitAmount() + limitCashAmount() + limitCashCount() limitCount() validated = true } @@ -373,6 +502,8 @@ private constructor( (scope.asKnown().getOrNull()?.validity() ?: 0) + (filters.asKnown().getOrNull()?.validity() ?: 0) + (if (limitAmount.asKnown().isPresent) 1 else 0) + + (if (limitCashAmount.asKnown().isPresent) 1 else 0) + + (if (limitCashCount.asKnown().isPresent) 1 else 0) + (if (limitCount.asKnown().isPresent) 1 else 0) /** The scope the velocity is calculated for */ @@ -524,16 +655,27 @@ private constructor( scope == other.scope && filters == other.filters && limitAmount == other.limitAmount && + limitCashAmount == other.limitCashAmount && + limitCashCount == other.limitCashCount && limitCount == other.limitCount && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(period, scope, filters, limitAmount, limitCount, additionalProperties) + Objects.hash( + period, + scope, + filters, + limitAmount, + limitCashAmount, + limitCashCount, + limitCount, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "VelocityLimitParams{period=$period, scope=$scope, filters=$filters, limitAmount=$limitAmount, limitCount=$limitCount, additionalProperties=$additionalProperties}" + "VelocityLimitParams{period=$period, scope=$scope, filters=$filters, limitAmount=$limitAmount, limitCashAmount=$limitCashAmount, limitCashCount=$limitCashCount, limitCount=$limitCount, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt new file mode 100644 index 000000000..271e8b61c --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsync.kt @@ -0,0 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.async + +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.models.BlockchainRecipient +import com.lithic.api.models.BlockchainRecipientCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface BlockchainRecipientServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): BlockchainRecipientServiceAsync + + /** + * Register a blockchain address as a withdrawal destination for a financial account + * + * The recipient is created with a `PENDING` verification state and cannot receive a payout + * until screening of the address completes. Registering an address that is already registered + * to the same financial account returns the existing recipient and its current verification + * state, rather than creating a second one + */ + fun create(params: BlockchainRecipientCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [BlockchainRecipientServiceAsync] that provides access to raw HTTP responses for + * each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): BlockchainRecipientServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /v1/blockchain_recipients`, but is otherwise the + * same as [BlockchainRecipientServiceAsync.create]. + */ + fun create( + params: BlockchainRecipientCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt new file mode 100644 index 000000000..6c47d1e09 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncImpl.kt @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.async + +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.handlers.errorBodyHandler +import com.lithic.api.core.handlers.errorHandler +import com.lithic.api.core.handlers.jsonHandler +import com.lithic.api.core.http.HttpMethod +import com.lithic.api.core.http.HttpRequest +import com.lithic.api.core.http.HttpResponse +import com.lithic.api.core.http.HttpResponse.Handler +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.core.http.json +import com.lithic.api.core.http.parseable +import com.lithic.api.core.prepareAsync +import com.lithic.api.models.BlockchainRecipient +import com.lithic.api.models.BlockchainRecipientCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +class BlockchainRecipientServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientServiceAsync { + + private val withRawResponse: BlockchainRecipientServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): BlockchainRecipientServiceAsync.WithRawResponse = + withRawResponse + + override fun withOptions( + modifier: Consumer + ): BlockchainRecipientServiceAsync = + BlockchainRecipientServiceAsyncImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/blockchain_recipients + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + BlockchainRecipientServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): BlockchainRecipientServiceAsync.WithRawResponse = + BlockchainRecipientServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "blockchain_recipients") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt new file mode 100644 index 000000000..67020b171 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientService.kt @@ -0,0 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.models.BlockchainRecipient +import com.lithic.api.models.BlockchainRecipientCreateParams +import java.util.function.Consumer + +interface BlockchainRecipientService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): BlockchainRecipientService + + /** + * Register a blockchain address as a withdrawal destination for a financial account + * + * The recipient is created with a `PENDING` verification state and cannot receive a payout + * until screening of the address completes. Registering an address that is already registered + * to the same financial account returns the existing recipient and its current verification + * state, rather than creating a second one + */ + fun create(params: BlockchainRecipientCreateParams): BlockchainRecipient = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): BlockchainRecipient + + /** + * A view of [BlockchainRecipientService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): BlockchainRecipientService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /v1/blockchain_recipients`, but is otherwise the + * same as [BlockchainRecipientService.create]. + */ + @MustBeClosed + fun create(params: BlockchainRecipientCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt new file mode 100644 index 000000000..946e5a2dc --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceImpl.kt @@ -0,0 +1,84 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.blocking + +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.handlers.errorBodyHandler +import com.lithic.api.core.handlers.errorHandler +import com.lithic.api.core.handlers.jsonHandler +import com.lithic.api.core.http.HttpMethod +import com.lithic.api.core.http.HttpRequest +import com.lithic.api.core.http.HttpResponse +import com.lithic.api.core.http.HttpResponse.Handler +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.core.http.json +import com.lithic.api.core.http.parseable +import com.lithic.api.core.prepare +import com.lithic.api.models.BlockchainRecipient +import com.lithic.api.models.BlockchainRecipientCreateParams +import java.util.function.Consumer + +class BlockchainRecipientServiceImpl +internal constructor(private val clientOptions: ClientOptions) : BlockchainRecipientService { + + private val withRawResponse: BlockchainRecipientService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): BlockchainRecipientService.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): BlockchainRecipientService = + BlockchainRecipientServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions, + ): BlockchainRecipient = + // post /v1/blockchain_recipients + withRawResponse().create(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + BlockchainRecipientService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): BlockchainRecipientService.WithRawResponse = + BlockchainRecipientServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: BlockchainRecipientCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "blockchain_recipients") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt index 0b3762e5a..4198be927 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt @@ -77,6 +77,7 @@ internal class AccountActivityListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -156,6 +157,7 @@ internal class AccountActivityListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -239,6 +241,7 @@ internal class AccountActivityListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt index 8484cbb71..965aae621 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt @@ -788,6 +788,7 @@ internal class AccountActivityListResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -873,6 +874,7 @@ internal class AccountActivityListResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt index 46bbd28b0..1afb86835 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt @@ -817,6 +817,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -903,6 +904,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientCreateParamsTest.kt new file mode 100644 index 000000000..419b7188c --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientCreateParamsTest.kt @@ -0,0 +1,66 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class BlockchainRecipientCreateParamsTest { + + @Test + fun create() { + BlockchainRecipientCreateParams.builder() + .accountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + .address("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + .chain("ETHEREUM") + .owner("John Doe") + .ownerType(OwnerType.INDIVIDUAL) + .addressTag("address_tag") + .name("Cold wallet") + .build() + } + + @Test + fun body() { + val params = + BlockchainRecipientCreateParams.builder() + .accountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + .address("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + .chain("ETHEREUM") + .owner("John Doe") + .ownerType(OwnerType.INDIVIDUAL) + .addressTag("address_tag") + .name("Cold wallet") + .build() + + val body = params._body() + + assertThat(body.accountToken()).isEqualTo("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + assertThat(body.address()).isEqualTo("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + assertThat(body.chain()).isEqualTo("ETHEREUM") + assertThat(body.owner()).isEqualTo("John Doe") + assertThat(body.ownerType()).isEqualTo(OwnerType.INDIVIDUAL) + assertThat(body.addressTag()).contains("address_tag") + assertThat(body.name()).contains("Cold wallet") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + BlockchainRecipientCreateParams.builder() + .accountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + .address("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + .chain("ETHEREUM") + .owner("John Doe") + .ownerType(OwnerType.INDIVIDUAL) + .build() + + val body = params._body() + + assertThat(body.accountToken()).isEqualTo("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + assertThat(body.address()).isEqualTo("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + assertThat(body.chain()).isEqualTo("ETHEREUM") + assertThat(body.owner()).isEqualTo("John Doe") + assertThat(body.ownerType()).isEqualTo(OwnerType.INDIVIDUAL) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientTest.kt new file mode 100644 index 000000000..4bb8f4ac5 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BlockchainRecipientTest.kt @@ -0,0 +1,80 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class BlockchainRecipientTest { + + @Test + fun create() { + val blockchainRecipient = + BlockchainRecipient.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addressTag("address_tag") + .chain("chain") + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalId("external_id") + .name("name") + .owner("owner") + .ownerType(OwnerType.INDIVIDUAL) + .programId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .state(BlockchainRecipient.State.ENABLED) + .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .verificationState(BlockchainRecipient.VerificationState.PENDING) + .build() + + assertThat(blockchainRecipient.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(blockchainRecipient.accountToken()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(blockchainRecipient.addressTag()).contains("address_tag") + assertThat(blockchainRecipient.chain()).isEqualTo("chain") + assertThat(blockchainRecipient.created()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(blockchainRecipient.externalId()).contains("external_id") + assertThat(blockchainRecipient.name()).contains("name") + assertThat(blockchainRecipient.owner()).isEqualTo("owner") + assertThat(blockchainRecipient.ownerType()).isEqualTo(OwnerType.INDIVIDUAL) + assertThat(blockchainRecipient.programId()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(blockchainRecipient.state()).isEqualTo(BlockchainRecipient.State.ENABLED) + assertThat(blockchainRecipient.updated()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(blockchainRecipient.verificationState()) + .isEqualTo(BlockchainRecipient.VerificationState.PENDING) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val blockchainRecipient = + BlockchainRecipient.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addressTag("address_tag") + .chain("chain") + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .externalId("external_id") + .name("name") + .owner("owner") + .ownerType(OwnerType.INDIVIDUAL) + .programId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .state(BlockchainRecipient.State.ENABLED) + .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .verificationState(BlockchainRecipient.VerificationState.PENDING) + .build() + + val roundtrippedBlockchainRecipient = + jsonMapper.readValue( + jsonMapper.writeValueAsString(blockchainRecipient), + jacksonTypeRef(), + ) + + assertThat(roundtrippedBlockchainRecipient).isEqualTo(blockchainRecipient) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CaseEntityTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CaseEntityTest.kt index 23eb4902e..36cd66150 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CaseEntityTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CaseEntityTest.kt @@ -17,7 +17,7 @@ internal class CaseEntityTest { .entityType(CaseEntity.EntityType2.CARD) .build() - assertThat(caseEntity.entityToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(caseEntity.entityToken()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(caseEntity.entityType()).isEqualTo(CaseEntity.EntityType2.CARD) } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEventTest.kt index 5fe301bfe..7922077db 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionCreatedWebhookEventTest.kt @@ -18,6 +18,7 @@ internal class DisputeTransactionCreatedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -80,6 +81,8 @@ internal class DisputeTransactionCreatedWebhookEventTest { assertThat(disputeTransactionCreatedWebhookEvent.cardToken()) .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeTransactionCreatedWebhookEvent.caseId()).contains("case_id") + assertThat(disputeTransactionCreatedWebhookEvent.claimToken()) + .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeTransactionCreatedWebhookEvent.created()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(disputeTransactionCreatedWebhookEvent.currency()).isEqualTo("USD") @@ -151,6 +154,7 @@ internal class DisputeTransactionCreatedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEventTest.kt index c080d6411..5586ab152 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTransactionUpdatedWebhookEventTest.kt @@ -18,6 +18,7 @@ internal class DisputeTransactionUpdatedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -80,6 +81,8 @@ internal class DisputeTransactionUpdatedWebhookEventTest { assertThat(disputeTransactionUpdatedWebhookEvent.cardToken()) .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeTransactionUpdatedWebhookEvent.caseId()).contains("case_id") + assertThat(disputeTransactionUpdatedWebhookEvent.claimToken()) + .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeTransactionUpdatedWebhookEvent.created()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(disputeTransactionUpdatedWebhookEvent.currency()).isEqualTo("USD") @@ -151,6 +154,7 @@ internal class DisputeTransactionUpdatedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeV2Test.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeV2Test.kt index 145b0dd36..6bfe2dfd2 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeV2Test.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeV2Test.kt @@ -18,6 +18,7 @@ internal class DisputeV2Test { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -74,6 +75,7 @@ internal class DisputeV2Test { assertThat(disputeV2.accountToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeV2.cardToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeV2.caseId()).contains("case_id") + assertThat(disputeV2.claimToken()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(disputeV2.created()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(disputeV2.currency()).isEqualTo("USD") assertThat(disputeV2.disposition()).contains(DisputeV2.Disposition.WON) @@ -139,6 +141,7 @@ internal class DisputeV2Test { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListPageResponseTest.kt index 73eedede1..7bfc00c59 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListPageResponseTest.kt @@ -20,6 +20,7 @@ internal class DisputesV2ListPageResponseTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -88,6 +89,7 @@ internal class DisputesV2ListPageResponseTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -156,6 +158,7 @@ internal class DisputesV2ListPageResponseTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListParamsTest.kt index 1f545a3d4..13677f3a6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2ListParamsTest.kt @@ -15,6 +15,7 @@ internal class DisputesV2ListParamsTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .begin(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .disputedTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .end(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .endingBefore("ending_before") @@ -30,6 +31,7 @@ internal class DisputesV2ListParamsTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .begin(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .disputedTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .end(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .endingBefore("ending_before") @@ -45,6 +47,7 @@ internal class DisputesV2ListParamsTest { .put("account_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("begin", "2019-12-27T18:11:19.117Z") .put("card_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put("claim_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("disputed_transaction_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("end", "2019-12-27T18:11:19.117Z") .put("ending_before", "ending_before") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEventTest.kt index 4b0ee89a9..1a5983280 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountCreatedWebhookEventTest.kt @@ -3,6 +3,7 @@ package com.lithic.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -40,6 +41,14 @@ internal class FinancialAccountCreatedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) .build() @@ -79,6 +88,15 @@ internal class FinancialAccountCreatedWebhookEventTest { assertThat(financialAccountCreatedWebhookEvent.userDefinedStatus()) .contains("user_defined_status") assertThat(financialAccountCreatedWebhookEvent.accountNumber()).contains("account_number") + assertThat(financialAccountCreatedWebhookEvent.blockchainAddresses()) + .contains( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) assertThat(financialAccountCreatedWebhookEvent.routingNumber()).contains("routing_number") assertThat(financialAccountCreatedWebhookEvent.eventType()) .isEqualTo(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) @@ -115,6 +133,14 @@ internal class FinancialAccountCreatedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountListPageResponseTest.kt index d145b6c5c..4fcad53e2 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountListPageResponseTest.kt @@ -3,6 +3,7 @@ package com.lithic.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -44,6 +45,14 @@ internal class FinancialAccountListPageResponseTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .build() ) @@ -79,6 +88,14 @@ internal class FinancialAccountListPageResponseTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .build() ) @@ -120,6 +137,14 @@ internal class FinancialAccountListPageResponseTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountTest.kt index 98eb1f5ac..08f37d8d0 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountTest.kt @@ -3,6 +3,7 @@ package com.lithic.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -40,6 +41,14 @@ internal class FinancialAccountTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .build() @@ -74,6 +83,15 @@ internal class FinancialAccountTest { .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(financialAccount.userDefinedStatus()).contains("user_defined_status") assertThat(financialAccount.accountNumber()).contains("account_number") + assertThat(financialAccount.blockchainAddresses()) + .contains( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) assertThat(financialAccount.routingNumber()).contains("routing_number") } @@ -108,6 +126,14 @@ internal class FinancialAccountTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEventTest.kt index 79e2cac6d..b15b6d8dd 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdatedWebhookEventTest.kt @@ -3,6 +3,7 @@ package com.lithic.api.models import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.JsonValue import com.lithic.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -40,6 +41,14 @@ internal class FinancialAccountUpdatedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() @@ -79,6 +88,15 @@ internal class FinancialAccountUpdatedWebhookEventTest { assertThat(financialAccountUpdatedWebhookEvent.userDefinedStatus()) .contains("user_defined_status") assertThat(financialAccountUpdatedWebhookEvent.accountNumber()).contains("account_number") + assertThat(financialAccountUpdatedWebhookEvent.blockchainAddresses()) + .contains( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) assertThat(financialAccountUpdatedWebhookEvent.routingNumber()).contains("routing_number") assertThat(financialAccountUpdatedWebhookEvent.eventType()) .isEqualTo(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) @@ -115,6 +133,14 @@ internal class FinancialAccountUpdatedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index de53b7467..2346af998 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt @@ -7239,6 +7239,14 @@ internal class ParsedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) .build() @@ -7348,6 +7356,14 @@ internal class ParsedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType( FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED @@ -7394,6 +7410,14 @@ internal class ParsedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() @@ -7503,6 +7527,14 @@ internal class ParsedWebhookEventTest { .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .userDefinedStatus("user_defined_status") .accountNumber("account_number") + .blockchainAddresses( + FinancialAccount.BlockchainAddresses.builder() + .putAdditionalProperty( + "ETHEREUM", + JsonValue.from("0x5f2b9e8a1c4d7f0e3a6b9c2d5e8f1a4b7c0d3e6f"), + ) + .build() + ) .routingNumber("routing_number") .eventType( FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED @@ -9579,6 +9611,7 @@ internal class ParsedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -9730,6 +9763,7 @@ internal class ParsedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -9815,6 +9849,7 @@ internal class ParsedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -9966,6 +10001,7 @@ internal class ParsedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -12948,6 +12984,7 @@ internal class ParsedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -13087,6 +13124,7 @@ internal class ParsedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -13162,6 +13200,7 @@ internal class ParsedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) @@ -13301,6 +13340,7 @@ internal class ParsedWebhookEventTest { .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .caseId("case_id") + .claimToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("USD") .disposition(DisputeV2.Disposition.WON) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateResponseTest.kt index 5d638ef37..8026d984d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateResponseTest.kt @@ -71,6 +71,7 @@ internal class PaymentCreateResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -159,6 +160,8 @@ internal class PaymentCreateResponseTest { assertThat(paymentCreateResponse.status()).isEqualTo(Payment.TransactionStatus.PENDING) assertThat(paymentCreateResponse.updated()) .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(paymentCreateResponse.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") assertThat(paymentCreateResponse.currency()).contains("USD") assertThat(paymentCreateResponse.expectedReleaseDate()).isEmpty assertThat(paymentCreateResponse.externalBankAccountToken()) @@ -249,6 +252,7 @@ internal class PaymentCreateResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentListPageResponseTest.kt index 18f5b284f..2b0e370b6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentListPageResponseTest.kt @@ -77,6 +77,7 @@ internal class PaymentListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -151,6 +152,7 @@ internal class PaymentListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -233,6 +235,7 @@ internal class PaymentListPageResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetryResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetryResponseTest.kt index 35fde1b08..9053798c7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetryResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetryResponseTest.kt @@ -71,6 +71,7 @@ internal class PaymentRetryResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -159,6 +160,8 @@ internal class PaymentRetryResponseTest { assertThat(paymentRetryResponse.status()).isEqualTo(Payment.TransactionStatus.PENDING) assertThat(paymentRetryResponse.updated()) .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(paymentRetryResponse.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") assertThat(paymentRetryResponse.currency()).contains("USD") assertThat(paymentRetryResponse.expectedReleaseDate()).isEmpty assertThat(paymentRetryResponse.externalBankAccountToken()) @@ -249,6 +252,7 @@ internal class PaymentRetryResponseTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTest.kt index b75154717..459265ae4 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTest.kt @@ -71,6 +71,7 @@ internal class PaymentTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -143,6 +144,8 @@ internal class PaymentTest { assertThat(payment.source()).isEqualTo(Payment.Source.LITHIC) assertThat(payment.status()).isEqualTo(Payment.TransactionStatus.PENDING) assertThat(payment.updated()).isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(payment.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") assertThat(payment.currency()).contains("USD") assertThat(payment.expectedReleaseDate()).isEmpty assertThat(payment.externalBankAccountToken()) @@ -218,6 +221,7 @@ internal class PaymentTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEventTest.kt index 51a8d7e1c..f5627b211 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionCreatedWebhookEventTest.kt @@ -71,6 +71,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -155,6 +156,8 @@ internal class PaymentTransactionCreatedWebhookEventTest { .isEqualTo(Payment.TransactionStatus.PENDING) assertThat(paymentTransactionCreatedWebhookEvent.updated()) .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(paymentTransactionCreatedWebhookEvent.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") assertThat(paymentTransactionCreatedWebhookEvent.currency()).contains("USD") assertThat(paymentTransactionCreatedWebhookEvent.expectedReleaseDate()).isEmpty assertThat(paymentTransactionCreatedWebhookEvent.externalBankAccountToken()) @@ -233,6 +236,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEventTest.kt index e93812e7d..91fd9a94d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentTransactionUpdatedWebhookEventTest.kt @@ -71,6 +71,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") @@ -155,6 +156,8 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .isEqualTo(Payment.TransactionStatus.PENDING) assertThat(paymentTransactionUpdatedWebhookEvent.updated()) .isEqualTo(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + assertThat(paymentTransactionUpdatedWebhookEvent.blockchainRecipientToken()) + .contains("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") assertThat(paymentTransactionUpdatedWebhookEvent.currency()).contains("USD") assertThat(paymentTransactionUpdatedWebhookEvent.expectedReleaseDate()).isEmpty assertThat(paymentTransactionUpdatedWebhookEvent.externalBankAccountToken()) @@ -233,6 +236,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .source(Payment.Source.LITHIC) .status(Payment.TransactionStatus.PENDING) .updated(OffsetDateTime.parse("2025-10-27T20:12:25Z")) + .blockchainRecipientToken("1e3fdb71-4b52-4a30-a7a9-52c85e26a1d9") .currency("USD") .expectedReleaseDate(null) .externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt index 91d3b1462..41610a04a 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt @@ -30,6 +30,8 @@ internal class VelocityLimitParamsTest { .build() ) .limitAmount(10000L) + .limitCashAmount(5000L) + .limitCashCount(0L) .limitCount(0L) .build() @@ -54,6 +56,8 @@ internal class VelocityLimitParamsTest { .build() ) assertThat(velocityLimitParams.limitAmount()).contains(10000L) + assertThat(velocityLimitParams.limitCashAmount()).contains(5000L) + assertThat(velocityLimitParams.limitCashCount()).contains(0L) assertThat(velocityLimitParams.limitCount()).contains(0L) } @@ -79,6 +83,8 @@ internal class VelocityLimitParamsTest { .build() ) .limitAmount(10000L) + .limitCashAmount(5000L) + .limitCashCount(0L) .limitCount(0L) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt new file mode 100644 index 000000000..1e1b7077f --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BlockchainRecipientServiceAsyncTest.kt @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.async + +import com.lithic.api.TestServerExtension +import com.lithic.api.client.okhttp.LithicOkHttpClientAsync +import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.OwnerType +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class BlockchainRecipientServiceAsyncTest { + + @Test + fun create() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val blockchainRecipientServiceAsync = client.blockchainRecipients() + + val blockchainRecipientFuture = + blockchainRecipientServiceAsync.create( + BlockchainRecipientCreateParams.builder() + .accountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + .address("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + .chain("ETHEREUM") + .owner("John Doe") + .ownerType(OwnerType.INDIVIDUAL) + .addressTag("address_tag") + .name("Cold wallet") + .build() + ) + + val blockchainRecipient = blockchainRecipientFuture.get() + blockchainRecipient.validate() + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt new file mode 100644 index 000000000..9db896ff1 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BlockchainRecipientServiceTest.kt @@ -0,0 +1,39 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.blocking + +import com.lithic.api.TestServerExtension +import com.lithic.api.client.okhttp.LithicOkHttpClient +import com.lithic.api.models.BlockchainRecipientCreateParams +import com.lithic.api.models.OwnerType +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class BlockchainRecipientServiceTest { + + @Test + fun create() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val blockchainRecipientService = client.blockchainRecipients() + + val blockchainRecipient = + blockchainRecipientService.create( + BlockchainRecipientCreateParams.builder() + .accountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0") + .address("0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3") + .chain("ETHEREUM") + .owner("John Doe") + .ownerType(OwnerType.INDIVIDUAL) + .addressTag("address_tag") + .name("Cold wallet") + .build() + ) + + blockchainRecipient.validate() + } +} diff --git a/lithic-java-proguard-test/src/test/kotlin/com/lithic/api/proguard/ProGuardCompatibilityTest.kt b/lithic-java-proguard-test/src/test/kotlin/com/lithic/api/proguard/ProGuardCompatibilityTest.kt index 5a7497c30..bcf407767 100644 --- a/lithic-java-proguard-test/src/test/kotlin/com/lithic/api/proguard/ProGuardCompatibilityTest.kt +++ b/lithic-java-proguard-test/src/test/kotlin/com/lithic/api/proguard/ProGuardCompatibilityTest.kt @@ -68,6 +68,7 @@ internal class ProGuardCompatibilityTest { assertThat(client.transactions()).isNotNull() assertThat(client.responderEndpoints()).isNotNull() assertThat(client.externalBankAccounts()).isNotNull() + assertThat(client.blockchainRecipients()).isNotNull() assertThat(client.payments()).isNotNull() assertThat(client.threeDS()).isNotNull() assertThat(client.reports()).isNotNull() diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index 10f3c7055..5c1fbefc4 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -91,6 +91,7 @@ generate_instructions() { Maven Repo +

Stainless SDK Maven Repository