diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b8478cb7b..633bf86d7 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.281.0"
+ ".": "0.282.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index c3a436da3..28ec9075a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 202
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-06c4af41ee358cc77681ee9eb3e3997fb985c94baa60639f3b21bba1a73dd990.yml
-openapi_spec_hash: 636b35479a21d9be089b2d9b95646ba9
-config_hash: a185e9a72778cc4658ea73fb3a7f1354
+configured_endpoints: 214
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a7861b46606a5a2d849c4403583805c1074983cffaf7acfe0a4d7bafa38c5efd.yml
+openapi_spec_hash: a1cad356ebe1b02a67dbafbde7d7f1d4
+config_hash: b0b366d8c705ea0efe62093bae953e5a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e701702a4..b9e0bca0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.282.0 (2025-08-14)
+
+Full Changelog: [v0.281.0...v0.282.0](https://github.com/Increase/increase-java/compare/v0.281.0...v0.282.0)
+
+### Features
+
+* **api:** api update ([66b4681](https://github.com/Increase/increase-java/commit/66b46812c11f6043b88cde6e464fa24f228e0fdc))
+
## 0.281.0 (2025-08-14)
Full Changelog: [v0.280.0...v0.281.0](https://github.com/Increase/increase-java/compare/v0.280.0...v0.281.0)
diff --git a/README.md b/README.md
index 4fac724ce..619f4da9b 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.281.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.281.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.282.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.282.0)
@@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe
-The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.281.0).
+The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.282.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
### Gradle
```kotlin
-implementation("com.increase.api:increase-java:0.281.0")
+implementation("com.increase.api:increase-java:0.282.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.281.0")
com.increase.api
increase-java
- 0.281.0
+ 0.282.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index d291b7aa9..49e16c84d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.281.0" // x-release-please-version
+ version = "0.282.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
index 4d2321d88..c7b07e157 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
@@ -15,7 +15,10 @@ import com.increase.api.services.blocking.BookkeepingEntrySetService
import com.increase.api.services.blocking.CardDisputeService
import com.increase.api.services.blocking.CardPaymentService
import com.increase.api.services.blocking.CardPurchaseSupplementService
+import com.increase.api.services.blocking.CardPushTransferService
import com.increase.api.services.blocking.CardService
+import com.increase.api.services.blocking.CardTokenService
+import com.increase.api.services.blocking.CardValidationService
import com.increase.api.services.blocking.CheckDepositService
import com.increase.api.services.blocking.CheckTransferService
import com.increase.api.services.blocking.DeclinedTransactionService
@@ -198,6 +201,12 @@ interface IncreaseClient {
fun intrafiExclusions(): IntrafiExclusionService
+ fun cardTokens(): CardTokenService
+
+ fun cardPushTransfers(): CardPushTransferService
+
+ fun cardValidations(): CardValidationService
+
fun simulations(): SimulationService
/**
@@ -326,6 +335,12 @@ interface IncreaseClient {
fun intrafiExclusions(): IntrafiExclusionService.WithRawResponse
+ fun cardTokens(): CardTokenService.WithRawResponse
+
+ fun cardPushTransfers(): CardPushTransferService.WithRawResponse
+
+ fun cardValidations(): CardValidationService.WithRawResponse
+
fun simulations(): SimulationService.WithRawResponse
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
index 927a30481..8c7a92a9e 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
@@ -15,7 +15,10 @@ import com.increase.api.services.async.BookkeepingEntrySetServiceAsync
import com.increase.api.services.async.CardDisputeServiceAsync
import com.increase.api.services.async.CardPaymentServiceAsync
import com.increase.api.services.async.CardPurchaseSupplementServiceAsync
+import com.increase.api.services.async.CardPushTransferServiceAsync
import com.increase.api.services.async.CardServiceAsync
+import com.increase.api.services.async.CardTokenServiceAsync
+import com.increase.api.services.async.CardValidationServiceAsync
import com.increase.api.services.async.CheckDepositServiceAsync
import com.increase.api.services.async.CheckTransferServiceAsync
import com.increase.api.services.async.DeclinedTransactionServiceAsync
@@ -198,6 +201,12 @@ interface IncreaseClientAsync {
fun intrafiExclusions(): IntrafiExclusionServiceAsync
+ fun cardTokens(): CardTokenServiceAsync
+
+ fun cardPushTransfers(): CardPushTransferServiceAsync
+
+ fun cardValidations(): CardValidationServiceAsync
+
fun simulations(): SimulationServiceAsync
/**
@@ -330,6 +339,12 @@ interface IncreaseClientAsync {
fun intrafiExclusions(): IntrafiExclusionServiceAsync.WithRawResponse
+ fun cardTokens(): CardTokenServiceAsync.WithRawResponse
+
+ fun cardPushTransfers(): CardPushTransferServiceAsync.WithRawResponse
+
+ fun cardValidations(): CardValidationServiceAsync.WithRawResponse
+
fun simulations(): SimulationServiceAsync.WithRawResponse
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
index 4c417161a..1b70f5b20 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
@@ -28,8 +28,14 @@ import com.increase.api.services.async.CardPaymentServiceAsync
import com.increase.api.services.async.CardPaymentServiceAsyncImpl
import com.increase.api.services.async.CardPurchaseSupplementServiceAsync
import com.increase.api.services.async.CardPurchaseSupplementServiceAsyncImpl
+import com.increase.api.services.async.CardPushTransferServiceAsync
+import com.increase.api.services.async.CardPushTransferServiceAsyncImpl
import com.increase.api.services.async.CardServiceAsync
import com.increase.api.services.async.CardServiceAsyncImpl
+import com.increase.api.services.async.CardTokenServiceAsync
+import com.increase.api.services.async.CardTokenServiceAsyncImpl
+import com.increase.api.services.async.CardValidationServiceAsync
+import com.increase.api.services.async.CardValidationServiceAsyncImpl
import com.increase.api.services.async.CheckDepositServiceAsync
import com.increase.api.services.async.CheckDepositServiceAsyncImpl
import com.increase.api.services.async.CheckTransferServiceAsync
@@ -332,6 +338,18 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
IntrafiExclusionServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val cardTokens: CardTokenServiceAsync by lazy {
+ CardTokenServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val cardPushTransfers: CardPushTransferServiceAsync by lazy {
+ CardPushTransferServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val cardValidations: CardValidationServiceAsync by lazy {
+ CardValidationServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
private val simulations: SimulationServiceAsync by lazy {
SimulationServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -452,6 +470,12 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun webhooks(): WebhookServiceAsync = webhooks
+ override fun cardTokens(): CardTokenServiceAsync = cardTokens
+
+ override fun cardPushTransfers(): CardPushTransferServiceAsync = cardPushTransfers
+
+ override fun cardValidations(): CardValidationServiceAsync = cardValidations
+
override fun simulations(): SimulationServiceAsync = simulations
override fun close() = clientOptions.httpClient.close()
@@ -669,6 +693,18 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
IntrafiExclusionServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val cardTokens: CardTokenServiceAsync.WithRawResponse by lazy {
+ CardTokenServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cardPushTransfers: CardPushTransferServiceAsync.WithRawResponse by lazy {
+ CardPushTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cardValidations: CardValidationServiceAsync.WithRawResponse by lazy {
+ CardValidationServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val simulations: SimulationServiceAsync.WithRawResponse by lazy {
SimulationServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -811,6 +847,13 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun intrafiExclusions(): IntrafiExclusionServiceAsync.WithRawResponse =
intrafiExclusions
+ override fun cardTokens(): CardTokenServiceAsync.WithRawResponse = cardTokens
+
+ override fun cardPushTransfers(): CardPushTransferServiceAsync.WithRawResponse =
+ cardPushTransfers
+
+ override fun cardValidations(): CardValidationServiceAsync.WithRawResponse = cardValidations
+
override fun simulations(): SimulationServiceAsync.WithRawResponse = simulations
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
index f8e000c99..7546fa83d 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
@@ -28,8 +28,14 @@ import com.increase.api.services.blocking.CardPaymentService
import com.increase.api.services.blocking.CardPaymentServiceImpl
import com.increase.api.services.blocking.CardPurchaseSupplementService
import com.increase.api.services.blocking.CardPurchaseSupplementServiceImpl
+import com.increase.api.services.blocking.CardPushTransferService
+import com.increase.api.services.blocking.CardPushTransferServiceImpl
import com.increase.api.services.blocking.CardService
import com.increase.api.services.blocking.CardServiceImpl
+import com.increase.api.services.blocking.CardTokenService
+import com.increase.api.services.blocking.CardTokenServiceImpl
+import com.increase.api.services.blocking.CardValidationService
+import com.increase.api.services.blocking.CardValidationServiceImpl
import com.increase.api.services.blocking.CheckDepositService
import com.increase.api.services.blocking.CheckDepositServiceImpl
import com.increase.api.services.blocking.CheckTransferService
@@ -317,6 +323,18 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptionsWithUserAgent) }
+ private val cardTokens: CardTokenService by lazy {
+ CardTokenServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val cardPushTransfers: CardPushTransferService by lazy {
+ CardPushTransferServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val cardValidations: CardValidationService by lazy {
+ CardValidationServiceImpl(clientOptionsWithUserAgent)
+ }
+
private val simulations: SimulationService by lazy {
SimulationServiceImpl(clientOptionsWithUserAgent)
}
@@ -436,6 +454,12 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun webhooks(): WebhookService = webhooks
+ override fun cardTokens(): CardTokenService = cardTokens
+
+ override fun cardPushTransfers(): CardPushTransferService = cardPushTransfers
+
+ override fun cardValidations(): CardValidationService = cardValidations
+
override fun simulations(): SimulationService = simulations
override fun close() = clientOptions.httpClient.close()
@@ -651,6 +675,18 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
IntrafiExclusionServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val cardTokens: CardTokenService.WithRawResponse by lazy {
+ CardTokenServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cardPushTransfers: CardPushTransferService.WithRawResponse by lazy {
+ CardPushTransferServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cardValidations: CardValidationService.WithRawResponse by lazy {
+ CardValidationServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val simulations: SimulationService.WithRawResponse by lazy {
SimulationServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -789,6 +825,13 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun intrafiExclusions(): IntrafiExclusionService.WithRawResponse =
intrafiExclusions
+ override fun cardTokens(): CardTokenService.WithRawResponse = cardTokens
+
+ override fun cardPushTransfers(): CardPushTransferService.WithRawResponse =
+ cardPushTransfers
+
+ override fun cardValidations(): CardValidationService.WithRawResponse = cardValidations
+
override fun simulations(): SimulationService.WithRawResponse = simulations
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt
new file mode 100644
index 000000000..7de5285aa
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt
@@ -0,0 +1,5298 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.cardpushtransfers
+
+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.increase.api.core.Enum
+import com.increase.api.core.ExcludeMissing
+import com.increase.api.core.JsonField
+import com.increase.api.core.JsonMissing
+import com.increase.api.core.JsonValue
+import com.increase.api.core.checkRequired
+import com.increase.api.errors.IncreaseInvalidDataException
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Card Push Transfers send funds to a recipient's payment card in real-time. */
+class CardPushTransfer
+private constructor(
+ private val id: JsonField,
+ private val acceptance: JsonField,
+ private val accountId: JsonField,
+ private val amount: JsonField,
+ private val approval: JsonField,
+ private val businessApplicationIdentifier: JsonField,
+ private val cancellation: JsonField,
+ private val createdAt: JsonField,
+ private val createdBy: JsonField,
+ private val currency: JsonField,
+ private val decline: JsonField,
+ private val idempotencyKey: JsonField,
+ private val merchantCategoryCode: JsonField,
+ private val merchantCityName: JsonField,
+ private val merchantName: JsonField,
+ private val merchantNamePrefix: JsonField,
+ private val merchantPostalCode: JsonField,
+ private val merchantState: JsonField,
+ private val recipientName: JsonField,
+ private val senderAddressCity: JsonField,
+ private val senderAddressLine1: JsonField,
+ private val senderAddressPostalCode: JsonField,
+ private val senderAddressState: JsonField,
+ private val senderName: JsonField,
+ private val sourceAccountNumberId: JsonField,
+ private val status: JsonField,
+ private val submission: JsonField,
+ private val type: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
+ @JsonProperty("acceptance")
+ @ExcludeMissing
+ acceptance: JsonField = JsonMissing.of(),
+ @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(),
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("approval") @ExcludeMissing approval: JsonField = JsonMissing.of(),
+ @JsonProperty("business_application_identifier")
+ @ExcludeMissing
+ businessApplicationIdentifier: JsonField = JsonMissing.of(),
+ @JsonProperty("cancellation")
+ @ExcludeMissing
+ cancellation: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("created_by")
+ @ExcludeMissing
+ createdBy: JsonField = JsonMissing.of(),
+ @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(),
+ @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(),
+ @JsonProperty("idempotency_key")
+ @ExcludeMissing
+ idempotencyKey: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_category_code")
+ @ExcludeMissing
+ merchantCategoryCode: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_city_name")
+ @ExcludeMissing
+ merchantCityName: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_name")
+ @ExcludeMissing
+ merchantName: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_name_prefix")
+ @ExcludeMissing
+ merchantNamePrefix: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_postal_code")
+ @ExcludeMissing
+ merchantPostalCode: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_state")
+ @ExcludeMissing
+ merchantState: JsonField = JsonMissing.of(),
+ @JsonProperty("recipient_name")
+ @ExcludeMissing
+ recipientName: JsonField = JsonMissing.of(),
+ @JsonProperty("sender_address_city")
+ @ExcludeMissing
+ senderAddressCity: JsonField = JsonMissing.of(),
+ @JsonProperty("sender_address_line1")
+ @ExcludeMissing
+ senderAddressLine1: JsonField = JsonMissing.of(),
+ @JsonProperty("sender_address_postal_code")
+ @ExcludeMissing
+ senderAddressPostalCode: JsonField = JsonMissing.of(),
+ @JsonProperty("sender_address_state")
+ @ExcludeMissing
+ senderAddressState: JsonField = JsonMissing.of(),
+ @JsonProperty("sender_name")
+ @ExcludeMissing
+ senderName: JsonField = JsonMissing.of(),
+ @JsonProperty("source_account_number_id")
+ @ExcludeMissing
+ sourceAccountNumberId: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("submission")
+ @ExcludeMissing
+ submission: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ ) : this(
+ id,
+ acceptance,
+ accountId,
+ amount,
+ approval,
+ businessApplicationIdentifier,
+ cancellation,
+ createdAt,
+ createdBy,
+ currency,
+ decline,
+ idempotencyKey,
+ merchantCategoryCode,
+ merchantCityName,
+ merchantName,
+ merchantNamePrefix,
+ merchantPostalCode,
+ merchantState,
+ recipientName,
+ senderAddressCity,
+ senderAddressLine1,
+ senderAddressPostalCode,
+ senderAddressState,
+ senderName,
+ sourceAccountNumberId,
+ status,
+ submission,
+ type,
+ mutableMapOf(),
+ )
+
+ /**
+ * The Card Push Transfer's identifier.
+ *
+ * @throws IncreaseInvalidDataException 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 id(): String = id.getRequired("id")
+
+ /**
+ * If the transfer is accepted by the recipient bank, this will contain supplemental details.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun acceptance(): Optional = acceptance.getOptional("acceptance")
+
+ /**
+ * The Account from which the transfer was sent.
+ *
+ * @throws IncreaseInvalidDataException 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 accountId(): String = accountId.getRequired("account_id")
+
+ /**
+ * The transfer amount in USD cents.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
+
+ /**
+ * If your account requires approvals for transfers and the transfer was approved, this will
+ * contain details of the approval.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun approval(): Optional = approval.getOptional("approval")
+
+ /**
+ * The Business Application Identifier describes the type of transaction being performed. Your
+ * program must be approved for the specified Business Application Identifier in order to use
+ * it.
+ *
+ * @throws IncreaseInvalidDataException 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 businessApplicationIdentifier(): BusinessApplicationIdentifier =
+ businessApplicationIdentifier.getRequired("business_application_identifier")
+
+ /**
+ * If your account requires approvals for transfers and the transfer was not approved, this will
+ * contain details of the cancellation.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun cancellation(): Optional = cancellation.getOptional("cancellation")
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the transfer
+ * was created.
+ *
+ * @throws IncreaseInvalidDataException 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 createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
+
+ /**
+ * What object created the transfer, either via the API or the dashboard.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun createdBy(): Optional = createdBy.getOptional("created_by")
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency.
+ *
+ * @throws IncreaseInvalidDataException 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(): Currency = currency.getRequired("currency")
+
+ /**
+ * If the transfer is rejected by the card network or the destination financial institution,
+ * this will contain supplemental details.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun decline(): Optional = decline.getOptional("decline")
+
+ /**
+ * The idempotency key you chose for this object. This value is unique across Increase and is
+ * used to ensure that a request is only processed once. Learn more about
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key")
+
+ /**
+ * The merchant category code (MCC) of the merchant (generally your business) sending the
+ * transfer. This is a four-digit code that describes the type of business or service provided
+ * by the merchant. Your program must be approved for the specified MCC in order to use it.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantCategoryCode(): String = merchantCategoryCode.getRequired("merchant_category_code")
+
+ /**
+ * The city name of the merchant (generally your business) sending the transfer.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantCityName(): String = merchantCityName.getRequired("merchant_city_name")
+
+ /**
+ * The merchant name shows up as the statement descriptor for the transfer. This is typically
+ * the name of your business or organization.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantName(): String = merchantName.getRequired("merchant_name")
+
+ /**
+ * For certain Business Application Identifiers, the statement descriptor is
+ * `merchant_name_prefix*sender_name`, where the `merchant_name_prefix` is a one to four
+ * character prefix that identifies the merchant.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantNamePrefix(): String = merchantNamePrefix.getRequired("merchant_name_prefix")
+
+ /**
+ * The postal code of the merchant (generally your business) sending the transfer.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantPostalCode(): String = merchantPostalCode.getRequired("merchant_postal_code")
+
+ /**
+ * The state of the merchant (generally your business) sending the transfer.
+ *
+ * @throws IncreaseInvalidDataException 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 merchantState(): String = merchantState.getRequired("merchant_state")
+
+ /**
+ * The name of the funds recipient.
+ *
+ * @throws IncreaseInvalidDataException 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 recipientName(): String = recipientName.getRequired("recipient_name")
+
+ /**
+ * The city of the sender.
+ *
+ * @throws IncreaseInvalidDataException 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 senderAddressCity(): String = senderAddressCity.getRequired("sender_address_city")
+
+ /**
+ * The address line 1 of the sender.
+ *
+ * @throws IncreaseInvalidDataException 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 senderAddressLine1(): String = senderAddressLine1.getRequired("sender_address_line1")
+
+ /**
+ * The postal code of the sender.
+ *
+ * @throws IncreaseInvalidDataException 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 senderAddressPostalCode(): String =
+ senderAddressPostalCode.getRequired("sender_address_postal_code")
+
+ /**
+ * The state of the sender.
+ *
+ * @throws IncreaseInvalidDataException 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 senderAddressState(): String = senderAddressState.getRequired("sender_address_state")
+
+ /**
+ * The name of the funds originator.
+ *
+ * @throws IncreaseInvalidDataException 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 senderName(): String = senderName.getRequired("sender_name")
+
+ /**
+ * The Account Number the recipient will see as having sent the transfer.
+ *
+ * @throws IncreaseInvalidDataException 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 sourceAccountNumberId(): String =
+ sourceAccountNumberId.getRequired("source_account_number_id")
+
+ /**
+ * The lifecycle status of the transfer.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun status(): Status = status.getRequired("status")
+
+ /**
+ * After the transfer is submitted to the card network, this will contain supplemental details.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun submission(): Optional = submission.getOptional("submission")
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_push_transfer`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun type(): Type = type.getRequired("type")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ /**
+ * Returns the raw JSON value of [acceptance].
+ *
+ * Unlike [acceptance], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("acceptance")
+ @ExcludeMissing
+ fun _acceptance(): JsonField = acceptance
+
+ /**
+ * Returns the raw JSON value of [accountId].
+ *
+ * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [approval].
+ *
+ * Unlike [approval], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("approval") @ExcludeMissing fun _approval(): JsonField = approval
+
+ /**
+ * Returns the raw JSON value of [businessApplicationIdentifier].
+ *
+ * Unlike [businessApplicationIdentifier], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("business_application_identifier")
+ @ExcludeMissing
+ fun _businessApplicationIdentifier(): JsonField =
+ businessApplicationIdentifier
+
+ /**
+ * Returns the raw JSON value of [cancellation].
+ *
+ * Unlike [cancellation], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("cancellation")
+ @ExcludeMissing
+ fun _cancellation(): JsonField = cancellation
+
+ /**
+ * Returns the raw JSON value of [createdAt].
+ *
+ * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
+
+ /**
+ * Returns the raw JSON value of [createdBy].
+ *
+ * Unlike [createdBy], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created_by") @ExcludeMissing fun _createdBy(): JsonField = createdBy
+
+ /**
+ * 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 [decline].
+ *
+ * Unlike [decline], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline
+
+ /**
+ * Returns the raw JSON value of [idempotencyKey].
+ *
+ * Unlike [idempotencyKey], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("idempotency_key")
+ @ExcludeMissing
+ fun _idempotencyKey(): JsonField = idempotencyKey
+
+ /**
+ * Returns the raw JSON value of [merchantCategoryCode].
+ *
+ * Unlike [merchantCategoryCode], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_category_code")
+ @ExcludeMissing
+ fun _merchantCategoryCode(): JsonField = merchantCategoryCode
+
+ /**
+ * Returns the raw JSON value of [merchantCityName].
+ *
+ * Unlike [merchantCityName], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_city_name")
+ @ExcludeMissing
+ fun _merchantCityName(): JsonField = merchantCityName
+
+ /**
+ * Returns the raw JSON value of [merchantName].
+ *
+ * Unlike [merchantName], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("merchant_name")
+ @ExcludeMissing
+ fun _merchantName(): JsonField = merchantName
+
+ /**
+ * Returns the raw JSON value of [merchantNamePrefix].
+ *
+ * Unlike [merchantNamePrefix], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_name_prefix")
+ @ExcludeMissing
+ fun _merchantNamePrefix(): JsonField = merchantNamePrefix
+
+ /**
+ * Returns the raw JSON value of [merchantPostalCode].
+ *
+ * Unlike [merchantPostalCode], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_postal_code")
+ @ExcludeMissing
+ fun _merchantPostalCode(): JsonField = merchantPostalCode
+
+ /**
+ * Returns the raw JSON value of [merchantState].
+ *
+ * Unlike [merchantState], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("merchant_state")
+ @ExcludeMissing
+ fun _merchantState(): JsonField = merchantState
+
+ /**
+ * Returns the raw JSON value of [recipientName].
+ *
+ * Unlike [recipientName], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("recipient_name")
+ @ExcludeMissing
+ fun _recipientName(): JsonField = recipientName
+
+ /**
+ * Returns the raw JSON value of [senderAddressCity].
+ *
+ * Unlike [senderAddressCity], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("sender_address_city")
+ @ExcludeMissing
+ fun _senderAddressCity(): JsonField = senderAddressCity
+
+ /**
+ * Returns the raw JSON value of [senderAddressLine1].
+ *
+ * Unlike [senderAddressLine1], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("sender_address_line1")
+ @ExcludeMissing
+ fun _senderAddressLine1(): JsonField = senderAddressLine1
+
+ /**
+ * Returns the raw JSON value of [senderAddressPostalCode].
+ *
+ * Unlike [senderAddressPostalCode], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("sender_address_postal_code")
+ @ExcludeMissing
+ fun _senderAddressPostalCode(): JsonField = senderAddressPostalCode
+
+ /**
+ * Returns the raw JSON value of [senderAddressState].
+ *
+ * Unlike [senderAddressState], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("sender_address_state")
+ @ExcludeMissing
+ fun _senderAddressState(): JsonField = senderAddressState
+
+ /**
+ * Returns the raw JSON value of [senderName].
+ *
+ * Unlike [senderName], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("sender_name") @ExcludeMissing fun _senderName(): JsonField = senderName
+
+ /**
+ * Returns the raw JSON value of [sourceAccountNumberId].
+ *
+ * Unlike [sourceAccountNumberId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("source_account_number_id")
+ @ExcludeMissing
+ fun _sourceAccountNumberId(): JsonField = sourceAccountNumberId
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [submission].
+ *
+ * Unlike [submission], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("submission")
+ @ExcludeMissing
+ fun _submission(): JsonField = submission
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ @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 [CardPushTransfer].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .acceptance()
+ * .accountId()
+ * .amount()
+ * .approval()
+ * .businessApplicationIdentifier()
+ * .cancellation()
+ * .createdAt()
+ * .createdBy()
+ * .currency()
+ * .decline()
+ * .idempotencyKey()
+ * .merchantCategoryCode()
+ * .merchantCityName()
+ * .merchantName()
+ * .merchantNamePrefix()
+ * .merchantPostalCode()
+ * .merchantState()
+ * .recipientName()
+ * .senderAddressCity()
+ * .senderAddressLine1()
+ * .senderAddressPostalCode()
+ * .senderAddressState()
+ * .senderName()
+ * .sourceAccountNumberId()
+ * .status()
+ * .submission()
+ * .type()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CardPushTransfer]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var acceptance: JsonField? = null
+ private var accountId: JsonField? = null
+ private var amount: JsonField? = null
+ private var approval: JsonField? = null
+ private var businessApplicationIdentifier: JsonField? = null
+ private var cancellation: JsonField? = null
+ private var createdAt: JsonField? = null
+ private var createdBy: JsonField? = null
+ private var currency: JsonField? = null
+ private var decline: JsonField? = null
+ private var idempotencyKey: JsonField? = null
+ private var merchantCategoryCode: JsonField? = null
+ private var merchantCityName: JsonField? = null
+ private var merchantName: JsonField? = null
+ private var merchantNamePrefix: JsonField? = null
+ private var merchantPostalCode: JsonField? = null
+ private var merchantState: JsonField? = null
+ private var recipientName: JsonField? = null
+ private var senderAddressCity: JsonField? = null
+ private var senderAddressLine1: JsonField? = null
+ private var senderAddressPostalCode: JsonField? = null
+ private var senderAddressState: JsonField? = null
+ private var senderName: JsonField? = null
+ private var sourceAccountNumberId: JsonField? = null
+ private var status: JsonField? = null
+ private var submission: JsonField? = null
+ private var type: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cardPushTransfer: CardPushTransfer) = apply {
+ id = cardPushTransfer.id
+ acceptance = cardPushTransfer.acceptance
+ accountId = cardPushTransfer.accountId
+ amount = cardPushTransfer.amount
+ approval = cardPushTransfer.approval
+ businessApplicationIdentifier = cardPushTransfer.businessApplicationIdentifier
+ cancellation = cardPushTransfer.cancellation
+ createdAt = cardPushTransfer.createdAt
+ createdBy = cardPushTransfer.createdBy
+ currency = cardPushTransfer.currency
+ decline = cardPushTransfer.decline
+ idempotencyKey = cardPushTransfer.idempotencyKey
+ merchantCategoryCode = cardPushTransfer.merchantCategoryCode
+ merchantCityName = cardPushTransfer.merchantCityName
+ merchantName = cardPushTransfer.merchantName
+ merchantNamePrefix = cardPushTransfer.merchantNamePrefix
+ merchantPostalCode = cardPushTransfer.merchantPostalCode
+ merchantState = cardPushTransfer.merchantState
+ recipientName = cardPushTransfer.recipientName
+ senderAddressCity = cardPushTransfer.senderAddressCity
+ senderAddressLine1 = cardPushTransfer.senderAddressLine1
+ senderAddressPostalCode = cardPushTransfer.senderAddressPostalCode
+ senderAddressState = cardPushTransfer.senderAddressState
+ senderName = cardPushTransfer.senderName
+ sourceAccountNumberId = cardPushTransfer.sourceAccountNumberId
+ status = cardPushTransfer.status
+ submission = cardPushTransfer.submission
+ type = cardPushTransfer.type
+ additionalProperties = cardPushTransfer.additionalProperties.toMutableMap()
+ }
+
+ /** The Card Push Transfer's identifier. */
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ /**
+ * If the transfer is accepted by the recipient bank, this will contain supplemental
+ * details.
+ */
+ fun acceptance(acceptance: Acceptance?) = acceptance(JsonField.ofNullable(acceptance))
+
+ /** Alias for calling [Builder.acceptance] with `acceptance.orElse(null)`. */
+ fun acceptance(acceptance: Optional) = acceptance(acceptance.getOrNull())
+
+ /**
+ * Sets [Builder.acceptance] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.acceptance] with a well-typed [Acceptance] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun acceptance(acceptance: JsonField) = apply { this.acceptance = acceptance }
+
+ /** The Account from which the transfer was sent. */
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
+
+ /**
+ * Sets [Builder.accountId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accountId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
+
+ /** The transfer amount in USD cents. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /**
+ * If your account requires approvals for transfers and the transfer was approved, this will
+ * contain details of the approval.
+ */
+ fun approval(approval: Approval?) = approval(JsonField.ofNullable(approval))
+
+ /** Alias for calling [Builder.approval] with `approval.orElse(null)`. */
+ fun approval(approval: Optional) = approval(approval.getOrNull())
+
+ /**
+ * Sets [Builder.approval] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.approval] with a well-typed [Approval] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun approval(approval: JsonField) = apply { this.approval = approval }
+
+ /**
+ * The Business Application Identifier describes the type of transaction being performed.
+ * Your program must be approved for the specified Business Application Identifier in order
+ * to use it.
+ */
+ fun businessApplicationIdentifier(
+ businessApplicationIdentifier: BusinessApplicationIdentifier
+ ) = businessApplicationIdentifier(JsonField.of(businessApplicationIdentifier))
+
+ /**
+ * Sets [Builder.businessApplicationIdentifier] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.businessApplicationIdentifier] with a well-typed
+ * [BusinessApplicationIdentifier] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun businessApplicationIdentifier(
+ businessApplicationIdentifier: JsonField
+ ) = apply { this.businessApplicationIdentifier = businessApplicationIdentifier }
+
+ /**
+ * If your account requires approvals for transfers and the transfer was not approved, this
+ * will contain details of the cancellation.
+ */
+ fun cancellation(cancellation: Cancellation?) =
+ cancellation(JsonField.ofNullable(cancellation))
+
+ /** Alias for calling [Builder.cancellation] with `cancellation.orElse(null)`. */
+ fun cancellation(cancellation: Optional) =
+ cancellation(cancellation.getOrNull())
+
+ /**
+ * Sets [Builder.cancellation] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cancellation] with a well-typed [Cancellation] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun cancellation(cancellation: JsonField) = apply {
+ this.cancellation = cancellation
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * transfer was created.
+ */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+
+ /** What object created the transfer, either via the API or the dashboard. */
+ fun createdBy(createdBy: CreatedBy?) = createdBy(JsonField.ofNullable(createdBy))
+
+ /** Alias for calling [Builder.createdBy] with `createdBy.orElse(null)`. */
+ fun createdBy(createdBy: Optional) = createdBy(createdBy.getOrNull())
+
+ /**
+ * Sets [Builder.createdBy] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdBy] with a well-typed [CreatedBy] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy }
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency.
+ */
+ fun currency(currency: Currency) = currency(JsonField.of(currency))
+
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [Currency] 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 }
+
+ /**
+ * If the transfer is rejected by the card network or the destination financial institution,
+ * this will contain supplemental details.
+ */
+ fun decline(decline: Decline?) = decline(JsonField.ofNullable(decline))
+
+ /** Alias for calling [Builder.decline] with `decline.orElse(null)`. */
+ fun decline(decline: Optional) = decline(decline.getOrNull())
+
+ /**
+ * Sets [Builder.decline] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.decline] with a well-typed [Decline] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun decline(decline: JsonField) = apply { this.decline = decline }
+
+ /**
+ * The idempotency key you chose for this object. This value is unique across Increase and
+ * is used to ensure that a request is only processed once. Learn more about
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
+ */
+ fun idempotencyKey(idempotencyKey: String?) =
+ idempotencyKey(JsonField.ofNullable(idempotencyKey))
+
+ /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */
+ fun idempotencyKey(idempotencyKey: Optional) =
+ idempotencyKey(idempotencyKey.getOrNull())
+
+ /**
+ * Sets [Builder.idempotencyKey] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.idempotencyKey] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun idempotencyKey(idempotencyKey: JsonField) = apply {
+ this.idempotencyKey = idempotencyKey
+ }
+
+ /**
+ * The merchant category code (MCC) of the merchant (generally your business) sending the
+ * transfer. This is a four-digit code that describes the type of business or service
+ * provided by the merchant. Your program must be approved for the specified MCC in order to
+ * use it.
+ */
+ fun merchantCategoryCode(merchantCategoryCode: String) =
+ merchantCategoryCode(JsonField.of(merchantCategoryCode))
+
+ /**
+ * Sets [Builder.merchantCategoryCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantCategoryCode] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply {
+ this.merchantCategoryCode = merchantCategoryCode
+ }
+
+ /** The city name of the merchant (generally your business) sending the transfer. */
+ fun merchantCityName(merchantCityName: String) =
+ merchantCityName(JsonField.of(merchantCityName))
+
+ /**
+ * Sets [Builder.merchantCityName] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantCityName] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantCityName(merchantCityName: JsonField) = apply {
+ this.merchantCityName = merchantCityName
+ }
+
+ /**
+ * The merchant name shows up as the statement descriptor for the transfer. This is
+ * typically the name of your business or organization.
+ */
+ fun merchantName(merchantName: String) = merchantName(JsonField.of(merchantName))
+
+ /**
+ * Sets [Builder.merchantName] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantName] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun merchantName(merchantName: JsonField) = apply {
+ this.merchantName = merchantName
+ }
+
+ /**
+ * For certain Business Application Identifiers, the statement descriptor is
+ * `merchant_name_prefix*sender_name`, where the `merchant_name_prefix` is a one to four
+ * character prefix that identifies the merchant.
+ */
+ fun merchantNamePrefix(merchantNamePrefix: String) =
+ merchantNamePrefix(JsonField.of(merchantNamePrefix))
+
+ /**
+ * Sets [Builder.merchantNamePrefix] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantNamePrefix] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantNamePrefix(merchantNamePrefix: JsonField) = apply {
+ this.merchantNamePrefix = merchantNamePrefix
+ }
+
+ /** The postal code of the merchant (generally your business) sending the transfer. */
+ fun merchantPostalCode(merchantPostalCode: String) =
+ merchantPostalCode(JsonField.of(merchantPostalCode))
+
+ /**
+ * Sets [Builder.merchantPostalCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantPostalCode] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantPostalCode(merchantPostalCode: JsonField) = apply {
+ this.merchantPostalCode = merchantPostalCode
+ }
+
+ /** The state of the merchant (generally your business) sending the transfer. */
+ fun merchantState(merchantState: String) = merchantState(JsonField.of(merchantState))
+
+ /**
+ * Sets [Builder.merchantState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantState] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun merchantState(merchantState: JsonField) = apply {
+ this.merchantState = merchantState
+ }
+
+ /** The name of the funds recipient. */
+ fun recipientName(recipientName: String) = recipientName(JsonField.of(recipientName))
+
+ /**
+ * Sets [Builder.recipientName] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.recipientName] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun recipientName(recipientName: JsonField) = apply {
+ this.recipientName = recipientName
+ }
+
+ /** The city of the sender. */
+ fun senderAddressCity(senderAddressCity: String) =
+ senderAddressCity(JsonField.of(senderAddressCity))
+
+ /**
+ * Sets [Builder.senderAddressCity] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.senderAddressCity] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun senderAddressCity(senderAddressCity: JsonField) = apply {
+ this.senderAddressCity = senderAddressCity
+ }
+
+ /** The address line 1 of the sender. */
+ fun senderAddressLine1(senderAddressLine1: String) =
+ senderAddressLine1(JsonField.of(senderAddressLine1))
+
+ /**
+ * Sets [Builder.senderAddressLine1] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.senderAddressLine1] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun senderAddressLine1(senderAddressLine1: JsonField) = apply {
+ this.senderAddressLine1 = senderAddressLine1
+ }
+
+ /** The postal code of the sender. */
+ fun senderAddressPostalCode(senderAddressPostalCode: String) =
+ senderAddressPostalCode(JsonField.of(senderAddressPostalCode))
+
+ /**
+ * Sets [Builder.senderAddressPostalCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.senderAddressPostalCode] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun senderAddressPostalCode(senderAddressPostalCode: JsonField) = apply {
+ this.senderAddressPostalCode = senderAddressPostalCode
+ }
+
+ /** The state of the sender. */
+ fun senderAddressState(senderAddressState: String) =
+ senderAddressState(JsonField.of(senderAddressState))
+
+ /**
+ * Sets [Builder.senderAddressState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.senderAddressState] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun senderAddressState(senderAddressState: JsonField) = apply {
+ this.senderAddressState = senderAddressState
+ }
+
+ /** The name of the funds originator. */
+ fun senderName(senderName: String) = senderName(JsonField.of(senderName))
+
+ /**
+ * Sets [Builder.senderName] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.senderName] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun senderName(senderName: JsonField) = apply { this.senderName = senderName }
+
+ /** The Account Number the recipient will see as having sent the transfer. */
+ fun sourceAccountNumberId(sourceAccountNumberId: String) =
+ sourceAccountNumberId(JsonField.of(sourceAccountNumberId))
+
+ /**
+ * Sets [Builder.sourceAccountNumberId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sourceAccountNumberId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun sourceAccountNumberId(sourceAccountNumberId: JsonField) = apply {
+ this.sourceAccountNumberId = sourceAccountNumberId
+ }
+
+ /** The lifecycle status of the transfer. */
+ fun status(status: Status) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [Status] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ /**
+ * After the transfer is submitted to the card network, this will contain supplemental
+ * details.
+ */
+ fun submission(submission: Submission?) = submission(JsonField.ofNullable(submission))
+
+ /** Alias for calling [Builder.submission] with `submission.orElse(null)`. */
+ fun submission(submission: Optional) = submission(submission.getOrNull())
+
+ /**
+ * Sets [Builder.submission] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.submission] with a well-typed [Submission] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun submission(submission: JsonField) = apply { this.submission = submission }
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_push_transfer`.
+ */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [Type] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ 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 [CardPushTransfer].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .acceptance()
+ * .accountId()
+ * .amount()
+ * .approval()
+ * .businessApplicationIdentifier()
+ * .cancellation()
+ * .createdAt()
+ * .createdBy()
+ * .currency()
+ * .decline()
+ * .idempotencyKey()
+ * .merchantCategoryCode()
+ * .merchantCityName()
+ * .merchantName()
+ * .merchantNamePrefix()
+ * .merchantPostalCode()
+ * .merchantState()
+ * .recipientName()
+ * .senderAddressCity()
+ * .senderAddressLine1()
+ * .senderAddressPostalCode()
+ * .senderAddressState()
+ * .senderName()
+ * .sourceAccountNumberId()
+ * .status()
+ * .submission()
+ * .type()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CardPushTransfer =
+ CardPushTransfer(
+ checkRequired("id", id),
+ checkRequired("acceptance", acceptance),
+ checkRequired("accountId", accountId),
+ checkRequired("amount", amount),
+ checkRequired("approval", approval),
+ checkRequired("businessApplicationIdentifier", businessApplicationIdentifier),
+ checkRequired("cancellation", cancellation),
+ checkRequired("createdAt", createdAt),
+ checkRequired("createdBy", createdBy),
+ checkRequired("currency", currency),
+ checkRequired("decline", decline),
+ checkRequired("idempotencyKey", idempotencyKey),
+ checkRequired("merchantCategoryCode", merchantCategoryCode),
+ checkRequired("merchantCityName", merchantCityName),
+ checkRequired("merchantName", merchantName),
+ checkRequired("merchantNamePrefix", merchantNamePrefix),
+ checkRequired("merchantPostalCode", merchantPostalCode),
+ checkRequired("merchantState", merchantState),
+ checkRequired("recipientName", recipientName),
+ checkRequired("senderAddressCity", senderAddressCity),
+ checkRequired("senderAddressLine1", senderAddressLine1),
+ checkRequired("senderAddressPostalCode", senderAddressPostalCode),
+ checkRequired("senderAddressState", senderAddressState),
+ checkRequired("senderName", senderName),
+ checkRequired("sourceAccountNumberId", sourceAccountNumberId),
+ checkRequired("status", status),
+ checkRequired("submission", submission),
+ checkRequired("type", type),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CardPushTransfer = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ acceptance().ifPresent { it.validate() }
+ accountId()
+ amount()
+ approval().ifPresent { it.validate() }
+ businessApplicationIdentifier().validate()
+ cancellation().ifPresent { it.validate() }
+ createdAt()
+ createdBy().ifPresent { it.validate() }
+ currency().validate()
+ decline().ifPresent { it.validate() }
+ idempotencyKey()
+ merchantCategoryCode()
+ merchantCityName()
+ merchantName()
+ merchantNamePrefix()
+ merchantPostalCode()
+ merchantState()
+ recipientName()
+ senderAddressCity()
+ senderAddressLine1()
+ senderAddressPostalCode()
+ senderAddressState()
+ senderName()
+ sourceAccountNumberId()
+ status().validate()
+ submission().ifPresent { it.validate() }
+ type().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (id.asKnown().isPresent) 1 else 0) +
+ (acceptance.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (accountId.asKnown().isPresent) 1 else 0) +
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (approval.asKnown().getOrNull()?.validity() ?: 0) +
+ (businessApplicationIdentifier.asKnown().getOrNull()?.validity() ?: 0) +
+ (cancellation.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (createdBy.asKnown().getOrNull()?.validity() ?: 0) +
+ (currency.asKnown().getOrNull()?.validity() ?: 0) +
+ (decline.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (idempotencyKey.asKnown().isPresent) 1 else 0) +
+ (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) +
+ (if (merchantCityName.asKnown().isPresent) 1 else 0) +
+ (if (merchantName.asKnown().isPresent) 1 else 0) +
+ (if (merchantNamePrefix.asKnown().isPresent) 1 else 0) +
+ (if (merchantPostalCode.asKnown().isPresent) 1 else 0) +
+ (if (merchantState.asKnown().isPresent) 1 else 0) +
+ (if (recipientName.asKnown().isPresent) 1 else 0) +
+ (if (senderAddressCity.asKnown().isPresent) 1 else 0) +
+ (if (senderAddressLine1.asKnown().isPresent) 1 else 0) +
+ (if (senderAddressPostalCode.asKnown().isPresent) 1 else 0) +
+ (if (senderAddressState.asKnown().isPresent) 1 else 0) +
+ (if (senderName.asKnown().isPresent) 1 else 0) +
+ (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (submission.asKnown().getOrNull()?.validity() ?: 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0)
+
+ /**
+ * If the transfer is accepted by the recipient bank, this will contain supplemental details.
+ */
+ class Acceptance
+ private constructor(
+ private val acceptedAt: JsonField,
+ private val authorizationIdentificationResponse: JsonField,
+ private val cardVerificationValue2Result: JsonField,
+ private val networkTransactionIdentifier: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("accepted_at")
+ @ExcludeMissing
+ acceptedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("authorization_identification_response")
+ @ExcludeMissing
+ authorizationIdentificationResponse: JsonField = JsonMissing.of(),
+ @JsonProperty("card_verification_value2_result")
+ @ExcludeMissing
+ cardVerificationValue2Result: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("network_transaction_identifier")
+ @ExcludeMissing
+ networkTransactionIdentifier: JsonField = JsonMissing.of(),
+ ) : this(
+ acceptedAt,
+ authorizationIdentificationResponse,
+ cardVerificationValue2Result,
+ networkTransactionIdentifier,
+ mutableMapOf(),
+ )
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * transfer was accepted by the issuing bank.
+ *
+ * @throws IncreaseInvalidDataException 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 acceptedAt(): OffsetDateTime = acceptedAt.getRequired("accepted_at")
+
+ /**
+ * The authorization identification response from the issuing bank.
+ *
+ * @throws IncreaseInvalidDataException 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 authorizationIdentificationResponse(): String =
+ authorizationIdentificationResponse.getRequired("authorization_identification_response")
+
+ /**
+ * The result of the Card Verification Value 2 match.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun cardVerificationValue2Result(): Optional =
+ cardVerificationValue2Result.getOptional("card_verification_value2_result")
+
+ /**
+ * A unique identifier for the transaction on the card network.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun networkTransactionIdentifier(): Optional =
+ networkTransactionIdentifier.getOptional("network_transaction_identifier")
+
+ /**
+ * Returns the raw JSON value of [acceptedAt].
+ *
+ * Unlike [acceptedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("accepted_at")
+ @ExcludeMissing
+ fun _acceptedAt(): JsonField = acceptedAt
+
+ /**
+ * Returns the raw JSON value of [authorizationIdentificationResponse].
+ *
+ * Unlike [authorizationIdentificationResponse], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("authorization_identification_response")
+ @ExcludeMissing
+ fun _authorizationIdentificationResponse(): JsonField =
+ authorizationIdentificationResponse
+
+ /**
+ * Returns the raw JSON value of [cardVerificationValue2Result].
+ *
+ * Unlike [cardVerificationValue2Result], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("card_verification_value2_result")
+ @ExcludeMissing
+ fun _cardVerificationValue2Result(): JsonField =
+ cardVerificationValue2Result
+
+ /**
+ * Returns the raw JSON value of [networkTransactionIdentifier].
+ *
+ * Unlike [networkTransactionIdentifier], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("network_transaction_identifier")
+ @ExcludeMissing
+ fun _networkTransactionIdentifier(): JsonField = networkTransactionIdentifier
+
+ @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 [Acceptance].
+ *
+ * The following fields are required:
+ * ```java
+ * .acceptedAt()
+ * .authorizationIdentificationResponse()
+ * .cardVerificationValue2Result()
+ * .networkTransactionIdentifier()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Acceptance]. */
+ class Builder internal constructor() {
+
+ private var acceptedAt: JsonField? = null
+ private var authorizationIdentificationResponse: JsonField? = null
+ private var cardVerificationValue2Result: JsonField? =
+ null
+ private var networkTransactionIdentifier: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(acceptance: Acceptance) = apply {
+ acceptedAt = acceptance.acceptedAt
+ authorizationIdentificationResponse = acceptance.authorizationIdentificationResponse
+ cardVerificationValue2Result = acceptance.cardVerificationValue2Result
+ networkTransactionIdentifier = acceptance.networkTransactionIdentifier
+ additionalProperties = acceptance.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * transfer was accepted by the issuing bank.
+ */
+ fun acceptedAt(acceptedAt: OffsetDateTime) = acceptedAt(JsonField.of(acceptedAt))
+
+ /**
+ * Sets [Builder.acceptedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.acceptedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun acceptedAt(acceptedAt: JsonField) = apply {
+ this.acceptedAt = acceptedAt
+ }
+
+ /** The authorization identification response from the issuing bank. */
+ fun authorizationIdentificationResponse(authorizationIdentificationResponse: String) =
+ authorizationIdentificationResponse(
+ JsonField.of(authorizationIdentificationResponse)
+ )
+
+ /**
+ * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.authorizationIdentificationResponse] with a
+ * well-typed [String] value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun authorizationIdentificationResponse(
+ authorizationIdentificationResponse: JsonField
+ ) = apply {
+ this.authorizationIdentificationResponse = authorizationIdentificationResponse
+ }
+
+ /** The result of the Card Verification Value 2 match. */
+ fun cardVerificationValue2Result(
+ cardVerificationValue2Result: CardVerificationValue2Result?
+ ) = cardVerificationValue2Result(JsonField.ofNullable(cardVerificationValue2Result))
+
+ /**
+ * Alias for calling [Builder.cardVerificationValue2Result] with
+ * `cardVerificationValue2Result.orElse(null)`.
+ */
+ fun cardVerificationValue2Result(
+ cardVerificationValue2Result: Optional
+ ) = cardVerificationValue2Result(cardVerificationValue2Result.getOrNull())
+
+ /**
+ * Sets [Builder.cardVerificationValue2Result] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardVerificationValue2Result] with a well-typed
+ * [CardVerificationValue2Result] value instead. This method is primarily for setting
+ * the field to an undocumented or not yet supported value.
+ */
+ fun cardVerificationValue2Result(
+ cardVerificationValue2Result: JsonField
+ ) = apply { this.cardVerificationValue2Result = cardVerificationValue2Result }
+
+ /** A unique identifier for the transaction on the card network. */
+ fun networkTransactionIdentifier(networkTransactionIdentifier: String?) =
+ networkTransactionIdentifier(JsonField.ofNullable(networkTransactionIdentifier))
+
+ /**
+ * Alias for calling [Builder.networkTransactionIdentifier] with
+ * `networkTransactionIdentifier.orElse(null)`.
+ */
+ fun networkTransactionIdentifier(networkTransactionIdentifier: Optional) =
+ networkTransactionIdentifier(networkTransactionIdentifier.getOrNull())
+
+ /**
+ * Sets [Builder.networkTransactionIdentifier] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.networkTransactionIdentifier] with a well-typed
+ * [String] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun networkTransactionIdentifier(networkTransactionIdentifier: JsonField) =
+ apply {
+ this.networkTransactionIdentifier = networkTransactionIdentifier
+ }
+
+ 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 [Acceptance].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .acceptedAt()
+ * .authorizationIdentificationResponse()
+ * .cardVerificationValue2Result()
+ * .networkTransactionIdentifier()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Acceptance =
+ Acceptance(
+ checkRequired("acceptedAt", acceptedAt),
+ checkRequired(
+ "authorizationIdentificationResponse",
+ authorizationIdentificationResponse,
+ ),
+ checkRequired("cardVerificationValue2Result", cardVerificationValue2Result),
+ checkRequired("networkTransactionIdentifier", networkTransactionIdentifier),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Acceptance = apply {
+ if (validated) {
+ return@apply
+ }
+
+ acceptedAt()
+ authorizationIdentificationResponse()
+ cardVerificationValue2Result().ifPresent { it.validate() }
+ networkTransactionIdentifier()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (acceptedAt.asKnown().isPresent) 1 else 0) +
+ (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) +
+ (cardVerificationValue2Result.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (networkTransactionIdentifier.asKnown().isPresent) 1 else 0)
+
+ /** The result of the Card Verification Value 2 match. */
+ class CardVerificationValue2Result
+ @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 {
+
+ /** The Card Verification Value 2 (CVV2) matches the expected value. */
+ @JvmField val MATCH = of("match")
+
+ /** The Card Verification Value 2 (CVV2) does not match the expected value. */
+ @JvmField val NO_MATCH = of("no_match")
+
+ @JvmStatic fun of(value: String) = CardVerificationValue2Result(JsonField.of(value))
+ }
+
+ /** An enum containing [CardVerificationValue2Result]'s known values. */
+ enum class Known {
+ /** The Card Verification Value 2 (CVV2) matches the expected value. */
+ MATCH,
+ /** The Card Verification Value 2 (CVV2) does not match the expected value. */
+ NO_MATCH,
+ }
+
+ /**
+ * An enum containing [CardVerificationValue2Result]'s known values, as well as an
+ * [_UNKNOWN] member.
+ *
+ * An instance of [CardVerificationValue2Result] 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 {
+ /** The Card Verification Value 2 (CVV2) matches the expected value. */
+ MATCH,
+ /** The Card Verification Value 2 (CVV2) does not match the expected value. */
+ NO_MATCH,
+ /**
+ * An enum member indicating that [CardVerificationValue2Result] 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) {
+ MATCH -> Value.MATCH
+ NO_MATCH -> Value.NO_MATCH
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ MATCH -> Known.MATCH
+ NO_MATCH -> Known.NO_MATCH
+ else ->
+ throw IncreaseInvalidDataException(
+ "Unknown CardVerificationValue2Result: $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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CardVerificationValue2Result = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 CardVerificationValue2Result && 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 Acceptance &&
+ acceptedAt == other.acceptedAt &&
+ authorizationIdentificationResponse == other.authorizationIdentificationResponse &&
+ cardVerificationValue2Result == other.cardVerificationValue2Result &&
+ networkTransactionIdentifier == other.networkTransactionIdentifier &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ acceptedAt,
+ authorizationIdentificationResponse,
+ cardVerificationValue2Result,
+ networkTransactionIdentifier,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Acceptance{acceptedAt=$acceptedAt, authorizationIdentificationResponse=$authorizationIdentificationResponse, cardVerificationValue2Result=$cardVerificationValue2Result, networkTransactionIdentifier=$networkTransactionIdentifier, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * If your account requires approvals for transfers and the transfer was approved, this will
+ * contain details of the approval.
+ */
+ class Approval
+ private constructor(
+ private val approvedAt: JsonField,
+ private val approvedBy: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("approved_at")
+ @ExcludeMissing
+ approvedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("approved_by")
+ @ExcludeMissing
+ approvedBy: JsonField = JsonMissing.of(),
+ ) : this(approvedAt, approvedBy, mutableMapOf())
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * transfer was approved.
+ *
+ * @throws IncreaseInvalidDataException 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 approvedAt(): OffsetDateTime = approvedAt.getRequired("approved_at")
+
+ /**
+ * If the Transfer was approved by a user in the dashboard, the email address of that user.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun approvedBy(): Optional = approvedBy.getOptional("approved_by")
+
+ /**
+ * Returns the raw JSON value of [approvedAt].
+ *
+ * Unlike [approvedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("approved_at")
+ @ExcludeMissing
+ fun _approvedAt(): JsonField = approvedAt
+
+ /**
+ * Returns the raw JSON value of [approvedBy].
+ *
+ * Unlike [approvedBy], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("approved_by")
+ @ExcludeMissing
+ fun _approvedBy(): JsonField = approvedBy
+
+ @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 [Approval].
+ *
+ * The following fields are required:
+ * ```java
+ * .approvedAt()
+ * .approvedBy()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Approval]. */
+ class Builder internal constructor() {
+
+ private var approvedAt: JsonField? = null
+ private var approvedBy: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(approval: Approval) = apply {
+ approvedAt = approval.approvedAt
+ approvedBy = approval.approvedBy
+ additionalProperties = approval.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * transfer was approved.
+ */
+ fun approvedAt(approvedAt: OffsetDateTime) = approvedAt(JsonField.of(approvedAt))
+
+ /**
+ * Sets [Builder.approvedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.approvedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun approvedAt(approvedAt: JsonField) = apply {
+ this.approvedAt = approvedAt
+ }
+
+ /**
+ * If the Transfer was approved by a user in the dashboard, the email address of that
+ * user.
+ */
+ fun approvedBy(approvedBy: String?) = approvedBy(JsonField.ofNullable(approvedBy))
+
+ /** Alias for calling [Builder.approvedBy] with `approvedBy.orElse(null)`. */
+ fun approvedBy(approvedBy: Optional) = approvedBy(approvedBy.getOrNull())
+
+ /**
+ * Sets [Builder.approvedBy] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.approvedBy] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun approvedBy(approvedBy: JsonField) = apply { this.approvedBy = approvedBy }
+
+ 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 [Approval].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .approvedAt()
+ * .approvedBy()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Approval =
+ Approval(
+ checkRequired("approvedAt", approvedAt),
+ checkRequired("approvedBy", approvedBy),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Approval = apply {
+ if (validated) {
+ return@apply
+ }
+
+ approvedAt()
+ approvedBy()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (approvedAt.asKnown().isPresent) 1 else 0) +
+ (if (approvedBy.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Approval &&
+ approvedAt == other.approvedAt &&
+ approvedBy == other.approvedBy &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(approvedAt, approvedBy, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Approval{approvedAt=$approvedAt, approvedBy=$approvedBy, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * The Business Application Identifier describes the type of transaction being performed. Your
+ * program must be approved for the specified Business Application Identifier in order to use
+ * it.
+ */
+ class BusinessApplicationIdentifier
+ @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 {
+
+ /** Account to Account */
+ @JvmField val ACCOUNT_TO_ACCOUNT = of("account_to_account")
+
+ /** Business to Business */
+ @JvmField val BUSINESS_TO_BUSINESS = of("business_to_business")
+
+ /** Money Transfer Bank Initiated */
+ @JvmField val MONEY_TRANSFER_BANK_INITIATED = of("money_transfer_bank_initiated")
+
+ /** Non-Card Bill Payment */
+ @JvmField val NON_CARD_BILL_PAYMENT = of("non_card_bill_payment")
+
+ /** Consumer Bill Payment */
+ @JvmField val CONSUMER_BILL_PAYMENT = of("consumer_bill_payment")
+
+ /** Card Bill Payment */
+ @JvmField val CARD_BILL_PAYMENT = of("card_bill_payment")
+
+ /** Funds Disbursement */
+ @JvmField val FUNDS_DISBURSEMENT = of("funds_disbursement")
+
+ /** Funds Transfer */
+ @JvmField val FUNDS_TRANSFER = of("funds_transfer")
+
+ /** Loyalty and Offers */
+ @JvmField val LOYALTY_AND_OFFERS = of("loyalty_and_offers")
+
+ /** Merchant Disbursement */
+ @JvmField val MERCHANT_DISBURSEMENT = of("merchant_disbursement")
+
+ /** Merchant Payment */
+ @JvmField val MERCHANT_PAYMENT = of("merchant_payment")
+
+ /** Person to Person */
+ @JvmField val PERSON_TO_PERSON = of("person_to_person")
+
+ /** Top Up */
+ @JvmField val TOP_UP = of("top_up")
+
+ /** Wallet Transfer */
+ @JvmField val WALLET_TRANSFER = of("wallet_transfer")
+
+ @JvmStatic fun of(value: String) = BusinessApplicationIdentifier(JsonField.of(value))
+ }
+
+ /** An enum containing [BusinessApplicationIdentifier]'s known values. */
+ enum class Known {
+ /** Account to Account */
+ ACCOUNT_TO_ACCOUNT,
+ /** Business to Business */
+ BUSINESS_TO_BUSINESS,
+ /** Money Transfer Bank Initiated */
+ MONEY_TRANSFER_BANK_INITIATED,
+ /** Non-Card Bill Payment */
+ NON_CARD_BILL_PAYMENT,
+ /** Consumer Bill Payment */
+ CONSUMER_BILL_PAYMENT,
+ /** Card Bill Payment */
+ CARD_BILL_PAYMENT,
+ /** Funds Disbursement */
+ FUNDS_DISBURSEMENT,
+ /** Funds Transfer */
+ FUNDS_TRANSFER,
+ /** Loyalty and Offers */
+ LOYALTY_AND_OFFERS,
+ /** Merchant Disbursement */
+ MERCHANT_DISBURSEMENT,
+ /** Merchant Payment */
+ MERCHANT_PAYMENT,
+ /** Person to Person */
+ PERSON_TO_PERSON,
+ /** Top Up */
+ TOP_UP,
+ /** Wallet Transfer */
+ WALLET_TRANSFER,
+ }
+
+ /**
+ * An enum containing [BusinessApplicationIdentifier]'s known values, as well as an
+ * [_UNKNOWN] member.
+ *
+ * An instance of [BusinessApplicationIdentifier] 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 {
+ /** Account to Account */
+ ACCOUNT_TO_ACCOUNT,
+ /** Business to Business */
+ BUSINESS_TO_BUSINESS,
+ /** Money Transfer Bank Initiated */
+ MONEY_TRANSFER_BANK_INITIATED,
+ /** Non-Card Bill Payment */
+ NON_CARD_BILL_PAYMENT,
+ /** Consumer Bill Payment */
+ CONSUMER_BILL_PAYMENT,
+ /** Card Bill Payment */
+ CARD_BILL_PAYMENT,
+ /** Funds Disbursement */
+ FUNDS_DISBURSEMENT,
+ /** Funds Transfer */
+ FUNDS_TRANSFER,
+ /** Loyalty and Offers */
+ LOYALTY_AND_OFFERS,
+ /** Merchant Disbursement */
+ MERCHANT_DISBURSEMENT,
+ /** Merchant Payment */
+ MERCHANT_PAYMENT,
+ /** Person to Person */
+ PERSON_TO_PERSON,
+ /** Top Up */
+ TOP_UP,
+ /** Wallet Transfer */
+ WALLET_TRANSFER,
+ /**
+ * An enum member indicating that [BusinessApplicationIdentifier] 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) {
+ ACCOUNT_TO_ACCOUNT -> Value.ACCOUNT_TO_ACCOUNT
+ BUSINESS_TO_BUSINESS -> Value.BUSINESS_TO_BUSINESS
+ MONEY_TRANSFER_BANK_INITIATED -> Value.MONEY_TRANSFER_BANK_INITIATED
+ NON_CARD_BILL_PAYMENT -> Value.NON_CARD_BILL_PAYMENT
+ CONSUMER_BILL_PAYMENT -> Value.CONSUMER_BILL_PAYMENT
+ CARD_BILL_PAYMENT -> Value.CARD_BILL_PAYMENT
+ FUNDS_DISBURSEMENT -> Value.FUNDS_DISBURSEMENT
+ FUNDS_TRANSFER -> Value.FUNDS_TRANSFER
+ LOYALTY_AND_OFFERS -> Value.LOYALTY_AND_OFFERS
+ MERCHANT_DISBURSEMENT -> Value.MERCHANT_DISBURSEMENT
+ MERCHANT_PAYMENT -> Value.MERCHANT_PAYMENT
+ PERSON_TO_PERSON -> Value.PERSON_TO_PERSON
+ TOP_UP -> Value.TOP_UP
+ WALLET_TRANSFER -> Value.WALLET_TRANSFER
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ ACCOUNT_TO_ACCOUNT -> Known.ACCOUNT_TO_ACCOUNT
+ BUSINESS_TO_BUSINESS -> Known.BUSINESS_TO_BUSINESS
+ MONEY_TRANSFER_BANK_INITIATED -> Known.MONEY_TRANSFER_BANK_INITIATED
+ NON_CARD_BILL_PAYMENT -> Known.NON_CARD_BILL_PAYMENT
+ CONSUMER_BILL_PAYMENT -> Known.CONSUMER_BILL_PAYMENT
+ CARD_BILL_PAYMENT -> Known.CARD_BILL_PAYMENT
+ FUNDS_DISBURSEMENT -> Known.FUNDS_DISBURSEMENT
+ FUNDS_TRANSFER -> Known.FUNDS_TRANSFER
+ LOYALTY_AND_OFFERS -> Known.LOYALTY_AND_OFFERS
+ MERCHANT_DISBURSEMENT -> Known.MERCHANT_DISBURSEMENT
+ MERCHANT_PAYMENT -> Known.MERCHANT_PAYMENT
+ PERSON_TO_PERSON -> Known.PERSON_TO_PERSON
+ TOP_UP -> Known.TOP_UP
+ WALLET_TRANSFER -> Known.WALLET_TRANSFER
+ else ->
+ throw IncreaseInvalidDataException(
+ "Unknown BusinessApplicationIdentifier: $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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): BusinessApplicationIdentifier = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 BusinessApplicationIdentifier && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * If your account requires approvals for transfers and the transfer was not approved, this will
+ * contain details of the cancellation.
+ */
+ class Cancellation
+ private constructor(
+ private val canceledAt: JsonField,
+ private val canceledBy: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("canceled_at")
+ @ExcludeMissing
+ canceledAt: JsonField = JsonMissing.of(),
+ @JsonProperty("canceled_by")
+ @ExcludeMissing
+ canceledBy: JsonField = JsonMissing.of(),
+ ) : this(canceledAt, canceledBy, mutableMapOf())
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * Transfer was canceled.
+ *
+ * @throws IncreaseInvalidDataException 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 canceledAt(): OffsetDateTime = canceledAt.getRequired("canceled_at")
+
+ /**
+ * If the Transfer was canceled by a user in the dashboard, the email address of that user.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun canceledBy(): Optional = canceledBy.getOptional("canceled_by")
+
+ /**
+ * Returns the raw JSON value of [canceledAt].
+ *
+ * Unlike [canceledAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("canceled_at")
+ @ExcludeMissing
+ fun _canceledAt(): JsonField = canceledAt
+
+ /**
+ * Returns the raw JSON value of [canceledBy].
+ *
+ * Unlike [canceledBy], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("canceled_by")
+ @ExcludeMissing
+ fun _canceledBy(): JsonField = canceledBy
+
+ @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 [Cancellation].
+ *
+ * The following fields are required:
+ * ```java
+ * .canceledAt()
+ * .canceledBy()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Cancellation]. */
+ class Builder internal constructor() {
+
+ private var canceledAt: JsonField? = null
+ private var canceledBy: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cancellation: Cancellation) = apply {
+ canceledAt = cancellation.canceledAt
+ canceledBy = cancellation.canceledBy
+ additionalProperties = cancellation.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * Transfer was canceled.
+ */
+ fun canceledAt(canceledAt: OffsetDateTime) = canceledAt(JsonField.of(canceledAt))
+
+ /**
+ * Sets [Builder.canceledAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.canceledAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun canceledAt(canceledAt: JsonField) = apply {
+ this.canceledAt = canceledAt
+ }
+
+ /**
+ * If the Transfer was canceled by a user in the dashboard, the email address of that
+ * user.
+ */
+ fun canceledBy(canceledBy: String?) = canceledBy(JsonField.ofNullable(canceledBy))
+
+ /** Alias for calling [Builder.canceledBy] with `canceledBy.orElse(null)`. */
+ fun canceledBy(canceledBy: Optional) = canceledBy(canceledBy.getOrNull())
+
+ /**
+ * Sets [Builder.canceledBy] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.canceledBy] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun canceledBy(canceledBy: JsonField) = apply { this.canceledBy = canceledBy }
+
+ 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 [Cancellation].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .canceledAt()
+ * .canceledBy()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Cancellation =
+ Cancellation(
+ checkRequired("canceledAt", canceledAt),
+ checkRequired("canceledBy", canceledBy),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Cancellation = apply {
+ if (validated) {
+ return@apply
+ }
+
+ canceledAt()
+ canceledBy()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (canceledAt.asKnown().isPresent) 1 else 0) +
+ (if (canceledBy.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Cancellation &&
+ canceledAt == other.canceledAt &&
+ canceledBy == other.canceledBy &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(canceledAt, canceledBy, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Cancellation{canceledAt=$canceledAt, canceledBy=$canceledBy, additionalProperties=$additionalProperties}"
+ }
+
+ /** What object created the transfer, either via the API or the dashboard. */
+ class CreatedBy
+ private constructor(
+ private val apiKey: JsonField,
+ private val category: JsonField,
+ private val oauthApplication: JsonField,
+ private val user: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(),
+ @JsonProperty("category")
+ @ExcludeMissing
+ category: JsonField = JsonMissing.of(),
+ @JsonProperty("oauth_application")
+ @ExcludeMissing
+ oauthApplication: JsonField = JsonMissing.of(),
+ @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(),
+ ) : this(apiKey, category, oauthApplication, user, mutableMapOf())
+
+ /**
+ * If present, details about the API key that created the transfer.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun apiKey(): Optional = apiKey.getOptional("api_key")
+
+ /**
+ * The type of object that created this transfer.
+ *
+ * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category")
+
+ /**
+ * If present, details about the OAuth Application that created the transfer.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun oauthApplication(): Optional =
+ oauthApplication.getOptional("oauth_application")
+
+ /**
+ * If present, details about the User that created the transfer.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun user(): Optional = user.getOptional("user")
+
+ /**
+ * Returns the raw JSON value of [apiKey].
+ *
+ * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey
+
+ /**
+ * Returns the raw JSON value of [category].
+ *
+ * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category
+
+ /**
+ * Returns the raw JSON value of [oauthApplication].
+ *
+ * Unlike [oauthApplication], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("oauth_application")
+ @ExcludeMissing
+ fun _oauthApplication(): JsonField = oauthApplication
+
+ /**
+ * Returns the raw JSON value of [user].
+ *
+ * Unlike [user], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("user") @ExcludeMissing fun _user(): JsonField = user
+
+ @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 [CreatedBy].
+ *
+ * The following fields are required:
+ * ```java
+ * .apiKey()
+ * .category()
+ * .oauthApplication()
+ * .user()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CreatedBy]. */
+ class Builder internal constructor() {
+
+ private var apiKey: JsonField? = null
+ private var category: JsonField? = null
+ private var oauthApplication: JsonField? = null
+ private var user: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(createdBy: CreatedBy) = apply {
+ apiKey = createdBy.apiKey
+ category = createdBy.category
+ oauthApplication = createdBy.oauthApplication
+ user = createdBy.user
+ additionalProperties = createdBy.additionalProperties.toMutableMap()
+ }
+
+ /** If present, details about the API key that created the transfer. */
+ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey))
+
+ /** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */
+ fun apiKey(apiKey: Optional) = apiKey(apiKey.getOrNull())
+
+ /**
+ * Sets [Builder.apiKey] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.apiKey] with a well-typed [ApiKey] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey }
+
+ /** The type of object that created this transfer. */
+ fun category(category: Category) = category(JsonField.of(category))
+
+ /**
+ * Sets [Builder.category] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.category] with a well-typed [Category] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun category(category: JsonField