From 5af17d0a2f9d70199ff755fffef3b5ef7f23ab41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 09:10:26 +0000 Subject: [PATCH 1/4] feat(api): remove v1/aggregate_balances and related models --- .stats.yml | 8 +- .../com/lithic/api/client/LithicClient.kt | 5 - .../lithic/api/client/LithicClientAsync.kt | 5 - .../api/client/LithicClientAsyncImpl.kt | 15 - .../com/lithic/api/client/LithicClientImpl.kt | 15 - .../com/lithic/api/models/AggregateBalance.kt | 747 ------------------ .../api/models/AggregateBalanceListPage.kt | 131 --- .../models/AggregateBalanceListPageAsync.kt | 147 ---- .../AggregateBalanceListPageResponse.kt | 231 ------ .../api/models/AggregateBalanceListParams.kt | 353 --------- .../models/AggregateBalanceListResponse.kt | 546 ------------- .../models/CardAggregateBalanceListPage.kt | 131 --- .../CardAggregateBalanceListPageAsync.kt | 148 ---- .../CardAggregateBalanceListPageResponse.kt | 234 ------ .../models/CardAggregateBalanceListParams.kt | 220 ------ .../async/AggregateBalanceServiceAsync.kt | 86 -- .../async/AggregateBalanceServiceAsyncImpl.kt | 95 --- .../api/services/async/CardServiceAsync.kt | 5 - .../services/async/CardServiceAsyncImpl.kt | 15 - .../cards/AggregateBalanceServiceAsync.kt | 86 -- .../cards/AggregateBalanceServiceAsyncImpl.kt | 95 --- .../blocking/AggregateBalanceService.kt | 86 -- .../blocking/AggregateBalanceServiceImpl.kt | 88 --- .../api/services/blocking/CardService.kt | 5 - .../api/services/blocking/CardServiceImpl.kt | 15 - .../blocking/cards/AggregateBalanceService.kt | 86 -- .../cards/AggregateBalanceServiceImpl.kt | 88 --- .../AggregateBalanceListPageResponseTest.kt | 83 -- .../models/AggregateBalanceListParamsTest.kt | 39 - .../AggregateBalanceListResponseTest.kt | 68 -- .../lithic/api/models/AggregateBalanceTest.kt | 72 -- ...ardAggregateBalanceListPageResponseTest.kt | 80 -- .../CardAggregateBalanceListParamsTest.kt | 46 -- .../async/AggregateBalanceServiceAsyncTest.kt | 27 - .../cards/AggregateBalanceServiceAsyncTest.kt | 27 - .../blocking/AggregateBalanceServiceTest.kt | 26 - .../cards/AggregateBalanceServiceTest.kt | 26 - .../api/proguard/ProGuardCompatibilityTest.kt | 1 - 38 files changed, 4 insertions(+), 4177 deletions(-) delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageAsync.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageResponse.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListParams.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPage.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageAsync.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponse.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsync.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsync.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncImpl.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceService.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceService.kt delete mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceImpl.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListPageResponseTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListParamsTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListResponseTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListPageResponseTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListParamsTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt delete mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 3f808b063..ca0f3ae4c 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 +configured_endpoints: 174 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4fd8048b287f409ad2b91f7d0f0b7fc13cc9bc4ccc7859666f21203bab3d2f01.yml +openapi_spec_hash: a554c54d96a7604a770b6a8b1df46395 +config_hash: df0af4ff639b8a6923a6244d2247910c 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..3a0d0eda5 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 @@ -97,8 +96,6 @@ interface LithicClient { fun balances(): BalanceService - fun aggregateBalances(): AggregateBalanceService - fun disputes(): DisputeService fun disputesV2(): DisputesV2Service @@ -203,8 +200,6 @@ interface LithicClient { fun balances(): BalanceService.WithRawResponse - fun aggregateBalances(): AggregateBalanceService.WithRawResponse - fun disputes(): DisputeService.WithRawResponse fun disputesV2(): DisputesV2Service.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..a3d19c780 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 @@ -97,8 +96,6 @@ interface LithicClientAsync { fun balances(): BalanceServiceAsync - fun aggregateBalances(): AggregateBalanceServiceAsync - fun disputes(): DisputeServiceAsync fun disputesV2(): DisputesV2ServiceAsync @@ -206,8 +203,6 @@ interface LithicClientAsync { fun balances(): BalanceServiceAsync.WithRawResponse - fun aggregateBalances(): AggregateBalanceServiceAsync.WithRawResponse - fun disputes(): DisputeServiceAsync.WithRawResponse fun disputesV2(): DisputesV2ServiceAsync.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..7d882d9c3 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 @@ -137,10 +135,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) } @@ -259,8 +253,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 @@ -359,10 +351,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) } @@ -482,9 +470,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 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..a3f7d5310 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 @@ -132,10 +130,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 { @@ -239,8 +233,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 @@ -339,10 +331,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) } @@ -462,9 +450,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 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/AggregateBalanceListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.kt deleted file mode 100644 index a51b20a72..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPage.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.AggregateBalanceService -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** @see AggregateBalanceService.list */ -class AggregateBalanceListPage -private constructor( - private val service: AggregateBalanceService, - private val params: AggregateBalanceListParams, - private val response: AggregateBalanceListPageResponse, -) : Page { - - /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see AggregateBalanceListPageResponse.data - */ - fun data(): List = - response._data().getOptional("data").getOrNull() ?: emptyList() - - /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see AggregateBalanceListPageResponse.hasMore - */ - fun hasMore(): Optional = response._hasMore().getOptional("has_more") - - override fun items(): List = data() - - override fun hasNextPage(): Boolean = false - - fun nextPageParams(): AggregateBalanceListParams = - throw IllegalStateException("Cannot construct next page params") - - override fun nextPage(): AggregateBalanceListPage = service.list(nextPageParams()) - - fun autoPager(): AutoPager = AutoPager.from(this) - - /** The parameters that were used to request this page. */ - fun params(): AggregateBalanceListParams = params - - /** The response that this page was parsed from. */ - fun response(): AggregateBalanceListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [AggregateBalanceListPage]. - * - * The following fields are required: - * ```java - * .service() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalanceListPage]. */ - class Builder internal constructor() { - - private var service: AggregateBalanceService? = null - private var params: AggregateBalanceListParams? = null - private var response: AggregateBalanceListPageResponse? = null - - @JvmSynthetic - internal fun from(aggregateBalanceListPage: AggregateBalanceListPage) = apply { - service = aggregateBalanceListPage.service - params = aggregateBalanceListPage.params - response = aggregateBalanceListPage.response - } - - fun service(service: AggregateBalanceService) = apply { this.service = service } - - /** The parameters that were used to request this page. */ - fun params(params: AggregateBalanceListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: AggregateBalanceListPageResponse) = apply { - this.response = response - } - - /** - * Returns an immutable instance of [AggregateBalanceListPage]. - * - * 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(): AggregateBalanceListPage = - AggregateBalanceListPage( - checkRequired("service", service), - checkRequired("params", params), - checkRequired("response", response), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AggregateBalanceListPage && - service == other.service && - params == other.params && - response == other.response - } - - override fun hashCode(): Int = Objects.hash(service, params, response) - - override fun toString() = - "AggregateBalanceListPage{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/AggregateBalanceListPageAsync.kt deleted file mode 100644 index ab18fd5fc..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListPageAsync.kt +++ /dev/null @@ -1,147 +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.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 AggregateBalanceListPageAsync -private constructor( - private val service: AggregateBalanceServiceAsync, - private val streamHandlerExecutor: Executor, - private val params: AggregateBalanceListParams, - private val response: AggregateBalanceListPageResponse, -) : PageAsync { - - /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see AggregateBalanceListPageResponse.data - */ - fun data(): List = - response._data().getOptional("data").getOrNull() ?: emptyList() - - /** - * Delegates to [AggregateBalanceListPageResponse], but gracefully handles missing data. - * - * @see AggregateBalanceListPageResponse.hasMore - */ - fun hasMore(): Optional = response._hasMore().getOptional("has_more") - - override fun items(): List = data() - - override fun hasNextPage(): Boolean = false - - fun nextPageParams(): AggregateBalanceListParams = - 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(): AggregateBalanceListParams = params - - /** The response that this page was parsed from. */ - fun response(): AggregateBalanceListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of - * [AggregateBalanceListPageAsync]. - * - * The following fields are required: - * ```java - * .service() - * .streamHandlerExecutor() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AggregateBalanceListPageAsync]. */ - class Builder internal constructor() { - - private var service: AggregateBalanceServiceAsync? = null - private var streamHandlerExecutor: Executor? = null - private var params: AggregateBalanceListParams? = null - private var response: AggregateBalanceListPageResponse? = null - - @JvmSynthetic - internal fun from(aggregateBalanceListPageAsync: AggregateBalanceListPageAsync) = apply { - service = aggregateBalanceListPageAsync.service - streamHandlerExecutor = aggregateBalanceListPageAsync.streamHandlerExecutor - params = aggregateBalanceListPageAsync.params - response = aggregateBalanceListPageAsync.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: AggregateBalanceListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: AggregateBalanceListPageResponse) = apply { - this.response = response - } - - /** - * Returns an immutable instance of [AggregateBalanceListPageAsync]. - * - * 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(): AggregateBalanceListPageAsync = - AggregateBalanceListPageAsync( - 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 AggregateBalanceListPageAsync && - 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() = - "AggregateBalanceListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" -} 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/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/CardAggregateBalanceListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt deleted file mode 100644 index 8ca1d6388..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardAggregateBalanceListParams.kt +++ /dev/null @@ -1,220 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import com.lithic.api.core.Params -import com.lithic.api.core.http.Headers -import com.lithic.api.core.http.QueryParams -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Get the aggregated card balance across all end-user accounts. */ -class CardAggregateBalanceListParams -private constructor( - private val accountToken: String?, - private val businessAccountToken: String?, - 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) - - /** 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(): CardAggregateBalanceListParams = builder().build() - - /** - * Returns a mutable builder for constructing an instance of - * [CardAggregateBalanceListParams]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CardAggregateBalanceListParams]. */ - class Builder internal constructor() { - - private var accountToken: String? = null - private var businessAccountToken: String? = 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() - } - - /** 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()) - - /** 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()) - - 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 [CardAggregateBalanceListParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): CardAggregateBalanceListParams = - CardAggregateBalanceListParams( - accountToken, - businessAccountToken, - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - accountToken?.let { put("account_token", it) } - businessAccountToken?.let { put("business_account_token", it) } - putAll(additionalQueryParams) - } - .build() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CardAggregateBalanceListParams && - accountToken == other.accountToken && - businessAccountToken == other.businessAccountToken && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash(accountToken, businessAccountToken, additionalHeaders, additionalQueryParams) - - override fun toString() = - "CardAggregateBalanceListParams{accountToken=$accountToken, businessAccountToken=$businessAccountToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} 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/AggregateBalanceServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt deleted file mode 100644 index e45199b7a..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncImpl.kt +++ /dev/null @@ -1,95 +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.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.AggregateBalanceListPageAsync -import com.lithic.api.models.AggregateBalanceListPageResponse -import com.lithic.api.models.AggregateBalanceListParams -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: AggregateBalanceListParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/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: AggregateBalanceListParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "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 { - AggregateBalanceListPageAsync.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/async/CardServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt index b2b92af78..a79e8e69b 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 @@ -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/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/AggregateBalanceServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt deleted file mode 100644 index 927e0a17f..000000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceImpl.kt +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.blocking - -import com.lithic.api.core.ClientOptions -import com.lithic.api.core.RequestOptions -import com.lithic.api.core.handlers.errorBodyHandler -import com.lithic.api.core.handlers.errorHandler -import com.lithic.api.core.handlers.jsonHandler -import com.lithic.api.core.http.HttpMethod -import com.lithic.api.core.http.HttpRequest -import com.lithic.api.core.http.HttpResponse -import com.lithic.api.core.http.HttpResponse.Handler -import com.lithic.api.core.http.HttpResponseFor -import com.lithic.api.core.http.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 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: AggregateBalanceListParams, - requestOptions: RequestOptions, - ): AggregateBalanceListPage = - // get /v1/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: AggregateBalanceListParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "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 { - AggregateBalanceListPage.builder() - .service(AggregateBalanceServiceImpl(clientOptions)) - .params(params) - .response(it) - .build() - } - } - } - } -} 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..12b5331a6 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 @@ -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/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/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/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/services/async/AggregateBalanceServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt deleted file mode 100644 index a0ee259c2..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.async - -import com.lithic.api.TestServerExtension -import com.lithic.api.client.okhttp.LithicOkHttpClientAsync -import 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.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/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/AggregateBalanceServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt deleted file mode 100644 index 5edbec57e..000000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt +++ /dev/null @@ -1,26 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.services.blocking - -import com.lithic.api.TestServerExtension -import com.lithic.api.client.okhttp.LithicOkHttpClient -import 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.aggregateBalances() - - val page = aggregateBalanceService.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..d067b9f32 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() From 7e8636dfea36aff2e4bebc432f3d89375c2da25e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:13:02 +0000 Subject: [PATCH 2/4] feat(api): add external_id to payment_event feat(api): add get /v1/transfer_limits endpoint feat(api): add post /v1/book_transfers/{book_transfer_token}/retry endpoint --- .stats.yml | 8 +- .../com/lithic/api/client/LithicClient.kt | 5 + .../lithic/api/client/LithicClientAsync.kt | 5 + .../api/client/LithicClientAsyncImpl.kt | 14 + .../com/lithic/api/client/LithicClientImpl.kt | 14 + .../api/models/BookTransferRetryParams.kt | 447 +++++++ .../kotlin/com/lithic/api/models/Payment.kt | 49 +- .../api/models/TransferLimitListPage.kt | 129 ++ .../api/models/TransferLimitListPageAsync.kt | 144 +++ .../api/models/TransferLimitListParams.kt | 192 +++ .../api/models/TransferLimitsResponse.kt | 1050 +++++++++++++++++ .../async/BookTransferServiceAsync.kt | 56 + .../async/BookTransferServiceAsyncImpl.kt | 42 + .../async/TransferLimitServiceAsync.kt | 85 ++ .../async/TransferLimitServiceAsyncImpl.kt | 93 ++ .../services/blocking/BookTransferService.kt | 55 + .../blocking/BookTransferServiceImpl.kt | 39 + .../services/blocking/TransferLimitService.kt | 84 ++ .../blocking/TransferLimitServiceImpl.kt | 88 ++ .../models/AccountActivityListResponseTest.kt | 4 + ...ActivityRetrieveTransactionResponseTest.kt | 4 + .../api/models/BookTransferRetryParamsTest.kt | 43 + .../api/models/ParsedWebhookEventTest.kt | 8 + .../api/models/PaymentCreateResponseTest.kt | 6 + .../api/models/PaymentListPageResponseTest.kt | 6 + .../api/models/PaymentRetryResponseTest.kt | 6 + .../com/lithic/api/models/PaymentTest.kt | 6 + ...ymentTransactionCreatedWebhookEventTest.kt | 6 + ...ymentTransactionUpdatedWebhookEventTest.kt | 6 + .../api/models/TransferLimitListParamsTest.kt | 34 + .../api/models/TransferLimitsResponseTest.kt | 241 ++++ .../async/BookTransferServiceAsyncTest.kt | 22 + .../async/TransferLimitServiceAsyncTest.kt | 27 + .../blocking/BookTransferServiceTest.kt | 21 + .../blocking/TransferLimitServiceTest.kt | 26 + .../api/proguard/ProGuardCompatibilityTest.kt | 1 + 36 files changed, 3059 insertions(+), 7 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitsResponse.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsync.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitService.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/BookTransferRetryParamsTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitListParamsTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferLimitsResponseTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt diff --git a/.stats.yml b/.stats.yml index ca0f3ae4c..15f16473c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 174 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4fd8048b287f409ad2b91f7d0f0b7fc13cc9bc4ccc7859666f21203bab3d2f01.yml -openapi_spec_hash: a554c54d96a7604a770b6a8b1df46395 -config_hash: df0af4ff639b8a6923a6244d2247910c +configured_endpoints: 176 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1916ba0e95ce59f0feeebd6f3d2130990c812be7eabcda6e23c5fa096db912c7.yml +openapi_spec_hash: b465e7cb5c2dee36b5bdc6d540b2a530 +config_hash: a8a802e2c916a5d36a025bf64ab55ee7 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 3a0d0eda5..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 @@ -38,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 @@ -140,6 +141,8 @@ interface LithicClient { fun accountActivity(): AccountActivityService + fun transferLimits(): TransferLimitService + fun webhooks(): WebhookService /** Status of api */ @@ -244,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 a3d19c780..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 @@ -37,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 @@ -140,6 +141,8 @@ interface LithicClientAsync { fun accountActivity(): AccountActivityServiceAsync + fun transferLimits(): TransferLimitServiceAsync + fun webhooks(): WebhookServiceAsync /** Status of api */ @@ -247,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 7d882d9c3..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 @@ -77,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 @@ -223,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) } @@ -297,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( @@ -439,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) } @@ -521,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 a3f7d5310..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 @@ -77,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 @@ -206,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 @@ -277,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( @@ -419,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) } @@ -499,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/models/BookTransferRetryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt new file mode 100644 index 000000000..5d9f7684f --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt @@ -0,0 +1,447 @@ +// 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) + + /** + * Globally unique identifier for the retry. + * + * @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() } + + /** Globally unique identifier for the retry. */ + 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()) + + /** + * Globally unique identifier for the retry. + * + * @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() + } + + /** Globally unique identifier for the retry. */ + 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/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index aa49240b6..d8253daab 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 */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt new file mode 100644 index 000000000..a93b22981 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPage.kt @@ -0,0 +1,129 @@ +// 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.TransferLimitService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see TransferLimitService.list */ +class TransferLimitListPage +private constructor( + private val service: TransferLimitService, + private val params: TransferLimitListParams, + private val response: TransferLimitsResponse, +) : Page { + + /** + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. + * + * @see TransferLimitsResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. + * + * @see TransferLimitsResponse.hasMore + */ + fun hasMore(): Optional = response._hasMore().getOptional("has_more") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = false + + fun nextPageParams(): TransferLimitListParams = + throw IllegalStateException("Cannot construct next page params") + + override fun nextPage(): TransferLimitListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): TransferLimitListParams = params + + /** The response that this page was parsed from. */ + fun response(): TransferLimitsResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [TransferLimitListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransferLimitListPage]. */ + class Builder internal constructor() { + + private var service: TransferLimitService? = null + private var params: TransferLimitListParams? = null + private var response: TransferLimitsResponse? = null + + @JvmSynthetic + internal fun from(transferLimitListPage: TransferLimitListPage) = apply { + service = transferLimitListPage.service + params = transferLimitListPage.params + response = transferLimitListPage.response + } + + fun service(service: TransferLimitService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: TransferLimitListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: TransferLimitsResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [TransferLimitListPage]. + * + * 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(): TransferLimitListPage = + TransferLimitListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferLimitListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "TransferLimitListPage{service=$service, params=$params, response=$response}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt new file mode 100644 index 000000000..49c1e08dd --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListPageAsync.kt @@ -0,0 +1,144 @@ +// 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.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 TransferLimitServiceAsync.list */ +class TransferLimitListPageAsync +private constructor( + private val service: TransferLimitServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: TransferLimitListParams, + private val response: TransferLimitsResponse, +) : PageAsync { + + /** + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. + * + * @see TransferLimitsResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [TransferLimitsResponse], but gracefully handles missing data. + * + * @see TransferLimitsResponse.hasMore + */ + fun hasMore(): Optional = response._hasMore().getOptional("has_more") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = false + + fun nextPageParams(): TransferLimitListParams = + 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(): TransferLimitListParams = params + + /** The response that this page was parsed from. */ + fun response(): TransferLimitsResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [TransferLimitListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransferLimitListPageAsync]. */ + class Builder internal constructor() { + + private var service: TransferLimitServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: TransferLimitListParams? = null + private var response: TransferLimitsResponse? = null + + @JvmSynthetic + internal fun from(transferLimitListPageAsync: TransferLimitListPageAsync) = apply { + service = transferLimitListPageAsync.service + streamHandlerExecutor = transferLimitListPageAsync.streamHandlerExecutor + params = transferLimitListPageAsync.params + response = transferLimitListPageAsync.response + } + + 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: TransferLimitListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: TransferLimitsResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [TransferLimitListPageAsync]. + * + * 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(): TransferLimitListPageAsync = + TransferLimitListPageAsync( + 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 TransferLimitListPageAsync && + 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() = + "TransferLimitListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt new file mode 100644 index 000000000..7d17b95bf --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferLimitListParams.kt @@ -0,0 +1,192 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.core.Params +import com.lithic.api.core.http.Headers +import com.lithic.api.core.http.QueryParams +import java.time.LocalDate +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Get transfer limits for a specified date */ +class TransferLimitListParams +private constructor( + private val date: LocalDate?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** 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 + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): TransferLimitListParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [TransferLimitListParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransferLimitListParams]. */ + class Builder internal constructor() { + + private var date: LocalDate? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(transferLimitListParams: TransferLimitListParams) = apply { + date = transferLimitListParams.date + additionalHeaders = transferLimitListParams.additionalHeaders.toBuilder() + additionalQueryParams = transferLimitListParams.additionalQueryParams.toBuilder() + } + + /** Date for which to retrieve transfer limits (ISO 8601 format) */ + fun date(date: LocalDate?) = apply { this.date = date } + + /** Alias for calling [Builder.date] with `date.orElse(null)`. */ + fun date(date: Optional) = date(date.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 [TransferLimitListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TransferLimitListParams = + TransferLimitListParams(date, additionalHeaders.build(), additionalQueryParams.build()) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + date?.let { put("date", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferLimitListParams && + date == other.date && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(date, additionalHeaders, additionalQueryParams) + + override fun toString() = + "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/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/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/TransferLimitServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt new file mode 100644 index 000000000..c3bea99ea --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncImpl.kt @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.async + +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.handlers.errorBodyHandler +import com.lithic.api.core.handlers.errorHandler +import com.lithic.api.core.handlers.jsonHandler +import com.lithic.api.core.http.HttpMethod +import com.lithic.api.core.http.HttpRequest +import com.lithic.api.core.http.HttpResponse +import com.lithic.api.core.http.HttpResponse.Handler +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.core.http.parseable +import com.lithic.api.core.prepareAsync +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 TransferLimitServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitServiceAsync { + + private val withRawResponse: TransferLimitServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): TransferLimitServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): TransferLimitServiceAsync = + TransferLimitServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun list( + params: TransferLimitListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/transfer_limits + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): TransferLimitServiceAsync.WithRawResponse = + TransferLimitServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: TransferLimitListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "transfer_limits") + .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 { + TransferLimitListPageAsync.builder() + .service(TransferLimitServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + } +} 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/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/TransferLimitServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt new file mode 100644 index 000000000..a459eb527 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/TransferLimitServiceImpl.kt @@ -0,0 +1,88 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.blocking + +import com.lithic.api.core.ClientOptions +import com.lithic.api.core.RequestOptions +import com.lithic.api.core.handlers.errorBodyHandler +import com.lithic.api.core.handlers.errorHandler +import com.lithic.api.core.handlers.jsonHandler +import com.lithic.api.core.http.HttpMethod +import com.lithic.api.core.http.HttpRequest +import com.lithic.api.core.http.HttpResponse +import com.lithic.api.core.http.HttpResponse.Handler +import com.lithic.api.core.http.HttpResponseFor +import com.lithic.api.core.http.parseable +import com.lithic.api.core.prepare +import com.lithic.api.models.TransferLimitListPage +import com.lithic.api.models.TransferLimitListParams +import com.lithic.api.models.TransferLimitsResponse +import java.util.function.Consumer + +class TransferLimitServiceImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitService { + + private val withRawResponse: TransferLimitService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): TransferLimitService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): TransferLimitService = + TransferLimitServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun list( + params: TransferLimitListParams, + requestOptions: RequestOptions, + ): TransferLimitListPage = + // get /v1/transfer_limits + withRawResponse().list(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + TransferLimitService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): TransferLimitService.WithRawResponse = + TransferLimitServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: TransferLimitListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "transfer_limits") + .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 { + TransferLimitListPage.builder() + .service(TransferLimitServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + } +} 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/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/ParsedWebhookEventTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ParsedWebhookEventTest.kt index f12d52b27..81e692d81 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 @@ -7423,6 +7423,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 +7434,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) @@ -7556,6 +7558,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 +7569,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 +7636,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 +7647,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) @@ -7765,6 +7771,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 +7782,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) 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/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/TransferLimitServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt new file mode 100644 index 000000000..9e37e81a5 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferLimitServiceAsyncTest.kt @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.async + +import com.lithic.api.TestServerExtension +import com.lithic.api.client.okhttp.LithicOkHttpClientAsync +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class TransferLimitServiceAsyncTest { + + @Test + fun list() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val transferLimitServiceAsync = client.transferLimits() + + val pageFuture = transferLimitServiceAsync.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/TransferLimitServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt new file mode 100644 index 000000000..947310a92 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferLimitServiceTest.kt @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.services.blocking + +import com.lithic.api.TestServerExtension +import com.lithic.api.client.okhttp.LithicOkHttpClient +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class TransferLimitServiceTest { + + @Test + fun list() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val transferLimitService = client.transferLimits() + + val page = transferLimitService.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 d067b9f32..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 @@ -80,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() } From 7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:31:50 +0000 Subject: [PATCH 3/4] feat(api): add WIRE_DRAWDOWN_REQUEST transfer type docs(api): clarify description of token / retry_token when it serves as idempotency key feat(api): remove unnecessary X-Lithic-Pagination header --- .stats.yml | 6 +++--- .../kotlin/com/lithic/api/core/ClientOptions.kt | 1 - .../lithic/api/models/BookTransferRetryParams.kt | 16 ++++++++++++---- .../api/models/ExternalPaymentCreateParams.kt | 14 ++++++++++++++ .../models/ManagementOperationCreateParams.kt | 14 ++++++++++++++ .../main/kotlin/com/lithic/api/models/Payment.kt | 6 ++++++ 6 files changed, 49 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 15f16473c..f9404c375 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-1916ba0e95ce59f0feeebd6f3d2130990c812be7eabcda6e23c5fa096db912c7.yml -openapi_spec_hash: b465e7cb5c2dee36b5bdc6d540b2a530 -config_hash: a8a802e2c916a5d36a025bf64ab55ee7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-854de7cc8f79e150ffe98f038ce9f39367010b2bdfffc9992be2738697dc4880.yml +openapi_spec_hash: fd471b20f3eda1e00cdebf028cbfe867 +config_hash: 9dddee5f7af579864599849cb28a0770 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/models/BookTransferRetryParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferRetryParams.kt index 5d9f7684f..193e3c6de 100644 --- 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 @@ -32,7 +32,8 @@ private constructor( fun bookTransferToken(): Optional = Optional.ofNullable(bookTransferToken) /** - * Globally unique identifier for the retry. + * 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). @@ -102,7 +103,10 @@ private constructor( */ fun body(body: RetryBookTransferRequest) = apply { this.body = body.toBuilder() } - /** Globally unique identifier for the retry. */ + /** + * 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) } /** @@ -279,7 +283,8 @@ private constructor( ) : this(retryToken, mutableMapOf()) /** - * Globally unique identifier for the retry. + * 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). @@ -332,7 +337,10 @@ private constructor( additionalProperties = retryBookTransferRequest.additionalProperties.toMutableMap() } - /** Globally unique identifier for the retry. */ + /** + * 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)) /** 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/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/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index d8253daab..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 @@ -4769,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)) } @@ -4782,6 +4784,7 @@ private constructor( WIRE_INBOUND_ADMIN, WIRE_OUTBOUND_PAYMENT, WIRE_OUTBOUND_ADMIN, + WIRE_DRAWDOWN_REQUEST, } /** @@ -4802,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. */ @@ -4825,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 } @@ -4847,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") } From a648f8a30f0b5742d5127c8764e0c00a0a180f5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:32:20 +0000 Subject: [PATCH 4/4] release: 0.115.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 25 insertions(+), 7 deletions(-) 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/CHANGELOG.md b/CHANGELOG.md index 8d4795f3d..d7d77e10f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.115.0 (2025-12-23) + +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 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 WIRE_DRAWDOWN_REQUEST transfer type ([7d05a12](https://github.com/lithic-com/lithic-java/commit/7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6)) +* **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)) + + +### Documentation + +* **api:** clarify description of token / retry_token when it serves as idempotency key ([7d05a12](https://github.com/lithic-com/lithic-java/commit/7d05a12c19b115f9b3a7f7c410523e04c7a4c3c6)) + ## 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/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 {