diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d61779f3c..d3dc9f51b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.114.0" + ".": "0.115.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3f808b063..ddb484b7e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml -openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f -config_hash: 739714a3fead0b26ee3a3b7bc51081f6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml +openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a +config_hash: 9dddee5f7af579864599849cb28a0770 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4795f3d..c879280ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 0.115.0 (2026-01-08) + +Full Changelog: [v0.114.0...v0.115.0](https://github.com/lithic-com/lithic-java/compare/v0.114.0...v0.115.0) + +### Features + +* **api:** Add card state attribute to tokenization rules ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) +* **api:** Add event_type to ASA request and 3DS decisioning request ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) +* **api:** add external_id to payment_event ([7e8636d](https://github.com/lithic-com/lithic-java/commit/7e8636dfea36aff2e4bebc432f3d89375c2da25e)) +* **api:** add get /v1/transfer_limits endpoint ([7e8636d](https://github.com/lithic-com/lithic-java/commit/7e8636dfea36aff2e4bebc432f3d89375c2da25e)) +* **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([7e8636d](https://github.com/lithic-com/lithic-java/commit/7e8636dfea36aff2e4bebc432f3d89375c2da25e)) +* **api:** Add user defined status to ledger accounts ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) +* **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([7d05a12](https://github.com/lithic-com/lithic-java/commit/7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6)) +* **api:** Expose Payment Allocation Details ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) +* **api:** remove unnecessary X-Lithic-Pagination header ([7d05a12](https://github.com/lithic-com/lithic-java/commit/7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6)) +* **api:** remove v1/aggregate_balances and related models ([5af17d0](https://github.com/lithic-com/lithic-java/commit/5af17d0a2f9d70199ff755fffef3b5ef7f23ab41)) +* **client:** add `HttpRequest#url()` method ([fe27f93](https://github.com/lithic-com/lithic-java/commit/fe27f930f542aa2d772821f968923c9a341b081a)) + + +### Chores + +* update code formatting ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) + + +### Documentation + +* **api:** clarify description of token / retry_token when it serves as idempotency key ([7d05a12](https://github.com/lithic-com/lithic-java/commit/7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6)) +* Update language for Google Web Push Provisioning docs ([5d8ec28](https://github.com/lithic-com/lithic-java/commit/5d8ec284129e2b4440938ce752c6556701f4b394)) + ## 0.114.0 (2025-12-11) Full Changelog: [v0.113.0...v0.114.0](https://github.com/lithic-com/lithic-java/compare/v0.113.0...v0.114.0) diff --git a/LICENSE b/LICENSE index 06eee64e8..9410347b2 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Lithic + Copyright 2026 Lithic Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 0fa561515..234c6d0f2 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.114.0) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.114.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.114.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.115.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.115.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.115.0) @@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.114.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.115.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.114.0") +implementation("com.lithic.api:lithic-java:0.115.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.114.0") com.lithic.api lithic-java - 0.114.0 + 0.115.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index ec3bd95e1..1c30b48af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.114.0" // x-release-please-version + version = "0.115.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 eb7b7ff11..5c62db05a 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 @@ -11,7 +11,6 @@ import com.lithic.api.models.ClientApiStatusParams import com.lithic.api.services.blocking.AccountActivityService import com.lithic.api.services.blocking.AccountHolderService import com.lithic.api.services.blocking.AccountService -import com.lithic.api.services.blocking.AggregateBalanceService import com.lithic.api.services.blocking.AuthRuleService import com.lithic.api.services.blocking.AuthStreamEnrollmentService import com.lithic.api.services.blocking.BalanceService @@ -39,6 +38,7 @@ import com.lithic.api.services.blocking.ThreeDSService import com.lithic.api.services.blocking.TokenizationDecisioningService import com.lithic.api.services.blocking.TokenizationService import com.lithic.api.services.blocking.TransactionService +import com.lithic.api.services.blocking.TransferLimitService import com.lithic.api.services.blocking.TransferService import com.lithic.api.services.blocking.WebhookService import java.util.function.Consumer @@ -97,8 +97,6 @@ interface LithicClient { fun balances(): BalanceService - fun aggregateBalances(): AggregateBalanceService - fun disputes(): DisputeService fun disputesV2(): DisputesV2Service @@ -143,6 +141,8 @@ interface LithicClient { fun accountActivity(): AccountActivityService + fun transferLimits(): TransferLimitService + fun webhooks(): WebhookService /** Status of api */ @@ -203,8 +203,6 @@ interface LithicClient { fun balances(): BalanceService.WithRawResponse - fun aggregateBalances(): AggregateBalanceService.WithRawResponse - fun disputes(): DisputeService.WithRawResponse fun disputesV2(): DisputesV2Service.WithRawResponse @@ -249,6 +247,8 @@ interface LithicClient { fun accountActivity(): AccountActivityService.WithRawResponse + fun transferLimits(): TransferLimitService.WithRawResponse + fun webhooks(): WebhookService.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 982132d5b..720abfe67 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 @@ -10,7 +10,6 @@ import com.lithic.api.models.ClientApiStatusParams import com.lithic.api.services.async.AccountActivityServiceAsync import com.lithic.api.services.async.AccountHolderServiceAsync import com.lithic.api.services.async.AccountServiceAsync -import com.lithic.api.services.async.AggregateBalanceServiceAsync import com.lithic.api.services.async.AuthRuleServiceAsync import com.lithic.api.services.async.AuthStreamEnrollmentServiceAsync import com.lithic.api.services.async.BalanceServiceAsync @@ -38,6 +37,7 @@ import com.lithic.api.services.async.ThreeDSServiceAsync import com.lithic.api.services.async.TokenizationDecisioningServiceAsync import com.lithic.api.services.async.TokenizationServiceAsync import com.lithic.api.services.async.TransactionServiceAsync +import com.lithic.api.services.async.TransferLimitServiceAsync import com.lithic.api.services.async.TransferServiceAsync import com.lithic.api.services.async.WebhookServiceAsync import java.util.concurrent.CompletableFuture @@ -97,8 +97,6 @@ interface LithicClientAsync { fun balances(): BalanceServiceAsync - fun aggregateBalances(): AggregateBalanceServiceAsync - fun disputes(): DisputeServiceAsync fun disputesV2(): DisputesV2ServiceAsync @@ -143,6 +141,8 @@ interface LithicClientAsync { fun accountActivity(): AccountActivityServiceAsync + fun transferLimits(): TransferLimitServiceAsync + fun webhooks(): WebhookServiceAsync /** Status of api */ @@ -206,8 +206,6 @@ interface LithicClientAsync { fun balances(): BalanceServiceAsync.WithRawResponse - fun aggregateBalances(): AggregateBalanceServiceAsync.WithRawResponse - fun disputes(): DisputeServiceAsync.WithRawResponse fun disputesV2(): DisputesV2ServiceAsync.WithRawResponse @@ -252,6 +250,8 @@ interface LithicClientAsync { fun accountActivity(): AccountActivityServiceAsync.WithRawResponse + fun transferLimits(): TransferLimitServiceAsync.WithRawResponse + fun webhooks(): WebhookServiceAsync.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 b757af652..10e87732d 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 @@ -23,8 +23,6 @@ import com.lithic.api.services.async.AccountHolderServiceAsync import com.lithic.api.services.async.AccountHolderServiceAsyncImpl import com.lithic.api.services.async.AccountServiceAsync import com.lithic.api.services.async.AccountServiceAsyncImpl -import com.lithic.api.services.async.AggregateBalanceServiceAsync -import com.lithic.api.services.async.AggregateBalanceServiceAsyncImpl import com.lithic.api.services.async.AuthRuleServiceAsync import com.lithic.api.services.async.AuthRuleServiceAsyncImpl import com.lithic.api.services.async.AuthStreamEnrollmentServiceAsync @@ -79,6 +77,8 @@ import com.lithic.api.services.async.TokenizationServiceAsync import com.lithic.api.services.async.TokenizationServiceAsyncImpl import com.lithic.api.services.async.TransactionServiceAsync import com.lithic.api.services.async.TransactionServiceAsyncImpl +import com.lithic.api.services.async.TransferLimitServiceAsync +import com.lithic.api.services.async.TransferLimitServiceAsyncImpl import com.lithic.api.services.async.TransferServiceAsync import com.lithic.api.services.async.TransferServiceAsyncImpl import com.lithic.api.services.async.WebhookServiceAsync @@ -137,10 +137,6 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl BalanceServiceAsyncImpl(clientOptionsWithUserAgent) } - private val aggregateBalances: AggregateBalanceServiceAsync by lazy { - AggregateBalanceServiceAsyncImpl(clientOptionsWithUserAgent) - } - private val disputes: DisputeServiceAsync by lazy { DisputeServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -229,6 +225,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl AccountActivityServiceAsyncImpl(clientOptionsWithUserAgent) } + private val transferLimits: TransferLimitServiceAsync by lazy { + TransferLimitServiceAsyncImpl(clientOptionsWithUserAgent) + } + private val webhooks: WebhookServiceAsync by lazy { WebhookServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -259,8 +259,6 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun balances(): BalanceServiceAsync = balances - override fun aggregateBalances(): AggregateBalanceServiceAsync = aggregateBalances - override fun disputes(): DisputeServiceAsync = disputes override fun disputesV2(): DisputesV2ServiceAsync = disputesV2 @@ -305,6 +303,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun accountActivity(): AccountActivityServiceAsync = accountActivity + override fun transferLimits(): TransferLimitServiceAsync = transferLimits + override fun webhooks(): WebhookServiceAsync = webhooks override fun apiStatus( @@ -359,10 +359,6 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl BalanceServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val aggregateBalances: AggregateBalanceServiceAsync.WithRawResponse by lazy { - AggregateBalanceServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val disputes: DisputeServiceAsync.WithRawResponse by lazy { DisputeServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -451,6 +447,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl AccountActivityServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val transferLimits: TransferLimitServiceAsync.WithRawResponse by lazy { + TransferLimitServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val webhooks: WebhookServiceAsync.WithRawResponse by lazy { WebhookServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -482,9 +482,6 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun balances(): BalanceServiceAsync.WithRawResponse = balances - override fun aggregateBalances(): AggregateBalanceServiceAsync.WithRawResponse = - aggregateBalances - override fun disputes(): DisputeServiceAsync.WithRawResponse = disputes override fun disputesV2(): DisputesV2ServiceAsync.WithRawResponse = disputesV2 @@ -536,6 +533,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl override fun accountActivity(): AccountActivityServiceAsync.WithRawResponse = accountActivity + override fun transferLimits(): TransferLimitServiceAsync.WithRawResponse = transferLimits + override fun webhooks(): WebhookServiceAsync.WithRawResponse = webhooks private val apiStatusHandler: Handler = 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 eb652dd00..411eeb787 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 @@ -23,8 +23,6 @@ import com.lithic.api.services.blocking.AccountHolderService import com.lithic.api.services.blocking.AccountHolderServiceImpl import com.lithic.api.services.blocking.AccountService import com.lithic.api.services.blocking.AccountServiceImpl -import com.lithic.api.services.blocking.AggregateBalanceService -import com.lithic.api.services.blocking.AggregateBalanceServiceImpl import com.lithic.api.services.blocking.AuthRuleService import com.lithic.api.services.blocking.AuthRuleServiceImpl import com.lithic.api.services.blocking.AuthStreamEnrollmentService @@ -79,6 +77,8 @@ import com.lithic.api.services.blocking.TokenizationService import com.lithic.api.services.blocking.TokenizationServiceImpl import com.lithic.api.services.blocking.TransactionService import com.lithic.api.services.blocking.TransactionServiceImpl +import com.lithic.api.services.blocking.TransferLimitService +import com.lithic.api.services.blocking.TransferLimitServiceImpl import com.lithic.api.services.blocking.TransferService import com.lithic.api.services.blocking.TransferServiceImpl import com.lithic.api.services.blocking.WebhookService @@ -132,10 +132,6 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient private val balances: BalanceService by lazy { BalanceServiceImpl(clientOptionsWithUserAgent) } - private val aggregateBalances: AggregateBalanceService by lazy { - AggregateBalanceServiceImpl(clientOptionsWithUserAgent) - } - private val disputes: DisputeService by lazy { DisputeServiceImpl(clientOptionsWithUserAgent) } private val disputesV2: DisputesV2Service by lazy { @@ -212,6 +208,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient AccountActivityServiceImpl(clientOptionsWithUserAgent) } + private val transferLimits: TransferLimitService by lazy { + TransferLimitServiceImpl(clientOptionsWithUserAgent) + } + private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptionsWithUserAgent) } override fun async(): LithicClientAsync = async @@ -239,8 +239,6 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun balances(): BalanceService = balances - override fun aggregateBalances(): AggregateBalanceService = aggregateBalances - override fun disputes(): DisputeService = disputes override fun disputesV2(): DisputesV2Service = disputesV2 @@ -285,6 +283,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun accountActivity(): AccountActivityService = accountActivity + override fun transferLimits(): TransferLimitService = transferLimits + override fun webhooks(): WebhookService = webhooks override fun apiStatus( @@ -339,10 +339,6 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient BalanceServiceImpl.WithRawResponseImpl(clientOptions) } - private val aggregateBalances: AggregateBalanceService.WithRawResponse by lazy { - AggregateBalanceServiceImpl.WithRawResponseImpl(clientOptions) - } - private val disputes: DisputeService.WithRawResponse by lazy { DisputeServiceImpl.WithRawResponseImpl(clientOptions) } @@ -431,6 +427,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient AccountActivityServiceImpl.WithRawResponseImpl(clientOptions) } + private val transferLimits: TransferLimitService.WithRawResponse by lazy { + TransferLimitServiceImpl.WithRawResponseImpl(clientOptions) + } + private val webhooks: WebhookService.WithRawResponse by lazy { WebhookServiceImpl.WithRawResponseImpl(clientOptions) } @@ -462,9 +462,6 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun balances(): BalanceService.WithRawResponse = balances - override fun aggregateBalances(): AggregateBalanceService.WithRawResponse = - aggregateBalances - override fun disputes(): DisputeService.WithRawResponse = disputes override fun disputesV2(): DisputesV2Service.WithRawResponse = disputesV2 @@ -514,6 +511,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient override fun accountActivity(): AccountActivityService.WithRawResponse = accountActivity + override fun transferLimits(): TransferLimitService.WithRawResponse = transferLimits + override fun webhooks(): WebhookService.WithRawResponse = webhooks private val apiStatusHandler: Handler = diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt index f298434c8..0db2163ff 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt @@ -475,7 +475,6 @@ private constructor( headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) - headers.put("X-Lithic-Pagination", "cursor") apiKey.let { if (!it.isEmpty()) { headers.put("Authorization", it) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequest.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequest.kt index c4cab902d..db2552191 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequest.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequest.kt @@ -2,6 +2,7 @@ package com.lithic.api.core.http import com.lithic.api.core.checkRequired import com.lithic.api.core.toImmutable +import java.net.URLEncoder class HttpRequest private constructor( @@ -13,6 +14,35 @@ private constructor( @get:JvmName("body") val body: HttpRequestBody?, ) { + fun url(): String = buildString { + append(baseUrl) + + pathSegments.forEach { segment -> + if (!endsWith("/")) { + append("/") + } + append(URLEncoder.encode(segment, "UTF-8")) + } + + if (queryParams.isEmpty()) { + return@buildString + } + + append("?") + var isFirst = true + queryParams.keys().forEach { key -> + queryParams.values(key).forEach { value -> + if (!isFirst) { + append("&") + } + append(URLEncoder.encode(key, "UTF-8")) + append("=") + append(URLEncoder.encode(value, "UTF-8")) + isFirst = false + } + } + } + fun toBuilder(): Builder = Builder().from(this) override fun toString(): String = diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt deleted file mode 100644 index 16c545050..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt +++ /dev/null @@ -1,747 +0,0 @@ -// 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 kotlin.jvm.optionals.getOrNull - -/** Aggregate Balance across all end-user accounts */ -class AggregateBalance -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val availableAmount: JsonField, - private val created: JsonField, - private val currency: JsonField, - private val financialAccountType: JsonField, - private val lastFinancialAccountToken: JsonField, - private val lastTransactionEventToken: JsonField, - private val lastTransactionToken: JsonField, - private val pendingAmount: JsonField, - private val totalAmount: JsonField, - private val updated: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("available_amount") - @ExcludeMissing - availableAmount: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - created: JsonField = JsonMissing.of(), - @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_type") - @ExcludeMissing - financialAccountType: JsonField = JsonMissing.of(), - @JsonProperty("last_financial_account_token") - @ExcludeMissing - lastFinancialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - lastTransactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("last_transaction_token") - @ExcludeMissing - lastTransactionToken: JsonField = JsonMissing.of(), - @JsonProperty("pending_amount") - @ExcludeMissing - pendingAmount: JsonField = JsonMissing.of(), - @JsonProperty("total_amount") - @ExcludeMissing - totalAmount: JsonField = JsonMissing.of(), - @JsonProperty("updated") - @ExcludeMissing - updated: JsonField = JsonMissing.of(), - ) : this( - availableAmount, - created, - currency, - financialAccountType, - lastFinancialAccountToken, - lastTransactionEventToken, - lastTransactionToken, - pendingAmount, - totalAmount, - updated, - mutableMapOf(), - ) - - /** - * Funds available for spend in the currency's smallest unit (e.g., cents for USD) - * - * @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 availableAmount(): Long = availableAmount.getRequired("available_amount") - - /** - * Date and time for when the balance was first 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") - - /** - * 3-character alphabetic ISO 4217 code for the local currency of the balance. - * - * @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 currency(): String = currency.getRequired("currency") - - /** - * Type of financial account - * - * @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 financialAccountType(): FinancialAccountType = - financialAccountType.getRequired("financial_account_type") - - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - * - * @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 lastFinancialAccountToken(): String = - lastFinancialAccountToken.getRequired("last_financial_account_token") - - /** - * Globally unique identifier for the last transaction event that impacted this balance - * - * @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 lastTransactionEventToken(): String = - lastTransactionEventToken.getRequired("last_transaction_event_token") - - /** - * Globally unique identifier for the last transaction that impacted this balance - * - * @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 lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") - - /** - * Funds not available for spend due to card authorizations or pending ACH release. Shown in the - * currency's smallest unit (e.g., cents for USD) - * - * @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 pendingAmount(): Long = pendingAmount.getRequired("pending_amount") - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., cents for - * USD) - * - * @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 totalAmount(): Long = totalAmount.getRequired("total_amount") - - /** - * Date and time for when the balance 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") - - /** - * Returns the raw JSON value of [availableAmount]. - * - * Unlike [availableAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("available_amount") - @ExcludeMissing - fun _availableAmount(): JsonField = availableAmount - - /** - * 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 [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - - /** - * Returns the raw JSON value of [financialAccountType]. - * - * Unlike [financialAccountType], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("financial_account_type") - @ExcludeMissing - fun _financialAccountType(): JsonField = financialAccountType - - /** - * Returns the raw JSON value of [lastFinancialAccountToken]. - * - * Unlike [lastFinancialAccountToken], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("last_financial_account_token") - @ExcludeMissing - fun _lastFinancialAccountToken(): JsonField = lastFinancialAccountToken - - /** - * Returns the raw JSON value of [lastTransactionEventToken]. - * - * Unlike [lastTransactionEventToken], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun _lastTransactionEventToken(): JsonField = lastTransactionEventToken - - /** - * Returns the raw JSON value of [lastTransactionToken]. - * - * Unlike [lastTransactionToken], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun _lastTransactionToken(): JsonField = lastTransactionToken - - /** - * Returns the raw JSON value of [pendingAmount]. - * - * Unlike [pendingAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("pending_amount") - @ExcludeMissing - fun _pendingAmount(): JsonField = pendingAmount - - /** - * Returns the raw JSON value of [totalAmount]. - * - * Unlike [totalAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount(): JsonField = totalAmount - - /** - * 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 - - @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 [AggregateBalance]. - * - * The following fields are required: - * ```java - * .availableAmount() - * .created() - * .currency() - * .financialAccountType() - * .lastFinancialAccountToken() - * .lastTransactionEventToken() - * .lastTransactionToken() - * .pendingAmount() - * .totalAmount() - * .updated() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalance]. */ - class Builder internal constructor() { - - private var availableAmount: JsonField? = null - private var created: JsonField? = null - private var currency: JsonField? = null - private var financialAccountType: JsonField? = null - private var lastFinancialAccountToken: JsonField? = null - private var lastTransactionEventToken: JsonField? = null - private var lastTransactionToken: JsonField? = null - private var pendingAmount: JsonField? = null - private var totalAmount: JsonField? = null - private var updated: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(aggregateBalance: AggregateBalance) = apply { - availableAmount = aggregateBalance.availableAmount - created = aggregateBalance.created - currency = aggregateBalance.currency - financialAccountType = aggregateBalance.financialAccountType - lastFinancialAccountToken = aggregateBalance.lastFinancialAccountToken - lastTransactionEventToken = aggregateBalance.lastTransactionEventToken - lastTransactionToken = aggregateBalance.lastTransactionToken - pendingAmount = aggregateBalance.pendingAmount - totalAmount = aggregateBalance.totalAmount - updated = aggregateBalance.updated - additionalProperties = aggregateBalance.additionalProperties.toMutableMap() - } - - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) - - /** - * Sets [Builder.availableAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.availableAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun availableAmount(availableAmount: JsonField) = apply { - this.availableAmount = availableAmount - } - - /** Date and time for when the balance was first 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 } - - /** 3-character alphabetic ISO 4217 code for the local currency of the balance. */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** Type of financial account */ - fun financialAccountType(financialAccountType: FinancialAccountType) = - financialAccountType(JsonField.of(financialAccountType)) - - /** - * Sets [Builder.financialAccountType] to an arbitrary JSON value. - * - * You should usually call [Builder.financialAccountType] with a well-typed - * [FinancialAccountType] value instead. This method is primarily for setting the field to - * an undocumented or not yet supported value. - */ - fun financialAccountType(financialAccountType: JsonField) = apply { - this.financialAccountType = financialAccountType - } - - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - */ - fun lastFinancialAccountToken(lastFinancialAccountToken: String) = - lastFinancialAccountToken(JsonField.of(lastFinancialAccountToken)) - - /** - * Sets [Builder.lastFinancialAccountToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastFinancialAccountToken] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun lastFinancialAccountToken(lastFinancialAccountToken: JsonField) = apply { - this.lastFinancialAccountToken = lastFinancialAccountToken - } - - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(lastTransactionEventToken: String) = - lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) - - /** - * Sets [Builder.lastTransactionEventToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastTransactionEventToken] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { - this.lastTransactionEventToken = lastTransactionEventToken - } - - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(lastTransactionToken: String) = - lastTransactionToken(JsonField.of(lastTransactionToken)) - - /** - * Sets [Builder.lastTransactionToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastTransactionToken] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun lastTransactionToken(lastTransactionToken: JsonField) = apply { - this.lastTransactionToken = lastTransactionToken - } - - /** - * Funds not available for spend due to card authorizations or pending ACH release. Shown in - * the currency's smallest unit (e.g., cents for USD) - */ - fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) - - /** - * Sets [Builder.pendingAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.pendingAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun pendingAmount(pendingAmount: JsonField) = apply { - this.pendingAmount = pendingAmount - } - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., cents for - * USD) - */ - fun totalAmount(totalAmount: Long) = totalAmount(JsonField.of(totalAmount)) - - /** - * Sets [Builder.totalAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.totalAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } - - /** Date and time for when the balance was last updated. */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - - /** - * Sets [Builder.updated] to an arbitrary JSON value. - * - * You should usually call [Builder.updated] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updated(updated: JsonField) = apply { this.updated = updated } - - fun 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 [AggregateBalance]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .availableAmount() - * .created() - * .currency() - * .financialAccountType() - * .lastFinancialAccountToken() - * .lastTransactionEventToken() - * .lastTransactionToken() - * .pendingAmount() - * .totalAmount() - * .updated() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): AggregateBalance = - AggregateBalance( - checkRequired("availableAmount", availableAmount), - checkRequired("created", created), - checkRequired("currency", currency), - checkRequired("financialAccountType", financialAccountType), - checkRequired("lastFinancialAccountToken", lastFinancialAccountToken), - checkRequired("lastTransactionEventToken", lastTransactionEventToken), - checkRequired("lastTransactionToken", lastTransactionToken), - checkRequired("pendingAmount", pendingAmount), - checkRequired("totalAmount", totalAmount), - checkRequired("updated", updated), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): AggregateBalance = apply { - if (validated) { - return@apply - } - - availableAmount() - created() - currency() - financialAccountType().validate() - lastFinancialAccountToken() - lastTransactionEventToken() - lastTransactionToken() - pendingAmount() - totalAmount() - updated() - 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 (availableAmount.asKnown().isPresent) 1 else 0) + - (if (created.asKnown().isPresent) 1 else 0) + - (if (currency.asKnown().isPresent) 1 else 0) + - (financialAccountType.asKnown().getOrNull()?.validity() ?: 0) + - (if (lastFinancialAccountToken.asKnown().isPresent) 1 else 0) + - (if (lastTransactionEventToken.asKnown().isPresent) 1 else 0) + - (if (lastTransactionToken.asKnown().isPresent) 1 else 0) + - (if (pendingAmount.asKnown().isPresent) 1 else 0) + - (if (totalAmount.asKnown().isPresent) 1 else 0) + - (if (updated.asKnown().isPresent) 1 else 0) - - /** Type of financial account */ - class FinancialAccountType - @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 ISSUING = of("ISSUING") - - @JvmField val OPERATING = of("OPERATING") - - @JvmField val RESERVE = of("RESERVE") - - @JvmField val SECURITY = of("SECURITY") - - @JvmStatic fun of(value: String) = FinancialAccountType(JsonField.of(value)) - } - - /** An enum containing [FinancialAccountType]'s known values. */ - enum class Known { - ISSUING, - OPERATING, - RESERVE, - SECURITY, - } - - /** - * An enum containing [FinancialAccountType]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [FinancialAccountType] 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 { - ISSUING, - OPERATING, - RESERVE, - SECURITY, - /** - * An enum member indicating that [FinancialAccountType] 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) { - ISSUING -> Value.ISSUING - OPERATING -> Value.OPERATING - RESERVE -> Value.RESERVE - SECURITY -> Value.SECURITY - 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) { - ISSUING -> Known.ISSUING - OPERATING -> Known.OPERATING - RESERVE -> Known.RESERVE - SECURITY -> Known.SECURITY - else -> throw LithicInvalidDataException("Unknown FinancialAccountType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") } - - private var validated: Boolean = false - - fun validate(): FinancialAccountType = 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 FinancialAccountType && 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 AggregateBalance && - availableAmount == other.availableAmount && - created == other.created && - currency == other.currency && - financialAccountType == other.financialAccountType && - lastFinancialAccountToken == other.lastFinancialAccountToken && - lastTransactionEventToken == other.lastTransactionEventToken && - lastTransactionToken == other.lastTransactionToken && - pendingAmount == other.pendingAmount && - totalAmount == other.totalAmount && - updated == other.updated && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - availableAmount, - created, - currency, - financialAccountType, - lastFinancialAccountToken, - lastTransactionEventToken, - lastTransactionToken, - pendingAmount, - totalAmount, - updated, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "AggregateBalance{availableAmount=$availableAmount, created=$created, currency=$currency, financialAccountType=$financialAccountType, lastFinancialAccountToken=$lastFinancialAccountToken, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageResponse.kt deleted file mode 100644 index be5067244..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageResponse.kt +++ /dev/null @@ -1,231 +0,0 @@ -// 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.checkKnown -import com.lithic.api.core.checkRequired -import com.lithic.api.core.toImmutable -import com.lithic.api.errors.LithicInvalidDataException -import java.util.Collections -import java.util.Objects -import kotlin.jvm.optionals.getOrNull - -class AggregateBalanceListPageResponse -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val data: JsonField>, - private val hasMore: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("data") - @ExcludeMissing - data: JsonField> = JsonMissing.of(), - @JsonProperty("has_more") @ExcludeMissing hasMore: JsonField = JsonMissing.of(), - ) : this(data, hasMore, mutableMapOf()) - - /** - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun data(): List = data.getRequired("data") - - /** - * More data exists. - * - * @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 hasMore(): Boolean = hasMore.getRequired("has_more") - - /** - * Returns the raw JSON value of [data]. - * - * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data - - /** - * Returns the raw JSON value of [hasMore]. - * - * Unlike [hasMore], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("has_more") @ExcludeMissing fun _hasMore(): JsonField = hasMore - - @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 - * [AggregateBalanceListPageResponse]. - * - * The following fields are required: - * ```java - * .data() - * .hasMore() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalanceListPageResponse]. */ - class Builder internal constructor() { - - private var data: JsonField>? = null - private var hasMore: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(aggregateBalanceListPageResponse: AggregateBalanceListPageResponse) = - apply { - data = aggregateBalanceListPageResponse.data.map { it.toMutableList() } - hasMore = aggregateBalanceListPageResponse.hasMore - additionalProperties = - aggregateBalanceListPageResponse.additionalProperties.toMutableMap() - } - - fun data(data: List) = data(JsonField.of(data)) - - /** - * Sets [Builder.data] to an arbitrary JSON value. - * - * You should usually call [Builder.data] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun data(data: JsonField>) = apply { - this.data = data.map { it.toMutableList() } - } - - /** - * Adds a single [AggregateBalance] to [Builder.data]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addData(data: AggregateBalance) = apply { - this.data = - (this.data ?: JsonField.of(mutableListOf())).also { - checkKnown("data", it).add(data) - } - } - - /** More data exists. */ - fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore)) - - /** - * Sets [Builder.hasMore] to an arbitrary JSON value. - * - * You should usually call [Builder.hasMore] with a well-typed [Boolean] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore } - - 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 [AggregateBalanceListPageResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .data() - * .hasMore() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): AggregateBalanceListPageResponse = - AggregateBalanceListPageResponse( - checkRequired("data", data).map { it.toImmutable() }, - checkRequired("hasMore", hasMore), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): AggregateBalanceListPageResponse = apply { - if (validated) { - return@apply - } - - data().forEach { it.validate() } - hasMore() - 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 = - (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (hasMore.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AggregateBalanceListPageResponse && - data == other.data && - hasMore == other.hasMore && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(data, hasMore, additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "AggregateBalanceListPageResponse{data=$data, hasMore=$hasMore, additionalProperties=$additionalProperties}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListParams.kt deleted file mode 100644 index d477113b3..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListParams.kt +++ /dev/null @@ -1,353 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.fasterxml.jackson.annotation.JsonCreator -import com.lithic.api.core.Enum -import com.lithic.api.core.JsonField -import com.lithic.api.core.Params -import com.lithic.api.core.http.Headers -import com.lithic.api.core.http.QueryParams -import com.lithic.api.errors.LithicInvalidDataException -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Get the aggregated balance across all end-user accounts by financial account type */ -class AggregateBalanceListParams -private constructor( - private val financialAccountType: FinancialAccountType?, - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - /** Get the aggregate balance for a given Financial Account type. */ - fun financialAccountType(): Optional = - Optional.ofNullable(financialAccountType) - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun none(): AggregateBalanceListParams = builder().build() - - /** - * Returns a mutable builder for constructing an instance of [AggregateBalanceListParams]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalanceListParams]. */ - class Builder internal constructor() { - - private var financialAccountType: FinancialAccountType? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(aggregateBalanceListParams: AggregateBalanceListParams) = apply { - financialAccountType = aggregateBalanceListParams.financialAccountType - additionalHeaders = aggregateBalanceListParams.additionalHeaders.toBuilder() - additionalQueryParams = aggregateBalanceListParams.additionalQueryParams.toBuilder() - } - - /** Get the aggregate balance for a given Financial Account type. */ - fun financialAccountType(financialAccountType: FinancialAccountType?) = apply { - this.financialAccountType = financialAccountType - } - - /** - * Alias for calling [Builder.financialAccountType] with - * `financialAccountType.orElse(null)`. - */ - fun financialAccountType(financialAccountType: Optional) = - financialAccountType(financialAccountType.getOrNull()) - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [AggregateBalanceListParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): AggregateBalanceListParams = - AggregateBalanceListParams( - financialAccountType, - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - financialAccountType?.let { put("financial_account_type", it.toString()) } - putAll(additionalQueryParams) - } - .build() - - /** Get the aggregate balance for a given Financial Account type. */ - class FinancialAccountType - @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 ISSUING = of("ISSUING") - - @JvmField val OPERATING = of("OPERATING") - - @JvmField val RESERVE = of("RESERVE") - - @JvmField val SECURITY = of("SECURITY") - - @JvmStatic fun of(value: String) = FinancialAccountType(JsonField.of(value)) - } - - /** An enum containing [FinancialAccountType]'s known values. */ - enum class Known { - ISSUING, - OPERATING, - RESERVE, - SECURITY, - } - - /** - * An enum containing [FinancialAccountType]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [FinancialAccountType] 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 { - ISSUING, - OPERATING, - RESERVE, - SECURITY, - /** - * An enum member indicating that [FinancialAccountType] 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) { - ISSUING -> Value.ISSUING - OPERATING -> Value.OPERATING - RESERVE -> Value.RESERVE - SECURITY -> Value.SECURITY - 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) { - ISSUING -> Known.ISSUING - OPERATING -> Known.OPERATING - RESERVE -> Known.RESERVE - SECURITY -> Known.SECURITY - else -> throw LithicInvalidDataException("Unknown FinancialAccountType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. - * - * @throws LithicInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") } - - private var validated: Boolean = false - - fun validate(): FinancialAccountType = 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 FinancialAccountType && 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 AggregateBalanceListParams && - financialAccountType == other.financialAccountType && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash(financialAccountType, additionalHeaders, additionalQueryParams) - - override fun toString() = - "AggregateBalanceListParams{financialAccountType=$financialAccountType, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt deleted file mode 100644 index 6fb720c8a..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt +++ /dev/null @@ -1,546 +0,0 @@ -// 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.checkRequired -import com.lithic.api.errors.LithicInvalidDataException -import java.time.OffsetDateTime -import java.util.Collections -import java.util.Objects - -/** Card Aggregate Balance across all end-user accounts */ -class AggregateBalanceListResponse -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val availableAmount: JsonField, - private val created: JsonField, - private val currency: JsonField, - private val lastCardToken: JsonField, - private val lastTransactionEventToken: JsonField, - private val lastTransactionToken: JsonField, - private val pendingAmount: JsonField, - private val totalAmount: JsonField, - private val updated: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("available_amount") - @ExcludeMissing - availableAmount: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - created: JsonField = JsonMissing.of(), - @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), - @JsonProperty("last_card_token") - @ExcludeMissing - lastCardToken: JsonField = JsonMissing.of(), - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - lastTransactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("last_transaction_token") - @ExcludeMissing - lastTransactionToken: JsonField = JsonMissing.of(), - @JsonProperty("pending_amount") - @ExcludeMissing - pendingAmount: JsonField = JsonMissing.of(), - @JsonProperty("total_amount") - @ExcludeMissing - totalAmount: JsonField = JsonMissing.of(), - @JsonProperty("updated") - @ExcludeMissing - updated: JsonField = JsonMissing.of(), - ) : this( - availableAmount, - created, - currency, - lastCardToken, - lastTransactionEventToken, - lastTransactionToken, - pendingAmount, - totalAmount, - updated, - mutableMapOf(), - ) - - /** - * Funds available for spend in the currency's smallest unit (e.g., cents for USD) - * - * @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 availableAmount(): Long = availableAmount.getRequired("available_amount") - - /** - * Date and time for when the balance was first 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") - - /** - * 3-character alphabetic ISO 4217 code for the local currency of the balance. - * - * @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 currency(): String = currency.getRequired("currency") - - /** - * Globally unique identifier for the card that had its balance updated most recently - * - * @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 lastCardToken(): String = lastCardToken.getRequired("last_card_token") - - /** - * Globally unique identifier for the last transaction event that impacted this balance - * - * @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 lastTransactionEventToken(): String = - lastTransactionEventToken.getRequired("last_transaction_event_token") - - /** - * Globally unique identifier for the last transaction that impacted this balance - * - * @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 lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") - - /** - * Funds not available for spend due to card authorizations or pending ACH release. Shown in the - * currency's smallest unit (e.g., cents for USD) - * - * @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 pendingAmount(): Long = pendingAmount.getRequired("pending_amount") - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., cents for - * USD) - * - * @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 totalAmount(): Long = totalAmount.getRequired("total_amount") - - /** - * Date and time for when the balance 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") - - /** - * Returns the raw JSON value of [availableAmount]. - * - * Unlike [availableAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("available_amount") - @ExcludeMissing - fun _availableAmount(): JsonField = availableAmount - - /** - * 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 [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - - /** - * Returns the raw JSON value of [lastCardToken]. - * - * Unlike [lastCardToken], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("last_card_token") - @ExcludeMissing - fun _lastCardToken(): JsonField = lastCardToken - - /** - * Returns the raw JSON value of [lastTransactionEventToken]. - * - * Unlike [lastTransactionEventToken], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun _lastTransactionEventToken(): JsonField = lastTransactionEventToken - - /** - * Returns the raw JSON value of [lastTransactionToken]. - * - * Unlike [lastTransactionToken], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun _lastTransactionToken(): JsonField = lastTransactionToken - - /** - * Returns the raw JSON value of [pendingAmount]. - * - * Unlike [pendingAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("pending_amount") - @ExcludeMissing - fun _pendingAmount(): JsonField = pendingAmount - - /** - * Returns the raw JSON value of [totalAmount]. - * - * Unlike [totalAmount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount(): JsonField = totalAmount - - /** - * 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 - - @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 [AggregateBalanceListResponse]. - * - * The following fields are required: - * ```java - * .availableAmount() - * .created() - * .currency() - * .lastCardToken() - * .lastTransactionEventToken() - * .lastTransactionToken() - * .pendingAmount() - * .totalAmount() - * .updated() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalanceListResponse]. */ - class Builder internal constructor() { - - private var availableAmount: JsonField? = null - private var created: JsonField? = null - private var currency: JsonField? = null - private var lastCardToken: JsonField? = null - private var lastTransactionEventToken: JsonField? = null - private var lastTransactionToken: JsonField? = null - private var pendingAmount: JsonField? = null - private var totalAmount: JsonField? = null - private var updated: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(aggregateBalanceListResponse: AggregateBalanceListResponse) = apply { - availableAmount = aggregateBalanceListResponse.availableAmount - created = aggregateBalanceListResponse.created - currency = aggregateBalanceListResponse.currency - lastCardToken = aggregateBalanceListResponse.lastCardToken - lastTransactionEventToken = aggregateBalanceListResponse.lastTransactionEventToken - lastTransactionToken = aggregateBalanceListResponse.lastTransactionToken - pendingAmount = aggregateBalanceListResponse.pendingAmount - totalAmount = aggregateBalanceListResponse.totalAmount - updated = aggregateBalanceListResponse.updated - additionalProperties = aggregateBalanceListResponse.additionalProperties.toMutableMap() - } - - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) - - /** - * Sets [Builder.availableAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.availableAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun availableAmount(availableAmount: JsonField) = apply { - this.availableAmount = availableAmount - } - - /** Date and time for when the balance was first 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 } - - /** 3-character alphabetic ISO 4217 code for the local currency of the balance. */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** Globally unique identifier for the card that had its balance updated most recently */ - fun lastCardToken(lastCardToken: String) = lastCardToken(JsonField.of(lastCardToken)) - - /** - * Sets [Builder.lastCardToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastCardToken] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun lastCardToken(lastCardToken: JsonField) = apply { - this.lastCardToken = lastCardToken - } - - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(lastTransactionEventToken: String) = - lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) - - /** - * Sets [Builder.lastTransactionEventToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastTransactionEventToken] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { - this.lastTransactionEventToken = lastTransactionEventToken - } - - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(lastTransactionToken: String) = - lastTransactionToken(JsonField.of(lastTransactionToken)) - - /** - * Sets [Builder.lastTransactionToken] to an arbitrary JSON value. - * - * You should usually call [Builder.lastTransactionToken] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun lastTransactionToken(lastTransactionToken: JsonField) = apply { - this.lastTransactionToken = lastTransactionToken - } - - /** - * Funds not available for spend due to card authorizations or pending ACH release. Shown in - * the currency's smallest unit (e.g., cents for USD) - */ - fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) - - /** - * Sets [Builder.pendingAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.pendingAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun pendingAmount(pendingAmount: JsonField) = apply { - this.pendingAmount = pendingAmount - } - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., cents for - * USD) - */ - fun totalAmount(totalAmount: Long) = totalAmount(JsonField.of(totalAmount)) - - /** - * Sets [Builder.totalAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.totalAmount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } - - /** Date and time for when the balance was last updated. */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - - /** - * Sets [Builder.updated] to an arbitrary JSON value. - * - * You should usually call [Builder.updated] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updated(updated: JsonField) = apply { this.updated = updated } - - fun 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 [AggregateBalanceListResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .availableAmount() - * .created() - * .currency() - * .lastCardToken() - * .lastTransactionEventToken() - * .lastTransactionToken() - * .pendingAmount() - * .totalAmount() - * .updated() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): AggregateBalanceListResponse = - AggregateBalanceListResponse( - checkRequired("availableAmount", availableAmount), - checkRequired("created", created), - checkRequired("currency", currency), - checkRequired("lastCardToken", lastCardToken), - checkRequired("lastTransactionEventToken", lastTransactionEventToken), - checkRequired("lastTransactionToken", lastTransactionToken), - checkRequired("pendingAmount", pendingAmount), - checkRequired("totalAmount", totalAmount), - checkRequired("updated", updated), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): AggregateBalanceListResponse = apply { - if (validated) { - return@apply - } - - availableAmount() - created() - currency() - lastCardToken() - lastTransactionEventToken() - lastTransactionToken() - pendingAmount() - totalAmount() - updated() - 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 (availableAmount.asKnown().isPresent) 1 else 0) + - (if (created.asKnown().isPresent) 1 else 0) + - (if (currency.asKnown().isPresent) 1 else 0) + - (if (lastCardToken.asKnown().isPresent) 1 else 0) + - (if (lastTransactionEventToken.asKnown().isPresent) 1 else 0) + - (if (lastTransactionToken.asKnown().isPresent) 1 else 0) + - (if (pendingAmount.asKnown().isPresent) 1 else 0) + - (if (totalAmount.asKnown().isPresent) 1 else 0) + - (if (updated.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AggregateBalanceListResponse && - availableAmount == other.availableAmount && - created == other.created && - currency == other.currency && - lastCardToken == other.lastCardToken && - lastTransactionEventToken == other.lastTransactionEventToken && - lastTransactionToken == other.lastTransactionToken && - pendingAmount == other.pendingAmount && - totalAmount == other.totalAmount && - updated == other.updated && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - availableAmount, - created, - currency, - lastCardToken, - lastTransactionEventToken, - lastTransactionToken, - pendingAmount, - totalAmount, - updated, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "AggregateBalanceListResponse{availableAmount=$availableAmount, created=$created, currency=$currency, lastCardToken=$lastCardToken, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt new file mode 100644 index 000000000..193e3c6de --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt @@ -0,0 +1,455 @@ +// 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 + +/** Retry a book transfer that has been declined */ +class BookTransferRetryParams +private constructor( + private val bookTransferToken: String?, + private val body: RetryBookTransferRequest, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun bookTransferToken(): Optional = Optional.ofNullable(bookTransferToken) + + /** + * Customer-provided token that will serve as an idempotency token. This token will become the + * transaction token. + * + * @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 retryToken(): String = body.retryToken() + + /** + * Returns the raw JSON value of [retryToken]. + * + * Unlike [retryToken], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _retryToken(): JsonField = body._retryToken() + + 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 [BookTransferRetryParams]. + * + * The following fields are required: + * ```java + * .retryToken() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookTransferRetryParams]. */ + class Builder internal constructor() { + + private var bookTransferToken: String? = null + private var body: RetryBookTransferRequest.Builder = RetryBookTransferRequest.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(bookTransferRetryParams: BookTransferRetryParams) = apply { + bookTransferToken = bookTransferRetryParams.bookTransferToken + body = bookTransferRetryParams.body.toBuilder() + additionalHeaders = bookTransferRetryParams.additionalHeaders.toBuilder() + additionalQueryParams = bookTransferRetryParams.additionalQueryParams.toBuilder() + } + + fun bookTransferToken(bookTransferToken: String?) = apply { + this.bookTransferToken = bookTransferToken + } + + /** Alias for calling [Builder.bookTransferToken] with `bookTransferToken.orElse(null)`. */ + fun bookTransferToken(bookTransferToken: Optional) = + bookTransferToken(bookTransferToken.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [retryToken] + */ + fun body(body: RetryBookTransferRequest) = apply { this.body = body.toBuilder() } + + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ + fun retryToken(retryToken: String) = apply { body.retryToken(retryToken) } + + /** + * Sets [Builder.retryToken] to an arbitrary JSON value. + * + * You should usually call [Builder.retryToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun retryToken(retryToken: JsonField) = apply { body.retryToken(retryToken) } + + 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 [BookTransferRetryParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .retryToken() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookTransferRetryParams = + BookTransferRetryParams( + bookTransferToken, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): RetryBookTransferRequest = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> bookTransferToken ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class RetryBookTransferRequest + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val retryToken: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("retry_token") + @ExcludeMissing + retryToken: JsonField = JsonMissing.of() + ) : this(retryToken, mutableMapOf()) + + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + * + * @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 retryToken(): String = retryToken.getRequired("retry_token") + + /** + * Returns the raw JSON value of [retryToken]. + * + * Unlike [retryToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("retry_token") + @ExcludeMissing + fun _retryToken(): JsonField = retryToken + + @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 [RetryBookTransferRequest]. + * + * The following fields are required: + * ```java + * .retryToken() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RetryBookTransferRequest]. */ + class Builder internal constructor() { + + private var retryToken: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(retryBookTransferRequest: RetryBookTransferRequest) = apply { + retryToken = retryBookTransferRequest.retryToken + additionalProperties = retryBookTransferRequest.additionalProperties.toMutableMap() + } + + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ + fun retryToken(retryToken: String) = retryToken(JsonField.of(retryToken)) + + /** + * Sets [Builder.retryToken] to an arbitrary JSON value. + * + * You should usually call [Builder.retryToken] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun retryToken(retryToken: JsonField) = apply { this.retryToken = retryToken } + + 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 [RetryBookTransferRequest]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .retryToken() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RetryBookTransferRequest = + RetryBookTransferRequest( + checkRequired("retryToken", retryToken), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): RetryBookTransferRequest = apply { + if (validated) { + return@apply + } + + retryToken() + 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 (retryToken.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RetryBookTransferRequest && + retryToken == other.retryToken && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(retryToken, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RetryBookTransferRequest{retryToken=$retryToken, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookTransferRetryParams && + bookTransferToken == other.bookTransferToken && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(bookTransferToken, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "BookTransferRetryParams{bookTransferToken=$bookTransferToken, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPage.kt deleted file mode 100644 index a8bd2404a..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPage.kt +++ /dev/null @@ -1,131 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.lithic.api.core.AutoPager -import com.lithic.api.core.Page -import com.lithic.api.core.checkRequired -import com.lithic.api.services.blocking.cards.AggregateBalanceService -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** @see AggregateBalanceService.list */ -class CardAggregateBalanceListPage -private constructor( - private val service: AggregateBalanceService, - private val params: CardAggregateBalanceListParams, - private val response: CardAggregateBalanceListPageResponse, -) : Page { - - /** - * Delegates to [CardAggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see CardAggregateBalanceListPageResponse.data - */ - fun data(): List = - response._data().getOptional("data").getOrNull() ?: emptyList() - - /** - * Delegates to [CardAggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see CardAggregateBalanceListPageResponse.hasMore - */ - fun hasMore(): Optional = response._hasMore().getOptional("has_more") - - override fun items(): List = data() - - override fun hasNextPage(): Boolean = false - - fun nextPageParams(): CardAggregateBalanceListParams = - throw IllegalStateException("Cannot construct next page params") - - override fun nextPage(): CardAggregateBalanceListPage = service.list(nextPageParams()) - - fun autoPager(): AutoPager = AutoPager.from(this) - - /** The parameters that were used to request this page. */ - fun params(): CardAggregateBalanceListParams = params - - /** The response that this page was parsed from. */ - fun response(): CardAggregateBalanceListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [CardAggregateBalanceListPage]. - * - * The following fields are required: - * ```java - * .service() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CardAggregateBalanceListPage]. */ - class Builder internal constructor() { - - private var service: AggregateBalanceService? = null - private var params: CardAggregateBalanceListParams? = null - private var response: CardAggregateBalanceListPageResponse? = null - - @JvmSynthetic - internal fun from(cardAggregateBalanceListPage: CardAggregateBalanceListPage) = apply { - service = cardAggregateBalanceListPage.service - params = cardAggregateBalanceListPage.params - response = cardAggregateBalanceListPage.response - } - - fun service(service: AggregateBalanceService) = apply { this.service = service } - - /** The parameters that were used to request this page. */ - fun params(params: CardAggregateBalanceListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: CardAggregateBalanceListPageResponse) = apply { - this.response = response - } - - /** - * Returns an immutable instance of [CardAggregateBalanceListPage]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .service() - * .params() - * .response() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CardAggregateBalanceListPage = - CardAggregateBalanceListPage( - checkRequired("service", service), - checkRequired("params", params), - checkRequired("response", response), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CardAggregateBalanceListPage && - service == other.service && - params == other.params && - response == other.response - } - - override fun hashCode(): Int = Objects.hash(service, params, response) - - override fun toString() = - "CardAggregateBalanceListPage{service=$service, params=$params, response=$response}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageAsync.kt deleted file mode 100644 index c19e55975..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageAsync.kt +++ /dev/null @@ -1,148 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.lithic.api.core.AutoPagerAsync -import com.lithic.api.core.PageAsync -import com.lithic.api.core.checkRequired -import com.lithic.api.services.async.cards.AggregateBalanceServiceAsync -import java.util.Objects -import java.util.Optional -import java.util.concurrent.CompletableFuture -import java.util.concurrent.Executor -import kotlin.jvm.optionals.getOrNull - -/** @see AggregateBalanceServiceAsync.list */ -class CardAggregateBalanceListPageAsync -private constructor( - private val service: AggregateBalanceServiceAsync, - private val streamHandlerExecutor: Executor, - private val params: CardAggregateBalanceListParams, - private val response: CardAggregateBalanceListPageResponse, -) : PageAsync { - - /** - * Delegates to [CardAggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see CardAggregateBalanceListPageResponse.data - */ - fun data(): List = - response._data().getOptional("data").getOrNull() ?: emptyList() - - /** - * Delegates to [CardAggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see CardAggregateBalanceListPageResponse.hasMore - */ - fun hasMore(): Optional = response._hasMore().getOptional("has_more") - - override fun items(): List = data() - - override fun hasNextPage(): Boolean = false - - fun nextPageParams(): CardAggregateBalanceListParams = - throw IllegalStateException("Cannot construct next page params") - - override fun nextPage(): CompletableFuture = - service.list(nextPageParams()) - - fun autoPager(): AutoPagerAsync = - AutoPagerAsync.from(this, streamHandlerExecutor) - - /** The parameters that were used to request this page. */ - fun params(): CardAggregateBalanceListParams = params - - /** The response that this page was parsed from. */ - fun response(): CardAggregateBalanceListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of - * [CardAggregateBalanceListPageAsync]. - * - * The following fields are required: - * ```java - * .service() - * .streamHandlerExecutor() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CardAggregateBalanceListPageAsync]. */ - class Builder internal constructor() { - - private var service: AggregateBalanceServiceAsync? = null - private var streamHandlerExecutor: Executor? = null - private var params: CardAggregateBalanceListParams? = null - private var response: CardAggregateBalanceListPageResponse? = null - - @JvmSynthetic - internal fun from(cardAggregateBalanceListPageAsync: CardAggregateBalanceListPageAsync) = - apply { - service = cardAggregateBalanceListPageAsync.service - streamHandlerExecutor = cardAggregateBalanceListPageAsync.streamHandlerExecutor - params = cardAggregateBalanceListPageAsync.params - response = cardAggregateBalanceListPageAsync.response - } - - fun service(service: AggregateBalanceServiceAsync) = apply { this.service = service } - - fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { - this.streamHandlerExecutor = streamHandlerExecutor - } - - /** The parameters that were used to request this page. */ - fun params(params: CardAggregateBalanceListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: CardAggregateBalanceListPageResponse) = apply { - this.response = response - } - - /** - * Returns an immutable instance of [CardAggregateBalanceListPageAsync]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .service() - * .streamHandlerExecutor() - * .params() - * .response() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CardAggregateBalanceListPageAsync = - CardAggregateBalanceListPageAsync( - checkRequired("service", service), - checkRequired("streamHandlerExecutor", streamHandlerExecutor), - checkRequired("params", params), - checkRequired("response", response), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CardAggregateBalanceListPageAsync && - service == other.service && - streamHandlerExecutor == other.streamHandlerExecutor && - params == other.params && - response == other.response - } - - override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) - - override fun toString() = - "CardAggregateBalanceListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponse.kt deleted file mode 100644 index 2761c6ec1..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponse.kt +++ /dev/null @@ -1,234 +0,0 @@ -// 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.checkKnown -import com.lithic.api.core.checkRequired -import com.lithic.api.core.toImmutable -import com.lithic.api.errors.LithicInvalidDataException -import java.util.Collections -import java.util.Objects -import kotlin.jvm.optionals.getOrNull - -class CardAggregateBalanceListPageResponse -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val data: JsonField>, - private val hasMore: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("data") - @ExcludeMissing - data: JsonField> = JsonMissing.of(), - @JsonProperty("has_more") @ExcludeMissing hasMore: JsonField = JsonMissing.of(), - ) : this(data, hasMore, mutableMapOf()) - - /** - * @throws LithicInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun data(): List = data.getRequired("data") - - /** - * More data exists. - * - * @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 hasMore(): Boolean = hasMore.getRequired("has_more") - - /** - * Returns the raw JSON value of [data]. - * - * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("data") - @ExcludeMissing - fun _data(): JsonField> = data - - /** - * Returns the raw JSON value of [hasMore]. - * - * Unlike [hasMore], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("has_more") @ExcludeMissing fun _hasMore(): JsonField = hasMore - - @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 - * [CardAggregateBalanceListPageResponse]. - * - * The following fields are required: - * ```java - * .data() - * .hasMore() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CardAggregateBalanceListPageResponse]. */ - class Builder internal constructor() { - - private var data: JsonField>? = null - private var hasMore: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - cardAggregateBalanceListPageResponse: CardAggregateBalanceListPageResponse - ) = apply { - data = cardAggregateBalanceListPageResponse.data.map { it.toMutableList() } - hasMore = cardAggregateBalanceListPageResponse.hasMore - additionalProperties = - cardAggregateBalanceListPageResponse.additionalProperties.toMutableMap() - } - - fun data(data: List) = data(JsonField.of(data)) - - /** - * Sets [Builder.data] to an arbitrary JSON value. - * - * You should usually call [Builder.data] with a well-typed - * `List` value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun data(data: JsonField>) = apply { - this.data = data.map { it.toMutableList() } - } - - /** - * Adds a single [AggregateBalanceListResponse] to [Builder.data]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addData(data: AggregateBalanceListResponse) = apply { - this.data = - (this.data ?: JsonField.of(mutableListOf())).also { - checkKnown("data", it).add(data) - } - } - - /** More data exists. */ - fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore)) - - /** - * Sets [Builder.hasMore] to an arbitrary JSON value. - * - * You should usually call [Builder.hasMore] with a well-typed [Boolean] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore } - - 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 [CardAggregateBalanceListPageResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .data() - * .hasMore() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CardAggregateBalanceListPageResponse = - CardAggregateBalanceListPageResponse( - checkRequired("data", data).map { it.toImmutable() }, - checkRequired("hasMore", hasMore), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): CardAggregateBalanceListPageResponse = apply { - if (validated) { - return@apply - } - - data().forEach { it.validate() } - hasMore() - 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 = - (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (hasMore.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CardAggregateBalanceListPageResponse && - data == other.data && - hasMore == other.hasMore && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(data, hasMore, additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "CardAggregateBalanceListPageResponse{data=$data, hasMore=$hasMore, additionalProperties=$additionalProperties}" -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AsaRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt similarity index 96% rename from lithic-java-core/src/main/kotlin/com/lithic/api/models/AsaRequestWebhookEvent.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt index 1aea2ef82..758a8889a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AsaRequestWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEvent.kt @@ -21,8 +21,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** The Auth Stream Access request payload that was sent to the ASA responder. */ -class AsaRequestWebhookEvent +class CardAuthorizationApprovalRequestWebhookEvent @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val token: JsonField, @@ -34,6 +33,7 @@ private constructor( private val cardholderCurrency: JsonField, private val cashAmount: JsonField, private val created: JsonField, + private val eventType: JsonField, private val merchant: JsonField, private val merchantAmount: JsonField, private val merchantCurrency: JsonField, @@ -75,6 +75,9 @@ private constructor( @JsonProperty("created") @ExcludeMissing created: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + eventType: JsonField = JsonMissing.of(), @JsonProperty("merchant") @ExcludeMissing merchant: JsonField = JsonMissing.of(), @JsonProperty("merchant_amount") @ExcludeMissing @@ -132,6 +135,7 @@ private constructor( cardholderCurrency, cashAmount, created, + eventType, merchant, merchantAmount, merchantCurrency, @@ -233,6 +237,12 @@ private constructor( */ fun created(): OffsetDateTime = created.getRequired("created") + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun eventType(): EventType = eventType.getRequired("event_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). @@ -465,6 +475,13 @@ private constructor( */ @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created + /** + * Returns the raw JSON value of [eventType]. + * + * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("event_type") @ExcludeMissing fun _eventType(): JsonField = eventType + /** * Returns the raw JSON value of [merchant]. * @@ -640,7 +657,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AsaRequestWebhookEvent]. + * Returns a mutable builder for constructing an instance of + * [CardAuthorizationApprovalRequestWebhookEvent]. * * The following fields are required: * ```java @@ -653,6 +671,7 @@ private constructor( * .cardholderCurrency() * .cashAmount() * .created() + * .eventType() * .merchant() * .merchantAmount() * .merchantCurrency() @@ -664,7 +683,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AsaRequestWebhookEvent]. */ + /** A builder for [CardAuthorizationApprovalRequestWebhookEvent]. */ class Builder internal constructor() { private var token: JsonField? = null @@ -676,6 +695,7 @@ private constructor( private var cardholderCurrency: JsonField? = null private var cashAmount: JsonField? = null private var created: JsonField? = null + private var eventType: JsonField? = null private var merchant: JsonField? = null private var merchantAmount: JsonField? = null private var merchantCurrency: JsonField? = null @@ -698,36 +718,42 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(asaRequestWebhookEvent: AsaRequestWebhookEvent) = apply { - token = asaRequestWebhookEvent.token - acquirerFee = asaRequestWebhookEvent.acquirerFee - amount = asaRequestWebhookEvent.amount - authorizationAmount = asaRequestWebhookEvent.authorizationAmount - avs = asaRequestWebhookEvent.avs - card = asaRequestWebhookEvent.card - cardholderCurrency = asaRequestWebhookEvent.cardholderCurrency - cashAmount = asaRequestWebhookEvent.cashAmount - created = asaRequestWebhookEvent.created - merchant = asaRequestWebhookEvent.merchant - merchantAmount = asaRequestWebhookEvent.merchantAmount - merchantCurrency = asaRequestWebhookEvent.merchantCurrency - settledAmount = asaRequestWebhookEvent.settledAmount - status = asaRequestWebhookEvent.status - transactionInitiator = asaRequestWebhookEvent.transactionInitiator - accountType = asaRequestWebhookEvent.accountType - cardholderAuthentication = asaRequestWebhookEvent.cardholderAuthentication - cashback = asaRequestWebhookEvent.cashback - conversionRate = asaRequestWebhookEvent.conversionRate - eventToken = asaRequestWebhookEvent.eventToken - fleetInfo = asaRequestWebhookEvent.fleetInfo - latestChallenge = asaRequestWebhookEvent.latestChallenge - network = asaRequestWebhookEvent.network - networkRiskScore = asaRequestWebhookEvent.networkRiskScore - networkSpecificData = asaRequestWebhookEvent.networkSpecificData - pos = asaRequestWebhookEvent.pos - tokenInfo = asaRequestWebhookEvent.tokenInfo - ttl = asaRequestWebhookEvent.ttl - additionalProperties = asaRequestWebhookEvent.additionalProperties.toMutableMap() + internal fun from( + cardAuthorizationApprovalRequestWebhookEvent: + CardAuthorizationApprovalRequestWebhookEvent + ) = apply { + token = cardAuthorizationApprovalRequestWebhookEvent.token + acquirerFee = cardAuthorizationApprovalRequestWebhookEvent.acquirerFee + amount = cardAuthorizationApprovalRequestWebhookEvent.amount + authorizationAmount = cardAuthorizationApprovalRequestWebhookEvent.authorizationAmount + avs = cardAuthorizationApprovalRequestWebhookEvent.avs + card = cardAuthorizationApprovalRequestWebhookEvent.card + cardholderCurrency = cardAuthorizationApprovalRequestWebhookEvent.cardholderCurrency + cashAmount = cardAuthorizationApprovalRequestWebhookEvent.cashAmount + created = cardAuthorizationApprovalRequestWebhookEvent.created + eventType = cardAuthorizationApprovalRequestWebhookEvent.eventType + merchant = cardAuthorizationApprovalRequestWebhookEvent.merchant + merchantAmount = cardAuthorizationApprovalRequestWebhookEvent.merchantAmount + merchantCurrency = cardAuthorizationApprovalRequestWebhookEvent.merchantCurrency + settledAmount = cardAuthorizationApprovalRequestWebhookEvent.settledAmount + status = cardAuthorizationApprovalRequestWebhookEvent.status + transactionInitiator = cardAuthorizationApprovalRequestWebhookEvent.transactionInitiator + accountType = cardAuthorizationApprovalRequestWebhookEvent.accountType + cardholderAuthentication = + cardAuthorizationApprovalRequestWebhookEvent.cardholderAuthentication + cashback = cardAuthorizationApprovalRequestWebhookEvent.cashback + conversionRate = cardAuthorizationApprovalRequestWebhookEvent.conversionRate + eventToken = cardAuthorizationApprovalRequestWebhookEvent.eventToken + fleetInfo = cardAuthorizationApprovalRequestWebhookEvent.fleetInfo + latestChallenge = cardAuthorizationApprovalRequestWebhookEvent.latestChallenge + network = cardAuthorizationApprovalRequestWebhookEvent.network + networkRiskScore = cardAuthorizationApprovalRequestWebhookEvent.networkRiskScore + networkSpecificData = cardAuthorizationApprovalRequestWebhookEvent.networkSpecificData + pos = cardAuthorizationApprovalRequestWebhookEvent.pos + tokenInfo = cardAuthorizationApprovalRequestWebhookEvent.tokenInfo + ttl = cardAuthorizationApprovalRequestWebhookEvent.ttl + additionalProperties = + cardAuthorizationApprovalRequestWebhookEvent.additionalProperties.toMutableMap() } /** The provisional transaction group uuid associated with the authorization */ @@ -857,6 +883,17 @@ private constructor( */ fun created(created: JsonField) = apply { this.created = created } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + /** + * Sets [Builder.eventType] to an arbitrary JSON value. + * + * You should usually call [Builder.eventType] with a well-typed [EventType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun merchant(merchant: Merchant) = merchant(JsonField.of(merchant)) /** @@ -1183,7 +1220,7 @@ private constructor( } /** - * Returns an immutable instance of [AsaRequestWebhookEvent]. + * Returns an immutable instance of [CardAuthorizationApprovalRequestWebhookEvent]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1198,6 +1235,7 @@ private constructor( * .cardholderCurrency() * .cashAmount() * .created() + * .eventType() * .merchant() * .merchantAmount() * .merchantCurrency() @@ -1208,8 +1246,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AsaRequestWebhookEvent = - AsaRequestWebhookEvent( + fun build(): CardAuthorizationApprovalRequestWebhookEvent = + CardAuthorizationApprovalRequestWebhookEvent( checkRequired("token", token), checkRequired("acquirerFee", acquirerFee), checkRequired("amount", amount), @@ -1219,6 +1257,7 @@ private constructor( checkRequired("cardholderCurrency", cardholderCurrency), checkRequired("cashAmount", cashAmount), checkRequired("created", created), + checkRequired("eventType", eventType), checkRequired("merchant", merchant), checkRequired("merchantAmount", merchantAmount), checkRequired("merchantCurrency", merchantCurrency), @@ -1244,7 +1283,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AsaRequestWebhookEvent = apply { + fun validate(): CardAuthorizationApprovalRequestWebhookEvent = apply { if (validated) { return@apply } @@ -1258,6 +1297,7 @@ private constructor( cardholderCurrency() cashAmount() created() + eventType().validate() merchant().validate() merchantAmount() merchantCurrency() @@ -1304,6 +1344,7 @@ private constructor( (if (cardholderCurrency.asKnown().isPresent) 1 else 0) + (if (cashAmount.asKnown().isPresent) 1 else 0) + (if (created.asKnown().isPresent) 1 else 0) + + (eventType.asKnown().getOrNull()?.validity() ?: 0) + (merchant.asKnown().getOrNull()?.validity() ?: 0) + (if (merchantAmount.asKnown().isPresent) 1 else 0) + (if (merchantCurrency.asKnown().isPresent) 1 else 0) + @@ -2634,6 +2675,128 @@ private constructor( "AsaRequestCard{token=$token, hostname=$hostname, lastFour=$lastFour, memo=$memo, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, type=$type, additionalProperties=$additionalProperties}" } + class EventType @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 CARD_AUTHORIZATION_APPROVAL_REQUEST = of("card_authorization.approval_request") + + @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) + } + + /** An enum containing [EventType]'s known values. */ + enum class Known { + CARD_AUTHORIZATION_APPROVAL_REQUEST + } + + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] 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 { + CARD_AUTHORIZATION_APPROVAL_REQUEST, + /** + * An enum member indicating that [EventType] 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) { + CARD_AUTHORIZATION_APPROVAL_REQUEST -> Value.CARD_AUTHORIZATION_APPROVAL_REQUEST + 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) { + CARD_AUTHORIZATION_APPROVAL_REQUEST -> Known.CARD_AUTHORIZATION_APPROVAL_REQUEST + else -> throw LithicInvalidDataException("Unknown EventType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): EventType = 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 EventType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * The type of authorization request that this request is for. Note that `CREDIT_AUTHORIZATION` * and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to users with credit decisioning via @@ -7243,7 +7406,7 @@ private constructor( return true } - return other is AsaRequestWebhookEvent && + return other is CardAuthorizationApprovalRequestWebhookEvent && token == other.token && acquirerFee == other.acquirerFee && amount == other.amount && @@ -7253,6 +7416,7 @@ private constructor( cardholderCurrency == other.cardholderCurrency && cashAmount == other.cashAmount && created == other.created && + eventType == other.eventType && merchant == other.merchant && merchantAmount == other.merchantAmount && merchantCurrency == other.merchantCurrency && @@ -7286,6 +7450,7 @@ private constructor( cardholderCurrency, cashAmount, created, + eventType, merchant, merchantAmount, merchantCurrency, @@ -7312,5 +7477,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AsaRequestWebhookEvent{token=$token, acquirerFee=$acquirerFee, amount=$amount, authorizationAmount=$authorizationAmount, avs=$avs, card=$card, cardholderCurrency=$cardholderCurrency, cashAmount=$cashAmount, created=$created, merchant=$merchant, merchantAmount=$merchantAmount, merchantCurrency=$merchantCurrency, settledAmount=$settledAmount, status=$status, transactionInitiator=$transactionInitiator, accountType=$accountType, cardholderAuthentication=$cardholderAuthentication, cashback=$cashback, conversionRate=$conversionRate, eventToken=$eventToken, fleetInfo=$fleetInfo, latestChallenge=$latestChallenge, network=$network, networkRiskScore=$networkRiskScore, networkSpecificData=$networkSpecificData, pos=$pos, tokenInfo=$tokenInfo, ttl=$ttl, additionalProperties=$additionalProperties}" + "CardAuthorizationApprovalRequestWebhookEvent{token=$token, acquirerFee=$acquirerFee, amount=$amount, authorizationAmount=$authorizationAmount, avs=$avs, card=$card, cardholderCurrency=$cardholderCurrency, cashAmount=$cashAmount, created=$created, eventType=$eventType, merchant=$merchant, merchantAmount=$merchantAmount, merchantCurrency=$merchantCurrency, settledAmount=$settledAmount, status=$status, transactionInitiator=$transactionInitiator, accountType=$accountType, cardholderAuthentication=$cardholderAuthentication, cashback=$cashback, conversionRate=$conversionRate, eventToken=$eventToken, fleetInfo=$fleetInfo, latestChallenge=$latestChallenge, network=$network, networkRiskScore=$networkRiskScore, networkSpecificData=$networkSpecificData, pos=$pos, tokenInfo=$tokenInfo, ttl=$ttl, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt index 04df486dc..a3f1273f7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardWebProvisionParams.kt @@ -22,7 +22,7 @@ import kotlin.jvm.optionals.getOrNull /** * Allow your cardholders to directly add payment cards to the device's digital wallet from a - * browser on the web. Currently only suported for Apple Pay. + * browser on the web. * * This requires some additional setup and configuration. Please * [Contact Us](https://lithic.com/contact) or your Customer Success representative for more diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt index b7753b123..9d9781ec0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ConditionalTokenizationActionParameters.kt @@ -1522,6 +1522,8 @@ private constructor( * `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS`. * * `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. * * `WALLET_TOKEN_STATUS`: The current status of the wallet token. + * * `CARD_STATE`: The state of the card being tokenized. Valid values are `CLOSED`, `OPEN`, + * `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. * * @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). @@ -1642,6 +1644,8 @@ private constructor( * `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS`. * * `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. * * `WALLET_TOKEN_STATUS`: The current status of the wallet token. + * * `CARD_STATE`: The state of the card being tokenized. Valid values are `CLOSED`, + * `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. */ fun attribute(attribute: Attribute) = attribute(JsonField.of(attribute)) @@ -1795,6 +1799,8 @@ private constructor( * `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS`. * * `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. * * `WALLET_TOKEN_STATUS`: The current status of the wallet token. + * * `CARD_STATE`: The state of the card being tokenized. Valid values are `CLOSED`, `OPEN`, + * `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. */ class Attribute @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1831,6 +1837,8 @@ private constructor( @JvmField val WALLET_TOKEN_STATUS = of("WALLET_TOKEN_STATUS") + @JvmField val CARD_STATE = of("CARD_STATE") + @JvmStatic fun of(value: String) = Attribute(JsonField.of(value)) } @@ -1846,6 +1854,7 @@ private constructor( WALLET_RECOMMENDATION_REASONS, TOKEN_REQUESTOR_ID, WALLET_TOKEN_STATUS, + CARD_STATE, } /** @@ -1868,6 +1877,7 @@ private constructor( WALLET_RECOMMENDATION_REASONS, TOKEN_REQUESTOR_ID, WALLET_TOKEN_STATUS, + CARD_STATE, /** * An enum member indicating that [Attribute] was instantiated with an unknown * value. @@ -1894,6 +1904,7 @@ private constructor( WALLET_RECOMMENDATION_REASONS -> Value.WALLET_RECOMMENDATION_REASONS TOKEN_REQUESTOR_ID -> Value.TOKEN_REQUESTOR_ID WALLET_TOKEN_STATUS -> Value.WALLET_TOKEN_STATUS + CARD_STATE -> Value.CARD_STATE else -> Value._UNKNOWN } @@ -1918,6 +1929,7 @@ private constructor( WALLET_RECOMMENDATION_REASONS -> Known.WALLET_RECOMMENDATION_REASONS TOKEN_REQUESTOR_ID -> Known.TOKEN_REQUESTOR_ID WALLET_TOKEN_STATUS -> Known.WALLET_TOKEN_STATUS + CARD_STATE -> Known.CARD_STATE else -> throw LithicInvalidDataException("Unknown Attribute: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt index 71dcbce80..db934b2b7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt @@ -61,6 +61,9 @@ private constructor( fun paymentType(): ExternalPaymentDirection = body.paymentType() /** + * Customer-provided token that will serve as an idempotency token. This token will become the + * transaction token. + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -270,6 +273,10 @@ private constructor( body.paymentType(paymentType) } + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ fun token(token: String) = apply { body.token(token) } /** @@ -548,6 +555,9 @@ private constructor( fun paymentType(): ExternalPaymentDirection = paymentType.getRequired("payment_type") /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -774,6 +784,10 @@ private constructor( this.paymentType = paymentType } + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ fun token(token: String) = token(JsonField.of(token)) /** 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 edbbc859b..9d2201cfd 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 @@ -29,11 +29,12 @@ private constructor( private val isForBenefitOf: JsonField, private val nickname: JsonField, private val status: JsonField, + private val substatus: JsonField, private val type: JsonField, private val updated: JsonField, + private val userDefinedStatus: JsonField, private val accountNumber: JsonField, private val routingNumber: JsonField, - private val substatus: JsonField, private val additionalProperties: MutableMap, ) { @@ -56,19 +57,22 @@ private constructor( @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("substatus") + @ExcludeMissing + substatus: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("user_defined_status") + @ExcludeMissing + userDefinedStatus: JsonField = JsonMissing.of(), @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("substatus") - @ExcludeMissing - substatus: JsonField = JsonMissing.of(), ) : this( token, accountToken, @@ -77,11 +81,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, mutableMapOf(), ) @@ -134,6 +139,14 @@ private constructor( */ fun status(): FinancialAccountStatus = status.getRequired("status") + /** + * Substatus for the financial account + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun substatus(): Optional = substatus.getOptional("substatus") + /** * @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). @@ -147,24 +160,24 @@ private constructor( fun updated(): OffsetDateTime = updated.getRequired("updated") /** + * User-defined status for the financial account + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun accountNumber(): Optional = accountNumber.getOptional("account_number") + fun userDefinedStatus(): Optional = userDefinedStatus.getOptional("user_defined_status") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun routingNumber(): Optional = routingNumber.getOptional("routing_number") + fun accountNumber(): Optional = accountNumber.getOptional("account_number") /** - * Substatus for the financial account - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun substatus(): Optional = substatus.getOptional("substatus") + fun routingNumber(): Optional = routingNumber.getOptional("routing_number") /** * Returns the raw JSON value of [token]. @@ -224,6 +237,15 @@ private constructor( @ExcludeMissing fun _status(): JsonField = status + /** + * Returns the raw JSON value of [substatus]. + * + * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("substatus") + @ExcludeMissing + fun _substatus(): JsonField = substatus + /** * Returns the raw JSON value of [type]. * @@ -238,6 +260,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [userDefinedStatus]. + * + * Unlike [userDefinedStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_defined_status") + @ExcludeMissing + fun _userDefinedStatus(): JsonField = userDefinedStatus + /** * Returns the raw JSON value of [accountNumber]. * @@ -256,15 +288,6 @@ private constructor( @ExcludeMissing fun _routingNumber(): JsonField = routingNumber - /** - * Returns the raw JSON value of [substatus]. - * - * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("substatus") - @ExcludeMissing - fun _substatus(): JsonField = substatus - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -291,8 +314,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * ``` */ @JvmStatic fun builder() = Builder() @@ -308,11 +333,12 @@ private constructor( private var isForBenefitOf: JsonField? = null private var nickname: JsonField? = null private var status: JsonField? = null + private var substatus: JsonField? = null private var type: JsonField? = null private var updated: JsonField? = null + private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var substatus: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -324,11 +350,12 @@ private constructor( isForBenefitOf = financialAccount.isForBenefitOf nickname = financialAccount.nickname status = financialAccount.status + substatus = financialAccount.substatus type = financialAccount.type updated = financialAccount.updated + userDefinedStatus = financialAccount.userDefinedStatus accountNumber = financialAccount.accountNumber routingNumber = financialAccount.routingNumber - substatus = financialAccount.substatus additionalProperties = financialAccount.additionalProperties.toMutableMap() } @@ -430,6 +457,25 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } + /** Substatus for the financial account */ + fun substatus(substatus: FinancialAccountSubstatus?) = + substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = + substatus(substatus.getOrNull()) + + /** + * Sets [Builder.substatus] to an arbitrary JSON value. + * + * You should usually call [Builder.substatus] with a well-typed [FinancialAccountSubstatus] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun substatus(substatus: JsonField) = apply { + this.substatus = substatus + } + fun type(type: Type) = type(JsonField.of(type)) /** @@ -451,6 +497,25 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** User-defined status for the financial account */ + fun userDefinedStatus(userDefinedStatus: String?) = + userDefinedStatus(JsonField.ofNullable(userDefinedStatus)) + + /** Alias for calling [Builder.userDefinedStatus] with `userDefinedStatus.orElse(null)`. */ + fun userDefinedStatus(userDefinedStatus: Optional) = + userDefinedStatus(userDefinedStatus.getOrNull()) + + /** + * Sets [Builder.userDefinedStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedStatus] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userDefinedStatus(userDefinedStatus: JsonField) = apply { + this.userDefinedStatus = userDefinedStatus + } + fun accountNumber(accountNumber: String?) = accountNumber(JsonField.ofNullable(accountNumber)) @@ -487,25 +552,6 @@ private constructor( this.routingNumber = routingNumber } - /** Substatus for the financial account */ - fun substatus(substatus: FinancialAccountSubstatus?) = - substatus(JsonField.ofNullable(substatus)) - - /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ - fun substatus(substatus: Optional) = - substatus(substatus.getOrNull()) - - /** - * Sets [Builder.substatus] to an arbitrary JSON value. - * - * You should usually call [Builder.substatus] with a well-typed [FinancialAccountSubstatus] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun substatus(substatus: JsonField) = apply { - this.substatus = substatus - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -539,8 +585,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * ``` * * @throws IllegalStateException if any required field is unset. @@ -554,11 +602,12 @@ private constructor( checkRequired("isForBenefitOf", isForBenefitOf), checkRequired("nickname", nickname), checkRequired("status", status), + checkRequired("substatus", substatus), checkRequired("type", type), checkRequired("updated", updated), + checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, routingNumber, - substatus, additionalProperties.toMutableMap(), ) } @@ -577,11 +626,12 @@ private constructor( isForBenefitOf() nickname() status().validate() + substatus().ifPresent { it.validate() } type().validate() updated() + userDefinedStatus() accountNumber() routingNumber() - substatus().ifPresent { it.validate() } validated = true } @@ -607,11 +657,12 @@ private constructor( (if (isForBenefitOf.asKnown().isPresent) 1 else 0) + (if (nickname.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + + (substatus.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + - (if (routingNumber.asKnown().isPresent) 1 else 0) + - (substatus.asKnown().getOrNull()?.validity() ?: 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) class FinancialAccountCreditConfig @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1328,7 +1379,10 @@ private constructor( override fun toString() = value.toString() } - class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + /** Substatus for the financial account */ + class FinancialAccountSubstatus + @JsonCreator + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1342,64 +1396,49 @@ private constructor( companion object { - @JvmField val ISSUING = of("ISSUING") - - @JvmField val RESERVE = of("RESERVE") - - @JvmField val OPERATING = of("OPERATING") - - @JvmField val CHARGED_OFF_FEES = of("CHARGED_OFF_FEES") - - @JvmField val CHARGED_OFF_INTEREST = of("CHARGED_OFF_INTEREST") - - @JvmField val CHARGED_OFF_PRINCIPAL = of("CHARGED_OFF_PRINCIPAL") + @JvmField val CHARGED_OFF_DELINQUENT = of("CHARGED_OFF_DELINQUENT") - @JvmField val SECURITY = of("SECURITY") + @JvmField val CHARGED_OFF_FRAUD = of("CHARGED_OFF_FRAUD") - @JvmField val PROGRAM_RECEIVABLES = of("PROGRAM_RECEIVABLES") + @JvmField val END_USER_REQUEST = of("END_USER_REQUEST") - @JvmField val COLLECTION = of("COLLECTION") + @JvmField val BANK_REQUEST = of("BANK_REQUEST") - @JvmField val PROGRAM_BANK_ACCOUNTS_PAYABLE = of("PROGRAM_BANK_ACCOUNTS_PAYABLE") + @JvmField val DELINQUENT = of("DELINQUENT") - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + @JvmStatic fun of(value: String) = FinancialAccountSubstatus(JsonField.of(value)) } - /** An enum containing [Type]'s known values. */ + /** An enum containing [FinancialAccountSubstatus]'s known values. */ enum class Known { - ISSUING, - RESERVE, - OPERATING, - CHARGED_OFF_FEES, - CHARGED_OFF_INTEREST, - CHARGED_OFF_PRINCIPAL, - SECURITY, - PROGRAM_RECEIVABLES, - COLLECTION, - PROGRAM_BANK_ACCOUNTS_PAYABLE, + CHARGED_OFF_DELINQUENT, + CHARGED_OFF_FRAUD, + END_USER_REQUEST, + BANK_REQUEST, + DELINQUENT, } /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [FinancialAccountSubstatus]'s known values, as well as an [_UNKNOWN] + * member. * - * An instance of [Type] can contain an unknown value in a couple of cases: + * An instance of [FinancialAccountSubstatus] 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 { - ISSUING, - RESERVE, - OPERATING, - CHARGED_OFF_FEES, - CHARGED_OFF_INTEREST, - CHARGED_OFF_PRINCIPAL, - SECURITY, - PROGRAM_RECEIVABLES, - COLLECTION, - PROGRAM_BANK_ACCOUNTS_PAYABLE, - /** An enum member indicating that [Type] was instantiated with an unknown value. */ + CHARGED_OFF_DELINQUENT, + CHARGED_OFF_FRAUD, + END_USER_REQUEST, + BANK_REQUEST, + DELINQUENT, + /** + * An enum member indicating that [FinancialAccountSubstatus] was instantiated with an + * unknown value. + */ _UNKNOWN, } @@ -1412,16 +1451,11 @@ private constructor( */ fun value(): Value = when (this) { - ISSUING -> Value.ISSUING - RESERVE -> Value.RESERVE - OPERATING -> Value.OPERATING - CHARGED_OFF_FEES -> Value.CHARGED_OFF_FEES - CHARGED_OFF_INTEREST -> Value.CHARGED_OFF_INTEREST - CHARGED_OFF_PRINCIPAL -> Value.CHARGED_OFF_PRINCIPAL - SECURITY -> Value.SECURITY - PROGRAM_RECEIVABLES -> Value.PROGRAM_RECEIVABLES - COLLECTION -> Value.COLLECTION - PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE + CHARGED_OFF_DELINQUENT -> Value.CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD -> Value.CHARGED_OFF_FRAUD + END_USER_REQUEST -> Value.END_USER_REQUEST + BANK_REQUEST -> Value.BANK_REQUEST + DELINQUENT -> Value.DELINQUENT else -> Value._UNKNOWN } @@ -1436,17 +1470,13 @@ private constructor( */ fun known(): Known = when (this) { - ISSUING -> Known.ISSUING - RESERVE -> Known.RESERVE - OPERATING -> Known.OPERATING - CHARGED_OFF_FEES -> Known.CHARGED_OFF_FEES - CHARGED_OFF_INTEREST -> Known.CHARGED_OFF_INTEREST - CHARGED_OFF_PRINCIPAL -> Known.CHARGED_OFF_PRINCIPAL - SECURITY -> Known.SECURITY - PROGRAM_RECEIVABLES -> Known.PROGRAM_RECEIVABLES - COLLECTION -> Known.COLLECTION - PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE - else -> throw LithicInvalidDataException("Unknown Type: $value") + CHARGED_OFF_DELINQUENT -> Known.CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD -> Known.CHARGED_OFF_FRAUD + END_USER_REQUEST -> Known.END_USER_REQUEST + BANK_REQUEST -> Known.BANK_REQUEST + DELINQUENT -> Known.DELINQUENT + else -> + throw LithicInvalidDataException("Unknown FinancialAccountSubstatus: $value") } /** @@ -1463,7 +1493,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Type = apply { + fun validate(): FinancialAccountSubstatus = apply { if (validated) { return@apply } @@ -1493,7 +1523,7 @@ private constructor( return true } - return other is Type && value == other.value + return other is FinancialAccountSubstatus && value == other.value } override fun hashCode() = value.hashCode() @@ -1501,10 +1531,7 @@ private constructor( override fun toString() = value.toString() } - /** Substatus for the financial account */ - class FinancialAccountSubstatus - @JsonCreator - private constructor(private val value: JsonField) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1518,49 +1545,64 @@ private constructor( companion object { - @JvmField val CHARGED_OFF_DELINQUENT = of("CHARGED_OFF_DELINQUENT") + @JvmField val ISSUING = of("ISSUING") - @JvmField val CHARGED_OFF_FRAUD = of("CHARGED_OFF_FRAUD") + @JvmField val RESERVE = of("RESERVE") - @JvmField val END_USER_REQUEST = of("END_USER_REQUEST") + @JvmField val OPERATING = of("OPERATING") - @JvmField val BANK_REQUEST = of("BANK_REQUEST") + @JvmField val CHARGED_OFF_FEES = of("CHARGED_OFF_FEES") - @JvmField val DELINQUENT = of("DELINQUENT") + @JvmField val CHARGED_OFF_INTEREST = of("CHARGED_OFF_INTEREST") - @JvmStatic fun of(value: String) = FinancialAccountSubstatus(JsonField.of(value)) + @JvmField val CHARGED_OFF_PRINCIPAL = of("CHARGED_OFF_PRINCIPAL") + + @JvmField val SECURITY = of("SECURITY") + + @JvmField val PROGRAM_RECEIVABLES = of("PROGRAM_RECEIVABLES") + + @JvmField val COLLECTION = of("COLLECTION") + + @JvmField val PROGRAM_BANK_ACCOUNTS_PAYABLE = of("PROGRAM_BANK_ACCOUNTS_PAYABLE") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - /** An enum containing [FinancialAccountSubstatus]'s known values. */ + /** An enum containing [Type]'s known values. */ enum class Known { - CHARGED_OFF_DELINQUENT, - CHARGED_OFF_FRAUD, - END_USER_REQUEST, - BANK_REQUEST, - DELINQUENT, + ISSUING, + RESERVE, + OPERATING, + CHARGED_OFF_FEES, + CHARGED_OFF_INTEREST, + CHARGED_OFF_PRINCIPAL, + SECURITY, + PROGRAM_RECEIVABLES, + COLLECTION, + PROGRAM_BANK_ACCOUNTS_PAYABLE, } /** - * An enum containing [FinancialAccountSubstatus]'s known values, as well as an [_UNKNOWN] - * member. + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [FinancialAccountSubstatus] can contain an unknown value in a couple of - * cases: + * An instance of [Type] 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 { - CHARGED_OFF_DELINQUENT, - CHARGED_OFF_FRAUD, - END_USER_REQUEST, - BANK_REQUEST, - DELINQUENT, - /** - * An enum member indicating that [FinancialAccountSubstatus] was instantiated with an - * unknown value. - */ + ISSUING, + RESERVE, + OPERATING, + CHARGED_OFF_FEES, + CHARGED_OFF_INTEREST, + CHARGED_OFF_PRINCIPAL, + SECURITY, + PROGRAM_RECEIVABLES, + COLLECTION, + PROGRAM_BANK_ACCOUNTS_PAYABLE, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1573,11 +1615,16 @@ private constructor( */ fun value(): Value = when (this) { - CHARGED_OFF_DELINQUENT -> Value.CHARGED_OFF_DELINQUENT - CHARGED_OFF_FRAUD -> Value.CHARGED_OFF_FRAUD - END_USER_REQUEST -> Value.END_USER_REQUEST - BANK_REQUEST -> Value.BANK_REQUEST - DELINQUENT -> Value.DELINQUENT + ISSUING -> Value.ISSUING + RESERVE -> Value.RESERVE + OPERATING -> Value.OPERATING + CHARGED_OFF_FEES -> Value.CHARGED_OFF_FEES + CHARGED_OFF_INTEREST -> Value.CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL -> Value.CHARGED_OFF_PRINCIPAL + SECURITY -> Value.SECURITY + PROGRAM_RECEIVABLES -> Value.PROGRAM_RECEIVABLES + COLLECTION -> Value.COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE else -> Value._UNKNOWN } @@ -1592,13 +1639,17 @@ private constructor( */ fun known(): Known = when (this) { - CHARGED_OFF_DELINQUENT -> Known.CHARGED_OFF_DELINQUENT - CHARGED_OFF_FRAUD -> Known.CHARGED_OFF_FRAUD - END_USER_REQUEST -> Known.END_USER_REQUEST - BANK_REQUEST -> Known.BANK_REQUEST - DELINQUENT -> Known.DELINQUENT - else -> - throw LithicInvalidDataException("Unknown FinancialAccountSubstatus: $value") + ISSUING -> Known.ISSUING + RESERVE -> Known.RESERVE + OPERATING -> Known.OPERATING + CHARGED_OFF_FEES -> Known.CHARGED_OFF_FEES + CHARGED_OFF_INTEREST -> Known.CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL -> Known.CHARGED_OFF_PRINCIPAL + SECURITY -> Known.SECURITY + PROGRAM_RECEIVABLES -> Known.PROGRAM_RECEIVABLES + COLLECTION -> Known.COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE + else -> throw LithicInvalidDataException("Unknown Type: $value") } /** @@ -1615,7 +1666,7 @@ private constructor( private var validated: Boolean = false - fun validate(): FinancialAccountSubstatus = apply { + fun validate(): Type = apply { if (validated) { return@apply } @@ -1645,7 +1696,7 @@ private constructor( return true } - return other is FinancialAccountSubstatus && value == other.value + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -1666,11 +1717,12 @@ private constructor( isForBenefitOf == other.isForBenefitOf && nickname == other.nickname && status == other.status && + substatus == other.substatus && type == other.type && updated == other.updated && + userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && routingNumber == other.routingNumber && - substatus == other.substatus && additionalProperties == other.additionalProperties } @@ -1683,11 +1735,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, additionalProperties, ) } @@ -1695,5 +1748,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, type=$type, updated=$updated, accountNumber=$accountNumber, routingNumber=$routingNumber, substatus=$substatus, 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, 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 c6e3c854f..8ae1b086c 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 @@ -29,11 +29,12 @@ private constructor( private val isForBenefitOf: JsonField, private val nickname: JsonField, private val status: JsonField, + private val substatus: JsonField, private val type: JsonField, private val updated: JsonField, + private val userDefinedStatus: JsonField, private val accountNumber: JsonField, private val routingNumber: JsonField, - private val substatus: JsonField, private val eventType: JsonField, private val additionalProperties: MutableMap, ) { @@ -58,21 +59,24 @@ private constructor( @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("substatus") + @ExcludeMissing + substatus: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("user_defined_status") + @ExcludeMissing + userDefinedStatus: JsonField = JsonMissing.of(), @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("substatus") - @ExcludeMissing - substatus: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing eventType: JsonField = JsonMissing.of(), @@ -84,11 +88,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, eventType, mutableMapOf(), ) @@ -102,11 +107,12 @@ private constructor( .isForBenefitOf(isForBenefitOf) .nickname(nickname) .status(status) + .substatus(substatus) .type(type) .updated(updated) + .userDefinedStatus(userDefinedStatus) .accountNumber(accountNumber) .routingNumber(routingNumber) - .substatus(substatus) .build() /** @@ -158,6 +164,15 @@ private constructor( */ fun status(): FinancialAccount.FinancialAccountStatus = status.getRequired("status") + /** + * Substatus for the financial account + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun substatus(): Optional = + substatus.getOptional("substatus") + /** * @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). @@ -171,25 +186,24 @@ private constructor( fun updated(): OffsetDateTime = updated.getRequired("updated") /** + * User-defined status for the financial account + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun accountNumber(): Optional = accountNumber.getOptional("account_number") + fun userDefinedStatus(): Optional = userDefinedStatus.getOptional("user_defined_status") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun routingNumber(): Optional = routingNumber.getOptional("routing_number") + fun accountNumber(): Optional = accountNumber.getOptional("account_number") /** - * Substatus for the financial account - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun substatus(): Optional = - substatus.getOptional("substatus") + fun routingNumber(): Optional = routingNumber.getOptional("routing_number") /** * The type of event that occurred. @@ -258,6 +272,15 @@ private constructor( @ExcludeMissing fun _status(): JsonField = status + /** + * Returns the raw JSON value of [substatus]. + * + * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("substatus") + @ExcludeMissing + fun _substatus(): JsonField = substatus + /** * Returns the raw JSON value of [type]. * @@ -272,6 +295,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [userDefinedStatus]. + * + * Unlike [userDefinedStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_defined_status") + @ExcludeMissing + fun _userDefinedStatus(): JsonField = userDefinedStatus + /** * Returns the raw JSON value of [accountNumber]. * @@ -290,15 +323,6 @@ private constructor( @ExcludeMissing fun _routingNumber(): JsonField = routingNumber - /** - * Returns the raw JSON value of [substatus]. - * - * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("substatus") - @ExcludeMissing - fun _substatus(): JsonField = substatus - /** * Returns the raw JSON value of [eventType]. * @@ -333,8 +357,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * .eventType() * ``` */ @@ -352,12 +378,12 @@ private constructor( private var isForBenefitOf: JsonField? = null private var nickname: JsonField? = null private var status: JsonField? = null + private var substatus: JsonField? = null private var type: JsonField? = null private var updated: JsonField? = null + private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var substatus: JsonField = - JsonMissing.of() private var eventType: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -372,11 +398,12 @@ private constructor( isForBenefitOf = financialAccountCreatedWebhookEvent.isForBenefitOf nickname = financialAccountCreatedWebhookEvent.nickname status = financialAccountCreatedWebhookEvent.status + substatus = financialAccountCreatedWebhookEvent.substatus type = financialAccountCreatedWebhookEvent.type updated = financialAccountCreatedWebhookEvent.updated + userDefinedStatus = financialAccountCreatedWebhookEvent.userDefinedStatus accountNumber = financialAccountCreatedWebhookEvent.accountNumber routingNumber = financialAccountCreatedWebhookEvent.routingNumber - substatus = financialAccountCreatedWebhookEvent.substatus eventType = financialAccountCreatedWebhookEvent.eventType additionalProperties = financialAccountCreatedWebhookEvent.additionalProperties.toMutableMap() @@ -483,6 +510,25 @@ private constructor( this.status = status } + /** Substatus for the financial account */ + fun substatus(substatus: FinancialAccount.FinancialAccountSubstatus?) = + substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = + substatus(substatus.getOrNull()) + + /** + * Sets [Builder.substatus] to an arbitrary JSON value. + * + * You should usually call [Builder.substatus] with a well-typed + * [FinancialAccount.FinancialAccountSubstatus] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun substatus(substatus: JsonField) = apply { + this.substatus = substatus + } + fun type(type: FinancialAccount.Type) = type(JsonField.of(type)) /** @@ -505,6 +551,25 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** User-defined status for the financial account */ + fun userDefinedStatus(userDefinedStatus: String?) = + userDefinedStatus(JsonField.ofNullable(userDefinedStatus)) + + /** Alias for calling [Builder.userDefinedStatus] with `userDefinedStatus.orElse(null)`. */ + fun userDefinedStatus(userDefinedStatus: Optional) = + userDefinedStatus(userDefinedStatus.getOrNull()) + + /** + * Sets [Builder.userDefinedStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedStatus] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userDefinedStatus(userDefinedStatus: JsonField) = apply { + this.userDefinedStatus = userDefinedStatus + } + fun accountNumber(accountNumber: String?) = accountNumber(JsonField.ofNullable(accountNumber)) @@ -541,25 +606,6 @@ private constructor( this.routingNumber = routingNumber } - /** Substatus for the financial account */ - fun substatus(substatus: FinancialAccount.FinancialAccountSubstatus?) = - substatus(JsonField.ofNullable(substatus)) - - /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ - fun substatus(substatus: Optional) = - substatus(substatus.getOrNull()) - - /** - * Sets [Builder.substatus] to an arbitrary JSON value. - * - * You should usually call [Builder.substatus] with a well-typed - * [FinancialAccount.FinancialAccountSubstatus] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun substatus(substatus: JsonField) = apply { - this.substatus = substatus - } - /** The type of event that occurred. */ fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) @@ -605,8 +651,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * .eventType() * ``` * @@ -621,11 +669,12 @@ private constructor( checkRequired("isForBenefitOf", isForBenefitOf), checkRequired("nickname", nickname), checkRequired("status", status), + checkRequired("substatus", substatus), checkRequired("type", type), checkRequired("updated", updated), + checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, routingNumber, - substatus, checkRequired("eventType", eventType), additionalProperties.toMutableMap(), ) @@ -645,11 +694,12 @@ private constructor( isForBenefitOf() nickname() status().validate() + substatus().ifPresent { it.validate() } type().validate() updated() + userDefinedStatus() accountNumber() routingNumber() - substatus().ifPresent { it.validate() } eventType().validate() validated = true } @@ -676,11 +726,12 @@ private constructor( (if (isForBenefitOf.asKnown().isPresent) 1 else 0) + (if (nickname.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + + (substatus.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + - (substatus.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) /** The type of event that occurred. */ @@ -818,11 +869,12 @@ private constructor( isForBenefitOf == other.isForBenefitOf && nickname == other.nickname && status == other.status && + substatus == other.substatus && type == other.type && updated == other.updated && + userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && routingNumber == other.routingNumber && - substatus == other.substatus && eventType == other.eventType && additionalProperties == other.additionalProperties } @@ -836,11 +888,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, eventType, additionalProperties, ) @@ -849,5 +902,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, type=$type, updated=$updated, accountNumber=$accountNumber, routingNumber=$routingNumber, substatus=$substatus, 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, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt index e3b4445f3..e51d0e37d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParams.kt @@ -48,6 +48,14 @@ private constructor( */ fun substatus(): Optional = body.substatus() + /** + * User-defined status for the financial account + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userDefinedStatus(): Optional = body.userDefinedStatus() + /** * Returns the raw JSON value of [status]. * @@ -62,6 +70,14 @@ private constructor( */ fun _substatus(): JsonField = body._substatus() + /** + * Returns the raw JSON value of [userDefinedStatus]. + * + * Unlike [userDefinedStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _userDefinedStatus(): JsonField = body._userDefinedStatus() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -124,6 +140,7 @@ private constructor( * Otherwise, it's more convenient to use the top-level setters instead: * - [status] * - [substatus] + * - [userDefinedStatus] */ fun body(body: UpdateFinancialAccountStatusRequest) = apply { this.body = body.toBuilder() } @@ -159,6 +176,22 @@ private constructor( body.substatus(substatus) } + /** User-defined status for the financial account */ + fun userDefinedStatus(userDefinedStatus: String) = apply { + body.userDefinedStatus(userDefinedStatus) + } + + /** + * Sets [Builder.userDefinedStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedStatus] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userDefinedStatus(userDefinedStatus: JsonField) = apply { + body.userDefinedStatus(userDefinedStatus) + } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -315,6 +348,7 @@ private constructor( private constructor( private val status: JsonField, private val substatus: JsonField, + private val userDefinedStatus: JsonField, private val additionalProperties: MutableMap, ) { @@ -326,7 +360,10 @@ private constructor( @JsonProperty("substatus") @ExcludeMissing substatus: JsonField = JsonMissing.of(), - ) : this(status, substatus, mutableMapOf()) + @JsonProperty("user_defined_status") + @ExcludeMissing + userDefinedStatus: JsonField = JsonMissing.of(), + ) : this(status, substatus, userDefinedStatus, mutableMapOf()) /** * Status of the financial account @@ -345,6 +382,15 @@ private constructor( fun substatus(): Optional = substatus.getOptional("substatus") + /** + * User-defined status for the financial account + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userDefinedStatus(): Optional = + userDefinedStatus.getOptional("user_defined_status") + /** * Returns the raw JSON value of [status]. * @@ -363,6 +409,16 @@ private constructor( @ExcludeMissing fun _substatus(): JsonField = substatus + /** + * Returns the raw JSON value of [userDefinedStatus]. + * + * Unlike [userDefinedStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_defined_status") + @ExcludeMissing + fun _userDefinedStatus(): JsonField = userDefinedStatus + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -395,6 +451,7 @@ private constructor( private var status: JsonField? = null private var substatus: JsonField? = null + private var userDefinedStatus: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -403,6 +460,7 @@ private constructor( ) = apply { status = updateFinancialAccountStatusRequest.status substatus = updateFinancialAccountStatusRequest.substatus + userDefinedStatus = updateFinancialAccountStatusRequest.userDefinedStatus additionalProperties = updateFinancialAccountStatusRequest.additionalProperties.toMutableMap() } @@ -438,6 +496,21 @@ private constructor( this.substatus = substatus } + /** User-defined status for the financial account */ + fun userDefinedStatus(userDefinedStatus: String) = + userDefinedStatus(JsonField.of(userDefinedStatus)) + + /** + * Sets [Builder.userDefinedStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedStatus] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userDefinedStatus(userDefinedStatus: JsonField) = apply { + this.userDefinedStatus = userDefinedStatus + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -474,6 +547,7 @@ private constructor( UpdateFinancialAccountStatusRequest( checkRequired("status", status), checkRequired("substatus", substatus), + userDefinedStatus, additionalProperties.toMutableMap(), ) } @@ -487,6 +561,7 @@ private constructor( status().validate() substatus().ifPresent { it.validate() } + userDefinedStatus() validated = true } @@ -507,7 +582,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (status.asKnown().getOrNull()?.validity() ?: 0) + - (substatus.asKnown().getOrNull()?.validity() ?: 0) + (substatus.asKnown().getOrNull()?.validity() ?: 0) + + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -517,15 +593,18 @@ private constructor( return other is UpdateFinancialAccountStatusRequest && status == other.status && substatus == other.substatus && + userDefinedStatus == other.userDefinedStatus && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(status, substatus, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(status, substatus, userDefinedStatus, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "UpdateFinancialAccountStatusRequest{status=$status, substatus=$substatus, additionalProperties=$additionalProperties}" + "UpdateFinancialAccountStatusRequest{status=$status, substatus=$substatus, userDefinedStatus=$userDefinedStatus, additionalProperties=$additionalProperties}" } /** Status of the financial account */ 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 4856b37e2..ad785d9c4 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 @@ -29,11 +29,12 @@ private constructor( private val isForBenefitOf: JsonField, private val nickname: JsonField, private val status: JsonField, + private val substatus: JsonField, private val type: JsonField, private val updated: JsonField, + private val userDefinedStatus: JsonField, private val accountNumber: JsonField, private val routingNumber: JsonField, - private val substatus: JsonField, private val eventType: JsonField, private val additionalProperties: MutableMap, ) { @@ -58,21 +59,24 @@ private constructor( @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("substatus") + @ExcludeMissing + substatus: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing updated: JsonField = JsonMissing.of(), + @JsonProperty("user_defined_status") + @ExcludeMissing + userDefinedStatus: JsonField = JsonMissing.of(), @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("substatus") - @ExcludeMissing - substatus: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing eventType: JsonField = JsonMissing.of(), @@ -84,11 +88,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, eventType, mutableMapOf(), ) @@ -102,11 +107,12 @@ private constructor( .isForBenefitOf(isForBenefitOf) .nickname(nickname) .status(status) + .substatus(substatus) .type(type) .updated(updated) + .userDefinedStatus(userDefinedStatus) .accountNumber(accountNumber) .routingNumber(routingNumber) - .substatus(substatus) .build() /** @@ -158,6 +164,15 @@ private constructor( */ fun status(): FinancialAccount.FinancialAccountStatus = status.getRequired("status") + /** + * Substatus for the financial account + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun substatus(): Optional = + substatus.getOptional("substatus") + /** * @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). @@ -171,25 +186,24 @@ private constructor( fun updated(): OffsetDateTime = updated.getRequired("updated") /** + * User-defined status for the financial account + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun accountNumber(): Optional = accountNumber.getOptional("account_number") + fun userDefinedStatus(): Optional = userDefinedStatus.getOptional("user_defined_status") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun routingNumber(): Optional = routingNumber.getOptional("routing_number") + fun accountNumber(): Optional = accountNumber.getOptional("account_number") /** - * Substatus for the financial account - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun substatus(): Optional = - substatus.getOptional("substatus") + fun routingNumber(): Optional = routingNumber.getOptional("routing_number") /** * The type of event that occurred. @@ -258,6 +272,15 @@ private constructor( @ExcludeMissing fun _status(): JsonField = status + /** + * Returns the raw JSON value of [substatus]. + * + * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("substatus") + @ExcludeMissing + fun _substatus(): JsonField = substatus + /** * Returns the raw JSON value of [type]. * @@ -272,6 +295,16 @@ private constructor( */ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated + /** + * Returns the raw JSON value of [userDefinedStatus]. + * + * Unlike [userDefinedStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_defined_status") + @ExcludeMissing + fun _userDefinedStatus(): JsonField = userDefinedStatus + /** * Returns the raw JSON value of [accountNumber]. * @@ -290,15 +323,6 @@ private constructor( @ExcludeMissing fun _routingNumber(): JsonField = routingNumber - /** - * Returns the raw JSON value of [substatus]. - * - * Unlike [substatus], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("substatus") - @ExcludeMissing - fun _substatus(): JsonField = substatus - /** * Returns the raw JSON value of [eventType]. * @@ -333,8 +357,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * .eventType() * ``` */ @@ -352,12 +378,12 @@ private constructor( private var isForBenefitOf: JsonField? = null private var nickname: JsonField? = null private var status: JsonField? = null + private var substatus: JsonField? = null private var type: JsonField? = null private var updated: JsonField? = null + private var userDefinedStatus: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var substatus: JsonField = - JsonMissing.of() private var eventType: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -372,11 +398,12 @@ private constructor( isForBenefitOf = financialAccountUpdatedWebhookEvent.isForBenefitOf nickname = financialAccountUpdatedWebhookEvent.nickname status = financialAccountUpdatedWebhookEvent.status + substatus = financialAccountUpdatedWebhookEvent.substatus type = financialAccountUpdatedWebhookEvent.type updated = financialAccountUpdatedWebhookEvent.updated + userDefinedStatus = financialAccountUpdatedWebhookEvent.userDefinedStatus accountNumber = financialAccountUpdatedWebhookEvent.accountNumber routingNumber = financialAccountUpdatedWebhookEvent.routingNumber - substatus = financialAccountUpdatedWebhookEvent.substatus eventType = financialAccountUpdatedWebhookEvent.eventType additionalProperties = financialAccountUpdatedWebhookEvent.additionalProperties.toMutableMap() @@ -483,6 +510,25 @@ private constructor( this.status = status } + /** Substatus for the financial account */ + fun substatus(substatus: FinancialAccount.FinancialAccountSubstatus?) = + substatus(JsonField.ofNullable(substatus)) + + /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ + fun substatus(substatus: Optional) = + substatus(substatus.getOrNull()) + + /** + * Sets [Builder.substatus] to an arbitrary JSON value. + * + * You should usually call [Builder.substatus] with a well-typed + * [FinancialAccount.FinancialAccountSubstatus] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun substatus(substatus: JsonField) = apply { + this.substatus = substatus + } + fun type(type: FinancialAccount.Type) = type(JsonField.of(type)) /** @@ -505,6 +551,25 @@ private constructor( */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** User-defined status for the financial account */ + fun userDefinedStatus(userDefinedStatus: String?) = + userDefinedStatus(JsonField.ofNullable(userDefinedStatus)) + + /** Alias for calling [Builder.userDefinedStatus] with `userDefinedStatus.orElse(null)`. */ + fun userDefinedStatus(userDefinedStatus: Optional) = + userDefinedStatus(userDefinedStatus.getOrNull()) + + /** + * Sets [Builder.userDefinedStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.userDefinedStatus] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userDefinedStatus(userDefinedStatus: JsonField) = apply { + this.userDefinedStatus = userDefinedStatus + } + fun accountNumber(accountNumber: String?) = accountNumber(JsonField.ofNullable(accountNumber)) @@ -541,25 +606,6 @@ private constructor( this.routingNumber = routingNumber } - /** Substatus for the financial account */ - fun substatus(substatus: FinancialAccount.FinancialAccountSubstatus?) = - substatus(JsonField.ofNullable(substatus)) - - /** Alias for calling [Builder.substatus] with `substatus.orElse(null)`. */ - fun substatus(substatus: Optional) = - substatus(substatus.getOrNull()) - - /** - * Sets [Builder.substatus] to an arbitrary JSON value. - * - * You should usually call [Builder.substatus] with a well-typed - * [FinancialAccount.FinancialAccountSubstatus] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun substatus(substatus: JsonField) = apply { - this.substatus = substatus - } - /** The type of event that occurred. */ fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) @@ -605,8 +651,10 @@ private constructor( * .isForBenefitOf() * .nickname() * .status() + * .substatus() * .type() * .updated() + * .userDefinedStatus() * .eventType() * ``` * @@ -621,11 +669,12 @@ private constructor( checkRequired("isForBenefitOf", isForBenefitOf), checkRequired("nickname", nickname), checkRequired("status", status), + checkRequired("substatus", substatus), checkRequired("type", type), checkRequired("updated", updated), + checkRequired("userDefinedStatus", userDefinedStatus), accountNumber, routingNumber, - substatus, checkRequired("eventType", eventType), additionalProperties.toMutableMap(), ) @@ -645,11 +694,12 @@ private constructor( isForBenefitOf() nickname() status().validate() + substatus().ifPresent { it.validate() } type().validate() updated() + userDefinedStatus() accountNumber() routingNumber() - substatus().ifPresent { it.validate() } eventType().validate() validated = true } @@ -676,11 +726,12 @@ private constructor( (if (isForBenefitOf.asKnown().isPresent) 1 else 0) + (if (nickname.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + + (substatus.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) + (if (updated.asKnown().isPresent) 1 else 0) + + (if (userDefinedStatus.asKnown().isPresent) 1 else 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + - (substatus.asKnown().getOrNull()?.validity() ?: 0) + (eventType.asKnown().getOrNull()?.validity() ?: 0) /** The type of event that occurred. */ @@ -818,11 +869,12 @@ private constructor( isForBenefitOf == other.isForBenefitOf && nickname == other.nickname && status == other.status && + substatus == other.substatus && type == other.type && updated == other.updated && + userDefinedStatus == other.userDefinedStatus && accountNumber == other.accountNumber && routingNumber == other.routingNumber && - substatus == other.substatus && eventType == other.eventType && additionalProperties == other.additionalProperties } @@ -836,11 +888,12 @@ private constructor( isForBenefitOf, nickname, status, + substatus, type, updated, + userDefinedStatus, accountNumber, routingNumber, - substatus, eventType, additionalProperties, ) @@ -849,5 +902,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, type=$type, updated=$updated, accountNumber=$accountNumber, routingNumber=$routingNumber, substatus=$substatus, 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, routingNumber=$routingNumber, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt index 606e51277..274e35e3a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt @@ -37,7 +37,7 @@ private constructor( private val financialAccountToken: JsonField, private val interestDetails: JsonField, private val minimumPaymentBalance: JsonField, - private val paymentAllocation: JsonField, + private val paymentAllocation: JsonField, private val periodTotals: JsonField, private val previousStatementBalance: JsonField, private val startingBalance: JsonField, @@ -88,7 +88,7 @@ private constructor( minimumPaymentBalance: JsonField = JsonMissing.of(), @JsonProperty("payment_allocation") @ExcludeMissing - paymentAllocation: JsonField = JsonMissing.of(), + paymentAllocation: JsonField = JsonMissing.of(), @JsonProperty("period_totals") @ExcludeMissing periodTotals: JsonField = JsonMissing.of(), @@ -244,7 +244,7 @@ private constructor( * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun paymentAllocation(): CategoryBalances = paymentAllocation.getRequired("payment_allocation") + fun paymentAllocation(): PaymentAllocation = paymentAllocation.getRequired("payment_allocation") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type or is @@ -424,7 +424,7 @@ private constructor( */ @JsonProperty("payment_allocation") @ExcludeMissing - fun _paymentAllocation(): JsonField = paymentAllocation + fun _paymentAllocation(): JsonField = paymentAllocation /** * Returns the raw JSON value of [periodTotals]. @@ -546,7 +546,7 @@ private constructor( private var financialAccountToken: JsonField? = null private var interestDetails: JsonField? = null private var minimumPaymentBalance: JsonField? = null - private var paymentAllocation: JsonField? = null + private var paymentAllocation: JsonField? = null private var periodTotals: JsonField? = null private var previousStatementBalance: JsonField? = null private var startingBalance: JsonField? = null @@ -776,17 +776,17 @@ private constructor( this.minimumPaymentBalance = minimumPaymentBalance } - fun paymentAllocation(paymentAllocation: CategoryBalances) = + fun paymentAllocation(paymentAllocation: PaymentAllocation) = paymentAllocation(JsonField.of(paymentAllocation)) /** * Sets [Builder.paymentAllocation] to an arbitrary JSON value. * - * You should usually call [Builder.paymentAllocation] with a well-typed [CategoryBalances] + * You should usually call [Builder.paymentAllocation] with a well-typed [PaymentAllocation] * value instead. This method is primarily for setting the field to an undocumented or not * yet supported value. */ - fun paymentAllocation(paymentAllocation: JsonField) = apply { + fun paymentAllocation(paymentAllocation: JsonField) = apply { this.paymentAllocation = paymentAllocation } @@ -3298,6 +3298,402 @@ private constructor( "BalanceDetails{amount=$amount, remaining=$remaining, additionalProperties=$additionalProperties}" } + class PaymentAllocation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val feeDetails: JsonField, + private val fees: JsonField, + private val interest: JsonField, + private val interestDetails: JsonField, + private val principal: JsonField, + private val principalDetails: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("fee_details") + @ExcludeMissing + feeDetails: JsonField = JsonMissing.of(), + @JsonProperty("fees") @ExcludeMissing fees: JsonField = JsonMissing.of(), + @JsonProperty("interest") @ExcludeMissing interest: JsonField = JsonMissing.of(), + @JsonProperty("interest_details") + @ExcludeMissing + interestDetails: JsonField = JsonMissing.of(), + @JsonProperty("principal") + @ExcludeMissing + principal: JsonField = JsonMissing.of(), + @JsonProperty("principal_details") + @ExcludeMissing + principalDetails: JsonField = JsonMissing.of(), + ) : this( + feeDetails, + fees, + interest, + interestDetails, + principal, + principalDetails, + mutableMapOf(), + ) + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun feeDetails(): Optional = feeDetails.getOptional("fee_details") + + /** + * Amount allocated to fees in cents + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun fees(): Long = fees.getRequired("fees") + + /** + * Amount allocated to interest in cents + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun interest(): Long = interest.getRequired("interest") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun interestDetails(): Optional = + interestDetails.getOptional("interest_details") + + /** + * Amount allocated to principal in cents + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun principal(): Long = principal.getRequired("principal") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun principalDetails(): Optional = + principalDetails.getOptional("principal_details") + + /** + * Returns the raw JSON value of [feeDetails]. + * + * Unlike [feeDetails], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("fee_details") + @ExcludeMissing + fun _feeDetails(): JsonField = feeDetails + + /** + * Returns the raw JSON value of [fees]. + * + * Unlike [fees], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("fees") @ExcludeMissing fun _fees(): JsonField = fees + + /** + * Returns the raw JSON value of [interest]. + * + * Unlike [interest], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("interest") @ExcludeMissing fun _interest(): JsonField = interest + + /** + * Returns the raw JSON value of [interestDetails]. + * + * Unlike [interestDetails], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("interest_details") + @ExcludeMissing + fun _interestDetails(): JsonField = interestDetails + + /** + * Returns the raw JSON value of [principal]. + * + * Unlike [principal], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("principal") @ExcludeMissing fun _principal(): JsonField = principal + + /** + * Returns the raw JSON value of [principalDetails]. + * + * Unlike [principalDetails], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("principal_details") + @ExcludeMissing + fun _principalDetails(): JsonField = principalDetails + + @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 [PaymentAllocation]. + * + * The following fields are required: + * ```java + * .feeDetails() + * .fees() + * .interest() + * .interestDetails() + * .principal() + * .principalDetails() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PaymentAllocation]. */ + class Builder internal constructor() { + + private var feeDetails: JsonField? = null + private var fees: JsonField? = null + private var interest: JsonField? = null + private var interestDetails: JsonField? = null + private var principal: JsonField? = null + private var principalDetails: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentAllocation: PaymentAllocation) = apply { + feeDetails = paymentAllocation.feeDetails + fees = paymentAllocation.fees + interest = paymentAllocation.interest + interestDetails = paymentAllocation.interestDetails + principal = paymentAllocation.principal + principalDetails = paymentAllocation.principalDetails + additionalProperties = paymentAllocation.additionalProperties.toMutableMap() + } + + fun feeDetails(feeDetails: CategoryDetails?) = + feeDetails(JsonField.ofNullable(feeDetails)) + + /** Alias for calling [Builder.feeDetails] with `feeDetails.orElse(null)`. */ + fun feeDetails(feeDetails: Optional) = + feeDetails(feeDetails.getOrNull()) + + /** + * Sets [Builder.feeDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.feeDetails] with a well-typed [CategoryDetails] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun feeDetails(feeDetails: JsonField) = apply { + this.feeDetails = feeDetails + } + + /** Amount allocated to fees in cents */ + fun fees(fees: Long) = fees(JsonField.of(fees)) + + /** + * Sets [Builder.fees] to an arbitrary JSON value. + * + * You should usually call [Builder.fees] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun fees(fees: JsonField) = apply { this.fees = fees } + + /** Amount allocated to interest in cents */ + fun interest(interest: Long) = interest(JsonField.of(interest)) + + /** + * Sets [Builder.interest] to an arbitrary JSON value. + * + * You should usually call [Builder.interest] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun interest(interest: JsonField) = apply { this.interest = interest } + + fun interestDetails(interestDetails: CategoryDetails?) = + interestDetails(JsonField.ofNullable(interestDetails)) + + /** Alias for calling [Builder.interestDetails] with `interestDetails.orElse(null)`. */ + fun interestDetails(interestDetails: Optional) = + interestDetails(interestDetails.getOrNull()) + + /** + * Sets [Builder.interestDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.interestDetails] with a well-typed [CategoryDetails] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun interestDetails(interestDetails: JsonField) = apply { + this.interestDetails = interestDetails + } + + /** Amount allocated to principal in cents */ + fun principal(principal: Long) = principal(JsonField.of(principal)) + + /** + * Sets [Builder.principal] to an arbitrary JSON value. + * + * You should usually call [Builder.principal] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun principal(principal: JsonField) = apply { this.principal = principal } + + fun principalDetails(principalDetails: CategoryDetails?) = + principalDetails(JsonField.ofNullable(principalDetails)) + + /** + * Alias for calling [Builder.principalDetails] with `principalDetails.orElse(null)`. + */ + fun principalDetails(principalDetails: Optional) = + principalDetails(principalDetails.getOrNull()) + + /** + * Sets [Builder.principalDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.principalDetails] with a well-typed + * [CategoryDetails] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun principalDetails(principalDetails: JsonField) = apply { + this.principalDetails = principalDetails + } + + 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 [PaymentAllocation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .feeDetails() + * .fees() + * .interest() + * .interestDetails() + * .principal() + * .principalDetails() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PaymentAllocation = + PaymentAllocation( + checkRequired("feeDetails", feeDetails), + checkRequired("fees", fees), + checkRequired("interest", interest), + checkRequired("interestDetails", interestDetails), + checkRequired("principal", principal), + checkRequired("principalDetails", principalDetails), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): PaymentAllocation = apply { + if (validated) { + return@apply + } + + feeDetails().ifPresent { it.validate() } + fees() + interest() + interestDetails().ifPresent { it.validate() } + principal() + principalDetails().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (feeDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (fees.asKnown().isPresent) 1 else 0) + + (if (interest.asKnown().isPresent) 1 else 0) + + (interestDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (principal.asKnown().isPresent) 1 else 0) + + (principalDetails.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentAllocation && + feeDetails == other.feeDetails && + fees == other.fees && + interest == other.interest && + interestDetails == other.interestDetails && + principal == other.principal && + principalDetails == other.principalDetails && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + feeDetails, + fees, + interest, + interestDetails, + principal, + principalDetails, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PaymentAllocation{feeDetails=$feeDetails, fees=$fees, interest=$interest, interestDetails=$interestDetails, principal=$principal, principalDetails=$principalDetails, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt index 935f2ef48..c5087b934 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEvent.kt @@ -37,7 +37,7 @@ private constructor( private val financialAccountToken: JsonField, private val interestDetails: JsonField, private val minimumPaymentBalance: JsonField, - private val paymentAllocation: JsonField, + private val paymentAllocation: JsonField, private val periodTotals: JsonField, private val previousStatementBalance: JsonField, private val startingBalance: JsonField, @@ -91,7 +91,7 @@ private constructor( minimumPaymentBalance: JsonField = JsonMissing.of(), @JsonProperty("payment_allocation") @ExcludeMissing - paymentAllocation: JsonField = JsonMissing.of(), + paymentAllocation: JsonField = JsonMissing.of(), @JsonProperty("period_totals") @ExcludeMissing periodTotals: JsonField = JsonMissing.of(), @@ -278,7 +278,8 @@ private constructor( * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun paymentAllocation(): CategoryBalances = paymentAllocation.getRequired("payment_allocation") + fun paymentAllocation(): LoanTape.PaymentAllocation = + paymentAllocation.getRequired("payment_allocation") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type or is @@ -468,7 +469,7 @@ private constructor( */ @JsonProperty("payment_allocation") @ExcludeMissing - fun _paymentAllocation(): JsonField = paymentAllocation + fun _paymentAllocation(): JsonField = paymentAllocation /** * Returns the raw JSON value of [periodTotals]. @@ -598,7 +599,7 @@ private constructor( private var financialAccountToken: JsonField? = null private var interestDetails: JsonField? = null private var minimumPaymentBalance: JsonField? = null - private var paymentAllocation: JsonField? = null + private var paymentAllocation: JsonField? = null private var periodTotals: JsonField? = null private var previousStatementBalance: JsonField? = null private var startingBalance: JsonField? = null @@ -831,17 +832,17 @@ private constructor( this.minimumPaymentBalance = minimumPaymentBalance } - fun paymentAllocation(paymentAllocation: CategoryBalances) = + fun paymentAllocation(paymentAllocation: LoanTape.PaymentAllocation) = paymentAllocation(JsonField.of(paymentAllocation)) /** * Sets [Builder.paymentAllocation] to an arbitrary JSON value. * - * You should usually call [Builder.paymentAllocation] with a well-typed [CategoryBalances] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.paymentAllocation] with a well-typed + * [LoanTape.PaymentAllocation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. */ - fun paymentAllocation(paymentAllocation: JsonField) = apply { + fun paymentAllocation(paymentAllocation: JsonField) = apply { this.paymentAllocation = paymentAllocation } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt index ba7ac888c..dd2defbb0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEvent.kt @@ -37,7 +37,7 @@ private constructor( private val financialAccountToken: JsonField, private val interestDetails: JsonField, private val minimumPaymentBalance: JsonField, - private val paymentAllocation: JsonField, + private val paymentAllocation: JsonField, private val periodTotals: JsonField, private val previousStatementBalance: JsonField, private val startingBalance: JsonField, @@ -91,7 +91,7 @@ private constructor( minimumPaymentBalance: JsonField = JsonMissing.of(), @JsonProperty("payment_allocation") @ExcludeMissing - paymentAllocation: JsonField = JsonMissing.of(), + paymentAllocation: JsonField = JsonMissing.of(), @JsonProperty("period_totals") @ExcludeMissing periodTotals: JsonField = JsonMissing.of(), @@ -278,7 +278,8 @@ private constructor( * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun paymentAllocation(): CategoryBalances = paymentAllocation.getRequired("payment_allocation") + fun paymentAllocation(): LoanTape.PaymentAllocation = + paymentAllocation.getRequired("payment_allocation") /** * @throws LithicInvalidDataException if the JSON field has an unexpected type or is @@ -468,7 +469,7 @@ private constructor( */ @JsonProperty("payment_allocation") @ExcludeMissing - fun _paymentAllocation(): JsonField = paymentAllocation + fun _paymentAllocation(): JsonField = paymentAllocation /** * Returns the raw JSON value of [periodTotals]. @@ -598,7 +599,7 @@ private constructor( private var financialAccountToken: JsonField? = null private var interestDetails: JsonField? = null private var minimumPaymentBalance: JsonField? = null - private var paymentAllocation: JsonField? = null + private var paymentAllocation: JsonField? = null private var periodTotals: JsonField? = null private var previousStatementBalance: JsonField? = null private var startingBalance: JsonField? = null @@ -831,17 +832,17 @@ private constructor( this.minimumPaymentBalance = minimumPaymentBalance } - fun paymentAllocation(paymentAllocation: CategoryBalances) = + fun paymentAllocation(paymentAllocation: LoanTape.PaymentAllocation) = paymentAllocation(JsonField.of(paymentAllocation)) /** * Sets [Builder.paymentAllocation] to an arbitrary JSON value. * - * You should usually call [Builder.paymentAllocation] with a well-typed [CategoryBalances] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.paymentAllocation] with a well-typed + * [LoanTape.PaymentAllocation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. */ - fun paymentAllocation(paymentAllocation: JsonField) = apply { + fun paymentAllocation(paymentAllocation: JsonField) = apply { this.paymentAllocation = paymentAllocation } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt index 1e8bb83aa..cb3200ded 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ManagementOperationCreateParams.kt @@ -67,6 +67,9 @@ private constructor( fun financialAccountToken(): String = body.financialAccountToken() /** + * Customer-provided token that will serve as an idempotency token. This token will become the + * transaction token. + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -313,6 +316,10 @@ private constructor( body.financialAccountToken(financialAccountToken) } + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ fun token(token: String) = apply { body.token(token) } /** @@ -617,6 +624,9 @@ private constructor( financialAccountToken.getRequired("financial_account_token") /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -888,6 +898,10 @@ private constructor( this.financialAccountToken = financialAccountToken } + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ fun token(token: String) = token(JsonField.of(token)) /** diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt index 1c42792eb..ef5b9831d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ParsedWebhookEvent.kt @@ -43,7 +43,8 @@ private constructor( private val legacyPayload: LegacyPayload? = null, private val accountHolderVerification: AccountHolderVerificationWebhookEvent? = null, private val accountHolderDocumentUpdated: AccountHolderDocumentUpdatedWebhookEvent? = null, - private val asaRequest: AsaRequestWebhookEvent? = null, + private val cardAuthorizationApprovalRequest: CardAuthorizationApprovalRequestWebhookEvent? = + null, private val tokenizationDecisioningRequest: TokenizationDecisioningRequestWebhookEvent? = null, private val authRulesBacktestReportCreated: AuthRulesBacktestReportCreatedWebhookEvent? = null, private val balanceUpdated: BalanceUpdatedWebhookEvent? = null, @@ -107,7 +108,9 @@ private constructor( TokenizationTwoFactorAuthenticationCodeSentWebhookEvent? = null, private val tokenizationUpdated: TokenizationUpdatedWebhookEvent? = null, - private val threeDSAuthentication: ThreeDSAuthentication? = null, + private val threeDSAuthenticationApprovalRequest: + ThreeDSAuthenticationApprovalRequestWebhookEvent? = + null, private val disputeTransactionCreated: DisputeTransactionCreatedWebhookEvent? = null, private val disputeTransactionUpdated: DisputeTransactionUpdatedWebhookEvent? = null, private val _json: JsonValue? = null, @@ -131,8 +134,8 @@ private constructor( fun accountHolderDocumentUpdated(): Optional = Optional.ofNullable(accountHolderDocumentUpdated) - /** The Auth Stream Access request payload that was sent to the ASA responder. */ - fun asaRequest(): Optional = Optional.ofNullable(asaRequest) + fun cardAuthorizationApprovalRequest(): Optional = + Optional.ofNullable(cardAuthorizationApprovalRequest) /** A webhook for tokenization decisioning sent to the customer's responder endpoint */ fun tokenizationDecisioningRequest(): Optional = @@ -285,8 +288,9 @@ private constructor( Optional.ofNullable(tokenizationUpdated) /** Represents a 3DS authentication */ - fun threeDSAuthentication(): Optional = - Optional.ofNullable(threeDSAuthentication) + fun threeDSAuthenticationApprovalRequest(): + Optional = + Optional.ofNullable(threeDSAuthenticationApprovalRequest) /** The Dispute object tracks the progression of a dispute throughout its lifecycle. */ fun disputeTransactionCreated(): Optional = @@ -308,7 +312,7 @@ private constructor( fun isAccountHolderDocumentUpdated(): Boolean = accountHolderDocumentUpdated != null - fun isAsaRequest(): Boolean = asaRequest != null + fun isCardAuthorizationApprovalRequest(): Boolean = cardAuthorizationApprovalRequest != null fun isTokenizationDecisioningRequest(): Boolean = tokenizationDecisioningRequest != null @@ -409,7 +413,8 @@ private constructor( fun isTokenizationUpdated(): Boolean = tokenizationUpdated != null - fun isThreeDSAuthentication(): Boolean = threeDSAuthentication != null + fun isThreeDSAuthenticationApprovalRequest(): Boolean = + threeDSAuthenticationApprovalRequest != null fun isDisputeTransactionCreated(): Boolean = disputeTransactionCreated != null @@ -433,8 +438,8 @@ private constructor( fun asAccountHolderDocumentUpdated(): AccountHolderDocumentUpdatedWebhookEvent = accountHolderDocumentUpdated.getOrThrow("accountHolderDocumentUpdated") - /** The Auth Stream Access request payload that was sent to the ASA responder. */ - fun asAsaRequest(): AsaRequestWebhookEvent = asaRequest.getOrThrow("asaRequest") + fun asCardAuthorizationApprovalRequest(): CardAuthorizationApprovalRequestWebhookEvent = + cardAuthorizationApprovalRequest.getOrThrow("cardAuthorizationApprovalRequest") /** A webhook for tokenization decisioning sent to the customer's responder endpoint */ fun asTokenizationDecisioningRequest(): TokenizationDecisioningRequestWebhookEvent = @@ -595,8 +600,8 @@ private constructor( tokenizationUpdated.getOrThrow("tokenizationUpdated") /** Represents a 3DS authentication */ - fun asThreeDSAuthentication(): ThreeDSAuthentication = - threeDSAuthentication.getOrThrow("threeDSAuthentication") + fun asThreeDSAuthenticationApprovalRequest(): ThreeDSAuthenticationApprovalRequestWebhookEvent = + threeDSAuthenticationApprovalRequest.getOrThrow("threeDSAuthenticationApprovalRequest") /** The Dispute object tracks the progression of a dispute throughout its lifecycle. */ fun asDisputeTransactionCreated(): DisputeTransactionCreatedWebhookEvent = @@ -618,7 +623,8 @@ private constructor( visitor.visitAccountHolderVerification(accountHolderVerification) accountHolderDocumentUpdated != null -> visitor.visitAccountHolderDocumentUpdated(accountHolderDocumentUpdated) - asaRequest != null -> visitor.visitAsaRequest(asaRequest) + cardAuthorizationApprovalRequest != null -> + visitor.visitCardAuthorizationApprovalRequest(cardAuthorizationApprovalRequest) tokenizationDecisioningRequest != null -> visitor.visitTokenizationDecisioningRequest(tokenizationDecisioningRequest) authRulesBacktestReportCreated != null -> @@ -708,8 +714,10 @@ private constructor( tokenizationTwoFactorAuthenticationCodeSent ) tokenizationUpdated != null -> visitor.visitTokenizationUpdated(tokenizationUpdated) - threeDSAuthentication != null -> - visitor.visitThreeDSAuthentication(threeDSAuthentication) + threeDSAuthenticationApprovalRequest != null -> + visitor.visitThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest + ) disputeTransactionCreated != null -> visitor.visitDisputeTransactionCreated(disputeTransactionCreated) disputeTransactionUpdated != null -> @@ -756,8 +764,10 @@ private constructor( accountHolderDocumentUpdated.validate() } - override fun visitAsaRequest(asaRequest: AsaRequestWebhookEvent) { - asaRequest.validate() + override fun visitCardAuthorizationApprovalRequest( + cardAuthorizationApprovalRequest: CardAuthorizationApprovalRequestWebhookEvent + ) { + cardAuthorizationApprovalRequest.validate() } override fun visitTokenizationDecisioningRequest( @@ -1031,10 +1041,11 @@ private constructor( tokenizationUpdated.validate() } - override fun visitThreeDSAuthentication( - threeDSAuthentication: ThreeDSAuthentication + override fun visitThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest: + ThreeDSAuthenticationApprovalRequestWebhookEvent ) { - threeDSAuthentication.validate() + threeDSAuthenticationApprovalRequest.validate() } override fun visitDisputeTransactionCreated( @@ -1089,8 +1100,9 @@ private constructor( accountHolderDocumentUpdated: AccountHolderDocumentUpdatedWebhookEvent ) = accountHolderDocumentUpdated.validity() - override fun visitAsaRequest(asaRequest: AsaRequestWebhookEvent) = - asaRequest.validity() + override fun visitCardAuthorizationApprovalRequest( + cardAuthorizationApprovalRequest: CardAuthorizationApprovalRequestWebhookEvent + ) = cardAuthorizationApprovalRequest.validity() override fun visitTokenizationDecisioningRequest( tokenizationDecisioningRequest: TokenizationDecisioningRequestWebhookEvent @@ -1278,9 +1290,10 @@ private constructor( tokenizationUpdated: TokenizationUpdatedWebhookEvent ) = tokenizationUpdated.validity() - override fun visitThreeDSAuthentication( - threeDSAuthentication: ThreeDSAuthentication - ) = threeDSAuthentication.validity() + override fun visitThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest: + ThreeDSAuthenticationApprovalRequestWebhookEvent + ) = threeDSAuthenticationApprovalRequest.validity() override fun visitDisputeTransactionCreated( disputeTransactionCreated: DisputeTransactionCreatedWebhookEvent @@ -1306,7 +1319,7 @@ private constructor( legacyPayload == other.legacyPayload && accountHolderVerification == other.accountHolderVerification && accountHolderDocumentUpdated == other.accountHolderDocumentUpdated && - asaRequest == other.asaRequest && + cardAuthorizationApprovalRequest == other.cardAuthorizationApprovalRequest && tokenizationDecisioningRequest == other.tokenizationDecisioningRequest && authRulesBacktestReportCreated == other.authRulesBacktestReportCreated && balanceUpdated == other.balanceUpdated && @@ -1359,7 +1372,7 @@ private constructor( tokenizationTwoFactorAuthenticationCodeSent == other.tokenizationTwoFactorAuthenticationCodeSent && tokenizationUpdated == other.tokenizationUpdated && - threeDSAuthentication == other.threeDSAuthentication && + threeDSAuthenticationApprovalRequest == other.threeDSAuthenticationApprovalRequest && disputeTransactionCreated == other.disputeTransactionCreated && disputeTransactionUpdated == other.disputeTransactionUpdated } @@ -1372,7 +1385,7 @@ private constructor( legacyPayload, accountHolderVerification, accountHolderDocumentUpdated, - asaRequest, + cardAuthorizationApprovalRequest, tokenizationDecisioningRequest, authRulesBacktestReportCreated, balanceUpdated, @@ -1420,7 +1433,7 @@ private constructor( tokenizationTwoFactorAuthenticationCode, tokenizationTwoFactorAuthenticationCodeSent, tokenizationUpdated, - threeDSAuthentication, + threeDSAuthenticationApprovalRequest, disputeTransactionCreated, disputeTransactionUpdated, ) @@ -1436,7 +1449,8 @@ private constructor( "ParsedWebhookEvent{accountHolderVerification=$accountHolderVerification}" accountHolderDocumentUpdated != null -> "ParsedWebhookEvent{accountHolderDocumentUpdated=$accountHolderDocumentUpdated}" - asaRequest != null -> "ParsedWebhookEvent{asaRequest=$asaRequest}" + cardAuthorizationApprovalRequest != null -> + "ParsedWebhookEvent{cardAuthorizationApprovalRequest=$cardAuthorizationApprovalRequest}" tokenizationDecisioningRequest != null -> "ParsedWebhookEvent{tokenizationDecisioningRequest=$tokenizationDecisioningRequest}" authRulesBacktestReportCreated != null -> @@ -1521,8 +1535,8 @@ private constructor( "ParsedWebhookEvent{tokenizationTwoFactorAuthenticationCodeSent=$tokenizationTwoFactorAuthenticationCodeSent}" tokenizationUpdated != null -> "ParsedWebhookEvent{tokenizationUpdated=$tokenizationUpdated}" - threeDSAuthentication != null -> - "ParsedWebhookEvent{threeDSAuthentication=$threeDSAuthentication}" + threeDSAuthenticationApprovalRequest != null -> + "ParsedWebhookEvent{threeDSAuthenticationApprovalRequest=$threeDSAuthenticationApprovalRequest}" disputeTransactionCreated != null -> "ParsedWebhookEvent{disputeTransactionCreated=$disputeTransactionCreated}" disputeTransactionUpdated != null -> @@ -1560,10 +1574,10 @@ private constructor( accountHolderDocumentUpdated: AccountHolderDocumentUpdatedWebhookEvent ) = ParsedWebhookEvent(accountHolderDocumentUpdated = accountHolderDocumentUpdated) - /** The Auth Stream Access request payload that was sent to the ASA responder. */ @JvmStatic - fun ofAsaRequest(asaRequest: AsaRequestWebhookEvent) = - ParsedWebhookEvent(asaRequest = asaRequest) + fun ofCardAuthorizationApprovalRequest( + cardAuthorizationApprovalRequest: CardAuthorizationApprovalRequestWebhookEvent + ) = ParsedWebhookEvent(cardAuthorizationApprovalRequest = cardAuthorizationApprovalRequest) /** A webhook for tokenization decisioning sent to the customer's responder endpoint */ @JvmStatic @@ -1822,8 +1836,12 @@ private constructor( /** Represents a 3DS authentication */ @JvmStatic - fun ofThreeDSAuthentication(threeDSAuthentication: ThreeDSAuthentication) = - ParsedWebhookEvent(threeDSAuthentication = threeDSAuthentication) + fun ofThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest: ThreeDSAuthenticationApprovalRequestWebhookEvent + ) = + ParsedWebhookEvent( + threeDSAuthenticationApprovalRequest = threeDSAuthenticationApprovalRequest + ) /** The Dispute object tracks the progression of a dispute throughout its lifecycle. */ @JvmStatic @@ -1863,8 +1881,9 @@ private constructor( accountHolderDocumentUpdated: AccountHolderDocumentUpdatedWebhookEvent ): T - /** The Auth Stream Access request payload that was sent to the ASA responder. */ - fun visitAsaRequest(asaRequest: AsaRequestWebhookEvent): T + fun visitCardAuthorizationApprovalRequest( + cardAuthorizationApprovalRequest: CardAuthorizationApprovalRequestWebhookEvent + ): T /** A webhook for tokenization decisioning sent to the customer's responder endpoint */ fun visitTokenizationDecisioningRequest( @@ -2039,7 +2058,9 @@ private constructor( fun visitTokenizationUpdated(tokenizationUpdated: TokenizationUpdatedWebhookEvent): T /** Represents a 3DS authentication */ - fun visitThreeDSAuthentication(threeDSAuthentication: ThreeDSAuthentication): T + fun visitThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest: ThreeDSAuthenticationApprovalRequestWebhookEvent + ): T /** The Dispute object tracks the progression of a dispute throughout its lifecycle. */ fun visitDisputeTransactionCreated( @@ -2098,9 +2119,16 @@ private constructor( ?.let { ParsedWebhookEvent(accountHolderDocumentUpdated = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ParsedWebhookEvent(asaRequest = it, _json = json) - }, + tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + ParsedWebhookEvent( + cardAuthorizationApprovalRequest = it, + _json = json, + ) + }, tryDeserialize( node, jacksonTypeRef(), @@ -2393,9 +2421,16 @@ private constructor( }, tryDeserialize(node, jacksonTypeRef()) ?.let { ParsedWebhookEvent(tokenizationUpdated = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ParsedWebhookEvent(threeDSAuthentication = it, _json = json) - }, + tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + ParsedWebhookEvent( + threeDSAuthenticationApprovalRequest = it, + _json = json, + ) + }, tryDeserialize( node, jacksonTypeRef(), @@ -2443,7 +2478,8 @@ private constructor( generator.writeObject(value.accountHolderVerification) value.accountHolderDocumentUpdated != null -> generator.writeObject(value.accountHolderDocumentUpdated) - value.asaRequest != null -> generator.writeObject(value.asaRequest) + value.cardAuthorizationApprovalRequest != null -> + generator.writeObject(value.cardAuthorizationApprovalRequest) value.tokenizationDecisioningRequest != null -> generator.writeObject(value.tokenizationDecisioningRequest) value.authRulesBacktestReportCreated != null -> @@ -2531,8 +2567,8 @@ private constructor( generator.writeObject(value.tokenizationTwoFactorAuthenticationCodeSent) value.tokenizationUpdated != null -> generator.writeObject(value.tokenizationUpdated) - value.threeDSAuthentication != null -> - generator.writeObject(value.threeDSAuthentication) + value.threeDSAuthenticationApprovalRequest != null -> + generator.writeObject(value.threeDSAuthenticationApprovalRequest) value.disputeTransactionCreated != null -> generator.writeObject(value.disputeTransactionCreated) value.disputeTransactionUpdated != null -> 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 aa49240b6..5927991a5 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 @@ -1442,6 +1442,7 @@ private constructor( private val result: JsonField, private val type: JsonField, private val detailedResults: JsonField>, + private val externalId: JsonField, private val additionalProperties: MutableMap, ) { @@ -1459,7 +1460,10 @@ private constructor( @JsonProperty("detailed_results") @ExcludeMissing detailedResults: JsonField> = JsonMissing.of(), - ) : this(token, amount, created, result, type, detailedResults, mutableMapOf()) + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), + ) : this(token, amount, created, result, type, detailedResults, externalId, mutableMapOf()) /** * Globally unique identifier. @@ -1533,6 +1537,14 @@ private constructor( fun detailedResults(): Optional> = detailedResults.getOptional("detailed_results") + /** + * Payment event external ID, for example, ACH trace number. + * + * @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") + /** * Returns the raw JSON value of [token]. * @@ -1578,6 +1590,15 @@ private constructor( @ExcludeMissing fun _detailedResults(): JsonField> = detailedResults + /** + * 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 + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1616,6 +1637,7 @@ private constructor( private var result: JsonField? = null private var type: JsonField? = null private var detailedResults: JsonField>? = null + private var externalId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1626,6 +1648,7 @@ private constructor( result = paymentEvent.result type = paymentEvent.type detailedResults = paymentEvent.detailedResults.map { it.toMutableList() } + externalId = paymentEvent.externalId additionalProperties = paymentEvent.additionalProperties.toMutableMap() } @@ -1745,6 +1768,21 @@ private constructor( } } + /** Payment event external ID, for example, ACH trace number. */ + 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 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1788,6 +1826,7 @@ private constructor( checkRequired("result", result), checkRequired("type", type), (detailedResults ?: JsonMissing.of()).map { it.toImmutable() }, + externalId, additionalProperties.toMutableMap(), ) } @@ -1805,6 +1844,7 @@ private constructor( result().validate() type().validate() detailedResults().ifPresent { it.forEach { it.validate() } } + externalId() validated = true } @@ -1829,7 +1869,8 @@ private constructor( (if (created.asKnown().isPresent) 1 else 0) + (result.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) + - (detailedResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (detailedResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (externalId.asKnown().isPresent) 1 else 0) /** * APPROVED financial events were successful while DECLINED financial events were declined @@ -2368,6 +2409,7 @@ private constructor( result == other.result && type == other.type && detailedResults == other.detailedResults && + externalId == other.externalId && additionalProperties == other.additionalProperties } @@ -2379,6 +2421,7 @@ private constructor( result, type, detailedResults, + externalId, additionalProperties, ) } @@ -2386,7 +2429,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, detailedResults=$detailedResults, additionalProperties=$additionalProperties}" + "PaymentEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, detailedResults=$detailedResults, externalId=$externalId, additionalProperties=$additionalProperties}" } /** PAYMENT - Payment Transaction */ @@ -4726,6 +4769,8 @@ private constructor( @JvmField val WIRE_OUTBOUND_ADMIN = of("WIRE_OUTBOUND_ADMIN") + @JvmField val WIRE_DRAWDOWN_REQUEST = of("WIRE_DRAWDOWN_REQUEST") + @JvmStatic fun of(value: String) = TransferType(JsonField.of(value)) } @@ -4739,6 +4784,7 @@ private constructor( WIRE_INBOUND_ADMIN, WIRE_OUTBOUND_PAYMENT, WIRE_OUTBOUND_ADMIN, + WIRE_DRAWDOWN_REQUEST, } /** @@ -4759,6 +4805,7 @@ private constructor( WIRE_INBOUND_ADMIN, WIRE_OUTBOUND_PAYMENT, WIRE_OUTBOUND_ADMIN, + WIRE_DRAWDOWN_REQUEST, /** * An enum member indicating that [TransferType] was instantiated with an unknown value. */ @@ -4782,6 +4829,7 @@ private constructor( WIRE_INBOUND_ADMIN -> Value.WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN + WIRE_DRAWDOWN_REQUEST -> Value.WIRE_DRAWDOWN_REQUEST else -> Value._UNKNOWN } @@ -4804,6 +4852,7 @@ private constructor( WIRE_INBOUND_ADMIN -> Known.WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN + WIRE_DRAWDOWN_REQUEST -> Known.WIRE_DRAWDOWN_REQUEST else -> throw LithicInvalidDataException("Unknown TransferType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt new file mode 100644 index 000000000..26e91639d --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEvent.kt @@ -0,0 +1,1412 @@ +// 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 + +/** Represents a 3DS authentication */ +class ThreeDSAuthenticationApprovalRequestWebhookEvent +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val token: JsonField, + private val accountType: JsonField, + private val authenticationResult: JsonField, + private val cardExpiryCheck: JsonField, + private val cardToken: JsonField, + private val cardholder: JsonField, + private val channel: JsonField, + private val created: JsonField, + private val merchant: JsonField, + private val messageCategory: JsonField, + private val threeDSRequestorChallengeIndicator: + JsonField, + private val additionalData: JsonField, + private val app: JsonField, + private val authenticationRequestType: + JsonField, + private val browser: JsonField, + private val challengeMetadata: JsonField, + private val challengeOrchestratedBy: JsonField, + private val decisionMadeBy: JsonField, + private val threeRiRequestType: JsonField, + private val transaction: JsonField, + private val eventType: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(), + @JsonProperty("account_type") + @ExcludeMissing + accountType: JsonField = JsonMissing.of(), + @JsonProperty("authentication_result") + @ExcludeMissing + authenticationResult: JsonField = + JsonMissing.of(), + @JsonProperty("card_expiry_check") + @ExcludeMissing + cardExpiryCheck: JsonField = JsonMissing.of(), + @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(), + @JsonProperty("cardholder") + @ExcludeMissing + cardholder: JsonField = JsonMissing.of(), + @JsonProperty("channel") + @ExcludeMissing + channel: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + created: JsonField = JsonMissing.of(), + @JsonProperty("merchant") + @ExcludeMissing + merchant: JsonField = JsonMissing.of(), + @JsonProperty("message_category") + @ExcludeMissing + messageCategory: JsonField = JsonMissing.of(), + @JsonProperty("three_ds_requestor_challenge_indicator") + @ExcludeMissing + threeDSRequestorChallengeIndicator: + JsonField = + JsonMissing.of(), + @JsonProperty("additional_data") + @ExcludeMissing + additionalData: JsonField = JsonMissing.of(), + @JsonProperty("app") + @ExcludeMissing + app: JsonField = JsonMissing.of(), + @JsonProperty("authentication_request_type") + @ExcludeMissing + authenticationRequestType: JsonField = + JsonMissing.of(), + @JsonProperty("browser") + @ExcludeMissing + browser: JsonField = JsonMissing.of(), + @JsonProperty("challenge_metadata") + @ExcludeMissing + challengeMetadata: JsonField = JsonMissing.of(), + @JsonProperty("challenge_orchestrated_by") + @ExcludeMissing + challengeOrchestratedBy: JsonField = + JsonMissing.of(), + @JsonProperty("decision_made_by") + @ExcludeMissing + decisionMadeBy: JsonField = JsonMissing.of(), + @JsonProperty("three_ri_request_type") + @ExcludeMissing + threeRiRequestType: JsonField = JsonMissing.of(), + @JsonProperty("transaction") + @ExcludeMissing + transaction: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + eventType: JsonField = JsonMissing.of(), + ) : this( + token, + accountType, + authenticationResult, + cardExpiryCheck, + cardToken, + cardholder, + channel, + created, + merchant, + messageCategory, + threeDSRequestorChallengeIndicator, + additionalData, + app, + authenticationRequestType, + browser, + challengeMetadata, + challengeOrchestratedBy, + decisionMadeBy, + threeRiRequestType, + transaction, + eventType, + mutableMapOf(), + ) + + fun toThreeDSAuthentication(): ThreeDSAuthentication = + ThreeDSAuthentication.builder() + .token(token) + .accountType(accountType) + .authenticationResult(authenticationResult) + .cardExpiryCheck(cardExpiryCheck) + .cardToken(cardToken) + .cardholder(cardholder) + .channel(channel) + .created(created) + .merchant(merchant) + .messageCategory(messageCategory) + .threeDSRequestorChallengeIndicator(threeDSRequestorChallengeIndicator) + .additionalData(additionalData) + .app(app) + .authenticationRequestType(authenticationRequestType) + .browser(browser) + .challengeMetadata(challengeMetadata) + .challengeOrchestratedBy(challengeOrchestratedBy) + .decisionMadeBy(decisionMadeBy) + .threeRiRequestType(threeRiRequestType) + .transaction(transaction) + .build() + + /** + * Globally unique identifier for the 3DS authentication. Permitted values: 36-digit version 4 + * UUID (including hyphens). + * + * @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") + + /** + * Type of account/card that is being used for the transaction. Maps to EMV 3DS field + * `acctType`. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accountType(): Optional = + accountType.getOptional("account_type") + + /** + * Indicates the outcome of the 3DS authentication process. + * + * @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 authenticationResult(): ThreeDSAuthentication.AuthenticationResult = + authenticationResult.getRequired("authentication_result") + + /** + * Indicates whether the expiration date provided by the cardholder during checkout matches + * Lithic's record of the card's expiration date. + * + * @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 cardExpiryCheck(): ThreeDSAuthentication.CardExpiryCheck = + cardExpiryCheck.getRequired("card_expiry_check") + + /** + * Globally unique identifier for the card on which the 3DS authentication has occurred. + * Permitted values: 36-digit version 4 UUID (including hyphens). + * + * @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 cardToken(): String = cardToken.getRequired("card_token") + + /** + * Object containing data about the cardholder provided during the transaction. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun cardholder(): ThreeDSAuthentication.Cardholder = cardholder.getRequired("cardholder") + + /** + * Channel in which the authentication occurs. Maps to EMV 3DS field `deviceChannel`. + * + * @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 channel(): ThreeDSAuthentication.Channel = channel.getRequired("channel") + + /** + * Date and time when the authentication was created in Lithic's system. Permitted values: Date + * string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + * + * @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") + + /** + * Object containing data about the merchant involved in the e-commerce transaction. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun merchant(): ThreeDSAuthentication.Merchant = merchant.getRequired("merchant") + + /** + * Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For NON_PAYMENT_AUTHENTICATION, + * additional_data and transaction fields are not populated. + * + * @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 messageCategory(): ThreeDSAuthentication.MessageCategory = + messageCategory.getRequired("message_category") + + /** + * Indicates whether a challenge is requested for this transaction + * * `NO_PREFERENCE` - No Preference + * * `NO_CHALLENGE_REQUESTED` - No Challenge Requested + * * `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + * * `CHALLENGE_MANDATE` - Challenge requested (Mandate) + * * `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional risk analysis + * is already performed) + * * `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + * * `OTHER` - Other indicators not captured by above. These are rarely used + * + * @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 threeDSRequestorChallengeIndicator(): + ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator = + threeDSRequestorChallengeIndicator.getRequired("three_ds_requestor_challenge_indicator") + + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS standard + * spec (e.g., specific fields that only certain card networks send but are not required across + * all 3DS requests). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun additionalData(): Optional = + additionalData.getOptional("additional_data") + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun app(): Optional = app.getOptional("app") + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing the + * merchant to request an authentication. Maps to EMV 3DS field + * `threeDSRequestorAuthenticationInd`. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun authenticationRequestType(): Optional = + authenticationRequestType.getOptional("authentication_request_type") + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if the + * channel is 'BROWSER'. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun browser(): Optional = browser.getOptional("browser") + + /** + * Metadata about the challenge method and delivery. Only present when a challenge is triggered. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun challengeMetadata(): Optional = + challengeMetadata.getOptional("challenge_metadata") + + /** + * Entity that orchestrates the challenge. This won't be set for authentications for which a + * decision has not yet been made (e.g. in-flight customer decisioning request). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun challengeOrchestratedBy(): Optional = + challengeOrchestratedBy.getOptional("challenge_orchestrated_by") + + /** + * Entity that made the authentication decision. This won't be set for authentications for which + * a decision has not yet been made (e.g. in-flight customer decisioning request). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun decisionMadeBy(): Optional = + decisionMadeBy.getOptional("decision_made_by") + + /** + * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes place + * at the initiation of the merchant rather than the cardholder. The most common example of this + * is where a merchant is authenticating before billing for a recurring transaction such as a + * pay TV subscription or a utility bill. Maps to EMV 3DS field `threeRIInd`. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun threeRiRequestType(): Optional = + threeRiRequestType.getOptional("three_ri_request_type") + + /** + * Object containing data about the e-commerce transaction for which the merchant is requesting + * authentication. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transaction(): Optional = + transaction.getOptional("transaction") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun eventType(): EventType = eventType.getRequired("event_type") + + /** + * 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 [accountType]. + * + * Unlike [accountType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_type") + @ExcludeMissing + fun _accountType(): JsonField = accountType + + /** + * Returns the raw JSON value of [authenticationResult]. + * + * Unlike [authenticationResult], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("authentication_result") + @ExcludeMissing + fun _authenticationResult(): JsonField = + authenticationResult + + /** + * Returns the raw JSON value of [cardExpiryCheck]. + * + * Unlike [cardExpiryCheck], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("card_expiry_check") + @ExcludeMissing + fun _cardExpiryCheck(): JsonField = cardExpiryCheck + + /** + * Returns the raw JSON value of [cardToken]. + * + * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken + + /** + * Returns the raw JSON value of [cardholder]. + * + * Unlike [cardholder], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cardholder") + @ExcludeMissing + fun _cardholder(): JsonField = cardholder + + /** + * Returns the raw JSON value of [channel]. + * + * Unlike [channel], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("channel") + @ExcludeMissing + fun _channel(): JsonField = channel + + /** + * 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 [merchant]. + * + * Unlike [merchant], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("merchant") + @ExcludeMissing + fun _merchant(): JsonField = merchant + + /** + * Returns the raw JSON value of [messageCategory]. + * + * Unlike [messageCategory], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("message_category") + @ExcludeMissing + fun _messageCategory(): JsonField = messageCategory + + /** + * Returns the raw JSON value of [threeDSRequestorChallengeIndicator]. + * + * Unlike [threeDSRequestorChallengeIndicator], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("three_ds_requestor_challenge_indicator") + @ExcludeMissing + fun _threeDSRequestorChallengeIndicator(): + JsonField = + threeDSRequestorChallengeIndicator + + /** + * Returns the raw JSON value of [additionalData]. + * + * Unlike [additionalData], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("additional_data") + @ExcludeMissing + fun _additionalData(): JsonField = additionalData + + /** + * Returns the raw JSON value of [app]. + * + * Unlike [app], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("app") @ExcludeMissing fun _app(): JsonField = app + + /** + * Returns the raw JSON value of [authenticationRequestType]. + * + * Unlike [authenticationRequestType], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("authentication_request_type") + @ExcludeMissing + fun _authenticationRequestType(): JsonField = + authenticationRequestType + + /** + * Returns the raw JSON value of [browser]. + * + * Unlike [browser], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("browser") + @ExcludeMissing + fun _browser(): JsonField = browser + + /** + * Returns the raw JSON value of [challengeMetadata]. + * + * Unlike [challengeMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("challenge_metadata") + @ExcludeMissing + fun _challengeMetadata(): JsonField = challengeMetadata + + /** + * Returns the raw JSON value of [challengeOrchestratedBy]. + * + * Unlike [challengeOrchestratedBy], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("challenge_orchestrated_by") + @ExcludeMissing + fun _challengeOrchestratedBy(): JsonField = + challengeOrchestratedBy + + /** + * Returns the raw JSON value of [decisionMadeBy]. + * + * Unlike [decisionMadeBy], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("decision_made_by") + @ExcludeMissing + fun _decisionMadeBy(): JsonField = decisionMadeBy + + /** + * Returns the raw JSON value of [threeRiRequestType]. + * + * Unlike [threeRiRequestType], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("three_ri_request_type") + @ExcludeMissing + fun _threeRiRequestType(): JsonField = + threeRiRequestType + + /** + * Returns the raw JSON value of [transaction]. + * + * Unlike [transaction], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction") + @ExcludeMissing + fun _transaction(): JsonField = transaction + + /** + * Returns the raw JSON value of [eventType]. + * + * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("event_type") @ExcludeMissing fun _eventType(): JsonField = eventType + + @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 + * [ThreeDSAuthenticationApprovalRequestWebhookEvent]. + * + * The following fields are required: + * ```java + * .token() + * .accountType() + * .authenticationResult() + * .cardExpiryCheck() + * .cardToken() + * .cardholder() + * .channel() + * .created() + * .merchant() + * .messageCategory() + * .threeDSRequestorChallengeIndicator() + * .eventType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThreeDSAuthenticationApprovalRequestWebhookEvent]. */ + class Builder internal constructor() { + + private var token: JsonField? = null + private var accountType: JsonField? = null + private var authenticationResult: JsonField? = + null + private var cardExpiryCheck: JsonField? = null + private var cardToken: JsonField? = null + private var cardholder: JsonField? = null + private var channel: JsonField? = null + private var created: JsonField? = null + private var merchant: JsonField? = null + private var messageCategory: JsonField? = null + private var threeDSRequestorChallengeIndicator: + JsonField? = + null + private var additionalData: JsonField = + JsonMissing.of() + private var app: JsonField = JsonMissing.of() + private var authenticationRequestType: + JsonField = + JsonMissing.of() + private var browser: JsonField = JsonMissing.of() + private var challengeMetadata: JsonField = + JsonMissing.of() + private var challengeOrchestratedBy: + JsonField = + JsonMissing.of() + private var decisionMadeBy: JsonField = + JsonMissing.of() + private var threeRiRequestType: JsonField = + JsonMissing.of() + private var transaction: JsonField = JsonMissing.of() + private var eventType: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + threeDSAuthenticationApprovalRequestWebhookEvent: + ThreeDSAuthenticationApprovalRequestWebhookEvent + ) = apply { + token = threeDSAuthenticationApprovalRequestWebhookEvent.token + accountType = threeDSAuthenticationApprovalRequestWebhookEvent.accountType + authenticationResult = + threeDSAuthenticationApprovalRequestWebhookEvent.authenticationResult + cardExpiryCheck = threeDSAuthenticationApprovalRequestWebhookEvent.cardExpiryCheck + cardToken = threeDSAuthenticationApprovalRequestWebhookEvent.cardToken + cardholder = threeDSAuthenticationApprovalRequestWebhookEvent.cardholder + channel = threeDSAuthenticationApprovalRequestWebhookEvent.channel + created = threeDSAuthenticationApprovalRequestWebhookEvent.created + merchant = threeDSAuthenticationApprovalRequestWebhookEvent.merchant + messageCategory = threeDSAuthenticationApprovalRequestWebhookEvent.messageCategory + threeDSRequestorChallengeIndicator = + threeDSAuthenticationApprovalRequestWebhookEvent.threeDSRequestorChallengeIndicator + additionalData = threeDSAuthenticationApprovalRequestWebhookEvent.additionalData + app = threeDSAuthenticationApprovalRequestWebhookEvent.app + authenticationRequestType = + threeDSAuthenticationApprovalRequestWebhookEvent.authenticationRequestType + browser = threeDSAuthenticationApprovalRequestWebhookEvent.browser + challengeMetadata = threeDSAuthenticationApprovalRequestWebhookEvent.challengeMetadata + challengeOrchestratedBy = + threeDSAuthenticationApprovalRequestWebhookEvent.challengeOrchestratedBy + decisionMadeBy = threeDSAuthenticationApprovalRequestWebhookEvent.decisionMadeBy + threeRiRequestType = threeDSAuthenticationApprovalRequestWebhookEvent.threeRiRequestType + transaction = threeDSAuthenticationApprovalRequestWebhookEvent.transaction + eventType = threeDSAuthenticationApprovalRequestWebhookEvent.eventType + additionalProperties = + threeDSAuthenticationApprovalRequestWebhookEvent.additionalProperties.toMutableMap() + } + + /** + * Globally unique identifier for the 3DS authentication. Permitted values: 36-digit version + * 4 UUID (including hyphens). + */ + 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 } + + /** + * Type of account/card that is being used for the transaction. Maps to EMV 3DS field + * `acctType`. + */ + fun accountType(accountType: ThreeDSAuthentication.AccountType?) = + accountType(JsonField.ofNullable(accountType)) + + /** Alias for calling [Builder.accountType] with `accountType.orElse(null)`. */ + fun accountType(accountType: Optional) = + accountType(accountType.getOrNull()) + + /** + * Sets [Builder.accountType] to an arbitrary JSON value. + * + * You should usually call [Builder.accountType] with a well-typed + * [ThreeDSAuthentication.AccountType] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun accountType(accountType: JsonField) = apply { + this.accountType = accountType + } + + /** Indicates the outcome of the 3DS authentication process. */ + fun authenticationResult(authenticationResult: ThreeDSAuthentication.AuthenticationResult) = + authenticationResult(JsonField.of(authenticationResult)) + + /** + * Sets [Builder.authenticationResult] to an arbitrary JSON value. + * + * You should usually call [Builder.authenticationResult] with a well-typed + * [ThreeDSAuthentication.AuthenticationResult] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun authenticationResult( + authenticationResult: JsonField + ) = apply { this.authenticationResult = authenticationResult } + + /** + * Indicates whether the expiration date provided by the cardholder during checkout matches + * Lithic's record of the card's expiration date. + */ + fun cardExpiryCheck(cardExpiryCheck: ThreeDSAuthentication.CardExpiryCheck) = + cardExpiryCheck(JsonField.of(cardExpiryCheck)) + + /** + * Sets [Builder.cardExpiryCheck] to an arbitrary JSON value. + * + * You should usually call [Builder.cardExpiryCheck] with a well-typed + * [ThreeDSAuthentication.CardExpiryCheck] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun cardExpiryCheck(cardExpiryCheck: JsonField) = + apply { + this.cardExpiryCheck = cardExpiryCheck + } + + /** + * Globally unique identifier for the card on which the 3DS authentication has occurred. + * Permitted values: 36-digit version 4 UUID (including hyphens). + */ + fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) + + /** + * Sets [Builder.cardToken] to an arbitrary JSON value. + * + * You should usually call [Builder.cardToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } + + /** Object containing data about the cardholder provided during the transaction. */ + fun cardholder(cardholder: ThreeDSAuthentication.Cardholder) = + cardholder(JsonField.of(cardholder)) + + /** + * Sets [Builder.cardholder] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholder] with a well-typed + * [ThreeDSAuthentication.Cardholder] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun cardholder(cardholder: JsonField) = apply { + this.cardholder = cardholder + } + + /** Channel in which the authentication occurs. Maps to EMV 3DS field `deviceChannel`. */ + fun channel(channel: ThreeDSAuthentication.Channel) = channel(JsonField.of(channel)) + + /** + * Sets [Builder.channel] to an arbitrary JSON value. + * + * You should usually call [Builder.channel] with a well-typed + * [ThreeDSAuthentication.Channel] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun channel(channel: JsonField) = apply { + this.channel = channel + } + + /** + * Date and time when the authentication was created in Lithic's system. Permitted values: + * Date string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + */ + 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 } + + /** Object containing data about the merchant involved in the e-commerce transaction. */ + fun merchant(merchant: ThreeDSAuthentication.Merchant) = merchant(JsonField.of(merchant)) + + /** + * Sets [Builder.merchant] to an arbitrary JSON value. + * + * You should usually call [Builder.merchant] with a well-typed + * [ThreeDSAuthentication.Merchant] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun merchant(merchant: JsonField) = apply { + this.merchant = merchant + } + + /** + * Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + * NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not populated. + */ + fun messageCategory(messageCategory: ThreeDSAuthentication.MessageCategory) = + messageCategory(JsonField.of(messageCategory)) + + /** + * Sets [Builder.messageCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.messageCategory] with a well-typed + * [ThreeDSAuthentication.MessageCategory] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun messageCategory(messageCategory: JsonField) = + apply { + this.messageCategory = messageCategory + } + + /** + * Indicates whether a challenge is requested for this transaction + * * `NO_PREFERENCE` - No Preference + * * `NO_CHALLENGE_REQUESTED` - No Challenge Requested + * * `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + * * `CHALLENGE_MANDATE` - Challenge requested (Mandate) + * * `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional risk + * analysis is already performed) + * * `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + * * `OTHER` - Other indicators not captured by above. These are rarely used + */ + fun threeDSRequestorChallengeIndicator( + threeDSRequestorChallengeIndicator: + ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator + ) = threeDSRequestorChallengeIndicator(JsonField.of(threeDSRequestorChallengeIndicator)) + + /** + * Sets [Builder.threeDSRequestorChallengeIndicator] to an arbitrary JSON value. + * + * You should usually call [Builder.threeDSRequestorChallengeIndicator] with a well-typed + * [ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun threeDSRequestorChallengeIndicator( + threeDSRequestorChallengeIndicator: + JsonField + ) = apply { this.threeDSRequestorChallengeIndicator = threeDSRequestorChallengeIndicator } + + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS + * standard spec (e.g., specific fields that only certain card networks send but are not + * required across all 3DS requests). + */ + fun additionalData(additionalData: ThreeDSAuthentication.AdditionalData?) = + additionalData(JsonField.ofNullable(additionalData)) + + /** Alias for calling [Builder.additionalData] with `additionalData.orElse(null)`. */ + fun additionalData(additionalData: Optional) = + additionalData(additionalData.getOrNull()) + + /** + * Sets [Builder.additionalData] to an arbitrary JSON value. + * + * You should usually call [Builder.additionalData] with a well-typed + * [ThreeDSAuthentication.AdditionalData] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun additionalData(additionalData: JsonField) = + apply { + this.additionalData = additionalData + } + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + */ + fun app(app: ThreeDSAuthentication.App?) = app(JsonField.ofNullable(app)) + + /** Alias for calling [Builder.app] with `app.orElse(null)`. */ + fun app(app: Optional) = app(app.getOrNull()) + + /** + * Sets [Builder.app] to an arbitrary JSON value. + * + * You should usually call [Builder.app] with a well-typed [ThreeDSAuthentication.App] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun app(app: JsonField) = apply { this.app = app } + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing + * the merchant to request an authentication. Maps to EMV 3DS field + * `threeDSRequestorAuthenticationInd`. + */ + fun authenticationRequestType( + authenticationRequestType: ThreeDSAuthentication.AuthenticationRequestType? + ) = authenticationRequestType(JsonField.ofNullable(authenticationRequestType)) + + /** + * Alias for calling [Builder.authenticationRequestType] with + * `authenticationRequestType.orElse(null)`. + */ + fun authenticationRequestType( + authenticationRequestType: Optional + ) = authenticationRequestType(authenticationRequestType.getOrNull()) + + /** + * Sets [Builder.authenticationRequestType] to an arbitrary JSON value. + * + * You should usually call [Builder.authenticationRequestType] with a well-typed + * [ThreeDSAuthentication.AuthenticationRequestType] value instead. This method is primarily + * for setting the field to an undocumented or not yet supported value. + */ + fun authenticationRequestType( + authenticationRequestType: JsonField + ) = apply { this.authenticationRequestType = authenticationRequestType } + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if + * the channel is 'BROWSER'. + */ + fun browser(browser: ThreeDSAuthentication.Browser?) = + browser(JsonField.ofNullable(browser)) + + /** Alias for calling [Builder.browser] with `browser.orElse(null)`. */ + fun browser(browser: Optional) = browser(browser.getOrNull()) + + /** + * Sets [Builder.browser] to an arbitrary JSON value. + * + * You should usually call [Builder.browser] with a well-typed + * [ThreeDSAuthentication.Browser] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun browser(browser: JsonField) = apply { + this.browser = browser + } + + /** + * Metadata about the challenge method and delivery. Only present when a challenge is + * triggered. + */ + fun challengeMetadata(challengeMetadata: ThreeDSAuthentication.ChallengeMetadata?) = + challengeMetadata(JsonField.ofNullable(challengeMetadata)) + + /** Alias for calling [Builder.challengeMetadata] with `challengeMetadata.orElse(null)`. */ + fun challengeMetadata( + challengeMetadata: Optional + ) = challengeMetadata(challengeMetadata.getOrNull()) + + /** + * Sets [Builder.challengeMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.challengeMetadata] with a well-typed + * [ThreeDSAuthentication.ChallengeMetadata] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun challengeMetadata( + challengeMetadata: JsonField + ) = apply { this.challengeMetadata = challengeMetadata } + + /** + * Entity that orchestrates the challenge. This won't be set for authentications for which a + * decision has not yet been made (e.g. in-flight customer decisioning request). + */ + fun challengeOrchestratedBy( + challengeOrchestratedBy: ThreeDSAuthentication.ChallengeOrchestratedBy? + ) = challengeOrchestratedBy(JsonField.ofNullable(challengeOrchestratedBy)) + + /** + * Alias for calling [Builder.challengeOrchestratedBy] with + * `challengeOrchestratedBy.orElse(null)`. + */ + fun challengeOrchestratedBy( + challengeOrchestratedBy: Optional + ) = challengeOrchestratedBy(challengeOrchestratedBy.getOrNull()) + + /** + * Sets [Builder.challengeOrchestratedBy] to an arbitrary JSON value. + * + * You should usually call [Builder.challengeOrchestratedBy] with a well-typed + * [ThreeDSAuthentication.ChallengeOrchestratedBy] value instead. This method is primarily + * for setting the field to an undocumented or not yet supported value. + */ + fun challengeOrchestratedBy( + challengeOrchestratedBy: JsonField + ) = apply { this.challengeOrchestratedBy = challengeOrchestratedBy } + + /** + * Entity that made the authentication decision. This won't be set for authentications for + * which a decision has not yet been made (e.g. in-flight customer decisioning request). + */ + fun decisionMadeBy(decisionMadeBy: ThreeDSAuthentication.DecisionMadeBy?) = + decisionMadeBy(JsonField.ofNullable(decisionMadeBy)) + + /** Alias for calling [Builder.decisionMadeBy] with `decisionMadeBy.orElse(null)`. */ + fun decisionMadeBy(decisionMadeBy: Optional) = + decisionMadeBy(decisionMadeBy.getOrNull()) + + /** + * Sets [Builder.decisionMadeBy] to an arbitrary JSON value. + * + * You should usually call [Builder.decisionMadeBy] with a well-typed + * [ThreeDSAuthentication.DecisionMadeBy] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun decisionMadeBy(decisionMadeBy: JsonField) = + apply { + this.decisionMadeBy = decisionMadeBy + } + + /** + * Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that takes + * place at the initiation of the merchant rather than the cardholder. The most common + * example of this is where a merchant is authenticating before billing for a recurring + * transaction such as a pay TV subscription or a utility bill. Maps to EMV 3DS field + * `threeRIInd`. + */ + fun threeRiRequestType(threeRiRequestType: ThreeDSAuthentication.ThreeRiRequestType?) = + threeRiRequestType(JsonField.ofNullable(threeRiRequestType)) + + /** + * Alias for calling [Builder.threeRiRequestType] with `threeRiRequestType.orElse(null)`. + */ + fun threeRiRequestType( + threeRiRequestType: Optional + ) = threeRiRequestType(threeRiRequestType.getOrNull()) + + /** + * Sets [Builder.threeRiRequestType] to an arbitrary JSON value. + * + * You should usually call [Builder.threeRiRequestType] with a well-typed + * [ThreeDSAuthentication.ThreeRiRequestType] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun threeRiRequestType( + threeRiRequestType: JsonField + ) = apply { this.threeRiRequestType = threeRiRequestType } + + /** + * Object containing data about the e-commerce transaction for which the merchant is + * requesting authentication. + */ + fun transaction(transaction: ThreeDSAuthentication.Transaction?) = + transaction(JsonField.ofNullable(transaction)) + + /** Alias for calling [Builder.transaction] with `transaction.orElse(null)`. */ + fun transaction(transaction: Optional) = + transaction(transaction.getOrNull()) + + /** + * Sets [Builder.transaction] to an arbitrary JSON value. + * + * You should usually call [Builder.transaction] with a well-typed + * [ThreeDSAuthentication.Transaction] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun transaction(transaction: JsonField) = apply { + this.transaction = transaction + } + + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + /** + * Sets [Builder.eventType] to an arbitrary JSON value. + * + * You should usually call [Builder.eventType] with a well-typed [EventType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + + 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 [ThreeDSAuthenticationApprovalRequestWebhookEvent]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .token() + * .accountType() + * .authenticationResult() + * .cardExpiryCheck() + * .cardToken() + * .cardholder() + * .channel() + * .created() + * .merchant() + * .messageCategory() + * .threeDSRequestorChallengeIndicator() + * .eventType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThreeDSAuthenticationApprovalRequestWebhookEvent = + ThreeDSAuthenticationApprovalRequestWebhookEvent( + checkRequired("token", token), + checkRequired("accountType", accountType), + checkRequired("authenticationResult", authenticationResult), + checkRequired("cardExpiryCheck", cardExpiryCheck), + checkRequired("cardToken", cardToken), + checkRequired("cardholder", cardholder), + checkRequired("channel", channel), + checkRequired("created", created), + checkRequired("merchant", merchant), + checkRequired("messageCategory", messageCategory), + checkRequired( + "threeDSRequestorChallengeIndicator", + threeDSRequestorChallengeIndicator, + ), + additionalData, + app, + authenticationRequestType, + browser, + challengeMetadata, + challengeOrchestratedBy, + decisionMadeBy, + threeRiRequestType, + transaction, + checkRequired("eventType", eventType), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThreeDSAuthenticationApprovalRequestWebhookEvent = apply { + if (validated) { + return@apply + } + + token() + accountType().ifPresent { it.validate() } + authenticationResult().validate() + cardExpiryCheck().validate() + cardToken() + cardholder().validate() + channel().validate() + created() + merchant().validate() + messageCategory().validate() + threeDSRequestorChallengeIndicator().validate() + additionalData().ifPresent { it.validate() } + app().ifPresent { it.validate() } + authenticationRequestType().ifPresent { it.validate() } + browser().ifPresent { it.validate() } + challengeMetadata().ifPresent { it.validate() } + challengeOrchestratedBy().ifPresent { it.validate() } + decisionMadeBy().ifPresent { it.validate() } + threeRiRequestType().ifPresent { it.validate() } + transaction().ifPresent { it.validate() } + eventType().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) + + (accountType.asKnown().getOrNull()?.validity() ?: 0) + + (authenticationResult.asKnown().getOrNull()?.validity() ?: 0) + + (cardExpiryCheck.asKnown().getOrNull()?.validity() ?: 0) + + (if (cardToken.asKnown().isPresent) 1 else 0) + + (cardholder.asKnown().getOrNull()?.validity() ?: 0) + + (channel.asKnown().getOrNull()?.validity() ?: 0) + + (if (created.asKnown().isPresent) 1 else 0) + + (merchant.asKnown().getOrNull()?.validity() ?: 0) + + (messageCategory.asKnown().getOrNull()?.validity() ?: 0) + + (threeDSRequestorChallengeIndicator.asKnown().getOrNull()?.validity() ?: 0) + + (additionalData.asKnown().getOrNull()?.validity() ?: 0) + + (app.asKnown().getOrNull()?.validity() ?: 0) + + (authenticationRequestType.asKnown().getOrNull()?.validity() ?: 0) + + (browser.asKnown().getOrNull()?.validity() ?: 0) + + (challengeMetadata.asKnown().getOrNull()?.validity() ?: 0) + + (challengeOrchestratedBy.asKnown().getOrNull()?.validity() ?: 0) + + (decisionMadeBy.asKnown().getOrNull()?.validity() ?: 0) + + (threeRiRequestType.asKnown().getOrNull()?.validity() ?: 0) + + (transaction.asKnown().getOrNull()?.validity() ?: 0) + + (eventType.asKnown().getOrNull()?.validity() ?: 0) + + class EventType @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 THREE_DS_AUTHENTICATION_APPROVAL_REQUEST = + of("three_ds_authentication.approval_request") + + @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) + } + + /** An enum containing [EventType]'s known values. */ + enum class Known { + THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + } + + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] 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 { + THREE_DS_AUTHENTICATION_APPROVAL_REQUEST, + /** + * An enum member indicating that [EventType] 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) { + THREE_DS_AUTHENTICATION_APPROVAL_REQUEST -> + Value.THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + 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) { + THREE_DS_AUTHENTICATION_APPROVAL_REQUEST -> + Known.THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + else -> throw LithicInvalidDataException("Unknown EventType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + fun validate(): EventType = 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 EventType && 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 ThreeDSAuthenticationApprovalRequestWebhookEvent && + token == other.token && + accountType == other.accountType && + authenticationResult == other.authenticationResult && + cardExpiryCheck == other.cardExpiryCheck && + cardToken == other.cardToken && + cardholder == other.cardholder && + channel == other.channel && + created == other.created && + merchant == other.merchant && + messageCategory == other.messageCategory && + threeDSRequestorChallengeIndicator == other.threeDSRequestorChallengeIndicator && + additionalData == other.additionalData && + app == other.app && + authenticationRequestType == other.authenticationRequestType && + browser == other.browser && + challengeMetadata == other.challengeMetadata && + challengeOrchestratedBy == other.challengeOrchestratedBy && + decisionMadeBy == other.decisionMadeBy && + threeRiRequestType == other.threeRiRequestType && + transaction == other.transaction && + eventType == other.eventType && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + token, + accountType, + authenticationResult, + cardExpiryCheck, + cardToken, + cardholder, + channel, + created, + merchant, + messageCategory, + threeDSRequestorChallengeIndicator, + additionalData, + app, + authenticationRequestType, + browser, + challengeMetadata, + challengeOrchestratedBy, + decisionMadeBy, + threeRiRequestType, + transaction, + eventType, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThreeDSAuthenticationApprovalRequestWebhookEvent{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, merchant=$merchant, messageCategory=$messageCategory, threeDSRequestorChallengeIndicator=$threeDSRequestorChallengeIndicator, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, challengeMetadata=$challengeMetadata, challengeOrchestratedBy=$challengeOrchestratedBy, decisionMadeBy=$decisionMadeBy, threeRiRequestType=$threeRiRequestType, transaction=$transaction, eventType=$eventType, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt index e9e8f7e88..ca86c905e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt @@ -7045,6 +7045,8 @@ private constructor( @JvmField val AUTH_RULE_BLOCKED_MCC = of("AUTH_RULE_BLOCKED_MCC") + @JvmField val AUTH_RULE = of("AUTH_RULE") + @JvmField val CARD_CLOSED = of("CARD_CLOSED") @JvmField @@ -7159,6 +7161,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC, AUTH_RULE_BLOCKED_COUNTRY, AUTH_RULE_BLOCKED_MCC, + AUTH_RULE, CARD_CLOSED, CARD_CRYPTOGRAM_VALIDATION_FAILURE, CARD_EXPIRED, @@ -7227,6 +7230,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC, AUTH_RULE_BLOCKED_COUNTRY, AUTH_RULE_BLOCKED_MCC, + AUTH_RULE, CARD_CLOSED, CARD_CRYPTOGRAM_VALIDATION_FAILURE, CARD_EXPIRED, @@ -7301,6 +7305,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC -> Value.AUTH_RULE_ALLOWED_MCC AUTH_RULE_BLOCKED_COUNTRY -> Value.AUTH_RULE_BLOCKED_COUNTRY AUTH_RULE_BLOCKED_MCC -> Value.AUTH_RULE_BLOCKED_MCC + AUTH_RULE -> Value.AUTH_RULE CARD_CLOSED -> Value.CARD_CLOSED CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Value.CARD_CRYPTOGRAM_VALIDATION_FAILURE CARD_EXPIRED -> Value.CARD_EXPIRED @@ -7376,6 +7381,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC -> Known.AUTH_RULE_ALLOWED_MCC AUTH_RULE_BLOCKED_COUNTRY -> Known.AUTH_RULE_BLOCKED_COUNTRY AUTH_RULE_BLOCKED_MCC -> Known.AUTH_RULE_BLOCKED_MCC + AUTH_RULE -> Known.AUTH_RULE CARD_CLOSED -> Known.CARD_CLOSED CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Known.CARD_CRYPTOGRAM_VALIDATION_FAILURE CARD_EXPIRED -> Known.CARD_EXPIRED @@ -9670,6 +9676,8 @@ private constructor( @JvmField val AUTH_RULE_BLOCKED_MCC = of("AUTH_RULE_BLOCKED_MCC") + @JvmField val AUTH_RULE = of("AUTH_RULE") + @JvmField val CARD_CLOSED = of("CARD_CLOSED") @JvmField @@ -9786,6 +9794,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC, AUTH_RULE_BLOCKED_COUNTRY, AUTH_RULE_BLOCKED_MCC, + AUTH_RULE, CARD_CLOSED, CARD_CRYPTOGRAM_VALIDATION_FAILURE, CARD_EXPIRED, @@ -9856,6 +9865,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC, AUTH_RULE_BLOCKED_COUNTRY, AUTH_RULE_BLOCKED_MCC, + AUTH_RULE, CARD_CLOSED, CARD_CRYPTOGRAM_VALIDATION_FAILURE, CARD_EXPIRED, @@ -9931,6 +9941,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC -> Value.AUTH_RULE_ALLOWED_MCC AUTH_RULE_BLOCKED_COUNTRY -> Value.AUTH_RULE_BLOCKED_COUNTRY AUTH_RULE_BLOCKED_MCC -> Value.AUTH_RULE_BLOCKED_MCC + AUTH_RULE -> Value.AUTH_RULE CARD_CLOSED -> Value.CARD_CLOSED CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Value.CARD_CRYPTOGRAM_VALIDATION_FAILURE @@ -10009,6 +10020,7 @@ private constructor( AUTH_RULE_ALLOWED_MCC -> Known.AUTH_RULE_ALLOWED_MCC AUTH_RULE_BLOCKED_COUNTRY -> Known.AUTH_RULE_BLOCKED_COUNTRY AUTH_RULE_BLOCKED_MCC -> Known.AUTH_RULE_BLOCKED_MCC + AUTH_RULE -> Known.AUTH_RULE CARD_CLOSED -> Known.CARD_CLOSED CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Known.CARD_CRYPTOGRAM_VALIDATION_FAILURE diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt similarity index 50% rename from lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt index a51b20a72..a93b22981 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt @@ -5,57 +5,57 @@ package com.lithic.api.models import com.lithic.api.core.AutoPager import com.lithic.api.core.Page import com.lithic.api.core.checkRequired -import com.lithic.api.services.blocking.AggregateBalanceService +import com.lithic.api.services.blocking.TransferLimitService import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** @see AggregateBalanceService.list */ -class AggregateBalanceListPage +/** @see TransferLimitService.list */ +class TransferLimitListPage private constructor( - private val service: AggregateBalanceService, - private val params: AggregateBalanceListParams, - private val response: AggregateBalanceListPageResponse, -) : Page { + private val service: TransferLimitService, + private val params: TransferLimitListParams, + private val response: TransferLimitsResponse, +) : Page { /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. * - * @see AggregateBalanceListPageResponse.data + * @see TransferLimitsResponse.data */ - fun data(): List = + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. * - * @see AggregateBalanceListPageResponse.hasMore + * @see TransferLimitsResponse.hasMore */ fun hasMore(): Optional = response._hasMore().getOptional("has_more") - override fun items(): List = data() + override fun items(): List = data() override fun hasNextPage(): Boolean = false - fun nextPageParams(): AggregateBalanceListParams = + fun nextPageParams(): TransferLimitListParams = throw IllegalStateException("Cannot construct next page params") - override fun nextPage(): AggregateBalanceListPage = service.list(nextPageParams()) + override fun nextPage(): TransferLimitListPage = service.list(nextPageParams()) - fun autoPager(): AutoPager = AutoPager.from(this) + fun autoPager(): AutoPager = AutoPager.from(this) /** The parameters that were used to request this page. */ - fun params(): AggregateBalanceListParams = params + fun params(): TransferLimitListParams = params /** The response that this page was parsed from. */ - fun response(): AggregateBalanceListPageResponse = response + fun response(): TransferLimitsResponse = response fun toBuilder() = Builder().from(this) companion object { /** - * Returns a mutable builder for constructing an instance of [AggregateBalanceListPage]. + * Returns a mutable builder for constructing an instance of [TransferLimitListPage]. * * The following fields are required: * ```java @@ -67,32 +67,30 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AggregateBalanceListPage]. */ + /** A builder for [TransferLimitListPage]. */ class Builder internal constructor() { - private var service: AggregateBalanceService? = null - private var params: AggregateBalanceListParams? = null - private var response: AggregateBalanceListPageResponse? = null + private var service: TransferLimitService? = null + private var params: TransferLimitListParams? = null + private var response: TransferLimitsResponse? = null @JvmSynthetic - internal fun from(aggregateBalanceListPage: AggregateBalanceListPage) = apply { - service = aggregateBalanceListPage.service - params = aggregateBalanceListPage.params - response = aggregateBalanceListPage.response + internal fun from(transferLimitListPage: TransferLimitListPage) = apply { + service = transferLimitListPage.service + params = transferLimitListPage.params + response = transferLimitListPage.response } - fun service(service: AggregateBalanceService) = apply { this.service = service } + fun service(service: TransferLimitService) = apply { this.service = service } /** The parameters that were used to request this page. */ - fun params(params: AggregateBalanceListParams) = apply { this.params = params } + fun params(params: TransferLimitListParams) = apply { this.params = params } /** The response that this page was parsed from. */ - fun response(response: AggregateBalanceListPageResponse) = apply { - this.response = response - } + fun response(response: TransferLimitsResponse) = apply { this.response = response } /** - * Returns an immutable instance of [AggregateBalanceListPage]. + * Returns an immutable instance of [TransferLimitListPage]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -105,8 +103,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AggregateBalanceListPage = - AggregateBalanceListPage( + fun build(): TransferLimitListPage = + TransferLimitListPage( checkRequired("service", service), checkRequired("params", params), checkRequired("response", response), @@ -118,7 +116,7 @@ private constructor( return true } - return other is AggregateBalanceListPage && + return other is TransferLimitListPage && service == other.service && params == other.params && response == other.response @@ -127,5 +125,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(service, params, response) override fun toString() = - "AggregateBalanceListPage{service=$service, params=$params, response=$response}" + "TransferLimitListPage{service=$service, params=$params, response=$response}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt similarity index 54% rename from lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageAsync.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt index ab18fd5fc..49c1e08dd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt @@ -5,63 +5,62 @@ package com.lithic.api.models import com.lithic.api.core.AutoPagerAsync import com.lithic.api.core.PageAsync import com.lithic.api.core.checkRequired -import com.lithic.api.services.async.AggregateBalanceServiceAsync +import com.lithic.api.services.async.TransferLimitServiceAsync import java.util.Objects import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import kotlin.jvm.optionals.getOrNull -/** @see AggregateBalanceServiceAsync.list */ -class AggregateBalanceListPageAsync +/** @see TransferLimitServiceAsync.list */ +class TransferLimitListPageAsync private constructor( - private val service: AggregateBalanceServiceAsync, + private val service: TransferLimitServiceAsync, private val streamHandlerExecutor: Executor, - private val params: AggregateBalanceListParams, - private val response: AggregateBalanceListPageResponse, -) : PageAsync { + private val params: TransferLimitListParams, + private val response: TransferLimitsResponse, +) : PageAsync { /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. * - * @see AggregateBalanceListPageResponse.data + * @see TransferLimitsResponse.data */ - fun data(): List = + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. * - * @see AggregateBalanceListPageResponse.hasMore + * @see TransferLimitsResponse.hasMore */ fun hasMore(): Optional = response._hasMore().getOptional("has_more") - override fun items(): List = data() + override fun items(): List = data() override fun hasNextPage(): Boolean = false - fun nextPageParams(): AggregateBalanceListParams = + fun nextPageParams(): TransferLimitListParams = throw IllegalStateException("Cannot construct next page params") - override fun nextPage(): CompletableFuture = + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) - fun autoPager(): AutoPagerAsync = + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) /** The parameters that were used to request this page. */ - fun params(): AggregateBalanceListParams = params + fun params(): TransferLimitListParams = params /** The response that this page was parsed from. */ - fun response(): AggregateBalanceListPageResponse = response + fun response(): TransferLimitsResponse = response fun toBuilder() = Builder().from(this) companion object { /** - * Returns a mutable builder for constructing an instance of - * [AggregateBalanceListPageAsync]. + * Returns a mutable builder for constructing an instance of [TransferLimitListPageAsync]. * * The following fields are required: * ```java @@ -74,38 +73,36 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AggregateBalanceListPageAsync]. */ + /** A builder for [TransferLimitListPageAsync]. */ class Builder internal constructor() { - private var service: AggregateBalanceServiceAsync? = null + private var service: TransferLimitServiceAsync? = null private var streamHandlerExecutor: Executor? = null - private var params: AggregateBalanceListParams? = null - private var response: AggregateBalanceListPageResponse? = null + private var params: TransferLimitListParams? = null + private var response: TransferLimitsResponse? = null @JvmSynthetic - internal fun from(aggregateBalanceListPageAsync: AggregateBalanceListPageAsync) = apply { - service = aggregateBalanceListPageAsync.service - streamHandlerExecutor = aggregateBalanceListPageAsync.streamHandlerExecutor - params = aggregateBalanceListPageAsync.params - response = aggregateBalanceListPageAsync.response + internal fun from(transferLimitListPageAsync: TransferLimitListPageAsync) = apply { + service = transferLimitListPageAsync.service + streamHandlerExecutor = transferLimitListPageAsync.streamHandlerExecutor + params = transferLimitListPageAsync.params + response = transferLimitListPageAsync.response } - fun service(service: AggregateBalanceServiceAsync) = apply { this.service = service } + fun service(service: TransferLimitServiceAsync) = apply { this.service = service } fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { this.streamHandlerExecutor = streamHandlerExecutor } /** The parameters that were used to request this page. */ - fun params(params: AggregateBalanceListParams) = apply { this.params = params } + fun params(params: TransferLimitListParams) = apply { this.params = params } /** The response that this page was parsed from. */ - fun response(response: AggregateBalanceListPageResponse) = apply { - this.response = response - } + fun response(response: TransferLimitsResponse) = apply { this.response = response } /** - * Returns an immutable instance of [AggregateBalanceListPageAsync]. + * Returns an immutable instance of [TransferLimitListPageAsync]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -119,8 +116,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AggregateBalanceListPageAsync = - AggregateBalanceListPageAsync( + fun build(): TransferLimitListPageAsync = + TransferLimitListPageAsync( checkRequired("service", service), checkRequired("streamHandlerExecutor", streamHandlerExecutor), checkRequired("params", params), @@ -133,7 +130,7 @@ private constructor( return true } - return other is AggregateBalanceListPageAsync && + return other is TransferLimitListPageAsync && service == other.service && streamHandlerExecutor == other.streamHandlerExecutor && params == other.params && @@ -143,5 +140,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) override fun toString() = - "AggregateBalanceListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" + "TransferLimitListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt similarity index 63% rename from lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt index 8ca1d6388..7d17b95bf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt @@ -5,24 +5,21 @@ package com.lithic.api.models import com.lithic.api.core.Params import com.lithic.api.core.http.Headers import com.lithic.api.core.http.QueryParams +import java.time.LocalDate import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Get the aggregated card balance across all end-user accounts. */ -class CardAggregateBalanceListParams +/** Get transfer limits for a specified date */ +class TransferLimitListParams private constructor( - private val accountToken: String?, - private val businessAccountToken: String?, + private val date: LocalDate?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - /** Cardholder to retrieve aggregate balances for. */ - fun accountToken(): Optional = Optional.ofNullable(accountToken) - - /** Business to retrieve aggregate balances for. */ - fun businessAccountToken(): Optional = Optional.ofNullable(businessAccountToken) + /** Date for which to retrieve transfer limits (ISO 8601 format) */ + fun date(): Optional = Optional.ofNullable(date) /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -34,48 +31,31 @@ private constructor( companion object { - @JvmStatic fun none(): CardAggregateBalanceListParams = builder().build() + @JvmStatic fun none(): TransferLimitListParams = builder().build() - /** - * Returns a mutable builder for constructing an instance of - * [CardAggregateBalanceListParams]. - */ + /** Returns a mutable builder for constructing an instance of [TransferLimitListParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [CardAggregateBalanceListParams]. */ + /** A builder for [TransferLimitListParams]. */ class Builder internal constructor() { - private var accountToken: String? = null - private var businessAccountToken: String? = null + private var date: LocalDate? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(cardAggregateBalanceListParams: CardAggregateBalanceListParams) = apply { - accountToken = cardAggregateBalanceListParams.accountToken - businessAccountToken = cardAggregateBalanceListParams.businessAccountToken - additionalHeaders = cardAggregateBalanceListParams.additionalHeaders.toBuilder() - additionalQueryParams = cardAggregateBalanceListParams.additionalQueryParams.toBuilder() + internal fun from(transferLimitListParams: TransferLimitListParams) = apply { + date = transferLimitListParams.date + additionalHeaders = transferLimitListParams.additionalHeaders.toBuilder() + additionalQueryParams = transferLimitListParams.additionalQueryParams.toBuilder() } - /** Cardholder to retrieve aggregate balances for. */ - fun accountToken(accountToken: String?) = apply { this.accountToken = accountToken } - - /** Alias for calling [Builder.accountToken] with `accountToken.orElse(null)`. */ - fun accountToken(accountToken: Optional) = accountToken(accountToken.getOrNull()) + /** Date for which to retrieve transfer limits (ISO 8601 format) */ + fun date(date: LocalDate?) = apply { this.date = date } - /** Business to retrieve aggregate balances for. */ - fun businessAccountToken(businessAccountToken: String?) = apply { - this.businessAccountToken = businessAccountToken - } - - /** - * Alias for calling [Builder.businessAccountToken] with - * `businessAccountToken.orElse(null)`. - */ - fun businessAccountToken(businessAccountToken: Optional) = - businessAccountToken(businessAccountToken.getOrNull()) + /** Alias for calling [Builder.date] with `date.orElse(null)`. */ + fun date(date: Optional) = date(date.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -176,17 +156,12 @@ private constructor( } /** - * Returns an immutable instance of [CardAggregateBalanceListParams]. + * Returns an immutable instance of [TransferLimitListParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): CardAggregateBalanceListParams = - CardAggregateBalanceListParams( - accountToken, - businessAccountToken, - additionalHeaders.build(), - additionalQueryParams.build(), - ) + fun build(): TransferLimitListParams = + TransferLimitListParams(date, additionalHeaders.build(), additionalQueryParams.build()) } override fun _headers(): Headers = additionalHeaders @@ -194,8 +169,7 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - accountToken?.let { put("account_token", it) } - businessAccountToken?.let { put("business_account_token", it) } + date?.let { put("date", it.toString()) } putAll(additionalQueryParams) } .build() @@ -205,16 +179,14 @@ private constructor( return true } - return other is CardAggregateBalanceListParams && - accountToken == other.accountToken && - businessAccountToken == other.businessAccountToken && + return other is TransferLimitListParams && + date == other.date && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = - Objects.hash(accountToken, businessAccountToken, additionalHeaders, additionalQueryParams) + override fun hashCode(): Int = Objects.hash(date, additionalHeaders, additionalQueryParams) override fun toString() = - "CardAggregateBalanceListParams{accountToken=$accountToken, businessAccountToken=$businessAccountToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "TransferLimitListParams{date=$date, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt new file mode 100644 index 000000000..94ec2d979 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt @@ -0,0 +1,1050 @@ +// 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.checkKnown +import com.lithic.api.core.checkRequired +import com.lithic.api.core.toImmutable +import com.lithic.api.errors.LithicInvalidDataException +import java.time.LocalDate +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class TransferLimitsResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val hasMore: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("has_more") @ExcludeMissing hasMore: JsonField = JsonMissing.of(), + ) : this(data, hasMore, mutableMapOf()) + + /** + * List of transfer limits + * + * @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 data(): List = data.getRequired("data") + + /** + * Whether there are more transfer limits + * + * @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 hasMore(): Boolean = hasMore.getRequired("has_more") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [hasMore]. + * + * Unlike [hasMore], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("has_more") @ExcludeMissing fun _hasMore(): JsonField = hasMore + + @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 [TransferLimitsResponse]. + * + * The following fields are required: + * ```java + * .data() + * .hasMore() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransferLimitsResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var hasMore: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(transferLimitsResponse: TransferLimitsResponse) = apply { + data = transferLimitsResponse.data.map { it.toMutableList() } + hasMore = transferLimitsResponse.hasMore + additionalProperties = transferLimitsResponse.additionalProperties.toMutableMap() + } + + /** List of transfer limits */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [TransferLimitItem] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: TransferLimitItem) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** Whether there are more transfer limits */ + fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore)) + + /** + * Sets [Builder.hasMore] to an arbitrary JSON value. + * + * You should usually call [Builder.hasMore] with a well-typed [Boolean] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore } + + 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 [TransferLimitsResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .hasMore() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TransferLimitsResponse = + TransferLimitsResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("hasMore", hasMore), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TransferLimitsResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + hasMore() + 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 = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (hasMore.asKnown().isPresent) 1 else 0) + + class TransferLimitItem + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val companyId: JsonField, + private val dailyLimit: JsonField, + private val date: JsonField, + private val isFbo: JsonField, + private val monthlyLimit: JsonField, + private val programLimitPerTransaction: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("company_id") + @ExcludeMissing + companyId: JsonField = JsonMissing.of(), + @JsonProperty("daily_limit") + @ExcludeMissing + dailyLimit: JsonField = JsonMissing.of(), + @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), + @JsonProperty("is_fbo") @ExcludeMissing isFbo: JsonField = JsonMissing.of(), + @JsonProperty("monthly_limit") + @ExcludeMissing + monthlyLimit: JsonField = JsonMissing.of(), + @JsonProperty("program_limit_per_transaction") + @ExcludeMissing + programLimitPerTransaction: JsonField = JsonMissing.of(), + ) : this( + companyId, + dailyLimit, + date, + isFbo, + monthlyLimit, + programLimitPerTransaction, + mutableMapOf(), + ) + + /** + * Company ID + * + * @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 companyId(): String = companyId.getRequired("company_id") + + /** + * Daily limits with progress + * + * @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 dailyLimit(): DirectionalLimits = dailyLimit.getRequired("daily_limit") + + /** + * The date for the limit view (ISO format) + * + * @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 date(): LocalDate = date.getRequired("date") + + /** + * Whether the company is a FBO; based on the company ID prefix + * + * @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 isFbo(): Boolean = isFbo.getRequired("is_fbo") + + /** + * Monthly limits with progress + * + * @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 monthlyLimit(): DirectionalLimits = monthlyLimit.getRequired("monthly_limit") + + /** + * Program transaction limits + * + * @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 programLimitPerTransaction(): DirectionalLimits = + programLimitPerTransaction.getRequired("program_limit_per_transaction") + + /** + * Returns the raw JSON value of [companyId]. + * + * Unlike [companyId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + + /** + * Returns the raw JSON value of [dailyLimit]. + * + * Unlike [dailyLimit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("daily_limit") + @ExcludeMissing + fun _dailyLimit(): JsonField = dailyLimit + + /** + * Returns the raw JSON value of [date]. + * + * Unlike [date], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date + + /** + * Returns the raw JSON value of [isFbo]. + * + * Unlike [isFbo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_fbo") @ExcludeMissing fun _isFbo(): JsonField = isFbo + + /** + * Returns the raw JSON value of [monthlyLimit]. + * + * Unlike [monthlyLimit], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("monthly_limit") + @ExcludeMissing + fun _monthlyLimit(): JsonField = monthlyLimit + + /** + * Returns the raw JSON value of [programLimitPerTransaction]. + * + * Unlike [programLimitPerTransaction], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("program_limit_per_transaction") + @ExcludeMissing + fun _programLimitPerTransaction(): JsonField = programLimitPerTransaction + + @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 [TransferLimitItem]. + * + * The following fields are required: + * ```java + * .companyId() + * .dailyLimit() + * .date() + * .isFbo() + * .monthlyLimit() + * .programLimitPerTransaction() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransferLimitItem]. */ + class Builder internal constructor() { + + private var companyId: JsonField? = null + private var dailyLimit: JsonField? = null + private var date: JsonField? = null + private var isFbo: JsonField? = null + private var monthlyLimit: JsonField? = null + private var programLimitPerTransaction: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(transferLimitItem: TransferLimitItem) = apply { + companyId = transferLimitItem.companyId + dailyLimit = transferLimitItem.dailyLimit + date = transferLimitItem.date + isFbo = transferLimitItem.isFbo + monthlyLimit = transferLimitItem.monthlyLimit + programLimitPerTransaction = transferLimitItem.programLimitPerTransaction + additionalProperties = transferLimitItem.additionalProperties.toMutableMap() + } + + /** Company ID */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** + * Sets [Builder.companyId] to an arbitrary JSON value. + * + * You should usually call [Builder.companyId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** Daily limits with progress */ + fun dailyLimit(dailyLimit: DirectionalLimits) = dailyLimit(JsonField.of(dailyLimit)) + + /** + * Sets [Builder.dailyLimit] to an arbitrary JSON value. + * + * You should usually call [Builder.dailyLimit] with a well-typed [DirectionalLimits] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dailyLimit(dailyLimit: JsonField) = apply { + this.dailyLimit = dailyLimit + } + + /** The date for the limit view (ISO format) */ + fun date(date: LocalDate) = date(JsonField.of(date)) + + /** + * Sets [Builder.date] to an arbitrary JSON value. + * + * You should usually call [Builder.date] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun date(date: JsonField) = apply { this.date = date } + + /** Whether the company is a FBO; based on the company ID prefix */ + fun isFbo(isFbo: Boolean) = isFbo(JsonField.of(isFbo)) + + /** + * Sets [Builder.isFbo] to an arbitrary JSON value. + * + * You should usually call [Builder.isFbo] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun isFbo(isFbo: JsonField) = apply { this.isFbo = isFbo } + + /** Monthly limits with progress */ + fun monthlyLimit(monthlyLimit: DirectionalLimits) = + monthlyLimit(JsonField.of(monthlyLimit)) + + /** + * Sets [Builder.monthlyLimit] to an arbitrary JSON value. + * + * You should usually call [Builder.monthlyLimit] with a well-typed [DirectionalLimits] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun monthlyLimit(monthlyLimit: JsonField) = apply { + this.monthlyLimit = monthlyLimit + } + + /** Program transaction limits */ + fun programLimitPerTransaction(programLimitPerTransaction: DirectionalLimits) = + programLimitPerTransaction(JsonField.of(programLimitPerTransaction)) + + /** + * Sets [Builder.programLimitPerTransaction] to an arbitrary JSON value. + * + * You should usually call [Builder.programLimitPerTransaction] with a well-typed + * [DirectionalLimits] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun programLimitPerTransaction( + programLimitPerTransaction: JsonField + ) = apply { this.programLimitPerTransaction = programLimitPerTransaction } + + 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 [TransferLimitItem]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .companyId() + * .dailyLimit() + * .date() + * .isFbo() + * .monthlyLimit() + * .programLimitPerTransaction() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TransferLimitItem = + TransferLimitItem( + checkRequired("companyId", companyId), + checkRequired("dailyLimit", dailyLimit), + checkRequired("date", date), + checkRequired("isFbo", isFbo), + checkRequired("monthlyLimit", monthlyLimit), + checkRequired("programLimitPerTransaction", programLimitPerTransaction), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TransferLimitItem = apply { + if (validated) { + return@apply + } + + companyId() + dailyLimit().validate() + date() + isFbo() + monthlyLimit().validate() + programLimitPerTransaction().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 (companyId.asKnown().isPresent) 1 else 0) + + (dailyLimit.asKnown().getOrNull()?.validity() ?: 0) + + (if (date.asKnown().isPresent) 1 else 0) + + (if (isFbo.asKnown().isPresent) 1 else 0) + + (monthlyLimit.asKnown().getOrNull()?.validity() ?: 0) + + (programLimitPerTransaction.asKnown().getOrNull()?.validity() ?: 0) + + /** Daily limits with progress */ + class DirectionalLimits + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val credit: JsonField, + private val debit: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("credit") + @ExcludeMissing + credit: JsonField = JsonMissing.of(), + @JsonProperty("debit") + @ExcludeMissing + debit: JsonField = JsonMissing.of(), + ) : this(credit, debit, mutableMapOf()) + + /** + * Credit limits + * + * @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 credit(): LimitWithProgress = credit.getRequired("credit") + + /** + * Debit limits + * + * @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 debit(): LimitWithProgress = debit.getRequired("debit") + + /** + * Returns the raw JSON value of [credit]. + * + * Unlike [credit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("credit") + @ExcludeMissing + fun _credit(): JsonField = credit + + /** + * Returns the raw JSON value of [debit]. + * + * Unlike [debit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debit") + @ExcludeMissing + fun _debit(): JsonField = debit + + @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 [DirectionalLimits]. + * + * The following fields are required: + * ```java + * .credit() + * .debit() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DirectionalLimits]. */ + class Builder internal constructor() { + + private var credit: JsonField? = null + private var debit: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(directionalLimits: DirectionalLimits) = apply { + credit = directionalLimits.credit + debit = directionalLimits.debit + additionalProperties = directionalLimits.additionalProperties.toMutableMap() + } + + /** Credit limits */ + fun credit(credit: LimitWithProgress) = credit(JsonField.of(credit)) + + /** + * Sets [Builder.credit] to an arbitrary JSON value. + * + * You should usually call [Builder.credit] with a well-typed [LimitWithProgress] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun credit(credit: JsonField) = apply { this.credit = credit } + + /** Debit limits */ + fun debit(debit: LimitWithProgress) = debit(JsonField.of(debit)) + + /** + * Sets [Builder.debit] to an arbitrary JSON value. + * + * You should usually call [Builder.debit] with a well-typed [LimitWithProgress] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun debit(debit: JsonField) = apply { this.debit = debit } + + 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 [DirectionalLimits]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .credit() + * .debit() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DirectionalLimits = + DirectionalLimits( + checkRequired("credit", credit), + checkRequired("debit", debit), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DirectionalLimits = apply { + if (validated) { + return@apply + } + + credit().validate() + debit().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 = + (credit.asKnown().getOrNull()?.validity() ?: 0) + + (debit.asKnown().getOrNull()?.validity() ?: 0) + + /** Credit limits */ + class LimitWithProgress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val limit: JsonField, + private val amountOriginated: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("limit") + @ExcludeMissing + limit: JsonField = JsonMissing.of(), + @JsonProperty("amount_originated") + @ExcludeMissing + amountOriginated: JsonField = JsonMissing.of(), + ) : this(limit, amountOriginated, mutableMapOf()) + + /** + * The limit amount + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun limit(): Long = limit.getRequired("limit") + + /** + * Amount originated towards limit + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun amountOriginated(): Optional = + amountOriginated.getOptional("amount_originated") + + /** + * Returns the raw JSON value of [limit]. + * + * Unlike [limit], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("limit") @ExcludeMissing fun _limit(): JsonField = limit + + /** + * Returns the raw JSON value of [amountOriginated]. + * + * Unlike [amountOriginated], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount_originated") + @ExcludeMissing + fun _amountOriginated(): JsonField = amountOriginated + + @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 + * [LimitWithProgress]. + * + * The following fields are required: + * ```java + * .limit() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LimitWithProgress]. */ + class Builder internal constructor() { + + private var limit: JsonField? = null + private var amountOriginated: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(limitWithProgress: LimitWithProgress) = apply { + limit = limitWithProgress.limit + amountOriginated = limitWithProgress.amountOriginated + additionalProperties = limitWithProgress.additionalProperties.toMutableMap() + } + + /** The limit amount */ + fun limit(limit: Long) = limit(JsonField.of(limit)) + + /** + * Sets [Builder.limit] to an arbitrary JSON value. + * + * You should usually call [Builder.limit] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun limit(limit: JsonField) = apply { this.limit = limit } + + /** Amount originated towards limit */ + fun amountOriginated(amountOriginated: Long) = + amountOriginated(JsonField.of(amountOriginated)) + + /** + * Sets [Builder.amountOriginated] to an arbitrary JSON value. + * + * You should usually call [Builder.amountOriginated] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amountOriginated(amountOriginated: JsonField) = apply { + this.amountOriginated = amountOriginated + } + + 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 [LimitWithProgress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .limit() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LimitWithProgress = + LimitWithProgress( + checkRequired("limit", limit), + amountOriginated, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LimitWithProgress = apply { + if (validated) { + return@apply + } + + limit() + amountOriginated() + 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 (limit.asKnown().isPresent) 1 else 0) + + (if (amountOriginated.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LimitWithProgress && + limit == other.limit && + amountOriginated == other.amountOriginated && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(limit, amountOriginated, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LimitWithProgress{limit=$limit, amountOriginated=$amountOriginated, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DirectionalLimits && + credit == other.credit && + debit == other.debit && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(credit, debit, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DirectionalLimits{credit=$credit, debit=$debit, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferLimitItem && + companyId == other.companyId && + dailyLimit == other.dailyLimit && + date == other.date && + isFbo == other.isFbo && + monthlyLimit == other.monthlyLimit && + programLimitPerTransaction == other.programLimitPerTransaction && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + companyId, + dailyLimit, + date, + isFbo, + monthlyLimit, + programLimitPerTransaction, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TransferLimitItem{companyId=$companyId, dailyLimit=$dailyLimit, date=$date, isFbo=$isFbo, monthlyLimit=$monthlyLimit, programLimitPerTransaction=$programLimitPerTransaction, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferLimitsResponse && + data == other.data && + hasMore == other.hasMore && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, hasMore, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TransferLimitsResponse{data=$data, hasMore=$hasMore, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsync.kt deleted file mode 100644 index 48c56329f..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsync.kt +++ /dev/null @@ -1,86 +0,0 @@ -// 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.AggregateBalanceListPageAsync -import com.lithic.api.models.AggregateBalanceListParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -interface AggregateBalanceServiceAsync { - - /** - * 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): AggregateBalanceServiceAsync - - /** Get the aggregated balance across all end-user accounts by financial account type */ - fun list(): CompletableFuture = - list(AggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = - list(AggregateBalanceListParams.none(), requestOptions) - - /** - * A view of [AggregateBalanceServiceAsync] 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 - ): AggregateBalanceServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/aggregate_balances`, but is otherwise the same - * as [AggregateBalanceServiceAsync.list]. - */ - fun list(): CompletableFuture> = - list(AggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none() - ): CompletableFuture> = - list(params, RequestOptions.none()) - - /** @see list */ - fun list( - requestOptions: RequestOptions - ): CompletableFuture> = - list(AggregateBalanceListParams.none(), requestOptions) - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsync.kt index 5de92133a..b01889c03 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsync.kt @@ -10,6 +10,7 @@ import com.lithic.api.models.BookTransferListPageAsync import com.lithic.api.models.BookTransferListParams import com.lithic.api.models.BookTransferResponse import com.lithic.api.models.BookTransferRetrieveParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -94,6 +95,31 @@ interface BookTransferServiceAsync { fun list(requestOptions: RequestOptions): CompletableFuture = list(BookTransferListParams.none(), requestOptions) + /** Retry a book transfer that has been declined */ + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + ): CompletableFuture = + retry(bookTransferToken, params, RequestOptions.none()) + + /** @see retry */ + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retry(params.toBuilder().bookTransferToken(bookTransferToken).build(), requestOptions) + + /** @see retry */ + fun retry(params: BookTransferRetryParams): CompletableFuture = + retry(params, RequestOptions.none()) + + /** @see retry */ + fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** Reverse a book transfer */ fun reverse(bookTransferToken: String): CompletableFuture = reverse(bookTransferToken, BookTransferReverseParams.none()) @@ -231,6 +257,36 @@ interface BookTransferServiceAsync { ): CompletableFuture> = list(BookTransferListParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /v1/book_transfers/{book_transfer_token}/retry`, + * but is otherwise the same as [BookTransferServiceAsync.retry]. + */ + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + ): CompletableFuture> = + retry(bookTransferToken, params, RequestOptions.none()) + + /** @see retry */ + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retry(params.toBuilder().bookTransferToken(bookTransferToken).build(), requestOptions) + + /** @see retry */ + fun retry( + params: BookTransferRetryParams + ): CompletableFuture> = + retry(params, RequestOptions.none()) + + /** @see retry */ + fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `post /v1/book_transfers/{book_transfer_token}/reverse`, * but is otherwise the same as [BookTransferServiceAsync.reverse]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncImpl.kt index 97990dec2..d73dd4921 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncImpl.kt @@ -22,6 +22,7 @@ import com.lithic.api.models.BookTransferListPageResponse import com.lithic.api.models.BookTransferListParams import com.lithic.api.models.BookTransferResponse import com.lithic.api.models.BookTransferRetrieveParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -60,6 +61,13 @@ class BookTransferServiceAsyncImpl internal constructor(private val clientOption // get /v1/book_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } + override fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/book_transfers/{book_transfer_token}/retry + withRawResponse().retry(params, requestOptions).thenApply { it.parse() } + override fun reverse( params: BookTransferReverseParams, requestOptions: RequestOptions, @@ -182,6 +190,40 @@ class BookTransferServiceAsyncImpl internal constructor(private val clientOption } } + private val retryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("bookTransferToken", params.bookTransferToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "book_transfers", params._pathParam(0), "retry") + .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 { retryHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val reverseHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt index b2b92af78..a22126fcb 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt @@ -24,7 +24,6 @@ import com.lithic.api.models.CardSpendLimits import com.lithic.api.models.CardUpdateParams import com.lithic.api.models.CardWebProvisionParams import com.lithic.api.models.CardWebProvisionResponse -import com.lithic.api.services.async.cards.AggregateBalanceServiceAsync import com.lithic.api.services.async.cards.BalanceServiceAsync import com.lithic.api.services.async.cards.FinancialTransactionServiceAsync import java.util.concurrent.CompletableFuture @@ -44,8 +43,6 @@ interface CardServiceAsync { */ fun withOptions(modifier: Consumer): CardServiceAsync - fun aggregateBalances(): AggregateBalanceServiceAsync - fun balances(): BalanceServiceAsync fun financialTransactions(): FinancialTransactionServiceAsync @@ -383,7 +380,7 @@ interface CardServiceAsync { /** * Allow your cardholders to directly add payment cards to the device's digital wallet from a - * browser on the web. Currently only suported for Apple Pay. + * browser on the web. * * This requires some additional setup and configuration. Please * [Contact Us](https://lithic.com/contact) or your Customer Success representative for more @@ -444,8 +441,6 @@ interface CardServiceAsync { */ fun withOptions(modifier: Consumer): CardServiceAsync.WithRawResponse - fun aggregateBalances(): AggregateBalanceServiceAsync.WithRawResponse - fun balances(): BalanceServiceAsync.WithRawResponse fun financialTransactions(): FinancialTransactionServiceAsync.WithRawResponse diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt index 3facd014d..a723a8ad6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt @@ -37,8 +37,6 @@ import com.lithic.api.models.CardSpendLimits import com.lithic.api.models.CardUpdateParams import com.lithic.api.models.CardWebProvisionParams import com.lithic.api.models.CardWebProvisionResponse -import com.lithic.api.services.async.cards.AggregateBalanceServiceAsync -import com.lithic.api.services.async.cards.AggregateBalanceServiceAsyncImpl import com.lithic.api.services.async.cards.BalanceServiceAsync import com.lithic.api.services.async.cards.BalanceServiceAsyncImpl import com.lithic.api.services.async.cards.FinancialTransactionServiceAsync @@ -59,10 +57,6 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien WithRawResponseImpl(clientOptions) } - private val aggregateBalances: AggregateBalanceServiceAsync by lazy { - AggregateBalanceServiceAsyncImpl(clientOptions) - } - private val balances: BalanceServiceAsync by lazy { BalanceServiceAsyncImpl(clientOptions) } private val financialTransactions: FinancialTransactionServiceAsync by lazy { @@ -74,8 +68,6 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun withOptions(modifier: Consumer): CardServiceAsync = CardServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun aggregateBalances(): AggregateBalanceServiceAsync = aggregateBalances - override fun balances(): BalanceServiceAsync = balances override fun financialTransactions(): FinancialTransactionServiceAsync = financialTransactions @@ -170,10 +162,6 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val aggregateBalances: AggregateBalanceServiceAsync.WithRawResponse by lazy { - AggregateBalanceServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val balances: BalanceServiceAsync.WithRawResponse by lazy { BalanceServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -190,9 +178,6 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien clientOptions.toBuilder().apply(modifier::accept).build() ) - override fun aggregateBalances(): AggregateBalanceServiceAsync.WithRawResponse = - aggregateBalances - override fun balances(): BalanceServiceAsync.WithRawResponse = balances override fun financialTransactions(): FinancialTransactionServiceAsync.WithRawResponse = diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsync.kt new file mode 100644 index 000000000..e47e6bd02 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsync.kt @@ -0,0 +1,85 @@ +// 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.TransferLimitListPageAsync +import com.lithic.api.models.TransferLimitListParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface TransferLimitServiceAsync { + + /** + * 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): TransferLimitServiceAsync + + /** Get transfer limits for a specified date */ + fun list(): CompletableFuture = list(TransferLimitListParams.none()) + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(TransferLimitListParams.none(), requestOptions) + + /** + * A view of [TransferLimitServiceAsync] 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 + ): TransferLimitServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/transfer_limits`, but is otherwise the same as + * [TransferLimitServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(TransferLimitListParams.none()) + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(TransferLimitListParams.none(), requestOptions) + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt similarity index 63% rename from lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt index e45199b7a..c3bea99ea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt @@ -14,58 +14,56 @@ import com.lithic.api.core.http.HttpResponse.Handler import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.core.http.parseable import com.lithic.api.core.prepareAsync -import com.lithic.api.models.AggregateBalanceListPageAsync -import com.lithic.api.models.AggregateBalanceListPageResponse -import com.lithic.api.models.AggregateBalanceListParams +import com.lithic.api.models.TransferLimitListPageAsync +import com.lithic.api.models.TransferLimitListParams +import com.lithic.api.models.TransferLimitsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer -class AggregateBalanceServiceAsyncImpl -internal constructor(private val clientOptions: ClientOptions) : AggregateBalanceServiceAsync { +class TransferLimitServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitServiceAsync { - private val withRawResponse: AggregateBalanceServiceAsync.WithRawResponse by lazy { + private val withRawResponse: TransferLimitServiceAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): AggregateBalanceServiceAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): TransferLimitServiceAsync.WithRawResponse = withRawResponse - override fun withOptions( - modifier: Consumer - ): AggregateBalanceServiceAsync = - AggregateBalanceServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): TransferLimitServiceAsync = + TransferLimitServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun list( - params: AggregateBalanceListParams, + params: TransferLimitListParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/aggregate_balances + ): CompletableFuture = + // get /v1/transfer_limits withRawResponse().list(params, requestOptions).thenApply { it.parse() } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceServiceAsync.WithRawResponse { + TransferLimitServiceAsync.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): AggregateBalanceServiceAsync.WithRawResponse = - AggregateBalanceServiceAsyncImpl.WithRawResponseImpl( + ): TransferLimitServiceAsync.WithRawResponse = + TransferLimitServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( - params: AggregateBalanceListParams, + params: TransferLimitListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "aggregate_balances") + .addPathSegments("v1", "transfer_limits") .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -81,8 +79,8 @@ internal constructor(private val clientOptions: ClientOptions) : AggregateBalanc } } .let { - AggregateBalanceListPageAsync.builder() - .service(AggregateBalanceServiceAsyncImpl(clientOptions)) + TransferLimitListPageAsync.builder() + .service(TransferLimitServiceAsyncImpl(clientOptions)) .streamHandlerExecutor(clientOptions.streamHandlerExecutor) .params(params) .response(it) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsync.kt deleted file mode 100644 index 9c581b2e1..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsync.kt +++ /dev/null @@ -1,86 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.async.cards - -import com.lithic.api.core.ClientOptions -import com.lithic.api.core.RequestOptions -import com.lithic.api.core.http.HttpResponseFor -import com.lithic.api.models.CardAggregateBalanceListPageAsync -import com.lithic.api.models.CardAggregateBalanceListParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -interface AggregateBalanceServiceAsync { - - /** - * 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): AggregateBalanceServiceAsync - - /** Get the aggregated card balance across all end-user accounts. */ - fun list(): CompletableFuture = - list(CardAggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = - list(CardAggregateBalanceListParams.none(), requestOptions) - - /** - * A view of [AggregateBalanceServiceAsync] 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 - ): AggregateBalanceServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/cards/aggregate_balances`, but is otherwise the - * same as [AggregateBalanceServiceAsync.list]. - */ - fun list(): CompletableFuture> = - list(CardAggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none() - ): CompletableFuture> = - list(params, RequestOptions.none()) - - /** @see list */ - fun list( - requestOptions: RequestOptions - ): CompletableFuture> = - list(CardAggregateBalanceListParams.none(), requestOptions) - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncImpl.kt deleted file mode 100644 index aa8353643..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncImpl.kt +++ /dev/null @@ -1,95 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.async.cards - -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.parseable -import com.lithic.api.core.prepareAsync -import com.lithic.api.models.CardAggregateBalanceListPageAsync -import com.lithic.api.models.CardAggregateBalanceListPageResponse -import com.lithic.api.models.CardAggregateBalanceListParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -class AggregateBalanceServiceAsyncImpl -internal constructor(private val clientOptions: ClientOptions) : AggregateBalanceServiceAsync { - - private val withRawResponse: AggregateBalanceServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): AggregateBalanceServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions( - modifier: Consumer - ): AggregateBalanceServiceAsync = - AggregateBalanceServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun list( - params: CardAggregateBalanceListParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/cards/aggregate_balances - withRawResponse().list(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): AggregateBalanceServiceAsync.WithRawResponse = - AggregateBalanceServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun list( - params: CardAggregateBalanceListParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "cards", "aggregate_balances") - .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 { listHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - .let { - CardAggregateBalanceListPageAsync.builder() - .service(AggregateBalanceServiceAsyncImpl(clientOptions)) - .streamHandlerExecutor(clientOptions.streamHandlerExecutor) - .params(params) - .response(it) - .build() - } - } - } - } - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceService.kt deleted file mode 100644 index 7e82ac01c..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceService.kt +++ /dev/null @@ -1,86 +0,0 @@ -// 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.AggregateBalanceListPage -import com.lithic.api.models.AggregateBalanceListParams -import java.util.function.Consumer - -interface AggregateBalanceService { - - /** - * 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): AggregateBalanceService - - /** Get the aggregated balance across all end-user accounts by financial account type */ - fun list(): AggregateBalanceListPage = list(AggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): AggregateBalanceListPage - - /** @see list */ - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none() - ): AggregateBalanceListPage = list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): AggregateBalanceListPage = - list(AggregateBalanceListParams.none(), requestOptions) - - /** - * A view of [AggregateBalanceService] 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 - ): AggregateBalanceService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/aggregate_balances`, but is otherwise the same - * as [AggregateBalanceService.list]. - */ - @MustBeClosed - fun list(): HttpResponseFor = - list(AggregateBalanceListParams.none()) - - /** @see list */ - @MustBeClosed - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see list */ - @MustBeClosed - fun list( - params: AggregateBalanceListParams = AggregateBalanceListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) - - /** @see list */ - @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = - list(AggregateBalanceListParams.none(), requestOptions) - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferService.kt index 9e2d54d66..70009c193 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferService.kt @@ -11,6 +11,7 @@ import com.lithic.api.models.BookTransferListPage import com.lithic.api.models.BookTransferListParams import com.lithic.api.models.BookTransferResponse import com.lithic.api.models.BookTransferRetrieveParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import java.util.function.Consumer @@ -89,6 +90,28 @@ interface BookTransferService { fun list(requestOptions: RequestOptions): BookTransferListPage = list(BookTransferListParams.none(), requestOptions) + /** Retry a book transfer that has been declined */ + fun retry(bookTransferToken: String, params: BookTransferRetryParams): BookTransferResponse = + retry(bookTransferToken, params, RequestOptions.none()) + + /** @see retry */ + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): BookTransferResponse = + retry(params.toBuilder().bookTransferToken(bookTransferToken).build(), requestOptions) + + /** @see retry */ + fun retry(params: BookTransferRetryParams): BookTransferResponse = + retry(params, RequestOptions.none()) + + /** @see retry */ + fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): BookTransferResponse + /** Reverse a book transfer */ fun reverse(bookTransferToken: String): BookTransferResponse = reverse(bookTransferToken, BookTransferReverseParams.none()) @@ -223,6 +246,38 @@ interface BookTransferService { fun list(requestOptions: RequestOptions): HttpResponseFor = list(BookTransferListParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `post /v1/book_transfers/{book_transfer_token}/retry`, + * but is otherwise the same as [BookTransferService.retry]. + */ + @MustBeClosed + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + ): HttpResponseFor = + retry(bookTransferToken, params, RequestOptions.none()) + + /** @see retry */ + @MustBeClosed + fun retry( + bookTransferToken: String, + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retry(params.toBuilder().bookTransferToken(bookTransferToken).build(), requestOptions) + + /** @see retry */ + @MustBeClosed + fun retry(params: BookTransferRetryParams): HttpResponseFor = + retry(params, RequestOptions.none()) + + /** @see retry */ + @MustBeClosed + fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `post /v1/book_transfers/{book_transfer_token}/reverse`, * but is otherwise the same as [BookTransferService.reverse]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferServiceImpl.kt index a44374271..41e14c279 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/BookTransferServiceImpl.kt @@ -22,6 +22,7 @@ import com.lithic.api.models.BookTransferListPageResponse import com.lithic.api.models.BookTransferListParams import com.lithic.api.models.BookTransferResponse import com.lithic.api.models.BookTransferRetrieveParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -59,6 +60,13 @@ class BookTransferServiceImpl internal constructor(private val clientOptions: Cl // get /v1/book_transfers withRawResponse().list(params, requestOptions).parse() + override fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions, + ): BookTransferResponse = + // post /v1/book_transfers/{book_transfer_token}/retry + withRawResponse().retry(params, requestOptions).parse() + override fun reverse( params: BookTransferReverseParams, requestOptions: RequestOptions, @@ -171,6 +179,37 @@ class BookTransferServiceImpl internal constructor(private val clientOptions: Cl } } + private val retryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retry( + params: BookTransferRetryParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("bookTransferToken", params.bookTransferToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "book_transfers", params._pathParam(0), "retry") + .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 { retryHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val reverseHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt index 7efa49da7..05b865b21 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt @@ -25,7 +25,6 @@ import com.lithic.api.models.CardSpendLimits import com.lithic.api.models.CardUpdateParams import com.lithic.api.models.CardWebProvisionParams import com.lithic.api.models.CardWebProvisionResponse -import com.lithic.api.services.blocking.cards.AggregateBalanceService import com.lithic.api.services.blocking.cards.BalanceService import com.lithic.api.services.blocking.cards.FinancialTransactionService import java.util.function.Consumer @@ -44,8 +43,6 @@ interface CardService { */ fun withOptions(modifier: Consumer): CardService - fun aggregateBalances(): AggregateBalanceService - fun balances(): BalanceService fun financialTransactions(): FinancialTransactionService @@ -349,7 +346,7 @@ interface CardService { /** * Allow your cardholders to directly add payment cards to the device's digital wallet from a - * browser on the web. Currently only suported for Apple Pay. + * browser on the web. * * This requires some additional setup and configuration. Please * [Contact Us](https://lithic.com/contact) or your Customer Success representative for more @@ -406,8 +403,6 @@ interface CardService { */ fun withOptions(modifier: Consumer): CardService.WithRawResponse - fun aggregateBalances(): AggregateBalanceService.WithRawResponse - fun balances(): BalanceService.WithRawResponse fun financialTransactions(): FinancialTransactionService.WithRawResponse diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt index df3fbf94e..bbba30ede 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt @@ -37,8 +37,6 @@ import com.lithic.api.models.CardSpendLimits import com.lithic.api.models.CardUpdateParams import com.lithic.api.models.CardWebProvisionParams import com.lithic.api.models.CardWebProvisionResponse -import com.lithic.api.services.blocking.cards.AggregateBalanceService -import com.lithic.api.services.blocking.cards.AggregateBalanceServiceImpl import com.lithic.api.services.blocking.cards.BalanceService import com.lithic.api.services.blocking.cards.BalanceServiceImpl import com.lithic.api.services.blocking.cards.FinancialTransactionService @@ -57,10 +55,6 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti WithRawResponseImpl(clientOptions) } - private val aggregateBalances: AggregateBalanceService by lazy { - AggregateBalanceServiceImpl(clientOptions) - } - private val balances: BalanceService by lazy { BalanceServiceImpl(clientOptions) } private val financialTransactions: FinancialTransactionService by lazy { @@ -72,8 +66,6 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti override fun withOptions(modifier: Consumer): CardService = CardServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun aggregateBalances(): AggregateBalanceService = aggregateBalances - override fun balances(): BalanceService = balances override fun financialTransactions(): FinancialTransactionService = financialTransactions @@ -144,10 +136,6 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val aggregateBalances: AggregateBalanceService.WithRawResponse by lazy { - AggregateBalanceServiceImpl.WithRawResponseImpl(clientOptions) - } - private val balances: BalanceService.WithRawResponse by lazy { BalanceServiceImpl.WithRawResponseImpl(clientOptions) } @@ -163,9 +151,6 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti clientOptions.toBuilder().apply(modifier::accept).build() ) - override fun aggregateBalances(): AggregateBalanceService.WithRawResponse = - aggregateBalances - override fun balances(): BalanceService.WithRawResponse = balances override fun financialTransactions(): FinancialTransactionService.WithRawResponse = diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitService.kt new file mode 100644 index 000000000..1e4b57a8a --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitService.kt @@ -0,0 +1,84 @@ +// 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.TransferLimitListPage +import com.lithic.api.models.TransferLimitListParams +import java.util.function.Consumer + +interface TransferLimitService { + + /** + * 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): TransferLimitService + + /** Get transfer limits for a specified date */ + fun list(): TransferLimitListPage = list(TransferLimitListParams.none()) + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): TransferLimitListPage + + /** @see list */ + fun list( + params: TransferLimitListParams = TransferLimitListParams.none() + ): TransferLimitListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): TransferLimitListPage = + list(TransferLimitListParams.none(), requestOptions) + + /** + * A view of [TransferLimitService] 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 + ): TransferLimitService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/transfer_limits`, but is otherwise the same as + * [TransferLimitService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = list(TransferLimitListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: TransferLimitListParams = TransferLimitListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: TransferLimitListParams = TransferLimitListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(TransferLimitListParams.none(), requestOptions) + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt similarity index 63% rename from lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt rename to lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt index 927e0a17f..a459eb527 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt @@ -14,55 +14,55 @@ import com.lithic.api.core.http.HttpResponse.Handler import com.lithic.api.core.http.HttpResponseFor import com.lithic.api.core.http.parseable import com.lithic.api.core.prepare -import com.lithic.api.models.AggregateBalanceListPage -import com.lithic.api.models.AggregateBalanceListPageResponse -import com.lithic.api.models.AggregateBalanceListParams +import com.lithic.api.models.TransferLimitListPage +import com.lithic.api.models.TransferLimitListParams +import com.lithic.api.models.TransferLimitsResponse import java.util.function.Consumer -class AggregateBalanceServiceImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceService { +class TransferLimitServiceImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitService { - private val withRawResponse: AggregateBalanceService.WithRawResponse by lazy { + private val withRawResponse: TransferLimitService.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): AggregateBalanceService.WithRawResponse = withRawResponse + override fun withRawResponse(): TransferLimitService.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): AggregateBalanceService = - AggregateBalanceServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): TransferLimitService = + TransferLimitServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun list( - params: AggregateBalanceListParams, + params: TransferLimitListParams, requestOptions: RequestOptions, - ): AggregateBalanceListPage = - // get /v1/aggregate_balances + ): TransferLimitListPage = + // get /v1/transfer_limits withRawResponse().list(params, requestOptions).parse() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceService.WithRawResponse { + TransferLimitService.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): AggregateBalanceService.WithRawResponse = - AggregateBalanceServiceImpl.WithRawResponseImpl( + ): TransferLimitService.WithRawResponse = + TransferLimitServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( - params: AggregateBalanceListParams, + params: TransferLimitListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "aggregate_balances") + .addPathSegments("v1", "transfer_limits") .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -76,8 +76,8 @@ class AggregateBalanceServiceImpl internal constructor(private val clientOptions } } .let { - AggregateBalanceListPage.builder() - .service(AggregateBalanceServiceImpl(clientOptions)) + TransferLimitListPage.builder() + .service(TransferLimitServiceImpl(clientOptions)) .params(params) .response(it) .build() diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceService.kt deleted file mode 100644 index b19909789..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceService.kt +++ /dev/null @@ -1,86 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.blocking.cards - -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.CardAggregateBalanceListPage -import com.lithic.api.models.CardAggregateBalanceListParams -import java.util.function.Consumer - -interface AggregateBalanceService { - - /** - * 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): AggregateBalanceService - - /** Get the aggregated card balance across all end-user accounts. */ - fun list(): CardAggregateBalanceListPage = list(CardAggregateBalanceListParams.none()) - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CardAggregateBalanceListPage - - /** @see list */ - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none() - ): CardAggregateBalanceListPage = list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): CardAggregateBalanceListPage = - list(CardAggregateBalanceListParams.none(), requestOptions) - - /** - * A view of [AggregateBalanceService] 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 - ): AggregateBalanceService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/cards/aggregate_balances`, but is otherwise the - * same as [AggregateBalanceService.list]. - */ - @MustBeClosed - fun list(): HttpResponseFor = - list(CardAggregateBalanceListParams.none()) - - /** @see list */ - @MustBeClosed - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see list */ - @MustBeClosed - fun list( - params: CardAggregateBalanceListParams = CardAggregateBalanceListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) - - /** @see list */ - @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = - list(CardAggregateBalanceListParams.none(), requestOptions) - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceImpl.kt deleted file mode 100644 index 7835fdcc0..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceImpl.kt +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.blocking.cards - -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.parseable -import com.lithic.api.core.prepare -import com.lithic.api.models.CardAggregateBalanceListPage -import com.lithic.api.models.CardAggregateBalanceListPageResponse -import com.lithic.api.models.CardAggregateBalanceListParams -import java.util.function.Consumer - -class AggregateBalanceServiceImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceService { - - private val withRawResponse: AggregateBalanceService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): AggregateBalanceService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): AggregateBalanceService = - AggregateBalanceServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun list( - params: CardAggregateBalanceListParams, - requestOptions: RequestOptions, - ): CardAggregateBalanceListPage = - // get /v1/cards/aggregate_balances - withRawResponse().list(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - AggregateBalanceService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): AggregateBalanceService.WithRawResponse = - AggregateBalanceServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun list( - params: CardAggregateBalanceListParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "cards", "aggregate_balances") - .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 { listHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - .let { - CardAggregateBalanceListPage.builder() - .service(AggregateBalanceServiceImpl(clientOptions)) - .params(params) - .response(it) - .build() - } - } - } - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/HttpRequestTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/HttpRequestTest.kt new file mode 100644 index 000000000..36f35c70c --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/core/http/HttpRequestTest.kt @@ -0,0 +1,110 @@ +package com.lithic.api.core.http + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.EnumSource + +internal class HttpRequestTest { + + enum class UrlTestCase(val request: HttpRequest, val expectedUrl: String) { + BASE_URL_ONLY( + HttpRequest.builder().method(HttpMethod.GET).baseUrl("https://api.example.com").build(), + expectedUrl = "https://api.example.com", + ), + BASE_URL_WITH_TRAILING_SLASH( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com/") + .build(), + expectedUrl = "https://api.example.com/", + ), + SINGLE_PATH_SEGMENT( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("users") + .build(), + expectedUrl = "https://api.example.com/users", + ), + MULTIPLE_PATH_SEGMENTS( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegments("users", "123", "profile") + .build(), + expectedUrl = "https://api.example.com/users/123/profile", + ), + PATH_SEGMENT_WITH_SPECIAL_CHARS( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("user name") + .build(), + expectedUrl = "https://api.example.com/user+name", + ), + SINGLE_QUERY_PARAM( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("users") + .putQueryParam("limit", "10") + .build(), + expectedUrl = "https://api.example.com/users?limit=10", + ), + MULTIPLE_QUERY_PARAMS( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("users") + .putQueryParam("limit", "10") + .putQueryParam("offset", "20") + .build(), + expectedUrl = "https://api.example.com/users?limit=10&offset=20", + ), + QUERY_PARAM_WITH_SPECIAL_CHARS( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("search") + .putQueryParam("q", "hello world") + .build(), + expectedUrl = "https://api.example.com/search?q=hello+world", + ), + MULTIPLE_VALUES_SAME_PARAM( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("users") + .putQueryParams("tags", listOf("admin", "user")) + .build(), + expectedUrl = "https://api.example.com/users?tags=admin&tags=user", + ), + BASE_URL_WITH_TRAILING_SLASH_AND_PATH( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com/") + .addPathSegment("users") + .build(), + expectedUrl = "https://api.example.com/users", + ), + COMPLEX_URL( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl("https://api.example.com") + .addPathSegments("v1", "users", "123") + .putQueryParams("include", listOf("profile", "settings")) + .putQueryParam("format", "json") + .build(), + expectedUrl = + "https://api.example.com/v1/users/123?include=profile&include=settings&format=json", + ), + } + + @ParameterizedTest + @EnumSource + fun url(testCase: UrlTestCase) { + val actualUrl = testCase.request.url() + + assertThat(actualUrl).isEqualTo(testCase.expectedUrl) + } +} 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 9798d1a0c..9e26b11e8 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 @@ -708,6 +708,7 @@ internal class AccountActivityListResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -718,6 +719,7 @@ internal class AccountActivityListResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -783,6 +785,7 @@ internal class AccountActivityListResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -793,6 +796,7 @@ internal class AccountActivityListResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 e5066f5d1..d632243da 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 @@ -737,6 +737,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -747,6 +748,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -813,6 +815,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -823,6 +826,7 @@ internal class AccountActivityRetrieveTransactionResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListPageResponseTest.kt deleted file mode 100644 index dc1aa625f..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListPageResponseTest.kt +++ /dev/null @@ -1,83 +0,0 @@ -// 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 AggregateBalanceListPageResponseTest { - - @Test - fun create() { - val aggregateBalanceListPageResponse = - AggregateBalanceListPageResponse.builder() - .addData( - AggregateBalance.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .financialAccountType(AggregateBalance.FinancialAccountType.ISSUING) - .lastFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .hasMore(true) - .build() - - assertThat(aggregateBalanceListPageResponse.data()) - .containsExactly( - AggregateBalance.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .financialAccountType(AggregateBalance.FinancialAccountType.ISSUING) - .lastFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - assertThat(aggregateBalanceListPageResponse.hasMore()).isEqualTo(true) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val aggregateBalanceListPageResponse = - AggregateBalanceListPageResponse.builder() - .addData( - AggregateBalance.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .financialAccountType(AggregateBalance.FinancialAccountType.ISSUING) - .lastFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .hasMore(true) - .build() - - val roundtrippedAggregateBalanceListPageResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(aggregateBalanceListPageResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedAggregateBalanceListPageResponse) - .isEqualTo(aggregateBalanceListPageResponse) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListParamsTest.kt deleted file mode 100644 index 941c3670e..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListParamsTest.kt +++ /dev/null @@ -1,39 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.lithic.api.core.http.QueryParams -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class AggregateBalanceListParamsTest { - - @Test - fun create() { - AggregateBalanceListParams.builder() - .financialAccountType(AggregateBalanceListParams.FinancialAccountType.ISSUING) - .build() - } - - @Test - fun queryParams() { - val params = - AggregateBalanceListParams.builder() - .financialAccountType(AggregateBalanceListParams.FinancialAccountType.ISSUING) - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo(QueryParams.builder().put("financial_account_type", "ISSUING").build()) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = AggregateBalanceListParams.builder().build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListResponseTest.kt deleted file mode 100644 index 26bfcf9a9..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListResponseTest.kt +++ /dev/null @@ -1,68 +0,0 @@ -// 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 AggregateBalanceListResponseTest { - - @Test - fun create() { - val aggregateBalanceListResponse = - AggregateBalanceListResponse.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .lastCardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - assertThat(aggregateBalanceListResponse.availableAmount()).isEqualTo(0L) - assertThat(aggregateBalanceListResponse.created()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(aggregateBalanceListResponse.currency()).isEqualTo("currency") - assertThat(aggregateBalanceListResponse.lastCardToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalanceListResponse.lastTransactionEventToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalanceListResponse.lastTransactionToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalanceListResponse.pendingAmount()).isEqualTo(0L) - assertThat(aggregateBalanceListResponse.totalAmount()).isEqualTo(0L) - assertThat(aggregateBalanceListResponse.updated()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val aggregateBalanceListResponse = - AggregateBalanceListResponse.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .lastCardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - val roundtrippedAggregateBalanceListResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(aggregateBalanceListResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedAggregateBalanceListResponse).isEqualTo(aggregateBalanceListResponse) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceTest.kt deleted file mode 100644 index c5c718fd5..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceTest.kt +++ /dev/null @@ -1,72 +0,0 @@ -// 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 AggregateBalanceTest { - - @Test - fun create() { - val aggregateBalance = - AggregateBalance.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .financialAccountType(AggregateBalance.FinancialAccountType.ISSUING) - .lastFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - assertThat(aggregateBalance.availableAmount()).isEqualTo(0L) - assertThat(aggregateBalance.created()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(aggregateBalance.currency()).isEqualTo("currency") - assertThat(aggregateBalance.financialAccountType()) - .isEqualTo(AggregateBalance.FinancialAccountType.ISSUING) - assertThat(aggregateBalance.lastFinancialAccountToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalance.lastTransactionEventToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalance.lastTransactionToken()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(aggregateBalance.pendingAmount()).isEqualTo(0L) - assertThat(aggregateBalance.totalAmount()).isEqualTo(0L) - assertThat(aggregateBalance.updated()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val aggregateBalance = - AggregateBalance.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .financialAccountType(AggregateBalance.FinancialAccountType.ISSUING) - .lastFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - val roundtrippedAggregateBalance = - jsonMapper.readValue( - jsonMapper.writeValueAsString(aggregateBalance), - jacksonTypeRef(), - ) - - assertThat(roundtrippedAggregateBalance).isEqualTo(aggregateBalance) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AsaRequestWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AsaRequestWebhookEventTest.kt deleted file mode 100644 index 75c2f78fe..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AsaRequestWebhookEventTest.kt +++ /dev/null @@ -1,487 +0,0 @@ -// 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 AsaRequestWebhookEventTest { - - @Test - fun create() { - val asaRequestWebhookEvent = - AsaRequestWebhookEvent.builder() - .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .acquirerFee(0L) - .amount(0L) - .authorizationAmount(0L) - .avs( - AsaRequestWebhookEvent.Avs.builder() - .address("address") - .addressOnFileMatch(AsaRequestWebhookEvent.Avs.AddressMatchResult.MATCH) - .zipcode("zipcode") - .build() - ) - .card( - AsaRequestWebhookEvent.AsaRequestCard.builder() - .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") - .lastFour("last_four") - .memo("memo") - .spendLimit(0L) - .spendLimitDuration( - AsaRequestWebhookEvent.AsaRequestCard.SpendLimitDuration.ANNUALLY - ) - .state(AsaRequestWebhookEvent.AsaRequestCard.State.CLOSED) - .type(AsaRequestWebhookEvent.AsaRequestCard.CardType.SINGLE_USE) - .build() - ) - .cardholderCurrency("cardholder_currency") - .cashAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .merchant( - Merchant.builder() - .acceptorId("333301802529120") - .acquiringInstitutionId("191231") - .city("NEW YORK") - .country("USA") - .descriptor("COFFEE SHOP") - .mcc("5812") - .state("NY") - .build() - ) - .merchantAmount(0L) - .merchantCurrency("USD") - .settledAmount(0L) - .status(AsaRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) - .transactionInitiator(AsaRequestWebhookEvent.TransactionInitiator.CARDHOLDER) - .accountType(AsaRequestWebhookEvent.AccountType.CHECKING) - .cardholderAuthentication( - CardholderAuthentication.builder() - .authenticationMethod( - CardholderAuthentication.AuthenticationMethod.FRICTIONLESS - ) - .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) - .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) - .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) - .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") - .build() - ) - .cashback(0L) - .conversionRate(0.0) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fleetInfo( - AsaRequestWebhookEvent.AsaRequestFleetInfo.builder() - .fleetPromptCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetPromptCode.NO_PROMPT - ) - .fleetRestrictionCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetRestrictionCode - .NO_RESTRICTIONS - ) - .driverNumber("driver_number") - .vehicleNumber("vehicle_number") - .build() - ) - .latestChallenge( - AsaRequestWebhookEvent.LatestChallenge.builder() - .phoneNumber("phone_number") - .status(AsaRequestWebhookEvent.LatestChallenge.Status.COMPLETED) - .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .network(AsaRequestWebhookEvent.Network.AMEX) - .networkRiskScore(0L) - .networkSpecificData( - AsaRequestWebhookEvent.AsaNetworkSpecificData.builder() - .mastercard( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .builder() - .ecommerceSecurityLevelIndicator("xxx") - .addOnBehalfServiceResult( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .OnBehalfServiceResult - .builder() - .result1("x") - .result2("x") - .service("xx") - .build() - ) - .transactionTypeIdentifier("xxx") - .build() - ) - .visa( - AsaRequestWebhookEvent.AsaNetworkSpecificData.AsaNetworkSpecificDataVisa - .builder() - .businessApplicationIdentifier("xx") - .build() - ) - .build() - ) - .pos( - AsaRequestWebhookEvent.Pos.builder() - .entryMode( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.builder() - .card( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Card.PRESENT - ) - .cardholder( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Cardholder - .DEFERRED_BILLING - ) - .pan( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Pan.AUTO_ENTRY - ) - .pinEntered(true) - .build() - ) - .terminal( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.builder() - .attended(true) - .cardRetentionCapable(true) - .onPremise(true) - .operator( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Operator - .ADMINISTRATIVE - ) - .partialApprovalCapable(true) - .pinCapability( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.PinCapability.CAPABLE - ) - .type(AsaRequestWebhookEvent.Pos.AsaPosTerminal.Type.ADMINISTRATIVE) - .acceptorTerminalId(" r 0K9tW") - .build() - ) - .build() - ) - .tokenInfo(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) - .ttl(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - assertThat(asaRequestWebhookEvent.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(asaRequestWebhookEvent.acquirerFee()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.amount()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.authorizationAmount()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.avs()) - .isEqualTo( - AsaRequestWebhookEvent.Avs.builder() - .address("address") - .addressOnFileMatch(AsaRequestWebhookEvent.Avs.AddressMatchResult.MATCH) - .zipcode("zipcode") - .build() - ) - assertThat(asaRequestWebhookEvent.card()) - .isEqualTo( - AsaRequestWebhookEvent.AsaRequestCard.builder() - .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") - .lastFour("last_four") - .memo("memo") - .spendLimit(0L) - .spendLimitDuration( - AsaRequestWebhookEvent.AsaRequestCard.SpendLimitDuration.ANNUALLY - ) - .state(AsaRequestWebhookEvent.AsaRequestCard.State.CLOSED) - .type(AsaRequestWebhookEvent.AsaRequestCard.CardType.SINGLE_USE) - .build() - ) - assertThat(asaRequestWebhookEvent.cardholderCurrency()).isEqualTo("cardholder_currency") - assertThat(asaRequestWebhookEvent.cashAmount()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.created()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(asaRequestWebhookEvent.merchant()) - .isEqualTo( - Merchant.builder() - .acceptorId("333301802529120") - .acquiringInstitutionId("191231") - .city("NEW YORK") - .country("USA") - .descriptor("COFFEE SHOP") - .mcc("5812") - .state("NY") - .build() - ) - assertThat(asaRequestWebhookEvent.merchantAmount()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.merchantCurrency()).isEqualTo("USD") - assertThat(asaRequestWebhookEvent.settledAmount()).isEqualTo(0L) - assertThat(asaRequestWebhookEvent.status()) - .isEqualTo(AsaRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) - assertThat(asaRequestWebhookEvent.transactionInitiator()) - .isEqualTo(AsaRequestWebhookEvent.TransactionInitiator.CARDHOLDER) - assertThat(asaRequestWebhookEvent.accountType()) - .contains(AsaRequestWebhookEvent.AccountType.CHECKING) - assertThat(asaRequestWebhookEvent.cardholderAuthentication()) - .contains( - CardholderAuthentication.builder() - .authenticationMethod( - CardholderAuthentication.AuthenticationMethod.FRICTIONLESS - ) - .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) - .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) - .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) - .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") - .build() - ) - assertThat(asaRequestWebhookEvent.cashback()).contains(0L) - assertThat(asaRequestWebhookEvent.conversionRate()).contains(0.0) - assertThat(asaRequestWebhookEvent.eventToken()) - .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(asaRequestWebhookEvent.fleetInfo()) - .contains( - AsaRequestWebhookEvent.AsaRequestFleetInfo.builder() - .fleetPromptCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetPromptCode.NO_PROMPT - ) - .fleetRestrictionCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetRestrictionCode - .NO_RESTRICTIONS - ) - .driverNumber("driver_number") - .vehicleNumber("vehicle_number") - .build() - ) - assertThat(asaRequestWebhookEvent.latestChallenge()) - .contains( - AsaRequestWebhookEvent.LatestChallenge.builder() - .phoneNumber("phone_number") - .status(AsaRequestWebhookEvent.LatestChallenge.Status.COMPLETED) - .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - assertThat(asaRequestWebhookEvent.network()).contains(AsaRequestWebhookEvent.Network.AMEX) - assertThat(asaRequestWebhookEvent.networkRiskScore()).contains(0L) - assertThat(asaRequestWebhookEvent.networkSpecificData()) - .contains( - AsaRequestWebhookEvent.AsaNetworkSpecificData.builder() - .mastercard( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .builder() - .ecommerceSecurityLevelIndicator("xxx") - .addOnBehalfServiceResult( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .OnBehalfServiceResult - .builder() - .result1("x") - .result2("x") - .service("xx") - .build() - ) - .transactionTypeIdentifier("xxx") - .build() - ) - .visa( - AsaRequestWebhookEvent.AsaNetworkSpecificData.AsaNetworkSpecificDataVisa - .builder() - .businessApplicationIdentifier("xx") - .build() - ) - .build() - ) - assertThat(asaRequestWebhookEvent.pos()) - .contains( - AsaRequestWebhookEvent.Pos.builder() - .entryMode( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.builder() - .card(AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Card.PRESENT) - .cardholder( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Cardholder - .DEFERRED_BILLING - ) - .pan(AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Pan.AUTO_ENTRY) - .pinEntered(true) - .build() - ) - .terminal( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.builder() - .attended(true) - .cardRetentionCapable(true) - .onPremise(true) - .operator( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Operator.ADMINISTRATIVE - ) - .partialApprovalCapable(true) - .pinCapability( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.PinCapability.CAPABLE - ) - .type(AsaRequestWebhookEvent.Pos.AsaPosTerminal.Type.ADMINISTRATIVE) - .acceptorTerminalId(" r 0K9tW") - .build() - ) - .build() - ) - assertThat(asaRequestWebhookEvent.tokenInfo()) - .contains(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) - assertThat(asaRequestWebhookEvent.ttl()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val asaRequestWebhookEvent = - AsaRequestWebhookEvent.builder() - .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .acquirerFee(0L) - .amount(0L) - .authorizationAmount(0L) - .avs( - AsaRequestWebhookEvent.Avs.builder() - .address("address") - .addressOnFileMatch(AsaRequestWebhookEvent.Avs.AddressMatchResult.MATCH) - .zipcode("zipcode") - .build() - ) - .card( - AsaRequestWebhookEvent.AsaRequestCard.builder() - .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hostname("hostname") - .lastFour("last_four") - .memo("memo") - .spendLimit(0L) - .spendLimitDuration( - AsaRequestWebhookEvent.AsaRequestCard.SpendLimitDuration.ANNUALLY - ) - .state(AsaRequestWebhookEvent.AsaRequestCard.State.CLOSED) - .type(AsaRequestWebhookEvent.AsaRequestCard.CardType.SINGLE_USE) - .build() - ) - .cardholderCurrency("cardholder_currency") - .cashAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .merchant( - Merchant.builder() - .acceptorId("333301802529120") - .acquiringInstitutionId("191231") - .city("NEW YORK") - .country("USA") - .descriptor("COFFEE SHOP") - .mcc("5812") - .state("NY") - .build() - ) - .merchantAmount(0L) - .merchantCurrency("USD") - .settledAmount(0L) - .status(AsaRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) - .transactionInitiator(AsaRequestWebhookEvent.TransactionInitiator.CARDHOLDER) - .accountType(AsaRequestWebhookEvent.AccountType.CHECKING) - .cardholderAuthentication( - CardholderAuthentication.builder() - .authenticationMethod( - CardholderAuthentication.AuthenticationMethod.FRICTIONLESS - ) - .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) - .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) - .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) - .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") - .build() - ) - .cashback(0L) - .conversionRate(0.0) - .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fleetInfo( - AsaRequestWebhookEvent.AsaRequestFleetInfo.builder() - .fleetPromptCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetPromptCode.NO_PROMPT - ) - .fleetRestrictionCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetRestrictionCode - .NO_RESTRICTIONS - ) - .driverNumber("driver_number") - .vehicleNumber("vehicle_number") - .build() - ) - .latestChallenge( - AsaRequestWebhookEvent.LatestChallenge.builder() - .phoneNumber("phone_number") - .status(AsaRequestWebhookEvent.LatestChallenge.Status.COMPLETED) - .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .network(AsaRequestWebhookEvent.Network.AMEX) - .networkRiskScore(0L) - .networkSpecificData( - AsaRequestWebhookEvent.AsaNetworkSpecificData.builder() - .mastercard( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .builder() - .ecommerceSecurityLevelIndicator("xxx") - .addOnBehalfServiceResult( - AsaRequestWebhookEvent.AsaNetworkSpecificData - .AsaNetworkSpecificDataMastercard - .OnBehalfServiceResult - .builder() - .result1("x") - .result2("x") - .service("xx") - .build() - ) - .transactionTypeIdentifier("xxx") - .build() - ) - .visa( - AsaRequestWebhookEvent.AsaNetworkSpecificData.AsaNetworkSpecificDataVisa - .builder() - .businessApplicationIdentifier("xx") - .build() - ) - .build() - ) - .pos( - AsaRequestWebhookEvent.Pos.builder() - .entryMode( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.builder() - .card( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Card.PRESENT - ) - .cardholder( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Cardholder - .DEFERRED_BILLING - ) - .pan( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Pan.AUTO_ENTRY - ) - .pinEntered(true) - .build() - ) - .terminal( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.builder() - .attended(true) - .cardRetentionCapable(true) - .onPremise(true) - .operator( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Operator - .ADMINISTRATIVE - ) - .partialApprovalCapable(true) - .pinCapability( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.PinCapability.CAPABLE - ) - .type(AsaRequestWebhookEvent.Pos.AsaPosTerminal.Type.ADMINISTRATIVE) - .acceptorTerminalId(" r 0K9tW") - .build() - ) - .build() - ) - .tokenInfo(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) - .ttl(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - val roundtrippedAsaRequestWebhookEvent = - jsonMapper.readValue( - jsonMapper.writeValueAsString(asaRequestWebhookEvent), - jacksonTypeRef(), - ) - - assertThat(roundtrippedAsaRequestWebhookEvent).isEqualTo(asaRequestWebhookEvent) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/BookTransferRetryParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BookTransferRetryParamsTest.kt new file mode 100644 index 000000000..8ec9590e4 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/BookTransferRetryParamsTest.kt @@ -0,0 +1,43 @@ +// 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 BookTransferRetryParamsTest { + + @Test + fun create() { + BookTransferRetryParams.builder() + .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + } + + @Test + fun pathParams() { + val params = + BookTransferRetryParams.builder() + .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + BookTransferRetryParams.builder() + .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val body = params._body() + + assertThat(body.retryToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponseTest.kt deleted file mode 100644 index d09ca12bb..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponseTest.kt +++ /dev/null @@ -1,80 +0,0 @@ -// 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 CardAggregateBalanceListPageResponseTest { - - @Test - fun create() { - val cardAggregateBalanceListPageResponse = - CardAggregateBalanceListPageResponse.builder() - .addData( - AggregateBalanceListResponse.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .lastCardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .hasMore(true) - .build() - - assertThat(cardAggregateBalanceListPageResponse.data()) - .containsExactly( - AggregateBalanceListResponse.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .lastCardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - assertThat(cardAggregateBalanceListPageResponse.hasMore()).isEqualTo(true) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val cardAggregateBalanceListPageResponse = - CardAggregateBalanceListPageResponse.builder() - .addData( - AggregateBalanceListResponse.builder() - .availableAmount(0L) - .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .currency("currency") - .lastCardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .lastTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pendingAmount(0L) - .totalAmount(0L) - .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .hasMore(true) - .build() - - val roundtrippedCardAggregateBalanceListPageResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(cardAggregateBalanceListPageResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedCardAggregateBalanceListPageResponse) - .isEqualTo(cardAggregateBalanceListPageResponse) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListParamsTest.kt deleted file mode 100644 index 08c76616d..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListParamsTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.lithic.api.core.http.QueryParams -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class CardAggregateBalanceListParamsTest { - - @Test - fun create() { - CardAggregateBalanceListParams.builder() - .accountToken("account_token") - .businessAccountToken("business_account_token") - .build() - } - - @Test - fun queryParams() { - val params = - CardAggregateBalanceListParams.builder() - .accountToken("account_token") - .businessAccountToken("business_account_token") - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("account_token", "account_token") - .put("business_account_token", "business_account_token") - .build() - ) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = CardAggregateBalanceListParams.builder().build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt new file mode 100644 index 000000000..7196fb57a --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAuthorizationApprovalRequestWebhookEventTest.kt @@ -0,0 +1,612 @@ +// 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 CardAuthorizationApprovalRequestWebhookEventTest { + + @Test + fun create() { + val cardAuthorizationApprovalRequestWebhookEvent = + CardAuthorizationApprovalRequestWebhookEvent.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .acquirerFee(0L) + .amount(0L) + .authorizationAmount(0L) + .avs( + CardAuthorizationApprovalRequestWebhookEvent.Avs.builder() + .address("address") + .addressOnFileMatch( + CardAuthorizationApprovalRequestWebhookEvent.Avs.AddressMatchResult + .MATCH + ) + .zipcode("zipcode") + .build() + ) + .card( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hostname("hostname") + .lastFour("last_four") + .memo("memo") + .spendLimit(0L) + .spendLimitDuration( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard + .SpendLimitDuration + .ANNUALLY + ) + .state( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.State.CLOSED + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.CardType + .SINGLE_USE + ) + .build() + ) + .cardholderCurrency("cardholder_currency") + .cashAmount(0L) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .eventType( + CardAuthorizationApprovalRequestWebhookEvent.EventType + .CARD_AUTHORIZATION_APPROVAL_REQUEST + ) + .merchant( + Merchant.builder() + .acceptorId("333301802529120") + .acquiringInstitutionId("191231") + .city("NEW YORK") + .country("USA") + .descriptor("COFFEE SHOP") + .mcc("5812") + .state("NY") + .build() + ) + .merchantAmount(0L) + .merchantCurrency("USD") + .settledAmount(0L) + .status(CardAuthorizationApprovalRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) + .transactionInitiator( + CardAuthorizationApprovalRequestWebhookEvent.TransactionInitiator.CARDHOLDER + ) + .accountType(CardAuthorizationApprovalRequestWebhookEvent.AccountType.CHECKING) + .cardholderAuthentication( + CardholderAuthentication.builder() + .authenticationMethod( + CardholderAuthentication.AuthenticationMethod.FRICTIONLESS + ) + .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) + .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) + .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) + .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") + .build() + ) + .cashback(0L) + .conversionRate(0.0) + .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fleetInfo( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo.builder() + .fleetPromptCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetPromptCode + .NO_PROMPT + ) + .fleetRestrictionCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetRestrictionCode + .NO_RESTRICTIONS + ) + .driverNumber("driver_number") + .vehicleNumber("vehicle_number") + .build() + ) + .latestChallenge( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.builder() + .phoneNumber("phone_number") + .status( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.Status + .COMPLETED + ) + .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .network(CardAuthorizationApprovalRequestWebhookEvent.Network.AMEX) + .networkRiskScore(0L) + .networkSpecificData( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData.builder() + .mastercard( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .builder() + .ecommerceSecurityLevelIndicator("xxx") + .addOnBehalfServiceResult( + CardAuthorizationApprovalRequestWebhookEvent + .AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .OnBehalfServiceResult + .builder() + .result1("x") + .result2("x") + .service("xx") + .build() + ) + .transactionTypeIdentifier("xxx") + .build() + ) + .visa( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataVisa + .builder() + .businessApplicationIdentifier("xx") + .build() + ) + .build() + ) + .pos( + CardAuthorizationApprovalRequestWebhookEvent.Pos.builder() + .entryMode( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaRequestPosEntryMode + .builder() + .card( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Card + .PRESENT + ) + .cardholder( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Cardholder + .DEFERRED_BILLING + ) + .pan( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Pan + .AUTO_ENTRY + ) + .pinEntered(true) + .build() + ) + .terminal( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .builder() + .attended(true) + .cardRetentionCapable(true) + .onPremise(true) + .operator( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Operator + .ADMINISTRATIVE + ) + .partialApprovalCapable(true) + .pinCapability( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .PinCapability + .CAPABLE + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Type + .ADMINISTRATIVE + ) + .acceptorTerminalId(" r 0K9tW") + .build() + ) + .build() + ) + .tokenInfo(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) + .ttl(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + + assertThat(cardAuthorizationApprovalRequestWebhookEvent.token()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(cardAuthorizationApprovalRequestWebhookEvent.acquirerFee()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.amount()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.authorizationAmount()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.avs()) + .isEqualTo( + CardAuthorizationApprovalRequestWebhookEvent.Avs.builder() + .address("address") + .addressOnFileMatch( + CardAuthorizationApprovalRequestWebhookEvent.Avs.AddressMatchResult.MATCH + ) + .zipcode("zipcode") + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.card()) + .isEqualTo( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hostname("hostname") + .lastFour("last_four") + .memo("memo") + .spendLimit(0L) + .spendLimitDuration( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard + .SpendLimitDuration + .ANNUALLY + ) + .state(CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.State.CLOSED) + .type( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.CardType + .SINGLE_USE + ) + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.cardholderCurrency()) + .isEqualTo("cardholder_currency") + assertThat(cardAuthorizationApprovalRequestWebhookEvent.cashAmount()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.created()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.eventType()) + .isEqualTo( + CardAuthorizationApprovalRequestWebhookEvent.EventType + .CARD_AUTHORIZATION_APPROVAL_REQUEST + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.merchant()) + .isEqualTo( + Merchant.builder() + .acceptorId("333301802529120") + .acquiringInstitutionId("191231") + .city("NEW YORK") + .country("USA") + .descriptor("COFFEE SHOP") + .mcc("5812") + .state("NY") + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.merchantAmount()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.merchantCurrency()).isEqualTo("USD") + assertThat(cardAuthorizationApprovalRequestWebhookEvent.settledAmount()).isEqualTo(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.status()) + .isEqualTo(CardAuthorizationApprovalRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.transactionInitiator()) + .isEqualTo(CardAuthorizationApprovalRequestWebhookEvent.TransactionInitiator.CARDHOLDER) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.accountType()) + .contains(CardAuthorizationApprovalRequestWebhookEvent.AccountType.CHECKING) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.cardholderAuthentication()) + .contains( + CardholderAuthentication.builder() + .authenticationMethod( + CardholderAuthentication.AuthenticationMethod.FRICTIONLESS + ) + .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) + .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) + .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) + .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.cashback()).contains(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.conversionRate()).contains(0.0) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.eventToken()) + .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(cardAuthorizationApprovalRequestWebhookEvent.fleetInfo()) + .contains( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo.builder() + .fleetPromptCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetPromptCode + .NO_PROMPT + ) + .fleetRestrictionCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetRestrictionCode + .NO_RESTRICTIONS + ) + .driverNumber("driver_number") + .vehicleNumber("vehicle_number") + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.latestChallenge()) + .contains( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.builder() + .phoneNumber("phone_number") + .status( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.Status + .COMPLETED + ) + .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.network()) + .contains(CardAuthorizationApprovalRequestWebhookEvent.Network.AMEX) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.networkRiskScore()).contains(0L) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.networkSpecificData()) + .contains( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData.builder() + .mastercard( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .builder() + .ecommerceSecurityLevelIndicator("xxx") + .addOnBehalfServiceResult( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .OnBehalfServiceResult + .builder() + .result1("x") + .result2("x") + .service("xx") + .build() + ) + .transactionTypeIdentifier("xxx") + .build() + ) + .visa( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataVisa + .builder() + .businessApplicationIdentifier("xx") + .build() + ) + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.pos()) + .contains( + CardAuthorizationApprovalRequestWebhookEvent.Pos.builder() + .entryMode( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaRequestPosEntryMode + .builder() + .card( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Card + .PRESENT + ) + .cardholder( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Cardholder + .DEFERRED_BILLING + ) + .pan( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Pan + .AUTO_ENTRY + ) + .pinEntered(true) + .build() + ) + .terminal( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal.builder() + .attended(true) + .cardRetentionCapable(true) + .onPremise(true) + .operator( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Operator + .ADMINISTRATIVE + ) + .partialApprovalCapable(true) + .pinCapability( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .PinCapability + .CAPABLE + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal.Type + .ADMINISTRATIVE + ) + .acceptorTerminalId(" r 0K9tW") + .build() + ) + .build() + ) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.tokenInfo()) + .contains(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) + assertThat(cardAuthorizationApprovalRequestWebhookEvent.ttl()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val cardAuthorizationApprovalRequestWebhookEvent = + CardAuthorizationApprovalRequestWebhookEvent.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .acquirerFee(0L) + .amount(0L) + .authorizationAmount(0L) + .avs( + CardAuthorizationApprovalRequestWebhookEvent.Avs.builder() + .address("address") + .addressOnFileMatch( + CardAuthorizationApprovalRequestWebhookEvent.Avs.AddressMatchResult + .MATCH + ) + .zipcode("zipcode") + .build() + ) + .card( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hostname("hostname") + .lastFour("last_four") + .memo("memo") + .spendLimit(0L) + .spendLimitDuration( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard + .SpendLimitDuration + .ANNUALLY + ) + .state( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.State.CLOSED + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.CardType + .SINGLE_USE + ) + .build() + ) + .cardholderCurrency("cardholder_currency") + .cashAmount(0L) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .eventType( + CardAuthorizationApprovalRequestWebhookEvent.EventType + .CARD_AUTHORIZATION_APPROVAL_REQUEST + ) + .merchant( + Merchant.builder() + .acceptorId("333301802529120") + .acquiringInstitutionId("191231") + .city("NEW YORK") + .country("USA") + .descriptor("COFFEE SHOP") + .mcc("5812") + .state("NY") + .build() + ) + .merchantAmount(0L) + .merchantCurrency("USD") + .settledAmount(0L) + .status(CardAuthorizationApprovalRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) + .transactionInitiator( + CardAuthorizationApprovalRequestWebhookEvent.TransactionInitiator.CARDHOLDER + ) + .accountType(CardAuthorizationApprovalRequestWebhookEvent.AccountType.CHECKING) + .cardholderAuthentication( + CardholderAuthentication.builder() + .authenticationMethod( + CardholderAuthentication.AuthenticationMethod.FRICTIONLESS + ) + .authenticationResult(CardholderAuthentication.AuthenticationResult.SUCCESS) + .decisionMadeBy(CardholderAuthentication.DecisionMadeBy.LITHIC_RULES) + .liabilityShift(CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED) + .threeDSAuthenticationToken("a6e372d0-b40a-43eb-b0d1-4e1aebef5875") + .build() + ) + .cashback(0L) + .conversionRate(0.0) + .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fleetInfo( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo.builder() + .fleetPromptCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetPromptCode + .NO_PROMPT + ) + .fleetRestrictionCode( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetRestrictionCode + .NO_RESTRICTIONS + ) + .driverNumber("driver_number") + .vehicleNumber("vehicle_number") + .build() + ) + .latestChallenge( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.builder() + .phoneNumber("phone_number") + .status( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.Status + .COMPLETED + ) + .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .network(CardAuthorizationApprovalRequestWebhookEvent.Network.AMEX) + .networkRiskScore(0L) + .networkSpecificData( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData.builder() + .mastercard( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .builder() + .ecommerceSecurityLevelIndicator("xxx") + .addOnBehalfServiceResult( + CardAuthorizationApprovalRequestWebhookEvent + .AsaNetworkSpecificData + .AsaNetworkSpecificDataMastercard + .OnBehalfServiceResult + .builder() + .result1("x") + .result2("x") + .service("xx") + .build() + ) + .transactionTypeIdentifier("xxx") + .build() + ) + .visa( + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataVisa + .builder() + .businessApplicationIdentifier("xx") + .build() + ) + .build() + ) + .pos( + CardAuthorizationApprovalRequestWebhookEvent.Pos.builder() + .entryMode( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaRequestPosEntryMode + .builder() + .card( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Card + .PRESENT + ) + .cardholder( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Cardholder + .DEFERRED_BILLING + ) + .pan( + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Pan + .AUTO_ENTRY + ) + .pinEntered(true) + .build() + ) + .terminal( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .builder() + .attended(true) + .cardRetentionCapable(true) + .onPremise(true) + .operator( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Operator + .ADMINISTRATIVE + ) + .partialApprovalCapable(true) + .pinCapability( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .PinCapability + .CAPABLE + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Type + .ADMINISTRATIVE + ) + .acceptorTerminalId(" r 0K9tW") + .build() + ) + .build() + ) + .tokenInfo(TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build()) + .ttl(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + + val roundtrippedCardAuthorizationApprovalRequestWebhookEvent = + jsonMapper.readValue( + jsonMapper.writeValueAsString(cardAuthorizationApprovalRequestWebhookEvent), + jacksonTypeRef(), + ) + + assertThat(roundtrippedCardAuthorizationApprovalRequestWebhookEvent) + .isEqualTo(cardAuthorizationApprovalRequestWebhookEvent) + } +} 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 d3858fbf0..4b0ee89a9 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 @@ -35,11 +35,12 @@ internal class FinancialAccountCreatedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) .build() @@ -69,14 +70,16 @@ internal class FinancialAccountCreatedWebhookEventTest { assertThat(financialAccountCreatedWebhookEvent.nickname()).contains("nickname") assertThat(financialAccountCreatedWebhookEvent.status()) .isEqualTo(FinancialAccount.FinancialAccountStatus.OPEN) + assertThat(financialAccountCreatedWebhookEvent.substatus()) + .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) assertThat(financialAccountCreatedWebhookEvent.type()) .isEqualTo(FinancialAccount.Type.ISSUING) assertThat(financialAccountCreatedWebhookEvent.updated()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(financialAccountCreatedWebhookEvent.userDefinedStatus()) + .contains("user_defined_status") assertThat(financialAccountCreatedWebhookEvent.accountNumber()).contains("account_number") assertThat(financialAccountCreatedWebhookEvent.routingNumber()).contains("routing_number") - assertThat(financialAccountCreatedWebhookEvent.substatus()) - .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) assertThat(financialAccountCreatedWebhookEvent.eventType()) .isEqualTo(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) } @@ -107,11 +110,12 @@ internal class FinancialAccountCreatedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .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 7fe594e4e..d145b6c5c 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 @@ -37,13 +37,14 @@ internal class FinancialAccountListPageResponseTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus( + FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT + ) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus( - FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT - ) .build() ) .hasMore(true) @@ -73,11 +74,12 @@ internal class FinancialAccountListPageResponseTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .build() ) assertThat(financialAccountListPageResponse.hasMore()).isEqualTo(true) @@ -111,13 +113,14 @@ internal class FinancialAccountListPageResponseTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus( + FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT + ) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus( - FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT - ) .build() ) .hasMore(true) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponseTest.kt index 8ec282ffc..ce9411dc6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountLoanTapeListPageResponseTest.kt @@ -134,7 +134,32 @@ internal class FinancialAccountLoanTapeListPageResponseTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -297,7 +322,32 @@ internal class FinancialAccountLoanTapeListPageResponseTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -464,7 +514,32 @@ internal class FinancialAccountLoanTapeListPageResponseTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() 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 ce3627a73..98eb1f5ac 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 @@ -35,11 +35,12 @@ internal class FinancialAccountTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .build() assertThat(financialAccount.token()).isEqualTo("b68b7424-aa69-4cbc-a946-30d90181b621") @@ -66,13 +67,14 @@ internal class FinancialAccountTest { assertThat(financialAccount.nickname()).contains("nickname") assertThat(financialAccount.status()) .isEqualTo(FinancialAccount.FinancialAccountStatus.OPEN) + assertThat(financialAccount.substatus()) + .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) assertThat(financialAccount.type()).isEqualTo(FinancialAccount.Type.ISSUING) assertThat(financialAccount.updated()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(financialAccount.userDefinedStatus()).contains("user_defined_status") assertThat(financialAccount.accountNumber()).contains("account_number") assertThat(financialAccount.routingNumber()).contains("routing_number") - assertThat(financialAccount.substatus()) - .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) } @Test @@ -101,11 +103,12 @@ internal class FinancialAccountTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .build() val roundtrippedFinancialAccount = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParamsTest.kt index e4976efcb..7cd394d42 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountUpdateStatusParamsTest.kt @@ -15,6 +15,7 @@ internal class FinancialAccountUpdateStatusParamsTest { .substatus( FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus.END_USER_REQUEST ) + .userDefinedStatus("26") .build() } @@ -37,6 +38,30 @@ internal class FinancialAccountUpdateStatusParamsTest { @Test fun body() { + val params = + FinancialAccountUpdateStatusParams.builder() + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .status(FinancialAccountUpdateStatusParams.FinancialAccountStatus.CLOSED) + .substatus( + FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus + .END_USER_REQUEST + ) + .userDefinedStatus("26") + .build() + + val body = params._body() + + assertThat(body.status()) + .isEqualTo(FinancialAccountUpdateStatusParams.FinancialAccountStatus.CLOSED) + assertThat(body.substatus()) + .contains( + FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus.END_USER_REQUEST + ) + assertThat(body.userDefinedStatus()).contains("26") + } + + @Test + fun bodyWithoutOptionalFields() { val params = FinancialAccountUpdateStatusParams.builder() .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 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 8f12e1fdd..79e2cac6d 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 @@ -35,11 +35,12 @@ internal class FinancialAccountUpdatedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() @@ -69,14 +70,16 @@ internal class FinancialAccountUpdatedWebhookEventTest { assertThat(financialAccountUpdatedWebhookEvent.nickname()).contains("nickname") assertThat(financialAccountUpdatedWebhookEvent.status()) .isEqualTo(FinancialAccount.FinancialAccountStatus.OPEN) + assertThat(financialAccountUpdatedWebhookEvent.substatus()) + .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) assertThat(financialAccountUpdatedWebhookEvent.type()) .isEqualTo(FinancialAccount.Type.ISSUING) assertThat(financialAccountUpdatedWebhookEvent.updated()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(financialAccountUpdatedWebhookEvent.userDefinedStatus()) + .contains("user_defined_status") assertThat(financialAccountUpdatedWebhookEvent.accountNumber()).contains("account_number") assertThat(financialAccountUpdatedWebhookEvent.routingNumber()).contains("routing_number") - assertThat(financialAccountUpdatedWebhookEvent.substatus()) - .contains(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) assertThat(financialAccountUpdatedWebhookEvent.eventType()) .isEqualTo(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) } @@ -107,11 +110,12 @@ internal class FinancialAccountUpdatedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEventTest.kt index 8c4711e32..82ea19ac6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeCreatedWebhookEventTest.kt @@ -114,7 +114,32 @@ internal class LoanTapeCreatedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -258,7 +283,34 @@ internal class LoanTapeCreatedWebhookEventTest { assertThat(loanTapeCreatedWebhookEvent.minimumPaymentBalance()) .isEqualTo(LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build()) assertThat(loanTapeCreatedWebhookEvent.paymentAllocation()) - .isEqualTo(CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build()) + .isEqualTo( + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() + ) assertThat(loanTapeCreatedWebhookEvent.periodTotals()) .isEqualTo( StatementTotals.builder() @@ -405,7 +457,32 @@ internal class LoanTapeCreatedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeTest.kt index 77f5be2f4..55aefc079 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeTest.kt @@ -114,7 +114,32 @@ internal class LoanTapeTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -255,7 +280,34 @@ internal class LoanTapeTest { assertThat(loanTape.minimumPaymentBalance()) .isEqualTo(LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build()) assertThat(loanTape.paymentAllocation()) - .isEqualTo(CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build()) + .isEqualTo( + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() + ) assertThat(loanTape.periodTotals()) .isEqualTo( StatementTotals.builder() @@ -399,7 +451,32 @@ internal class LoanTapeTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEventTest.kt index 957437d7a..b9c6a5839 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEventTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LoanTapeUpdatedWebhookEventTest.kt @@ -114,7 +114,32 @@ internal class LoanTapeUpdatedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -258,7 +283,34 @@ internal class LoanTapeUpdatedWebhookEventTest { assertThat(loanTapeUpdatedWebhookEvent.minimumPaymentBalance()) .isEqualTo(LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build()) assertThat(loanTapeUpdatedWebhookEvent.paymentAllocation()) - .isEqualTo(CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build()) + .isEqualTo( + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() + ) assertThat(loanTapeUpdatedWebhookEvent.periodTotals()) .isEqualTo( StatementTotals.builder() @@ -405,7 +457,32 @@ internal class LoanTapeUpdatedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() 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 f12d52b27..88c470259 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 @@ -43,7 +43,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -93,7 +93,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -230,7 +230,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -280,7 +280,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -435,7 +435,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -485,7 +485,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -560,7 +560,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).contains(legacyPayload) assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -610,7 +610,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -667,7 +667,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.accountHolderVerification()) .contains(accountHolderVerification) assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -717,7 +717,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -793,7 +793,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()) .contains(accountHolderDocumentUpdated) - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -843,7 +843,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -898,37 +898,51 @@ internal class ParsedWebhookEventTest { } @Test - fun ofAsaRequest() { - val asaRequest = - AsaRequestWebhookEvent.builder() + fun ofCardAuthorizationApprovalRequest() { + val cardAuthorizationApprovalRequest = + CardAuthorizationApprovalRequestWebhookEvent.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .acquirerFee(0L) .amount(0L) .authorizationAmount(0L) .avs( - AsaRequestWebhookEvent.Avs.builder() + CardAuthorizationApprovalRequestWebhookEvent.Avs.builder() .address("address") - .addressOnFileMatch(AsaRequestWebhookEvent.Avs.AddressMatchResult.MATCH) + .addressOnFileMatch( + CardAuthorizationApprovalRequestWebhookEvent.Avs.AddressMatchResult + .MATCH + ) .zipcode("zipcode") .build() ) .card( - AsaRequestWebhookEvent.AsaRequestCard.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) .spendLimitDuration( - AsaRequestWebhookEvent.AsaRequestCard.SpendLimitDuration.ANNUALLY + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard + .SpendLimitDuration + .ANNUALLY + ) + .state( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.State.CLOSED + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.CardType + .SINGLE_USE ) - .state(AsaRequestWebhookEvent.AsaRequestCard.State.CLOSED) - .type(AsaRequestWebhookEvent.AsaRequestCard.CardType.SINGLE_USE) .build() ) .cardholderCurrency("cardholder_currency") .cashAmount(0L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .eventType( + CardAuthorizationApprovalRequestWebhookEvent.EventType + .CARD_AUTHORIZATION_APPROVAL_REQUEST + ) .merchant( Merchant.builder() .acceptorId("333301802529120") @@ -943,9 +957,11 @@ internal class ParsedWebhookEventTest { .merchantAmount(0L) .merchantCurrency("USD") .settledAmount(0L) - .status(AsaRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) - .transactionInitiator(AsaRequestWebhookEvent.TransactionInitiator.CARDHOLDER) - .accountType(AsaRequestWebhookEvent.AccountType.CHECKING) + .status(CardAuthorizationApprovalRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) + .transactionInitiator( + CardAuthorizationApprovalRequestWebhookEvent.TransactionInitiator.CARDHOLDER + ) + .accountType(CardAuthorizationApprovalRequestWebhookEvent.AccountType.CHECKING) .cardholderAuthentication( CardholderAuthentication.builder() .authenticationMethod( @@ -961,12 +977,15 @@ internal class ParsedWebhookEventTest { .conversionRate(0.0) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fleetInfo( - AsaRequestWebhookEvent.AsaRequestFleetInfo.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo.builder() .fleetPromptCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetPromptCode.NO_PROMPT + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetPromptCode + .NO_PROMPT ) .fleetRestrictionCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetRestrictionCode + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetRestrictionCode .NO_RESTRICTIONS ) .driverNumber("driver_number") @@ -974,23 +993,27 @@ internal class ParsedWebhookEventTest { .build() ) .latestChallenge( - AsaRequestWebhookEvent.LatestChallenge.builder() + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.builder() .phoneNumber("phone_number") - .status(AsaRequestWebhookEvent.LatestChallenge.Status.COMPLETED) + .status( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.Status + .COMPLETED + ) .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .network(AsaRequestWebhookEvent.Network.AMEX) + .network(CardAuthorizationApprovalRequestWebhookEvent.Network.AMEX) .networkRiskScore(0L) .networkSpecificData( - AsaRequestWebhookEvent.AsaNetworkSpecificData.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData.builder() .mastercard( - AsaRequestWebhookEvent.AsaNetworkSpecificData + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData .AsaNetworkSpecificDataMastercard .builder() .ecommerceSecurityLevelIndicator("xxx") .addOnBehalfServiceResult( - AsaRequestWebhookEvent.AsaNetworkSpecificData + CardAuthorizationApprovalRequestWebhookEvent + .AsaNetworkSpecificData .AsaNetworkSpecificDataMastercard .OnBehalfServiceResult .builder() @@ -1003,7 +1026,8 @@ internal class ParsedWebhookEventTest { .build() ) .visa( - AsaRequestWebhookEvent.AsaNetworkSpecificData.AsaNetworkSpecificDataVisa + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .AsaNetworkSpecificDataVisa .builder() .businessApplicationIdentifier("xx") .build() @@ -1011,36 +1035,53 @@ internal class ParsedWebhookEventTest { .build() ) .pos( - AsaRequestWebhookEvent.Pos.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos.builder() .entryMode( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaRequestPosEntryMode + .builder() .card( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Card.PRESENT + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Card + .PRESENT ) .cardholder( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Cardholder + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Cardholder .DEFERRED_BILLING ) .pan( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Pan.AUTO_ENTRY + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Pan + .AUTO_ENTRY ) .pinEntered(true) .build() ) .terminal( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .builder() .attended(true) .cardRetentionCapable(true) .onPremise(true) .operator( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Operator + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Operator .ADMINISTRATIVE ) .partialApprovalCapable(true) .pinCapability( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.PinCapability.CAPABLE + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .PinCapability + .CAPABLE + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .Type + .ADMINISTRATIVE ) - .type(AsaRequestWebhookEvent.Pos.AsaPosTerminal.Type.ADMINISTRATIVE) .acceptorTerminalId(" r 0K9tW") .build() ) @@ -1050,7 +1091,8 @@ internal class ParsedWebhookEventTest { .ttl(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - val parsedWebhookEvent = ParsedWebhookEvent.ofAsaRequest(asaRequest) + val parsedWebhookEvent = + ParsedWebhookEvent.ofCardAuthorizationApprovalRequest(cardAuthorizationApprovalRequest) assertThat(parsedWebhookEvent.accountHolderCreated()).isEmpty assertThat(parsedWebhookEvent.kybPayload()).isEmpty @@ -1058,7 +1100,8 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).contains(asaRequest) + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()) + .contains(cardAuthorizationApprovalRequest) assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -1108,45 +1151,60 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @Test - fun ofAsaRequestRoundtrip() { + fun ofCardAuthorizationApprovalRequestRoundtrip() { val jsonMapper = jsonMapper() val parsedWebhookEvent = - ParsedWebhookEvent.ofAsaRequest( - AsaRequestWebhookEvent.builder() + ParsedWebhookEvent.ofCardAuthorizationApprovalRequest( + CardAuthorizationApprovalRequestWebhookEvent.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .acquirerFee(0L) .amount(0L) .authorizationAmount(0L) .avs( - AsaRequestWebhookEvent.Avs.builder() + CardAuthorizationApprovalRequestWebhookEvent.Avs.builder() .address("address") - .addressOnFileMatch(AsaRequestWebhookEvent.Avs.AddressMatchResult.MATCH) + .addressOnFileMatch( + CardAuthorizationApprovalRequestWebhookEvent.Avs.AddressMatchResult + .MATCH + ) .zipcode("zipcode") .build() ) .card( - AsaRequestWebhookEvent.AsaRequestCard.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hostname("hostname") .lastFour("last_four") .memo("memo") .spendLimit(0L) .spendLimitDuration( - AsaRequestWebhookEvent.AsaRequestCard.SpendLimitDuration.ANNUALLY + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard + .SpendLimitDuration + .ANNUALLY + ) + .state( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.State + .CLOSED + ) + .type( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestCard.CardType + .SINGLE_USE ) - .state(AsaRequestWebhookEvent.AsaRequestCard.State.CLOSED) - .type(AsaRequestWebhookEvent.AsaRequestCard.CardType.SINGLE_USE) .build() ) .cardholderCurrency("cardholder_currency") .cashAmount(0L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .eventType( + CardAuthorizationApprovalRequestWebhookEvent.EventType + .CARD_AUTHORIZATION_APPROVAL_REQUEST + ) .merchant( Merchant.builder() .acceptorId("333301802529120") @@ -1161,9 +1219,13 @@ internal class ParsedWebhookEventTest { .merchantAmount(0L) .merchantCurrency("USD") .settledAmount(0L) - .status(AsaRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION) - .transactionInitiator(AsaRequestWebhookEvent.TransactionInitiator.CARDHOLDER) - .accountType(AsaRequestWebhookEvent.AccountType.CHECKING) + .status( + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestStatus.AUTHORIZATION + ) + .transactionInitiator( + CardAuthorizationApprovalRequestWebhookEvent.TransactionInitiator.CARDHOLDER + ) + .accountType(CardAuthorizationApprovalRequestWebhookEvent.AccountType.CHECKING) .cardholderAuthentication( CardholderAuthentication.builder() .authenticationMethod( @@ -1183,12 +1245,15 @@ internal class ParsedWebhookEventTest { .conversionRate(0.0) .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fleetInfo( - AsaRequestWebhookEvent.AsaRequestFleetInfo.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo.builder() .fleetPromptCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetPromptCode.NO_PROMPT + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetPromptCode + .NO_PROMPT ) .fleetRestrictionCode( - AsaRequestWebhookEvent.AsaRequestFleetInfo.FleetRestrictionCode + CardAuthorizationApprovalRequestWebhookEvent.AsaRequestFleetInfo + .FleetRestrictionCode .NO_RESTRICTIONS ) .driverNumber("driver_number") @@ -1196,23 +1261,28 @@ internal class ParsedWebhookEventTest { .build() ) .latestChallenge( - AsaRequestWebhookEvent.LatestChallenge.builder() + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.builder() .phoneNumber("phone_number") - .status(AsaRequestWebhookEvent.LatestChallenge.Status.COMPLETED) + .status( + CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge.Status + .COMPLETED + ) .completedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .network(AsaRequestWebhookEvent.Network.AMEX) + .network(CardAuthorizationApprovalRequestWebhookEvent.Network.AMEX) .networkRiskScore(0L) .networkSpecificData( - AsaRequestWebhookEvent.AsaNetworkSpecificData.builder() + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData + .builder() .mastercard( - AsaRequestWebhookEvent.AsaNetworkSpecificData + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData .AsaNetworkSpecificDataMastercard .builder() .ecommerceSecurityLevelIndicator("xxx") .addOnBehalfServiceResult( - AsaRequestWebhookEvent.AsaNetworkSpecificData + CardAuthorizationApprovalRequestWebhookEvent + .AsaNetworkSpecificData .AsaNetworkSpecificDataMastercard .OnBehalfServiceResult .builder() @@ -1225,7 +1295,7 @@ internal class ParsedWebhookEventTest { .build() ) .visa( - AsaRequestWebhookEvent.AsaNetworkSpecificData + CardAuthorizationApprovalRequestWebhookEvent.AsaNetworkSpecificData .AsaNetworkSpecificDataVisa .builder() .businessApplicationIdentifier("xx") @@ -1234,40 +1304,55 @@ internal class ParsedWebhookEventTest { .build() ) .pos( - AsaRequestWebhookEvent.Pos.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos.builder() .entryMode( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .builder() .card( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Card + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Card .PRESENT ) .cardholder( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Cardholder + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Cardholder .DEFERRED_BILLING ) .pan( - AsaRequestWebhookEvent.Pos.AsaRequestPosEntryMode.Pan + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaRequestPosEntryMode + .Pan .AUTO_ENTRY ) .pinEntered(true) .build() ) .terminal( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.builder() + CardAuthorizationApprovalRequestWebhookEvent.Pos.AsaPosTerminal + .builder() .attended(true) .cardRetentionCapable(true) .onPremise(true) .operator( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Operator + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaPosTerminal + .Operator .ADMINISTRATIVE ) .partialApprovalCapable(true) .pinCapability( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.PinCapability + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaPosTerminal + .PinCapability .CAPABLE ) .type( - AsaRequestWebhookEvent.Pos.AsaPosTerminal.Type + CardAuthorizationApprovalRequestWebhookEvent.Pos + .AsaPosTerminal + .Type .ADMINISTRATIVE ) .acceptorTerminalId(" r 0K9tW") @@ -1359,7 +1444,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()) .contains(tokenizationDecisioningRequest) assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty @@ -1410,7 +1495,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -1557,7 +1642,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()) .contains(authRulesBacktestReportCreated) @@ -1608,7 +1693,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -1712,7 +1797,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).contains(balanceUpdated) @@ -1762,7 +1847,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -1864,7 +1949,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -1915,7 +2000,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2051,7 +2136,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2102,7 +2187,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2191,7 +2276,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2241,7 +2326,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2283,7 +2368,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2333,7 +2418,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2378,7 +2463,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2428,7 +2513,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2473,7 +2558,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2523,7 +2608,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2569,7 +2654,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2619,7 +2704,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -2875,7 +2960,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -2925,7 +3010,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -3246,7 +3331,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -3297,7 +3382,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -3450,7 +3535,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -3501,7 +3586,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -3678,7 +3763,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -3729,7 +3814,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -3885,7 +3970,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -3936,7 +4021,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4036,7 +4121,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4086,7 +4171,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4169,7 +4254,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4219,7 +4304,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4327,7 +4412,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4378,7 +4463,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4483,7 +4568,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4533,7 +4618,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4600,7 +4685,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4651,7 +4736,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4734,7 +4819,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4785,7 +4870,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -4892,7 +4977,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -4943,7 +5028,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5046,7 +5131,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5096,7 +5181,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5197,7 +5282,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5247,7 +5332,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5328,11 +5413,12 @@ internal class ParsedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType(FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED) .build() @@ -5345,7 +5431,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5395,7 +5481,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5427,11 +5513,12 @@ internal class ParsedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType( FinancialAccountCreatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_CREATED ) @@ -5472,11 +5559,12 @@ internal class ParsedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType(FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED) .build() @@ -5489,7 +5577,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5539,7 +5627,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5571,11 +5659,12 @@ internal class ParsedWebhookEventTest { .isForBenefitOf(true) .nickname("nickname") .status(FinancialAccount.FinancialAccountStatus.OPEN) + .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .type(FinancialAccount.Type.ISSUING) .updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userDefinedStatus("user_defined_status") .accountNumber("account_number") .routingNumber("routing_number") - .substatus(FinancialAccount.FinancialAccountSubstatus.CHARGED_OFF_DELINQUENT) .eventType( FinancialAccountUpdatedWebhookEvent.EventType.FINANCIAL_ACCOUNT_UPDATED ) @@ -5619,7 +5708,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5669,7 +5758,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -5808,7 +5897,32 @@ internal class ParsedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -5858,7 +5972,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -5908,7 +6022,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -6035,7 +6149,32 @@ internal class ParsedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -6189,7 +6328,32 @@ internal class ParsedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -6239,7 +6403,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -6289,7 +6453,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -6416,7 +6580,32 @@ internal class ParsedWebhookEventTest { LoanTape.BalanceDetails.builder().amount(0L).remaining(0L).build() ) .paymentAllocation( - CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() + LoanTape.PaymentAllocation.builder() + .feeDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .fees(0L) + .interest(0L) + .interestDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .principal(0L) + .principalDetails( + CategoryDetails.builder() + .balanceTransfers("balance_transfers") + .cashAdvances("cash_advances") + .purchases("purchases") + .build() + ) + .build() ) .periodTotals( StatementTotals.builder() @@ -6537,7 +6726,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -6588,7 +6777,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -6738,7 +6927,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -6789,7 +6978,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -6909,7 +7098,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -6960,7 +7149,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7050,7 +7239,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7101,7 +7290,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7186,7 +7375,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7236,7 +7425,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7313,7 +7502,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7363,7 +7552,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7423,6 +7612,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -7433,6 +7623,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -7481,7 +7672,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7532,7 +7723,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7556,6 +7747,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -7566,6 +7758,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -7632,6 +7825,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -7642,6 +7836,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -7690,7 +7885,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7741,7 +7936,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -7765,6 +7960,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -7775,6 +7971,7 @@ internal class ParsedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -7862,7 +8059,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -7912,7 +8109,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -8087,7 +8284,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -8137,7 +8334,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -8426,7 +8623,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -8477,7 +8674,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -8799,7 +8996,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -8850,7 +9047,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -9201,7 +9398,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -9252,7 +9449,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -9534,7 +9731,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -9585,7 +9782,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -9731,7 +9928,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -9781,7 +9978,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -9872,7 +10069,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -9923,7 +10120,7 @@ internal class ParsedWebhookEventTest { .contains(tokenizationTwoFactorAuthenticationCode) assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -10002,7 +10199,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -10053,7 +10250,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()) .contains(tokenizationTwoFactorAuthenticationCodeSent) assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -10155,7 +10352,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -10205,7 +10402,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).contains(tokenizationUpdated) - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @@ -10275,9 +10472,9 @@ internal class ParsedWebhookEventTest { } @Test - fun ofThreeDSAuthentication() { - val threeDSAuthentication = - ThreeDSAuthentication.builder() + fun ofThreeDSAuthenticationApprovalRequest() { + val threeDSAuthenticationApprovalRequest = + ThreeDSAuthenticationApprovalRequestWebhookEvent.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountType(ThreeDSAuthentication.AccountType.CREDIT) .authenticationResult(ThreeDSAuthentication.AuthenticationResult.DECLINE) @@ -10412,9 +10609,16 @@ internal class ParsedWebhookEventTest { .type(ThreeDSAuthentication.Transaction.Type.ACCOUNT_FUNDING) .build() ) + .eventType( + ThreeDSAuthenticationApprovalRequestWebhookEvent.EventType + .THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + ) .build() - val parsedWebhookEvent = ParsedWebhookEvent.ofThreeDSAuthentication(threeDSAuthentication) + val parsedWebhookEvent = + ParsedWebhookEvent.ofThreeDSAuthenticationApprovalRequest( + threeDSAuthenticationApprovalRequest + ) assertThat(parsedWebhookEvent.accountHolderCreated()).isEmpty assertThat(parsedWebhookEvent.kybPayload()).isEmpty @@ -10422,7 +10626,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -10472,17 +10676,18 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).contains(threeDSAuthentication) + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()) + .contains(threeDSAuthenticationApprovalRequest) assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty } @Test - fun ofThreeDSAuthenticationRoundtrip() { + fun ofThreeDSAuthenticationApprovalRequestRoundtrip() { val jsonMapper = jsonMapper() val parsedWebhookEvent = - ParsedWebhookEvent.ofThreeDSAuthentication( - ThreeDSAuthentication.builder() + ParsedWebhookEvent.ofThreeDSAuthenticationApprovalRequest( + ThreeDSAuthenticationApprovalRequestWebhookEvent.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountType(ThreeDSAuthentication.AccountType.CREDIT) .authenticationResult(ThreeDSAuthentication.AuthenticationResult.DECLINE) @@ -10625,6 +10830,10 @@ internal class ParsedWebhookEventTest { .type(ThreeDSAuthentication.Transaction.Type.ACCOUNT_FUNDING) .build() ) + .eventType( + ThreeDSAuthenticationApprovalRequestWebhookEvent.EventType + .THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + ) .build() ) @@ -10709,7 +10918,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -10759,7 +10968,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()) .contains(disputeTransactionCreated) assertThat(parsedWebhookEvent.disputeTransactionUpdated()).isEmpty @@ -10914,7 +11123,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.legacyPayload()).isEmpty assertThat(parsedWebhookEvent.accountHolderVerification()).isEmpty assertThat(parsedWebhookEvent.accountHolderDocumentUpdated()).isEmpty - assertThat(parsedWebhookEvent.asaRequest()).isEmpty + assertThat(parsedWebhookEvent.cardAuthorizationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.tokenizationDecisioningRequest()).isEmpty assertThat(parsedWebhookEvent.authRulesBacktestReportCreated()).isEmpty assertThat(parsedWebhookEvent.balanceUpdated()).isEmpty @@ -10964,7 +11173,7 @@ internal class ParsedWebhookEventTest { assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCode()).isEmpty assertThat(parsedWebhookEvent.tokenizationTwoFactorAuthenticationCodeSent()).isEmpty assertThat(parsedWebhookEvent.tokenizationUpdated()).isEmpty - assertThat(parsedWebhookEvent.threeDSAuthentication()).isEmpty + assertThat(parsedWebhookEvent.threeDSAuthenticationApprovalRequest()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionCreated()).isEmpty assertThat(parsedWebhookEvent.disputeTransactionUpdated()) .contains(disputeTransactionUpdated) 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 ea472e8e1..038896650 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 @@ -27,6 +27,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -37,6 +38,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -102,6 +104,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), Payment.PaymentEvent.builder() .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") @@ -110,6 +113,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), ) assertThat(paymentCreateResponse.family()).isEqualTo(Payment.Family.PAYMENT) @@ -186,6 +190,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -196,6 +201,7 @@ internal class PaymentCreateResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 45d44caae..f57e706d0 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 @@ -31,6 +31,7 @@ internal class PaymentListPageResponseTest { Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED ) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -43,6 +44,7 @@ internal class PaymentListPageResponseTest { Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED ) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -98,6 +100,7 @@ internal class PaymentListPageResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -108,6 +111,7 @@ internal class PaymentListPageResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -169,6 +173,7 @@ internal class PaymentListPageResponseTest { Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED ) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -181,6 +186,7 @@ internal class PaymentListPageResponseTest { Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED ) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 e403de9cd..dd82b0895 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 @@ -27,6 +27,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -37,6 +38,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -102,6 +104,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), Payment.PaymentEvent.builder() .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") @@ -110,6 +113,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), ) assertThat(paymentRetryResponse.family()).isEqualTo(Payment.Family.PAYMENT) @@ -186,6 +190,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -196,6 +201,7 @@ internal class PaymentRetryResponseTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 52406be1f..8eccd4416 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 @@ -27,6 +27,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -37,6 +38,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -87,6 +89,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), Payment.PaymentEvent.builder() .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") @@ -95,6 +98,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), ) assertThat(payment.family()).isEqualTo(Payment.Family.PAYMENT) @@ -155,6 +159,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -165,6 +170,7 @@ internal class PaymentTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 22e21ef28..b3bbccc89 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 @@ -27,6 +27,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -37,6 +38,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -95,6 +97,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), Payment.PaymentEvent.builder() .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") @@ -103,6 +106,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), ) assertThat(paymentTransactionCreatedWebhookEvent.family()).isEqualTo(Payment.Family.PAYMENT) @@ -170,6 +174,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -180,6 +185,7 @@ internal class PaymentTransactionCreatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) 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 cce65d851..7ab43cdef 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 @@ -27,6 +27,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -37,6 +38,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) @@ -95,6 +97,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), Payment.PaymentEvent.builder() .token("f9165477-7cfc-53c6-98f1-84e9ec856a60") @@ -103,6 +106,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build(), ) assertThat(paymentTransactionUpdatedWebhookEvent.family()).isEqualTo(Payment.Family.PAYMENT) @@ -170,6 +174,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .addEvent( @@ -180,6 +185,7 @@ internal class PaymentTransactionUpdatedWebhookEventTest { .result(Payment.PaymentEvent.Result.APPROVED) .type(Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED) .addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED) + .externalId("external_id") .build() ) .family(Payment.Family.PAYMENT) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt new file mode 100644 index 000000000..1fb4a8418 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationApprovalRequestWebhookEventTest.kt @@ -0,0 +1,467 @@ +// 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 ThreeDSAuthenticationApprovalRequestWebhookEventTest { + + @Test + fun create() { + val threeDSAuthenticationApprovalRequestWebhookEvent = + ThreeDSAuthenticationApprovalRequestWebhookEvent.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountType(ThreeDSAuthentication.AccountType.CREDIT) + .authenticationResult(ThreeDSAuthentication.AuthenticationResult.DECLINE) + .cardExpiryCheck(ThreeDSAuthentication.CardExpiryCheck.MATCH) + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardholder( + ThreeDSAuthentication.Cardholder.builder() + .addressMatch(true) + .addressOnFileMatch( + ThreeDSAuthentication.Cardholder.AddressMatchResult.MATCH + ) + .billingAddress( + ThreeDSAuthentication.Cardholder.BillingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .email("x") + .name("x") + .phoneNumberHome("x") + .phoneNumberMobile("x") + .phoneNumberWork("x") + .shippingAddress( + ThreeDSAuthentication.Cardholder.ShippingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .build() + ) + .channel(ThreeDSAuthentication.Channel.APP_BASED) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .merchant( + ThreeDSAuthentication.Merchant.builder() + .riskIndicator( + ThreeDSAuthentication.Merchant.RiskIndicator.builder() + .deliveryEmailAddress("delivery_email_address") + .deliveryTimeFrame( + ThreeDSAuthentication.Merchant.RiskIndicator.DeliveryTimeFrame + .ELECTRONIC_DELIVERY + ) + .giftCardAmount(0L) + .giftCardCount(0L) + .giftCardCurrency("xxx") + .orderAvailability( + ThreeDSAuthentication.Merchant.RiskIndicator.OrderAvailability + .FUTURE_AVAILABILITY + ) + .preOrderAvailableDate( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .reorderItems( + ThreeDSAuthentication.Merchant.RiskIndicator.ReorderItems + .FIRST_TIME_ORDERED + ) + .shippingMethod( + ThreeDSAuthentication.Merchant.RiskIndicator.ShippingMethod + .DIGITAL_GOODS + ) + .build() + ) + .id("id") + .country("xxx") + .mcc("xxxx") + .name("name") + .build() + ) + .messageCategory(ThreeDSAuthentication.MessageCategory.NON_PAYMENT_AUTHENTICATION) + .threeDSRequestorChallengeIndicator( + ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator.NO_PREFERENCE + ) + .additionalData( + ThreeDSAuthentication.AdditionalData.builder() + .networkDecision( + ThreeDSAuthentication.AdditionalData.NetworkDecision.LOW_RISK + ) + .networkRiskScore(0L) + .build() + ) + .app( + ThreeDSAuthentication.App.builder() + .device("device") + .deviceInfo("device_info") + .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") + .build() + ) + .authenticationRequestType(ThreeDSAuthentication.AuthenticationRequestType.ADD_CARD) + .browser( + ThreeDSAuthentication.Browser.builder() + .acceptHeader("accept_header") + .ip("ip") + .javaEnabled(true) + .javascriptEnabled(true) + .language("language") + .timeZone("time_zone") + .userAgent("user_agent") + .build() + ) + .challengeMetadata( + ThreeDSAuthentication.ChallengeMetadata.builder() + .methodType(ThreeDSAuthentication.ChallengeMetadata.MethodType.SMS_OTP) + .status(ThreeDSAuthentication.ChallengeMetadata.Status.SUCCESS) + .phoneNumber("phone_number") + .build() + ) + .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) + .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) + .transaction( + ThreeDSAuthentication.Transaction.builder() + .amount(0.0) + .cardholderAmount(0.0) + .currency("xxx") + .currencyExponent(0.0) + .dateTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .type(ThreeDSAuthentication.Transaction.Type.ACCOUNT_FUNDING) + .build() + ) + .eventType( + ThreeDSAuthenticationApprovalRequestWebhookEvent.EventType + .THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + ) + .build() + + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.token()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.accountType()) + .contains(ThreeDSAuthentication.AccountType.CREDIT) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.authenticationResult()) + .isEqualTo(ThreeDSAuthentication.AuthenticationResult.DECLINE) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.cardExpiryCheck()) + .isEqualTo(ThreeDSAuthentication.CardExpiryCheck.MATCH) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.cardToken()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.cardholder()) + .isEqualTo( + ThreeDSAuthentication.Cardholder.builder() + .addressMatch(true) + .addressOnFileMatch(ThreeDSAuthentication.Cardholder.AddressMatchResult.MATCH) + .billingAddress( + ThreeDSAuthentication.Cardholder.BillingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .email("x") + .name("x") + .phoneNumberHome("x") + .phoneNumberMobile("x") + .phoneNumberWork("x") + .shippingAddress( + ThreeDSAuthentication.Cardholder.ShippingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.channel()) + .isEqualTo(ThreeDSAuthentication.Channel.APP_BASED) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.created()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.merchant()) + .isEqualTo( + ThreeDSAuthentication.Merchant.builder() + .riskIndicator( + ThreeDSAuthentication.Merchant.RiskIndicator.builder() + .deliveryEmailAddress("delivery_email_address") + .deliveryTimeFrame( + ThreeDSAuthentication.Merchant.RiskIndicator.DeliveryTimeFrame + .ELECTRONIC_DELIVERY + ) + .giftCardAmount(0L) + .giftCardCount(0L) + .giftCardCurrency("xxx") + .orderAvailability( + ThreeDSAuthentication.Merchant.RiskIndicator.OrderAvailability + .FUTURE_AVAILABILITY + ) + .preOrderAvailableDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .reorderItems( + ThreeDSAuthentication.Merchant.RiskIndicator.ReorderItems + .FIRST_TIME_ORDERED + ) + .shippingMethod( + ThreeDSAuthentication.Merchant.RiskIndicator.ShippingMethod + .DIGITAL_GOODS + ) + .build() + ) + .id("id") + .country("xxx") + .mcc("xxxx") + .name("name") + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.messageCategory()) + .isEqualTo(ThreeDSAuthentication.MessageCategory.NON_PAYMENT_AUTHENTICATION) + assertThat( + threeDSAuthenticationApprovalRequestWebhookEvent + .threeDSRequestorChallengeIndicator() + ) + .isEqualTo(ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator.NO_PREFERENCE) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.additionalData()) + .contains( + ThreeDSAuthentication.AdditionalData.builder() + .networkDecision(ThreeDSAuthentication.AdditionalData.NetworkDecision.LOW_RISK) + .networkRiskScore(0L) + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.app()) + .contains( + ThreeDSAuthentication.App.builder() + .device("device") + .deviceInfo("device_info") + .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.authenticationRequestType()) + .contains(ThreeDSAuthentication.AuthenticationRequestType.ADD_CARD) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.browser()) + .contains( + ThreeDSAuthentication.Browser.builder() + .acceptHeader("accept_header") + .ip("ip") + .javaEnabled(true) + .javascriptEnabled(true) + .language("language") + .timeZone("time_zone") + .userAgent("user_agent") + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.challengeMetadata()) + .contains( + ThreeDSAuthentication.ChallengeMetadata.builder() + .methodType(ThreeDSAuthentication.ChallengeMetadata.MethodType.SMS_OTP) + .status(ThreeDSAuthentication.ChallengeMetadata.Status.SUCCESS) + .phoneNumber("phone_number") + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.challengeOrchestratedBy()) + .contains(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.decisionMadeBy()) + .contains(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.threeRiRequestType()) + .contains(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.transaction()) + .contains( + ThreeDSAuthentication.Transaction.builder() + .amount(0.0) + .cardholderAmount(0.0) + .currency("xxx") + .currencyExponent(0.0) + .dateTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .type(ThreeDSAuthentication.Transaction.Type.ACCOUNT_FUNDING) + .build() + ) + assertThat(threeDSAuthenticationApprovalRequestWebhookEvent.eventType()) + .isEqualTo( + ThreeDSAuthenticationApprovalRequestWebhookEvent.EventType + .THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val threeDSAuthenticationApprovalRequestWebhookEvent = + ThreeDSAuthenticationApprovalRequestWebhookEvent.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountType(ThreeDSAuthentication.AccountType.CREDIT) + .authenticationResult(ThreeDSAuthentication.AuthenticationResult.DECLINE) + .cardExpiryCheck(ThreeDSAuthentication.CardExpiryCheck.MATCH) + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardholder( + ThreeDSAuthentication.Cardholder.builder() + .addressMatch(true) + .addressOnFileMatch( + ThreeDSAuthentication.Cardholder.AddressMatchResult.MATCH + ) + .billingAddress( + ThreeDSAuthentication.Cardholder.BillingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .email("x") + .name("x") + .phoneNumberHome("x") + .phoneNumberMobile("x") + .phoneNumberWork("x") + .shippingAddress( + ThreeDSAuthentication.Cardholder.ShippingAddress.builder() + .address1("address1") + .address2("address2") + .address3("address3") + .city("city") + .country("xxx") + .postalCode("postal_code") + .build() + ) + .build() + ) + .channel(ThreeDSAuthentication.Channel.APP_BASED) + .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .merchant( + ThreeDSAuthentication.Merchant.builder() + .riskIndicator( + ThreeDSAuthentication.Merchant.RiskIndicator.builder() + .deliveryEmailAddress("delivery_email_address") + .deliveryTimeFrame( + ThreeDSAuthentication.Merchant.RiskIndicator.DeliveryTimeFrame + .ELECTRONIC_DELIVERY + ) + .giftCardAmount(0L) + .giftCardCount(0L) + .giftCardCurrency("xxx") + .orderAvailability( + ThreeDSAuthentication.Merchant.RiskIndicator.OrderAvailability + .FUTURE_AVAILABILITY + ) + .preOrderAvailableDate( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .reorderItems( + ThreeDSAuthentication.Merchant.RiskIndicator.ReorderItems + .FIRST_TIME_ORDERED + ) + .shippingMethod( + ThreeDSAuthentication.Merchant.RiskIndicator.ShippingMethod + .DIGITAL_GOODS + ) + .build() + ) + .id("id") + .country("xxx") + .mcc("xxxx") + .name("name") + .build() + ) + .messageCategory(ThreeDSAuthentication.MessageCategory.NON_PAYMENT_AUTHENTICATION) + .threeDSRequestorChallengeIndicator( + ThreeDSAuthentication.ThreeDSRequestorChallengeIndicator.NO_PREFERENCE + ) + .additionalData( + ThreeDSAuthentication.AdditionalData.builder() + .networkDecision( + ThreeDSAuthentication.AdditionalData.NetworkDecision.LOW_RISK + ) + .networkRiskScore(0L) + .build() + ) + .app( + ThreeDSAuthentication.App.builder() + .device("device") + .deviceInfo("device_info") + .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") + .build() + ) + .authenticationRequestType(ThreeDSAuthentication.AuthenticationRequestType.ADD_CARD) + .browser( + ThreeDSAuthentication.Browser.builder() + .acceptHeader("accept_header") + .ip("ip") + .javaEnabled(true) + .javascriptEnabled(true) + .language("language") + .timeZone("time_zone") + .userAgent("user_agent") + .build() + ) + .challengeMetadata( + ThreeDSAuthentication.ChallengeMetadata.builder() + .methodType(ThreeDSAuthentication.ChallengeMetadata.MethodType.SMS_OTP) + .status(ThreeDSAuthentication.ChallengeMetadata.Status.SUCCESS) + .phoneNumber("phone_number") + .build() + ) + .challengeOrchestratedBy(ThreeDSAuthentication.ChallengeOrchestratedBy.LITHIC) + .decisionMadeBy(ThreeDSAuthentication.DecisionMadeBy.LITHIC_RULES) + .threeRiRequestType(ThreeDSAuthentication.ThreeRiRequestType.ACCOUNT_VERIFICATION) + .transaction( + ThreeDSAuthentication.Transaction.builder() + .amount(0.0) + .cardholderAmount(0.0) + .currency("xxx") + .currencyExponent(0.0) + .dateTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .type(ThreeDSAuthentication.Transaction.Type.ACCOUNT_FUNDING) + .build() + ) + .eventType( + ThreeDSAuthenticationApprovalRequestWebhookEvent.EventType + .THREE_DS_AUTHENTICATION_APPROVAL_REQUEST + ) + .build() + + val roundtrippedThreeDSAuthenticationApprovalRequestWebhookEvent = + jsonMapper.readValue( + jsonMapper.writeValueAsString(threeDSAuthenticationApprovalRequestWebhookEvent), + jacksonTypeRef(), + ) + + assertThat(roundtrippedThreeDSAuthenticationApprovalRequestWebhookEvent) + .isEqualTo(threeDSAuthenticationApprovalRequestWebhookEvent) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitListParamsTest.kt new file mode 100644 index 000000000..3d6ece35f --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitListParamsTest.kt @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.core.http.QueryParams +import java.time.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class TransferLimitListParamsTest { + + @Test + fun create() { + TransferLimitListParams.builder().date(LocalDate.parse("2019-12-27")).build() + } + + @Test + fun queryParams() { + val params = TransferLimitListParams.builder().date(LocalDate.parse("2019-12-27")).build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().put("date", "2019-12-27").build()) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = TransferLimitListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitsResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitsResponseTest.kt new file mode 100644 index 000000000..2e055334a --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitsResponseTest.kt @@ -0,0 +1,241 @@ +// 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.LocalDate +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class TransferLimitsResponseTest { + + @Test + fun create() { + val transferLimitsResponse = + TransferLimitsResponse.builder() + .addData( + TransferLimitsResponse.TransferLimitItem.builder() + .companyId("company_id") + .dailyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .date(LocalDate.parse("2019-12-27")) + .isFbo(true) + .monthlyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .programLimitPerTransaction( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .build() + ) + .hasMore(true) + .build() + + assertThat(transferLimitsResponse.data()) + .containsExactly( + TransferLimitsResponse.TransferLimitItem.builder() + .companyId("company_id") + .dailyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .date(LocalDate.parse("2019-12-27")) + .isFbo(true) + .monthlyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .programLimitPerTransaction( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .build() + ) + assertThat(transferLimitsResponse.hasMore()).isEqualTo(true) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val transferLimitsResponse = + TransferLimitsResponse.builder() + .addData( + TransferLimitsResponse.TransferLimitItem.builder() + .companyId("company_id") + .dailyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .date(LocalDate.parse("2019-12-27")) + .isFbo(true) + .monthlyLimit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .programLimitPerTransaction( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits.builder() + .credit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .debit( + TransferLimitsResponse.TransferLimitItem.DirectionalLimits + .LimitWithProgress + .builder() + .limit(0L) + .amountOriginated(0L) + .build() + ) + .build() + ) + .build() + ) + .hasMore(true) + .build() + + val roundtrippedTransferLimitsResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(transferLimitsResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedTransferLimitsResponse).isEqualTo(transferLimitsResponse) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncTest.kt index eb72fefaa..0c1900ec3 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BookTransferServiceAsyncTest.kt @@ -5,6 +5,7 @@ package com.lithic.api.services.async import com.lithic.api.TestServerExtension import com.lithic.api.client.okhttp.LithicOkHttpClientAsync import com.lithic.api.models.BookTransferCreateParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -72,6 +73,27 @@ internal class BookTransferServiceAsyncTest { page.response().validate() } + @Test + fun retry() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val bookTransferServiceAsync = client.bookTransfers() + + val bookTransferResponseFuture = + bookTransferServiceAsync.retry( + BookTransferRetryParams.builder() + .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val bookTransferResponse = bookTransferResponseFuture.get() + bookTransferResponse.validate() + } + @Test fun reverse() { val client = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/FinancialAccountServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/FinancialAccountServiceAsyncTest.kt index 4e78d2bf1..3635d8fa1 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/FinancialAccountServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/FinancialAccountServiceAsyncTest.kt @@ -128,6 +128,7 @@ internal class FinancialAccountServiceAsyncTest { FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus .END_USER_REQUEST ) + .userDefinedStatus("26") .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt similarity index 77% rename from lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt rename to lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt index a0ee259c2..9e37e81a5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) -internal class AggregateBalanceServiceAsyncTest { +internal class TransferLimitServiceAsyncTest { @Test fun list() { @@ -17,9 +17,9 @@ internal class AggregateBalanceServiceAsyncTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My Lithic API Key") .build() - val aggregateBalanceServiceAsync = client.aggregateBalances() + val transferLimitServiceAsync = client.transferLimits() - val pageFuture = aggregateBalanceServiceAsync.list() + val pageFuture = transferLimitServiceAsync.list() val page = pageFuture.get() page.response().validate() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncTest.kt deleted file mode 100644 index 8f7b90bd6..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.async.cards - -import com.lithic.api.TestServerExtension -import com.lithic.api.client.okhttp.LithicOkHttpClientAsync -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith(TestServerExtension::class) -internal class AggregateBalanceServiceAsyncTest { - - @Test - fun list() { - val client = - LithicOkHttpClientAsync.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My Lithic API Key") - .build() - val aggregateBalanceServiceAsync = client.cards().aggregateBalances() - - val pageFuture = aggregateBalanceServiceAsync.list() - - val page = pageFuture.get() - page.response().validate() - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BookTransferServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BookTransferServiceTest.kt index aeaac6a81..57d19f31e 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BookTransferServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BookTransferServiceTest.kt @@ -5,6 +5,7 @@ package com.lithic.api.services.blocking import com.lithic.api.TestServerExtension import com.lithic.api.client.okhttp.LithicOkHttpClient import com.lithic.api.models.BookTransferCreateParams +import com.lithic.api.models.BookTransferRetryParams import com.lithic.api.models.BookTransferReverseParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -69,6 +70,26 @@ internal class BookTransferServiceTest { page.response().validate() } + @Test + fun retry() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val bookTransferService = client.bookTransfers() + + val bookTransferResponse = + bookTransferService.retry( + BookTransferRetryParams.builder() + .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + bookTransferResponse.validate() + } + @Test fun reverse() { val client = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/FinancialAccountServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/FinancialAccountServiceTest.kt index a4eae55f5..e67c7c0f5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/FinancialAccountServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/FinancialAccountServiceTest.kt @@ -121,6 +121,7 @@ internal class FinancialAccountServiceTest { FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus .END_USER_REQUEST ) + .userDefinedStatus("26") .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt similarity index 78% rename from lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt rename to lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt index 5edbec57e..947310a92 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) -internal class AggregateBalanceServiceTest { +internal class TransferLimitServiceTest { @Test fun list() { @@ -17,9 +17,9 @@ internal class AggregateBalanceServiceTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My Lithic API Key") .build() - val aggregateBalanceService = client.aggregateBalances() + val transferLimitService = client.transferLimits() - val page = aggregateBalanceService.list() + val page = transferLimitService.list() page.response().validate() } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceTest.kt deleted file mode 100644 index 494dd45bf..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceTest.kt +++ /dev/null @@ -1,26 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.blocking.cards - -import com.lithic.api.TestServerExtension -import com.lithic.api.client.okhttp.LithicOkHttpClient -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith(TestServerExtension::class) -internal class AggregateBalanceServiceTest { - - @Test - fun list() { - val client = - LithicOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My Lithic API Key") - .build() - val aggregateBalanceService = client.cards().aggregateBalances() - - val page = aggregateBalanceService.list() - - page.response().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 24dc0a8db..eabccc2a1 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 @@ -58,7 +58,6 @@ internal class ProGuardCompatibilityTest { assertThat(client.cards()).isNotNull() assertThat(client.cardBulkOrders()).isNotNull() assertThat(client.balances()).isNotNull() - assertThat(client.aggregateBalances()).isNotNull() assertThat(client.disputes()).isNotNull() assertThat(client.disputesV2()).isNotNull() assertThat(client.events()).isNotNull() @@ -81,6 +80,7 @@ internal class ProGuardCompatibilityTest { assertThat(client.fraud()).isNotNull() assertThat(client.networkPrograms()).isNotNull() assertThat(client.accountActivity()).isNotNull() + assertThat(client.transferLimits()).isNotNull() assertThat(client.webhooks()).isNotNull() }