diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cb4cd84d3..1a931c1e0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.347.0" + ".": "0.348.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 238098d13..fff512bc2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9e8783129ea725992844a51e7d6f6a639cae93753228cef7262eccb2e4bae58d.yml -openapi_spec_hash: f1a7326721f814625c7d5484956afded -config_hash: 4489d6e123ed885f5cb74fe619668e4b +configured_endpoints: 228 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e9e51b3c9b5c8d9e6e0267b62a12a00fedbce419b765192aa4e2470984192e1f.yml +openapi_spec_hash: 84bc91dd8b8a80edf447dddad15c23fc +config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/CHANGELOG.md b/CHANGELOG.md index 129577b90..0d84720d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## 0.348.0 (2025-10-31) + +Full Changelog: [v0.347.0...v0.348.0](https://github.com/Increase/increase-java/compare/v0.347.0...v0.348.0) + +### Features + +* **api:** api update ([5d1526d](https://github.com/Increase/increase-java/commit/5d1526d1629bb1dcbf40e3e09a921746c2927337)) +* **api:** api update ([c4c5a15](https://github.com/Increase/increase-java/commit/c4c5a15738430ba9fbd51e320cdbcd5db3060240)) +* **api:** api update ([d3025b1](https://github.com/Increase/increase-java/commit/d3025b144aa584b898034e04f7fc1cb53f0ed5de)) +* **api:** api update ([3b68ad7](https://github.com/Increase/increase-java/commit/3b68ad78944655bafdafdf3c0323652e11576841)) +* **api:** api update ([945eed1](https://github.com/Increase/increase-java/commit/945eed1c35b0d13b9f75b3a7830d0ead3f366db0)) +* **api:** api update ([d0e687c](https://github.com/Increase/increase-java/commit/d0e687c0f89f2a26f0a93a706ed365a906a1bfb9)) +* **api:** api update ([5803cda](https://github.com/Increase/increase-java/commit/5803cdab7196ff122cf8f9aedfaf89e3d33d231e)) +* **api:** api update ([05fd77e](https://github.com/Increase/increase-java/commit/05fd77ecbab2646bc41fcbde45b746f6c74d4674)) +* **api:** api update ([4082773](https://github.com/Increase/increase-java/commit/408277389cbc77d1a840a57a6ad0694bdef6a5e9)) +* **api:** api update ([9438908](https://github.com/Increase/increase-java/commit/94389080530654e684f60a910d4581f6edc19841)) +* **api:** api update ([e135f5f](https://github.com/Increase/increase-java/commit/e135f5f9de55f04bffdd9bf8cdf432cc185ff7dd)) +* **api:** api update ([26c0a6f](https://github.com/Increase/increase-java/commit/26c0a6f5543f3c6b5800b774c37b49c3efdecad7)) +* **api:** api update ([f7b88d8](https://github.com/Increase/increase-java/commit/f7b88d8b6148ab0f33f8c4f937346b2ef0c670d8)) +* **api:** api update ([a57da18](https://github.com/Increase/increase-java/commit/a57da1835b758b295c18930ead890ab1469997f5)) +* **api:** api update ([a7c29d9](https://github.com/Increase/increase-java/commit/a7c29d9eb1fcd85020ae654163f7a08aa6d606dd)) +* **api:** api update ([ee7968d](https://github.com/Increase/increase-java/commit/ee7968ddfed0a889d9c6cb4a0033d041ed07f751)) +* **api:** api update ([2111373](https://github.com/Increase/increase-java/commit/2111373ba896c63c028db86bc55b4f4cc15ab84c)) +* **api:** api update ([4cc243c](https://github.com/Increase/increase-java/commit/4cc243c53315482c3f0c4e66b83e1a97002075ad)) +* **api:** api update ([627c529](https://github.com/Increase/increase-java/commit/627c5290ea4b54edabb8ac80c45c5c4309ece8a1)) +* **api:** api update ([c2aa9ee](https://github.com/Increase/increase-java/commit/c2aa9ee013d28d1f078de229881f1feb3dfc32b4)) +* **api:** api update ([5bf05d8](https://github.com/Increase/increase-java/commit/5bf05d830f2ce0adeb347c992ae637d2256e2523)) +* **api:** api update ([2049ebb](https://github.com/Increase/increase-java/commit/2049ebb7ae2a221317c692c6b5e66860937e88f5)) +* **api:** api update ([4e3ec15](https://github.com/Increase/increase-java/commit/4e3ec15caa8c049362a17bd5d29c0f1857d6c711)) +* **api:** api update ([dbb50b0](https://github.com/Increase/increase-java/commit/dbb50b0f1b0225cda41b3cb3a2c3e0394be13f09)) +* **api:** api update ([a14bd3d](https://github.com/Increase/increase-java/commit/a14bd3d085793249c465069b89c3260e1b5ccfec)) +* **api:** api update ([a053a21](https://github.com/Increase/increase-java/commit/a053a213225c53d204b741b9c149ac0448aa60f3)) +* **api:** api update ([2344228](https://github.com/Increase/increase-java/commit/2344228fddb443ad50a3c4c0b6b6d8a6054f9125)) +* **api:** api update ([8933f23](https://github.com/Increase/increase-java/commit/8933f23c50360ad105a07d1b885f4a64143830be)) +* **api:** api update ([1c75bae](https://github.com/Increase/increase-java/commit/1c75baeb3991dc02fa1898d0a77c0f662473f610)) +* **api:** api update ([0b6df76](https://github.com/Increase/increase-java/commit/0b6df767c9f4b65cf437e57d55377a258d49c1a4)) + ## 0.347.0 (2025-10-06) Full Changelog: [v0.346.0...v0.347.0](https://github.com/Increase/increase-java/compare/v0.346.0...v0.347.0) diff --git a/README.md b/README.md index 4829dd052..becda8379 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.347.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.347.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.347.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.348.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.348.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.348.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.347.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.348.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.347.0") +implementation("com.increase.api:increase-java:0.348.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.347.0") com.increase.api increase-java - 0.347.0 + 0.348.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 3e6cc96e1..2ef7968f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.347.0" // x-release-please-version + version = "0.348.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 4de8c0ea2..dc57ab706 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 @@ -30,11 +30,13 @@ import com.increase.api.services.blocking.EventService import com.increase.api.services.blocking.EventSubscriptionService import com.increase.api.services.blocking.ExportService import com.increase.api.services.blocking.ExternalAccountService +import com.increase.api.services.blocking.FednowTransferService import com.increase.api.services.blocking.FileLinkService import com.increase.api.services.blocking.FileService import com.increase.api.services.blocking.GroupService import com.increase.api.services.blocking.InboundAchTransferService import com.increase.api.services.blocking.InboundCheckDepositService +import com.increase.api.services.blocking.InboundFednowTransferService import com.increase.api.services.blocking.InboundMailItemService import com.increase.api.services.blocking.InboundRealTimePaymentsTransferService import com.increase.api.services.blocking.InboundWireDrawdownRequestService @@ -147,6 +149,10 @@ interface IncreaseClient { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService + fun fednowTransfers(): FednowTransferService + + fun inboundFednowTransfers(): InboundFednowTransferService + fun checkDeposits(): CheckDepositService fun lockboxes(): LockboxService @@ -283,6 +289,10 @@ interface IncreaseClient { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService.WithRawResponse + fun fednowTransfers(): FednowTransferService.WithRawResponse + + fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse + fun checkDeposits(): CheckDepositService.WithRawResponse fun lockboxes(): LockboxService.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 ac800b994..be4579776 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 @@ -30,11 +30,13 @@ import com.increase.api.services.async.EventServiceAsync import com.increase.api.services.async.EventSubscriptionServiceAsync import com.increase.api.services.async.ExportServiceAsync import com.increase.api.services.async.ExternalAccountServiceAsync +import com.increase.api.services.async.FednowTransferServiceAsync import com.increase.api.services.async.FileLinkServiceAsync import com.increase.api.services.async.FileServiceAsync import com.increase.api.services.async.GroupServiceAsync import com.increase.api.services.async.InboundAchTransferServiceAsync import com.increase.api.services.async.InboundCheckDepositServiceAsync +import com.increase.api.services.async.InboundFednowTransferServiceAsync import com.increase.api.services.async.InboundMailItemServiceAsync import com.increase.api.services.async.InboundRealTimePaymentsTransferServiceAsync import com.increase.api.services.async.InboundWireDrawdownRequestServiceAsync @@ -147,6 +149,10 @@ interface IncreaseClientAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync + fun fednowTransfers(): FednowTransferServiceAsync + + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync + fun checkDeposits(): CheckDepositServiceAsync fun lockboxes(): LockboxServiceAsync @@ -287,6 +293,10 @@ interface IncreaseClientAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync.WithRawResponse + fun fednowTransfers(): FednowTransferServiceAsync.WithRawResponse + + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse + fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse fun lockboxes(): LockboxServiceAsync.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 1adb82f42..ddb03d381 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 @@ -58,6 +58,8 @@ import com.increase.api.services.async.ExportServiceAsync import com.increase.api.services.async.ExportServiceAsyncImpl import com.increase.api.services.async.ExternalAccountServiceAsync import com.increase.api.services.async.ExternalAccountServiceAsyncImpl +import com.increase.api.services.async.FednowTransferServiceAsync +import com.increase.api.services.async.FednowTransferServiceAsyncImpl import com.increase.api.services.async.FileLinkServiceAsync import com.increase.api.services.async.FileLinkServiceAsyncImpl import com.increase.api.services.async.FileServiceAsync @@ -68,6 +70,8 @@ import com.increase.api.services.async.InboundAchTransferServiceAsync import com.increase.api.services.async.InboundAchTransferServiceAsyncImpl import com.increase.api.services.async.InboundCheckDepositServiceAsync import com.increase.api.services.async.InboundCheckDepositServiceAsyncImpl +import com.increase.api.services.async.InboundFednowTransferServiceAsync +import com.increase.api.services.async.InboundFednowTransferServiceAsyncImpl import com.increase.api.services.async.InboundMailItemServiceAsync import com.increase.api.services.async.InboundMailItemServiceAsyncImpl import com.increase.api.services.async.InboundRealTimePaymentsTransferServiceAsync @@ -234,6 +238,14 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsyncImpl(clientOptionsWithUserAgent) } + private val fednowTransfers: FednowTransferServiceAsync by lazy { + FednowTransferServiceAsyncImpl(clientOptionsWithUserAgent) + } + + private val inboundFednowTransfers: InboundFednowTransferServiceAsync by lazy { + InboundFednowTransferServiceAsyncImpl(clientOptionsWithUserAgent) + } + private val checkDeposits: CheckDepositServiceAsync by lazy { CheckDepositServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -415,6 +427,11 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferServiceAsync = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync = checkDeposits override fun lockboxes(): LockboxServiceAsync = lockboxes @@ -587,6 +604,15 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val fednowTransfers: FednowTransferServiceAsync.WithRawResponse by lazy { + FednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val inboundFednowTransfers: + InboundFednowTransferServiceAsync.WithRawResponse by lazy { + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync.WithRawResponse by lazy { CheckDepositServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -782,6 +808,11 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsync.WithRawResponse = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferServiceAsync.WithRawResponse = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse = checkDeposits override fun lockboxes(): LockboxServiceAsync.WithRawResponse = lockboxes 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 0f57c4411..021a9434d 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 @@ -58,6 +58,8 @@ import com.increase.api.services.blocking.ExportService import com.increase.api.services.blocking.ExportServiceImpl import com.increase.api.services.blocking.ExternalAccountService import com.increase.api.services.blocking.ExternalAccountServiceImpl +import com.increase.api.services.blocking.FednowTransferService +import com.increase.api.services.blocking.FednowTransferServiceImpl import com.increase.api.services.blocking.FileLinkService import com.increase.api.services.blocking.FileLinkServiceImpl import com.increase.api.services.blocking.FileService @@ -68,6 +70,8 @@ import com.increase.api.services.blocking.InboundAchTransferService import com.increase.api.services.blocking.InboundAchTransferServiceImpl import com.increase.api.services.blocking.InboundCheckDepositService import com.increase.api.services.blocking.InboundCheckDepositServiceImpl +import com.increase.api.services.blocking.InboundFednowTransferService +import com.increase.api.services.blocking.InboundFednowTransferServiceImpl import com.increase.api.services.blocking.InboundMailItemService import com.increase.api.services.blocking.InboundMailItemServiceImpl import com.increase.api.services.blocking.InboundRealTimePaymentsTransferService @@ -231,6 +235,14 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferServiceImpl(clientOptionsWithUserAgent) } + private val fednowTransfers: FednowTransferService by lazy { + FednowTransferServiceImpl(clientOptionsWithUserAgent) + } + + private val inboundFednowTransfers: InboundFednowTransferService by lazy { + InboundFednowTransferServiceImpl(clientOptionsWithUserAgent) + } + private val checkDeposits: CheckDepositService by lazy { CheckDepositServiceImpl(clientOptionsWithUserAgent) } @@ -399,6 +411,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferService = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferService = inboundFednowTransfers + override fun checkDeposits(): CheckDepositService = checkDeposits override fun lockboxes(): LockboxService = lockboxes @@ -570,6 +586,14 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferServiceImpl.WithRawResponseImpl(clientOptions) } + private val fednowTransfers: FednowTransferService.WithRawResponse by lazy { + FednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val inboundFednowTransfers: InboundFednowTransferService.WithRawResponse by lazy { + InboundFednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositService.WithRawResponse by lazy { CheckDepositServiceImpl.WithRawResponseImpl(clientOptions) } @@ -763,6 +787,11 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferService.WithRawResponse = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferService.WithRawResponse = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositService.WithRawResponse = checkDeposits override fun lockboxes(): LockboxService.WithRawResponse = lockboxes diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt index 15743c3ee..34891d29d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt @@ -45,7 +45,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -163,7 +163,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. */ fun informationalEntityId(informationalEntityId: String) = apply { body.informationalEntityId(informationalEntityId) @@ -380,7 +380,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -497,7 +497,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with - * its activity. Its relationship to your group must be `informational`. + * its activity. This is generally the beneficiary of the funds. */ fun informationalEntityId(informationalEntityId: String) = informationalEntityId(JsonField.of(informationalEntityId)) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt index da96e5dde..e7e3be514 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt @@ -9434,6 +9434,7 @@ private constructor( class Submission @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val administrativeReturnsExpectedBy: JsonField, private val effectiveDate: JsonField, private val expectedFundsSettlementAt: JsonField, private val expectedSettlementSchedule: JsonField, @@ -9444,6 +9445,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("administrative_returns_expected_by") + @ExcludeMissing + administrativeReturnsExpectedBy: JsonField = JsonMissing.of(), @JsonProperty("effective_date") @ExcludeMissing effectiveDate: JsonField = JsonMissing.of(), @@ -9460,6 +9464,7 @@ private constructor( @ExcludeMissing traceNumber: JsonField = JsonMissing.of(), ) : this( + administrativeReturnsExpectedBy, effectiveDate, expectedFundsSettlementAt, expectedSettlementSchedule, @@ -9468,6 +9473,19 @@ private constructor( mutableMapOf(), ) + /** + * The timestamp by which any administrative returns are expected to be received by. This + * follows the NACHA guidelines for return windows, which are: "In general, return entries + * must be received by the RDFI’s ACH Operator by its deposit deadline for the return entry + * to be made available to the ODFI no later than the opening of business on the second + * banking day following the Settlement Date of the original entry.". + * + * @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 administrativeReturnsExpectedBy(): OffsetDateTime = + administrativeReturnsExpectedBy.getRequired("administrative_returns_expected_by") + /** * The ACH transfer's effective date as sent to the Federal Reserve. If a specific date was * configured using `preferred_effective_date`, this will match that value. Otherwise, it @@ -9519,6 +9537,17 @@ private constructor( */ fun traceNumber(): String = traceNumber.getRequired("trace_number") + /** + * Returns the raw JSON value of [administrativeReturnsExpectedBy]. + * + * Unlike [administrativeReturnsExpectedBy], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("administrative_returns_expected_by") + @ExcludeMissing + fun _administrativeReturnsExpectedBy(): JsonField = + administrativeReturnsExpectedBy + /** * Returns the raw JSON value of [effectiveDate]. * @@ -9587,6 +9616,7 @@ private constructor( * * The following fields are required: * ```java + * .administrativeReturnsExpectedBy() * .effectiveDate() * .expectedFundsSettlementAt() * .expectedSettlementSchedule() @@ -9600,6 +9630,7 @@ private constructor( /** A builder for [Submission]. */ class Builder internal constructor() { + private var administrativeReturnsExpectedBy: JsonField? = null private var effectiveDate: JsonField? = null private var expectedFundsSettlementAt: JsonField? = null private var expectedSettlementSchedule: JsonField? = null @@ -9609,6 +9640,7 @@ private constructor( @JvmSynthetic internal fun from(submission: Submission) = apply { + administrativeReturnsExpectedBy = submission.administrativeReturnsExpectedBy effectiveDate = submission.effectiveDate expectedFundsSettlementAt = submission.expectedFundsSettlementAt expectedSettlementSchedule = submission.expectedSettlementSchedule @@ -9617,6 +9649,27 @@ private constructor( additionalProperties = submission.additionalProperties.toMutableMap() } + /** + * The timestamp by which any administrative returns are expected to be received by. + * This follows the NACHA guidelines for return windows, which are: "In general, return + * entries must be received by the RDFI’s ACH Operator by its deposit deadline for the + * return entry to be made available to the ODFI no later than the opening of business + * on the second banking day following the Settlement Date of the original entry.". + */ + fun administrativeReturnsExpectedBy(administrativeReturnsExpectedBy: OffsetDateTime) = + administrativeReturnsExpectedBy(JsonField.of(administrativeReturnsExpectedBy)) + + /** + * Sets [Builder.administrativeReturnsExpectedBy] to an arbitrary JSON value. + * + * You should usually call [Builder.administrativeReturnsExpectedBy] with a well-typed + * [OffsetDateTime] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun administrativeReturnsExpectedBy( + administrativeReturnsExpectedBy: JsonField + ) = apply { this.administrativeReturnsExpectedBy = administrativeReturnsExpectedBy } + /** * The ACH transfer's effective date as sent to the Federal Reserve. If a specific date * was configured using `preferred_effective_date`, this will match that value. @@ -9734,6 +9787,7 @@ private constructor( * * The following fields are required: * ```java + * .administrativeReturnsExpectedBy() * .effectiveDate() * .expectedFundsSettlementAt() * .expectedSettlementSchedule() @@ -9745,6 +9799,10 @@ private constructor( */ fun build(): Submission = Submission( + checkRequired( + "administrativeReturnsExpectedBy", + administrativeReturnsExpectedBy, + ), checkRequired("effectiveDate", effectiveDate), checkRequired("expectedFundsSettlementAt", expectedFundsSettlementAt), checkRequired("expectedSettlementSchedule", expectedSettlementSchedule), @@ -9761,6 +9819,7 @@ private constructor( return@apply } + administrativeReturnsExpectedBy() effectiveDate() expectedFundsSettlementAt() expectedSettlementSchedule().validate() @@ -9785,7 +9844,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (effectiveDate.asKnown().isPresent) 1 else 0) + + (if (administrativeReturnsExpectedBy.asKnown().isPresent) 1 else 0) + + (if (effectiveDate.asKnown().isPresent) 1 else 0) + (if (expectedFundsSettlementAt.asKnown().isPresent) 1 else 0) + (expectedSettlementSchedule.asKnown().getOrNull()?.validity() ?: 0) + (if (submittedAt.asKnown().isPresent) 1 else 0) + @@ -9944,6 +10004,7 @@ private constructor( } return other is Submission && + administrativeReturnsExpectedBy == other.administrativeReturnsExpectedBy && effectiveDate == other.effectiveDate && expectedFundsSettlementAt == other.expectedFundsSettlementAt && expectedSettlementSchedule == other.expectedSettlementSchedule && @@ -9954,6 +10015,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + administrativeReturnsExpectedBy, effectiveDate, expectedFundsSettlementAt, expectedSettlementSchedule, @@ -9966,7 +10028,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Submission{effectiveDate=$effectiveDate, expectedFundsSettlementAt=$expectedFundsSettlementAt, expectedSettlementSchedule=$expectedSettlementSchedule, submittedAt=$submittedAt, traceNumber=$traceNumber, additionalProperties=$additionalProperties}" + "Submission{administrativeReturnsExpectedBy=$administrativeReturnsExpectedBy, effectiveDate=$effectiveDate, expectedFundsSettlementAt=$expectedFundsSettlementAt, expectedSettlementSchedule=$expectedSettlementSchedule, submittedAt=$submittedAt, traceNumber=$traceNumber, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index d8633d825..6dbf64042 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -1040,13 +1040,18 @@ private constructor( /** Visa: details will be under the `visa` object. */ @JvmField val VISA = of("visa") + /** Pulse: details will be under the `pulse` object. */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa: details will be under the `visa` object. */ - VISA + VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, } /** @@ -1061,6 +1066,8 @@ private constructor( enum class Value { /** Visa: details will be under the `visa` object. */ VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, /** An enum member indicating that [Network] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1075,6 +1082,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -1090,6 +1098,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -1755,21 +1764,22 @@ private constructor( private constructor( private val attachmentFiles: JsonField>, private val category: JsonField, - private val chargebackAccepted: JsonValue, - private val chargebackSubmitted: JsonValue, - private val chargebackTimedOut: JsonValue, + private val chargebackAccepted: JsonField, + private val chargebackSubmitted: JsonField, + private val chargebackTimedOut: JsonField, private val createdAt: JsonField, private val disputeFinancialTransactionId: JsonField, - private val merchantPrearbitrationDeclineSubmitted: JsonValue, + private val merchantPrearbitrationDeclineSubmitted: + JsonField, private val merchantPrearbitrationReceived: JsonField, - private val merchantPrearbitrationTimedOut: JsonValue, + private val merchantPrearbitrationTimedOut: JsonField, private val represented: JsonField, - private val representmentTimedOut: JsonValue, - private val userPrearbitrationAccepted: JsonValue, - private val userPrearbitrationDeclined: JsonValue, - private val userPrearbitrationSubmitted: JsonValue, - private val userPrearbitrationTimedOut: JsonValue, - private val userWithdrawalSubmitted: JsonValue, + private val representmentTimedOut: JsonField, + private val userPrearbitrationAccepted: JsonField, + private val userPrearbitrationDeclined: JsonField, + private val userPrearbitrationSubmitted: JsonField, + private val userPrearbitrationTimedOut: JsonField, + private val userWithdrawalSubmitted: JsonField, private val additionalProperties: MutableMap, ) { @@ -1783,13 +1793,13 @@ private constructor( category: JsonField = JsonMissing.of(), @JsonProperty("chargeback_accepted") @ExcludeMissing - chargebackAccepted: JsonValue = JsonMissing.of(), + chargebackAccepted: JsonField = JsonMissing.of(), @JsonProperty("chargeback_submitted") @ExcludeMissing - chargebackSubmitted: JsonValue = JsonMissing.of(), + chargebackSubmitted: JsonField = JsonMissing.of(), @JsonProperty("chargeback_timed_out") @ExcludeMissing - chargebackTimedOut: JsonValue = JsonMissing.of(), + chargebackTimedOut: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @@ -1798,35 +1808,42 @@ private constructor( disputeFinancialTransactionId: JsonField = JsonMissing.of(), @JsonProperty("merchant_prearbitration_decline_submitted") @ExcludeMissing - merchantPrearbitrationDeclineSubmitted: JsonValue = JsonMissing.of(), + merchantPrearbitrationDeclineSubmitted: + JsonField = + JsonMissing.of(), @JsonProperty("merchant_prearbitration_received") @ExcludeMissing merchantPrearbitrationReceived: JsonField = JsonMissing.of(), @JsonProperty("merchant_prearbitration_timed_out") @ExcludeMissing - merchantPrearbitrationTimedOut: JsonValue = JsonMissing.of(), + merchantPrearbitrationTimedOut: JsonField = + JsonMissing.of(), @JsonProperty("represented") @ExcludeMissing represented: JsonField = JsonMissing.of(), @JsonProperty("representment_timed_out") @ExcludeMissing - representmentTimedOut: JsonValue = JsonMissing.of(), + representmentTimedOut: JsonField = JsonMissing.of(), @JsonProperty("user_prearbitration_accepted") @ExcludeMissing - userPrearbitrationAccepted: JsonValue = JsonMissing.of(), + userPrearbitrationAccepted: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_declined") @ExcludeMissing - userPrearbitrationDeclined: JsonValue = JsonMissing.of(), + userPrearbitrationDeclined: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_submitted") @ExcludeMissing - userPrearbitrationSubmitted: JsonValue = JsonMissing.of(), + userPrearbitrationSubmitted: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_timed_out") @ExcludeMissing - userPrearbitrationTimedOut: JsonValue = JsonMissing.of(), + userPrearbitrationTimedOut: JsonField = + JsonMissing.of(), @JsonProperty("user_withdrawal_submitted") @ExcludeMissing - userWithdrawalSubmitted: JsonValue = JsonMissing.of(), + userWithdrawalSubmitted: JsonField = JsonMissing.of(), ) : this( attachmentFiles, category, @@ -1874,10 +1891,12 @@ private constructor( * `chargeback_accepted`. Contains the details specific to a chargeback accepted Visa * Card Dispute Network Event, which represents that a chargeback has been accepted by * the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_accepted") - @ExcludeMissing - fun _chargebackAccepted(): JsonValue = chargebackAccepted + fun chargebackAccepted(): Optional = + chargebackAccepted.getOptional("chargeback_accepted") /** * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be @@ -1885,10 +1904,12 @@ private constructor( * `chargeback_submitted`. Contains the details specific to a chargeback submitted Visa * Card Dispute Network Event, which represents that a chargeback has been submitted to * the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_submitted") - @ExcludeMissing - fun _chargebackSubmitted(): JsonValue = chargebackSubmitted + fun chargebackSubmitted(): Optional = + chargebackSubmitted.getOptional("chargeback_submitted") /** * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be @@ -1896,10 +1917,12 @@ private constructor( * `chargeback_timed_out`. Contains the details specific to a chargeback timed out Visa * Card Dispute Network Event, which represents that the chargeback has timed out in the * user's favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_timed_out") - @ExcludeMissing - fun _chargebackTimedOut(): JsonValue = chargebackTimedOut + fun chargebackTimedOut(): Optional = + chargebackTimedOut.getOptional("chargeback_timed_out") /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the @@ -1927,11 +1950,15 @@ private constructor( * merchant prearbitration decline submitted Visa Card Dispute Network Event, which * represents that the user has declined the merchant's request for a prearbitration * request decision in their favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("merchant_prearbitration_decline_submitted") - @ExcludeMissing - fun _merchantPrearbitrationDeclineSubmitted(): JsonValue = - merchantPrearbitrationDeclineSubmitted + fun merchantPrearbitrationDeclineSubmitted(): + Optional = + merchantPrearbitrationDeclineSubmitted.getOptional( + "merchant_prearbitration_decline_submitted" + ) /** * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This @@ -1952,10 +1979,12 @@ private constructor( * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant * prearbitration timed out Visa Card Dispute Network Event, which represents that the * user has timed out responding to the merchant's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("merchant_prearbitration_timed_out") - @ExcludeMissing - fun _merchantPrearbitrationTimedOut(): JsonValue = merchantPrearbitrationTimedOut + fun merchantPrearbitrationTimedOut(): Optional = + merchantPrearbitrationTimedOut.getOptional("merchant_prearbitration_timed_out") /** * A Card Dispute Re-presented Visa Network Event object. This field will be present in @@ -1975,10 +2004,12 @@ private constructor( * `representment_timed_out`. Contains the details specific to a re-presentment time-out * Visa Card Dispute Network Event, which represents that the user did not respond to * the re-presentment by the merchant within the time limit. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("representment_timed_out") - @ExcludeMissing - fun _representmentTimedOut(): JsonValue = representmentTimedOut + fun representmentTimedOut(): Optional = + representmentTimedOut.getOptional("representment_timed_out") /** * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This field @@ -1986,10 +2017,12 @@ private constructor( * `user_prearbitration_accepted`. Contains the details specific to a user * prearbitration accepted Visa Card Dispute Network Event, which represents that the * merchant has accepted the user's prearbitration request in the user's favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_accepted") - @ExcludeMissing - fun _userPrearbitrationAccepted(): JsonValue = userPrearbitrationAccepted + fun userPrearbitrationAccepted(): Optional = + userPrearbitrationAccepted.getOptional("user_prearbitration_accepted") /** * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This field @@ -1997,10 +2030,12 @@ private constructor( * `user_prearbitration_declined`. Contains the details specific to a user * prearbitration declined Visa Card Dispute Network Event, which represents that the * merchant has declined the user's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_declined") - @ExcludeMissing - fun _userPrearbitrationDeclined(): JsonValue = userPrearbitrationDeclined + fun userPrearbitrationDeclined(): Optional = + userPrearbitrationDeclined.getOptional("user_prearbitration_declined") /** * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This field @@ -2008,10 +2043,12 @@ private constructor( * `user_prearbitration_submitted`. Contains the details specific to a user * prearbitration submitted Visa Card Dispute Network Event, which represents that the * user's request for prearbitration has been submitted to the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_submitted") - @ExcludeMissing - fun _userPrearbitrationSubmitted(): JsonValue = userPrearbitrationSubmitted + fun userPrearbitrationSubmitted(): Optional = + userPrearbitrationSubmitted.getOptional("user_prearbitration_submitted") /** * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This field @@ -2019,10 +2056,12 @@ private constructor( * `user_prearbitration_timed_out`. Contains the details specific to a user * prearbitration timed out Visa Card Dispute Network Event, which represents that the * merchant has timed out responding to the user's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_timed_out") - @ExcludeMissing - fun _userPrearbitrationTimedOut(): JsonValue = userPrearbitrationTimedOut + fun userPrearbitrationTimedOut(): Optional = + userPrearbitrationTimedOut.getOptional("user_prearbitration_timed_out") /** * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field will @@ -2030,10 +2069,12 @@ private constructor( * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal * submitted Visa Card Dispute Network Event, which represents that the user's request * to withdraw the dispute has been submitted to the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_withdrawal_submitted") - @ExcludeMissing - fun _userWithdrawalSubmitted(): JsonValue = userWithdrawalSubmitted + fun userWithdrawalSubmitted(): Optional = + userWithdrawalSubmitted.getOptional("user_withdrawal_submitted") /** * Returns the raw JSON value of [attachmentFiles]. @@ -2055,6 +2096,36 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [chargebackAccepted]. + * + * Unlike [chargebackAccepted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_accepted") + @ExcludeMissing + fun _chargebackAccepted(): JsonField = chargebackAccepted + + /** + * Returns the raw JSON value of [chargebackSubmitted]. + * + * Unlike [chargebackSubmitted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_submitted") + @ExcludeMissing + fun _chargebackSubmitted(): JsonField = chargebackSubmitted + + /** + * Returns the raw JSON value of [chargebackTimedOut]. + * + * Unlike [chargebackTimedOut], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_timed_out") + @ExcludeMissing + fun _chargebackTimedOut(): JsonField = chargebackTimedOut + /** * Returns the raw JSON value of [createdAt]. * @@ -2075,6 +2146,18 @@ private constructor( @ExcludeMissing fun _disputeFinancialTransactionId(): JsonField = disputeFinancialTransactionId + /** + * Returns the raw JSON value of [merchantPrearbitrationDeclineSubmitted]. + * + * Unlike [merchantPrearbitrationDeclineSubmitted], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("merchant_prearbitration_decline_submitted") + @ExcludeMissing + fun _merchantPrearbitrationDeclineSubmitted(): + JsonField = + merchantPrearbitrationDeclineSubmitted + /** * Returns the raw JSON value of [merchantPrearbitrationReceived]. * @@ -2086,6 +2169,17 @@ private constructor( fun _merchantPrearbitrationReceived(): JsonField = merchantPrearbitrationReceived + /** + * Returns the raw JSON value of [merchantPrearbitrationTimedOut]. + * + * Unlike [merchantPrearbitrationTimedOut], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("merchant_prearbitration_timed_out") + @ExcludeMissing + fun _merchantPrearbitrationTimedOut(): JsonField = + merchantPrearbitrationTimedOut + /** * Returns the raw JSON value of [represented]. * @@ -2096,6 +2190,71 @@ private constructor( @ExcludeMissing fun _represented(): JsonField = represented + /** + * Returns the raw JSON value of [representmentTimedOut]. + * + * Unlike [representmentTimedOut], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("representment_timed_out") + @ExcludeMissing + fun _representmentTimedOut(): JsonField = representmentTimedOut + + /** + * Returns the raw JSON value of [userPrearbitrationAccepted]. + * + * Unlike [userPrearbitrationAccepted], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_accepted") + @ExcludeMissing + fun _userPrearbitrationAccepted(): JsonField = + userPrearbitrationAccepted + + /** + * Returns the raw JSON value of [userPrearbitrationDeclined]. + * + * Unlike [userPrearbitrationDeclined], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_declined") + @ExcludeMissing + fun _userPrearbitrationDeclined(): JsonField = + userPrearbitrationDeclined + + /** + * Returns the raw JSON value of [userPrearbitrationSubmitted]. + * + * Unlike [userPrearbitrationSubmitted], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_submitted") + @ExcludeMissing + fun _userPrearbitrationSubmitted(): JsonField = + userPrearbitrationSubmitted + + /** + * Returns the raw JSON value of [userPrearbitrationTimedOut]. + * + * Unlike [userPrearbitrationTimedOut], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_timed_out") + @ExcludeMissing + fun _userPrearbitrationTimedOut(): JsonField = + userPrearbitrationTimedOut + + /** + * Returns the raw JSON value of [userWithdrawalSubmitted]. + * + * Unlike [userWithdrawalSubmitted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("user_withdrawal_submitted") + @ExcludeMissing + fun _userWithdrawalSubmitted(): JsonField = + userWithdrawalSubmitted + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -2142,23 +2301,31 @@ private constructor( private var attachmentFiles: JsonField>? = null private var category: JsonField? = null - private var chargebackAccepted: JsonValue? = null - private var chargebackSubmitted: JsonValue? = null - private var chargebackTimedOut: JsonValue? = null + private var chargebackAccepted: JsonField? = null + private var chargebackSubmitted: JsonField? = null + private var chargebackTimedOut: JsonField? = null private var createdAt: JsonField? = null private var disputeFinancialTransactionId: JsonField? = null - private var merchantPrearbitrationDeclineSubmitted: JsonValue? = null + private var merchantPrearbitrationDeclineSubmitted: + JsonField? = + null private var merchantPrearbitrationReceived: JsonField? = null - private var merchantPrearbitrationTimedOut: JsonValue? = null + private var merchantPrearbitrationTimedOut: + JsonField? = + null private var represented: JsonField? = null - private var representmentTimedOut: JsonValue? = null - private var userPrearbitrationAccepted: JsonValue? = null - private var userPrearbitrationDeclined: JsonValue? = null - private var userPrearbitrationSubmitted: JsonValue? = null - private var userPrearbitrationTimedOut: JsonValue? = null - private var userWithdrawalSubmitted: JsonValue? = null + private var representmentTimedOut: JsonField? = null + private var userPrearbitrationAccepted: JsonField? = + null + private var userPrearbitrationDeclined: JsonField? = + null + private var userPrearbitrationSubmitted: JsonField? = + null + private var userPrearbitrationTimedOut: JsonField? = + null + private var userWithdrawalSubmitted: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -2234,7 +2401,24 @@ private constructor( * Visa Card Dispute Network Event, which represents that a chargeback has been * accepted by the merchant. */ - fun chargebackAccepted(chargebackAccepted: JsonValue) = apply { + fun chargebackAccepted(chargebackAccepted: ChargebackAccepted?) = + chargebackAccepted(JsonField.ofNullable(chargebackAccepted)) + + /** + * Alias for calling [Builder.chargebackAccepted] with + * `chargebackAccepted.orElse(null)`. + */ + fun chargebackAccepted(chargebackAccepted: Optional) = + chargebackAccepted(chargebackAccepted.getOrNull()) + + /** + * Sets [Builder.chargebackAccepted] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackAccepted] with a well-typed + * [ChargebackAccepted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackAccepted(chargebackAccepted: JsonField) = apply { this.chargebackAccepted = chargebackAccepted } @@ -2245,9 +2429,27 @@ private constructor( * Visa Card Dispute Network Event, which represents that a chargeback has been * submitted to the network. */ - fun chargebackSubmitted(chargebackSubmitted: JsonValue) = apply { - this.chargebackSubmitted = chargebackSubmitted - } + fun chargebackSubmitted(chargebackSubmitted: ChargebackSubmitted?) = + chargebackSubmitted(JsonField.ofNullable(chargebackSubmitted)) + + /** + * Alias for calling [Builder.chargebackSubmitted] with + * `chargebackSubmitted.orElse(null)`. + */ + fun chargebackSubmitted(chargebackSubmitted: Optional) = + chargebackSubmitted(chargebackSubmitted.getOrNull()) + + /** + * Sets [Builder.chargebackSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackSubmitted] with a well-typed + * [ChargebackSubmitted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackSubmitted(chargebackSubmitted: JsonField) = + apply { + this.chargebackSubmitted = chargebackSubmitted + } /** * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be @@ -2256,7 +2458,24 @@ private constructor( * Visa Card Dispute Network Event, which represents that the chargeback has timed * out in the user's favor. */ - fun chargebackTimedOut(chargebackTimedOut: JsonValue) = apply { + fun chargebackTimedOut(chargebackTimedOut: ChargebackTimedOut?) = + chargebackTimedOut(JsonField.ofNullable(chargebackTimedOut)) + + /** + * Alias for calling [Builder.chargebackTimedOut] with + * `chargebackTimedOut.orElse(null)`. + */ + fun chargebackTimedOut(chargebackTimedOut: Optional) = + chargebackTimedOut(chargebackTimedOut.getOrNull()) + + /** + * Sets [Builder.chargebackTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackTimedOut] with a well-typed + * [ChargebackTimedOut] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackTimedOut(chargebackTimedOut: JsonField) = apply { this.chargebackTimedOut = chargebackTimedOut } @@ -2312,7 +2531,34 @@ private constructor( * prearbitration request decision in their favor. */ fun merchantPrearbitrationDeclineSubmitted( - merchantPrearbitrationDeclineSubmitted: JsonValue + merchantPrearbitrationDeclineSubmitted: MerchantPrearbitrationDeclineSubmitted? + ) = + merchantPrearbitrationDeclineSubmitted( + JsonField.ofNullable(merchantPrearbitrationDeclineSubmitted) + ) + + /** + * Alias for calling [Builder.merchantPrearbitrationDeclineSubmitted] with + * `merchantPrearbitrationDeclineSubmitted.orElse(null)`. + */ + fun merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted: + Optional + ) = + merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted.getOrNull() + ) + + /** + * Sets [Builder.merchantPrearbitrationDeclineSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPrearbitrationDeclineSubmitted] with a + * well-typed [MerchantPrearbitrationDeclineSubmitted] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted: + JsonField ) = apply { this.merchantPrearbitrationDeclineSubmitted = merchantPrearbitrationDeclineSubmitted @@ -2358,10 +2604,31 @@ private constructor( * prearbitration timed out Visa Card Dispute Network Event, which represents that * the user has timed out responding to the merchant's prearbitration request. */ - fun merchantPrearbitrationTimedOut(merchantPrearbitrationTimedOut: JsonValue) = - apply { - this.merchantPrearbitrationTimedOut = merchantPrearbitrationTimedOut - } + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: MerchantPrearbitrationTimedOut? + ) = + merchantPrearbitrationTimedOut( + JsonField.ofNullable(merchantPrearbitrationTimedOut) + ) + + /** + * Alias for calling [Builder.merchantPrearbitrationTimedOut] with + * `merchantPrearbitrationTimedOut.orElse(null)`. + */ + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: Optional + ) = merchantPrearbitrationTimedOut(merchantPrearbitrationTimedOut.getOrNull()) + + /** + * Sets [Builder.merchantPrearbitrationTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPrearbitrationTimedOut] with a + * well-typed [MerchantPrearbitrationTimedOut] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: JsonField + ) = apply { this.merchantPrearbitrationTimedOut = merchantPrearbitrationTimedOut } /** * A Card Dispute Re-presented Visa Network Event object. This field will be present @@ -2395,9 +2662,27 @@ private constructor( * time-out Visa Card Dispute Network Event, which represents that the user did not * respond to the re-presentment by the merchant within the time limit. */ - fun representmentTimedOut(representmentTimedOut: JsonValue) = apply { - this.representmentTimedOut = representmentTimedOut - } + fun representmentTimedOut(representmentTimedOut: RepresentmentTimedOut?) = + representmentTimedOut(JsonField.ofNullable(representmentTimedOut)) + + /** + * Alias for calling [Builder.representmentTimedOut] with + * `representmentTimedOut.orElse(null)`. + */ + fun representmentTimedOut(representmentTimedOut: Optional) = + representmentTimedOut(representmentTimedOut.getOrNull()) + + /** + * Sets [Builder.representmentTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.representmentTimedOut] with a well-typed + * [RepresentmentTimedOut] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun representmentTimedOut(representmentTimedOut: JsonField) = + apply { + this.representmentTimedOut = representmentTimedOut + } /** * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This @@ -2406,9 +2691,28 @@ private constructor( * prearbitration accepted Visa Card Dispute Network Event, which represents that * the merchant has accepted the user's prearbitration request in the user's favor. */ - fun userPrearbitrationAccepted(userPrearbitrationAccepted: JsonValue) = apply { - this.userPrearbitrationAccepted = userPrearbitrationAccepted - } + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: UserPrearbitrationAccepted? + ) = userPrearbitrationAccepted(JsonField.ofNullable(userPrearbitrationAccepted)) + + /** + * Alias for calling [Builder.userPrearbitrationAccepted] with + * `userPrearbitrationAccepted.orElse(null)`. + */ + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: Optional + ) = userPrearbitrationAccepted(userPrearbitrationAccepted.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationAccepted] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationAccepted] with a well-typed + * [UserPrearbitrationAccepted] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: JsonField + ) = apply { this.userPrearbitrationAccepted = userPrearbitrationAccepted } /** * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This @@ -2417,9 +2721,28 @@ private constructor( * prearbitration declined Visa Card Dispute Network Event, which represents that * the merchant has declined the user's prearbitration request. */ - fun userPrearbitrationDeclined(userPrearbitrationDeclined: JsonValue) = apply { - this.userPrearbitrationDeclined = userPrearbitrationDeclined - } + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: UserPrearbitrationDeclined? + ) = userPrearbitrationDeclined(JsonField.ofNullable(userPrearbitrationDeclined)) + + /** + * Alias for calling [Builder.userPrearbitrationDeclined] with + * `userPrearbitrationDeclined.orElse(null)`. + */ + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: Optional + ) = userPrearbitrationDeclined(userPrearbitrationDeclined.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationDeclined] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationDeclined] with a well-typed + * [UserPrearbitrationDeclined] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: JsonField + ) = apply { this.userPrearbitrationDeclined = userPrearbitrationDeclined } /** * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This @@ -2428,9 +2751,28 @@ private constructor( * prearbitration submitted Visa Card Dispute Network Event, which represents that * the user's request for prearbitration has been submitted to the network. */ - fun userPrearbitrationSubmitted(userPrearbitrationSubmitted: JsonValue) = apply { - this.userPrearbitrationSubmitted = userPrearbitrationSubmitted - } + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: UserPrearbitrationSubmitted? + ) = userPrearbitrationSubmitted(JsonField.ofNullable(userPrearbitrationSubmitted)) + + /** + * Alias for calling [Builder.userPrearbitrationSubmitted] with + * `userPrearbitrationSubmitted.orElse(null)`. + */ + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: Optional + ) = userPrearbitrationSubmitted(userPrearbitrationSubmitted.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationSubmitted] with a well-typed + * [UserPrearbitrationSubmitted] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: JsonField + ) = apply { this.userPrearbitrationSubmitted = userPrearbitrationSubmitted } /** * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This @@ -2439,9 +2781,28 @@ private constructor( * prearbitration timed out Visa Card Dispute Network Event, which represents that * the merchant has timed out responding to the user's prearbitration request. */ - fun userPrearbitrationTimedOut(userPrearbitrationTimedOut: JsonValue) = apply { - this.userPrearbitrationTimedOut = userPrearbitrationTimedOut - } + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: UserPrearbitrationTimedOut? + ) = userPrearbitrationTimedOut(JsonField.ofNullable(userPrearbitrationTimedOut)) + + /** + * Alias for calling [Builder.userPrearbitrationTimedOut] with + * `userPrearbitrationTimedOut.orElse(null)`. + */ + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: Optional + ) = userPrearbitrationTimedOut(userPrearbitrationTimedOut.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationTimedOut] with a well-typed + * [UserPrearbitrationTimedOut] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: JsonField + ) = apply { this.userPrearbitrationTimedOut = userPrearbitrationTimedOut } /** * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field @@ -2450,9 +2811,27 @@ private constructor( * submitted Visa Card Dispute Network Event, which represents that the user's * request to withdraw the dispute has been submitted to the network. */ - fun userWithdrawalSubmitted(userWithdrawalSubmitted: JsonValue) = apply { - this.userWithdrawalSubmitted = userWithdrawalSubmitted - } + fun userWithdrawalSubmitted(userWithdrawalSubmitted: UserWithdrawalSubmitted?) = + userWithdrawalSubmitted(JsonField.ofNullable(userWithdrawalSubmitted)) + + /** + * Alias for calling [Builder.userWithdrawalSubmitted] with + * `userWithdrawalSubmitted.orElse(null)`. + */ + fun userWithdrawalSubmitted( + userWithdrawalSubmitted: Optional + ) = userWithdrawalSubmitted(userWithdrawalSubmitted.getOrNull()) + + /** + * Sets [Builder.userWithdrawalSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.userWithdrawalSubmitted] with a well-typed + * [UserWithdrawalSubmitted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun userWithdrawalSubmitted( + userWithdrawalSubmitted: JsonField + ) = apply { this.userWithdrawalSubmitted = userWithdrawalSubmitted } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2548,10 +2927,21 @@ private constructor( attachmentFiles().forEach { it.validate() } category().validate() + chargebackAccepted().ifPresent { it.validate() } + chargebackSubmitted().ifPresent { it.validate() } + chargebackTimedOut().ifPresent { it.validate() } createdAt() disputeFinancialTransactionId() + merchantPrearbitrationDeclineSubmitted().ifPresent { it.validate() } merchantPrearbitrationReceived().ifPresent { it.validate() } + merchantPrearbitrationTimedOut().ifPresent { it.validate() } represented().ifPresent { it.validate() } + representmentTimedOut().ifPresent { it.validate() } + userPrearbitrationAccepted().ifPresent { it.validate() } + userPrearbitrationDeclined().ifPresent { it.validate() } + userPrearbitrationSubmitted().ifPresent { it.validate() } + userPrearbitrationTimedOut().ifPresent { it.validate() } + userWithdrawalSubmitted().ifPresent { it.validate() } validated = true } @@ -2573,10 +2963,22 @@ private constructor( internal fun validity(): Int = (attachmentFiles.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackAccepted.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackSubmitted.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackTimedOut.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (disputeFinancialTransactionId.asKnown().isPresent) 1 else 0) + + (merchantPrearbitrationDeclineSubmitted.asKnown().getOrNull()?.validity() + ?: 0) + (merchantPrearbitrationReceived.asKnown().getOrNull()?.validity() ?: 0) + - (represented.asKnown().getOrNull()?.validity() ?: 0) + (merchantPrearbitrationTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (represented.asKnown().getOrNull()?.validity() ?: 0) + + (representmentTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationAccepted.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationDeclined.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationSubmitted.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (userWithdrawalSubmitted.asKnown().getOrNull()?.validity() ?: 0) class AttachmentFile @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3111,266 +3513,17 @@ private constructor( } /** - * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This - * field will be present in the JSON response if and only if `category` is equal to - * `merchant_prearbitration_received`. Contains the details specific to a merchant - * prearbitration received Visa Card Dispute Network Event, which represents that the - * merchant has issued a prearbitration request in the user's favor. + * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_accepted`. Contains the details specific to a chargeback accepted Visa + * Card Dispute Network Event, which represents that a chargeback has been accepted by + * the merchant. */ - class MerchantPrearbitrationReceived + class ChargebackAccepted @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val cardholderNoLongerDisputes: JsonField, - private val compellingEvidence: JsonField, - private val creditOrReversalProcessed: JsonField, - private val delayedChargeTransaction: JsonField, - private val evidenceOfImprint: JsonField, - private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField, - private val priorUndisputedNonFraudTransactions: - JsonField, - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - cardholderNoLongerDisputes: JsonField = - JsonMissing.of(), - @JsonProperty("compelling_evidence") - @ExcludeMissing - compellingEvidence: JsonField = JsonMissing.of(), - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - creditOrReversalProcessed: JsonField = - JsonMissing.of(), - @JsonProperty("delayed_charge_transaction") - @ExcludeMissing - delayedChargeTransaction: JsonField = - JsonMissing.of(), - @JsonProperty("evidence_of_imprint") - @ExcludeMissing - evidenceOfImprint: JsonField = JsonMissing.of(), - @JsonProperty("invalid_dispute") - @ExcludeMissing - invalidDispute: JsonField = JsonMissing.of(), - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField = - JsonMissing.of(), - @JsonProperty("prior_undisputed_non_fraud_transactions") - @ExcludeMissing - priorUndisputedNonFraudTransactions: - JsonField = - JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this( - cardholderNoLongerDisputes, - compellingEvidence, - creditOrReversalProcessed, - delayedChargeTransaction, - evidenceOfImprint, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenReceived, - priorUndisputedNonFraudTransactions, - reason, - mutableMapOf(), - ) - - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun cardholderNoLongerDisputes(): Optional = - cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") - - /** - * Compelling evidence details. Present if and only if `reason` is - * `compelling_evidence`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun compellingEvidence(): Optional = - compellingEvidence.getOptional("compelling_evidence") - - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun creditOrReversalProcessed(): Optional = - creditOrReversalProcessed.getOptional("credit_or_reversal_processed") - - /** - * Delayed charge transaction details. Present if and only if `reason` is - * `delayed_charge_transaction`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun delayedChargeTransaction(): Optional = - delayedChargeTransaction.getOptional("delayed_charge_transaction") - - /** - * Evidence of imprint details. Present if and only if `reason` is - * `evidence_of_imprint`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun evidenceOfImprint(): Optional = - evidenceOfImprint.getOptional("evidence_of_imprint") - - /** - * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun invalidDispute(): Optional = - invalidDispute.getOptional("invalid_dispute") - - /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived(): - Optional = - nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( - "non_fiat_currency_or_non_fungible_token_received" - ) - - /** - * Prior undisputed non-fraud transactions details. Present if and only if `reason` - * is `prior_undisputed_non_fraud_transactions`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun priorUndisputedNonFraudTransactions(): - Optional = - priorUndisputedNonFraudTransactions.getOptional( - "prior_undisputed_non_fraud_transactions" - ) - - /** - * The reason the merchant re-presented the dispute. - * - * @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 reason(): Reason = reason.getRequired("reason") - - /** - * Returns the raw JSON value of [cardholderNoLongerDisputes]. - * - * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - fun _cardholderNoLongerDisputes(): JsonField = - cardholderNoLongerDisputes - - /** - * Returns the raw JSON value of [compellingEvidence]. - * - * Unlike [compellingEvidence], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("compelling_evidence") - @ExcludeMissing - fun _compellingEvidence(): JsonField = compellingEvidence - - /** - * Returns the raw JSON value of [creditOrReversalProcessed]. - * - * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - fun _creditOrReversalProcessed(): JsonField = - creditOrReversalProcessed - - /** - * Returns the raw JSON value of [delayedChargeTransaction]. - * - * Unlike [delayedChargeTransaction], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("delayed_charge_transaction") - @ExcludeMissing - fun _delayedChargeTransaction(): JsonField = - delayedChargeTransaction - - /** - * Returns the raw JSON value of [evidenceOfImprint]. - * - * Unlike [evidenceOfImprint], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("evidence_of_imprint") - @ExcludeMissing - fun _evidenceOfImprint(): JsonField = evidenceOfImprint - - /** - * Returns the raw JSON value of [invalidDispute]. - * - * Unlike [invalidDispute], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("invalid_dispute") - @ExcludeMissing - fun _invalidDispute(): JsonField = invalidDispute + private constructor(private val additionalProperties: MutableMap) { - /** - * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. - * - * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if - * the JSON field has an unexpected type. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenReceived(): - JsonField = - nonFiatCurrencyOrNonFungibleTokenReceived - - /** - * Returns the raw JSON value of [priorUndisputedNonFraudTransactions]. - * - * Unlike [priorUndisputedNonFraudTransactions], this method doesn't throw if the - * JSON field has an unexpected type. - */ - @JsonProperty("prior_undisputed_non_fraud_transactions") - @ExcludeMissing - fun _priorUndisputedNonFraudTransactions(): - JsonField = - priorUndisputedNonFraudTransactions - - /** - * Returns the raw JSON value of [reason]. - * - * Unlike [reason], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + @JsonCreator private constructor() : this(mutableMapOf()) @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -3388,317 +3541,140 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [MerchantPrearbitrationReceived]. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .compellingEvidence() - * .creditOrReversalProcessed() - * .delayedChargeTransaction() - * .evidenceOfImprint() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .priorUndisputedNonFraudTransactions() - * .reason() - * ``` + * [ChargebackAccepted]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [MerchantPrearbitrationReceived]. */ + /** A builder for [ChargebackAccepted]. */ class Builder internal constructor() { - private var cardholderNoLongerDisputes: JsonField? = - null - private var compellingEvidence: JsonField? = null - private var creditOrReversalProcessed: JsonField? = - null - private var delayedChargeTransaction: JsonField? = - null - private var evidenceOfImprint: JsonField? = null - private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField? = - null - private var priorUndisputedNonFraudTransactions: - JsonField? = - null - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - merchantPrearbitrationReceived: MerchantPrearbitrationReceived - ) = apply { - cardholderNoLongerDisputes = - merchantPrearbitrationReceived.cardholderNoLongerDisputes - compellingEvidence = merchantPrearbitrationReceived.compellingEvidence - creditOrReversalProcessed = - merchantPrearbitrationReceived.creditOrReversalProcessed - delayedChargeTransaction = - merchantPrearbitrationReceived.delayedChargeTransaction - evidenceOfImprint = merchantPrearbitrationReceived.evidenceOfImprint - invalidDispute = merchantPrearbitrationReceived.invalidDispute - nonFiatCurrencyOrNonFungibleTokenReceived = - merchantPrearbitrationReceived.nonFiatCurrencyOrNonFungibleTokenReceived - priorUndisputedNonFraudTransactions = - merchantPrearbitrationReceived.priorUndisputedNonFraudTransactions - reason = merchantPrearbitrationReceived.reason + internal fun from(chargebackAccepted: ChargebackAccepted) = apply { additionalProperties = - merchantPrearbitrationReceived.additionalProperties.toMutableMap() + chargebackAccepted.additionalProperties.toMutableMap() } - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: CardholderNoLongerDisputes? - ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) - - /** - * Alias for calling [Builder.cardholderNoLongerDisputes] with - * `cardholderNoLongerDisputes.orElse(null)`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: Optional - ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) - - /** - * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. - * - * You should usually call [Builder.cardholderNoLongerDisputes] with a - * well-typed [CardholderNoLongerDisputes] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: JsonField - ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } - - /** - * Compelling evidence details. Present if and only if `reason` is - * `compelling_evidence`. - */ - fun compellingEvidence(compellingEvidence: CompellingEvidence?) = - compellingEvidence(JsonField.ofNullable(compellingEvidence)) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - /** - * Alias for calling [Builder.compellingEvidence] with - * `compellingEvidence.orElse(null)`. - */ - fun compellingEvidence(compellingEvidence: Optional) = - compellingEvidence(compellingEvidence.getOrNull()) + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - /** - * Sets [Builder.compellingEvidence] to an arbitrary JSON value. - * - * You should usually call [Builder.compellingEvidence] with a well-typed - * [CompellingEvidence] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun compellingEvidence(compellingEvidence: JsonField) = + fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.compellingEvidence = compellingEvidence + this.additionalProperties.putAll(additionalProperties) } - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: CreditOrReversalProcessed? - ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** - * Alias for calling [Builder.creditOrReversalProcessed] with - * `creditOrReversalProcessed.orElse(null)`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: Optional - ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. + * Returns an immutable instance of [ChargebackAccepted]. * - * You should usually call [Builder.creditOrReversalProcessed] with a well-typed - * [CreditOrReversalProcessed] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. + * Further updates to this [Builder] will not mutate the returned instance. */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: JsonField - ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } + fun build(): ChargebackAccepted = + ChargebackAccepted(additionalProperties.toMutableMap()) + } - /** - * Delayed charge transaction details. Present if and only if `reason` is - * `delayed_charge_transaction`. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: DelayedChargeTransaction? - ) = delayedChargeTransaction(JsonField.ofNullable(delayedChargeTransaction)) + private var validated: Boolean = false - /** - * Alias for calling [Builder.delayedChargeTransaction] with - * `delayedChargeTransaction.orElse(null)`. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: Optional - ) = delayedChargeTransaction(delayedChargeTransaction.getOrNull()) + fun validate(): ChargebackAccepted = apply { + if (validated) { + return@apply + } - /** - * Sets [Builder.delayedChargeTransaction] to an arbitrary JSON value. - * - * You should usually call [Builder.delayedChargeTransaction] with a well-typed - * [DelayedChargeTransaction] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: JsonField - ) = apply { this.delayedChargeTransaction = delayedChargeTransaction } + validated = true + } - /** - * Evidence of imprint details. Present if and only if `reason` is - * `evidence_of_imprint`. - */ - fun evidenceOfImprint(evidenceOfImprint: EvidenceOfImprint?) = - evidenceOfImprint(JsonField.ofNullable(evidenceOfImprint)) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - /** - * Alias for calling [Builder.evidenceOfImprint] with - * `evidenceOfImprint.orElse(null)`. - */ - fun evidenceOfImprint(evidenceOfImprint: Optional) = - evidenceOfImprint(evidenceOfImprint.getOrNull()) + /** + * 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 = 0 - /** - * Sets [Builder.evidenceOfImprint] to an arbitrary JSON value. - * - * You should usually call [Builder.evidenceOfImprint] with a well-typed - * [EvidenceOfImprint] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun evidenceOfImprint(evidenceOfImprint: JsonField) = apply { - this.evidenceOfImprint = evidenceOfImprint + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * Invalid dispute details. Present if and only if `reason` is - * `invalid_dispute`. - */ - fun invalidDispute(invalidDispute: InvalidDispute?) = - invalidDispute(JsonField.ofNullable(invalidDispute)) + return other is ChargebackAccepted && + additionalProperties == other.additionalProperties + } - /** - * Alias for calling [Builder.invalidDispute] with - * `invalidDispute.orElse(null)`. - */ - fun invalidDispute(invalidDispute: Optional) = - invalidDispute(invalidDispute.getOrNull()) + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * Sets [Builder.invalidDispute] to an arbitrary JSON value. - * - * You should usually call [Builder.invalidDispute] with a well-typed - * [InvalidDispute] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun invalidDispute(invalidDispute: JsonField) = apply { - this.invalidDispute = invalidDispute - } + override fun hashCode(): Int = hashCode - /** - * Non-fiat currency or non-fungible token received details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived? - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) - ) + override fun toString() = + "ChargebackAccepted{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with - * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - Optional - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() - ) + /** + * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_submitted`. Contains the details specific to a chargeback submitted Visa + * Card Dispute Network Event, which represents that a chargeback has been submitted to + * the network. + */ + class ChargebackSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON - * value. - * - * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] - * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField - ) = apply { - this.nonFiatCurrencyOrNonFungibleTokenReceived = - nonFiatCurrencyOrNonFungibleTokenReceived - } + @JsonCreator private constructor() : this(mutableMapOf()) - /** - * Prior undisputed non-fraud transactions details. Present if and only if - * `reason` is `prior_undisputed_non_fraud_transactions`. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions? - ) = - priorUndisputedNonFraudTransactions( - JsonField.ofNullable(priorUndisputedNonFraudTransactions) - ) + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Alias for calling [Builder.priorUndisputedNonFraudTransactions] with - * `priorUndisputedNonFraudTransactions.orElse(null)`. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: - Optional - ) = - priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions.getOrNull() - ) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Sets [Builder.priorUndisputedNonFraudTransactions] to an arbitrary JSON - * value. - * - * You should usually call [Builder.priorUndisputedNonFraudTransactions] with a - * well-typed [PriorUndisputedNonFraudTransactions] value instead. This method - * is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: - JsonField - ) = apply { - this.priorUndisputedNonFraudTransactions = - priorUndisputedNonFraudTransactions - } + fun toBuilder() = Builder().from(this) - /** The reason the merchant re-presented the dispute. */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) + companion object { /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [Reason] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * Returns a mutable builder for constructing an instance of + * [ChargebackSubmitted]. */ - fun reason(reason: JsonField) = apply { this.reason = reason } + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ChargebackSubmitted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(chargebackSubmitted: ChargebackSubmitted) = apply { + additionalProperties = + chargebackSubmitted.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -3723,62 +3699,21 @@ private constructor( } /** - * Returns an immutable instance of [MerchantPrearbitrationReceived]. + * Returns an immutable instance of [ChargebackSubmitted]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .compellingEvidence() - * .creditOrReversalProcessed() - * .delayedChargeTransaction() - * .evidenceOfImprint() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .priorUndisputedNonFraudTransactions() - * .reason() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): MerchantPrearbitrationReceived = - MerchantPrearbitrationReceived( - checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), - checkRequired("compellingEvidence", compellingEvidence), - checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), - checkRequired("delayedChargeTransaction", delayedChargeTransaction), - checkRequired("evidenceOfImprint", evidenceOfImprint), - checkRequired("invalidDispute", invalidDispute), - checkRequired( - "nonFiatCurrencyOrNonFungibleTokenReceived", - nonFiatCurrencyOrNonFungibleTokenReceived, - ), - checkRequired( - "priorUndisputedNonFraudTransactions", - priorUndisputedNonFraudTransactions, - ), - checkRequired("reason", reason), - additionalProperties.toMutableMap(), - ) + fun build(): ChargebackSubmitted = + ChargebackSubmitted(additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): MerchantPrearbitrationReceived = apply { + fun validate(): ChargebackSubmitted = apply { if (validated) { return@apply } - cardholderNoLongerDisputes().ifPresent { it.validate() } - compellingEvidence().ifPresent { it.validate() } - creditOrReversalProcessed().ifPresent { it.validate() } - delayedChargeTransaction().ifPresent { it.validate() } - evidenceOfImprint().ifPresent { it.validate() } - invalidDispute().ifPresent { it.validate() } - nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } - priorUndisputedNonFraudTransactions().ifPresent { it.validate() } - reason().validate() validated = true } @@ -3796,113 +3731,1061 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = - (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + - (compellingEvidence.asKnown().getOrNull()?.validity() ?: 0) + - (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + - (delayedChargeTransaction.asKnown().getOrNull()?.validity() ?: 0) + - (evidenceOfImprint.asKnown().getOrNull()?.validity() ?: 0) + - (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + - (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() - ?: 0) + - (priorUndisputedNonFraudTransactions.asKnown().getOrNull()?.validity() - ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) + @JvmSynthetic internal fun validity(): Int = 0 - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - */ - class CardholderNoLongerDisputes - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + return other is ChargebackSubmitted && + additionalProperties == other.additionalProperties + } - /** - * Explanation for why the merchant believes the cardholder no longer disputes - * the transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun explanation(): Optional = explanation.getOptional("explanation") + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + override fun hashCode(): Int = hashCode - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + override fun toString() = + "ChargebackSubmitted{additionalProperties=$additionalProperties}" + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** + * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_timed_out`. Contains the details specific to a chargeback timed out Visa + * Card Dispute Network Event, which represents that the chargeback has timed out in the + * user's favor. + */ + class ChargebackTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - fun toBuilder() = Builder().from(this) + @JsonCreator private constructor() : this(mutableMapOf()) - companion object { + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Returns a mutable builder for constructing an instance of - * [CardholderNoLongerDisputes]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** A builder for [CardholderNoLongerDisputes]. */ - class Builder internal constructor() { + fun toBuilder() = Builder().from(this) - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + companion object { - @JvmSynthetic - internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = - apply { - explanation = cardholderNoLongerDisputes.explanation - additionalProperties = - cardholderNoLongerDisputes.additionalProperties.toMutableMap() - } + /** + * Returns a mutable builder for constructing an instance of + * [ChargebackTimedOut]. + */ + @JvmStatic fun builder() = Builder() + } - /** - * Explanation for why the merchant believes the cardholder no longer - * disputes the transaction. - */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + /** A builder for [ChargebackTimedOut]. */ + class Builder internal constructor() { - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Sets [Builder.explanation] to an arbitrary JSON value. + @JvmSynthetic + internal fun from(chargebackTimedOut: ChargebackTimedOut) = apply { + additionalProperties = + chargebackTimedOut.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ChargebackTimedOut]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ChargebackTimedOut = + ChargebackTimedOut(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ChargebackTimedOut = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ChargebackTimedOut && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ChargebackTimedOut{additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event object. + * This field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_decline_submitted`. Contains the details specific to a + * merchant prearbitration decline submitted Visa Card Dispute Network Event, which + * represents that the user has declined the merchant's request for a prearbitration + * request decision in their favor. + */ + class MerchantPrearbitrationDeclineSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [MerchantPrearbitrationDeclineSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MerchantPrearbitrationDeclineSubmitted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + merchantPrearbitrationDeclineSubmitted: + MerchantPrearbitrationDeclineSubmitted + ) = apply { + additionalProperties = + merchantPrearbitrationDeclineSubmitted.additionalProperties + .toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [MerchantPrearbitrationDeclineSubmitted]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MerchantPrearbitrationDeclineSubmitted = + MerchantPrearbitrationDeclineSubmitted(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): MerchantPrearbitrationDeclineSubmitted = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MerchantPrearbitrationDeclineSubmitted && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MerchantPrearbitrationDeclineSubmitted{additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This + * field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_received`. Contains the details specific to a merchant + * prearbitration received Visa Card Dispute Network Event, which represents that the + * merchant has issued a prearbitration request in the user's favor. + */ + class MerchantPrearbitrationReceived + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardholderNoLongerDisputes: JsonField, + private val compellingEvidence: JsonField, + private val creditOrReversalProcessed: JsonField, + private val delayedChargeTransaction: JsonField, + private val evidenceOfImprint: JsonField, + private val invalidDispute: JsonField, + private val nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField, + private val priorUndisputedNonFraudTransactions: + JsonField, + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + cardholderNoLongerDisputes: JsonField = + JsonMissing.of(), + @JsonProperty("compelling_evidence") + @ExcludeMissing + compellingEvidence: JsonField = JsonMissing.of(), + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + creditOrReversalProcessed: JsonField = + JsonMissing.of(), + @JsonProperty("delayed_charge_transaction") + @ExcludeMissing + delayedChargeTransaction: JsonField = + JsonMissing.of(), + @JsonProperty("evidence_of_imprint") + @ExcludeMissing + evidenceOfImprint: JsonField = JsonMissing.of(), + @JsonProperty("invalid_dispute") + @ExcludeMissing + invalidDispute: JsonField = JsonMissing.of(), + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField = + JsonMissing.of(), + @JsonProperty("prior_undisputed_non_fraud_transactions") + @ExcludeMissing + priorUndisputedNonFraudTransactions: + JsonField = + JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + ) : this( + cardholderNoLongerDisputes, + compellingEvidence, + creditOrReversalProcessed, + delayedChargeTransaction, + evidenceOfImprint, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenReceived, + priorUndisputedNonFraudTransactions, + reason, + mutableMapOf(), + ) + + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun cardholderNoLongerDisputes(): Optional = + cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") + + /** + * Compelling evidence details. Present if and only if `reason` is + * `compelling_evidence`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun compellingEvidence(): Optional = + compellingEvidence.getOptional("compelling_evidence") + + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun creditOrReversalProcessed(): Optional = + creditOrReversalProcessed.getOptional("credit_or_reversal_processed") + + /** + * Delayed charge transaction details. Present if and only if `reason` is + * `delayed_charge_transaction`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun delayedChargeTransaction(): Optional = + delayedChargeTransaction.getOptional("delayed_charge_transaction") + + /** + * Evidence of imprint details. Present if and only if `reason` is + * `evidence_of_imprint`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun evidenceOfImprint(): Optional = + evidenceOfImprint.getOptional("evidence_of_imprint") + + /** + * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun invalidDispute(): Optional = + invalidDispute.getOptional("invalid_dispute") + + /** + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived(): + Optional = + nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( + "non_fiat_currency_or_non_fungible_token_received" + ) + + /** + * Prior undisputed non-fraud transactions details. Present if and only if `reason` + * is `prior_undisputed_non_fraud_transactions`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun priorUndisputedNonFraudTransactions(): + Optional = + priorUndisputedNonFraudTransactions.getOptional( + "prior_undisputed_non_fraud_transactions" + ) + + /** + * The reason the merchant re-presented the dispute. + * + * @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 reason(): Reason = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [cardholderNoLongerDisputes]. + * + * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + fun _cardholderNoLongerDisputes(): JsonField = + cardholderNoLongerDisputes + + /** + * Returns the raw JSON value of [compellingEvidence]. + * + * Unlike [compellingEvidence], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("compelling_evidence") + @ExcludeMissing + fun _compellingEvidence(): JsonField = compellingEvidence + + /** + * Returns the raw JSON value of [creditOrReversalProcessed]. + * + * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + fun _creditOrReversalProcessed(): JsonField = + creditOrReversalProcessed + + /** + * Returns the raw JSON value of [delayedChargeTransaction]. + * + * Unlike [delayedChargeTransaction], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("delayed_charge_transaction") + @ExcludeMissing + fun _delayedChargeTransaction(): JsonField = + delayedChargeTransaction + + /** + * Returns the raw JSON value of [evidenceOfImprint]. + * + * Unlike [evidenceOfImprint], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("evidence_of_imprint") + @ExcludeMissing + fun _evidenceOfImprint(): JsonField = evidenceOfImprint + + /** + * Returns the raw JSON value of [invalidDispute]. + * + * Unlike [invalidDispute], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("invalid_dispute") + @ExcludeMissing + fun _invalidDispute(): JsonField = invalidDispute + + /** + * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. + * + * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if + * the JSON field has an unexpected type. + */ + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenReceived(): + JsonField = + nonFiatCurrencyOrNonFungibleTokenReceived + + /** + * Returns the raw JSON value of [priorUndisputedNonFraudTransactions]. + * + * Unlike [priorUndisputedNonFraudTransactions], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("prior_undisputed_non_fraud_transactions") + @ExcludeMissing + fun _priorUndisputedNonFraudTransactions(): + JsonField = + priorUndisputedNonFraudTransactions + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @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 + * [MerchantPrearbitrationReceived]. + * + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .compellingEvidence() + * .creditOrReversalProcessed() + * .delayedChargeTransaction() + * .evidenceOfImprint() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .priorUndisputedNonFraudTransactions() + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MerchantPrearbitrationReceived]. */ + class Builder internal constructor() { + + private var cardholderNoLongerDisputes: JsonField? = + null + private var compellingEvidence: JsonField? = null + private var creditOrReversalProcessed: JsonField? = + null + private var delayedChargeTransaction: JsonField? = + null + private var evidenceOfImprint: JsonField? = null + private var invalidDispute: JsonField? = null + private var nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField? = + null + private var priorUndisputedNonFraudTransactions: + JsonField? = + null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + merchantPrearbitrationReceived: MerchantPrearbitrationReceived + ) = apply { + cardholderNoLongerDisputes = + merchantPrearbitrationReceived.cardholderNoLongerDisputes + compellingEvidence = merchantPrearbitrationReceived.compellingEvidence + creditOrReversalProcessed = + merchantPrearbitrationReceived.creditOrReversalProcessed + delayedChargeTransaction = + merchantPrearbitrationReceived.delayedChargeTransaction + evidenceOfImprint = merchantPrearbitrationReceived.evidenceOfImprint + invalidDispute = merchantPrearbitrationReceived.invalidDispute + nonFiatCurrencyOrNonFungibleTokenReceived = + merchantPrearbitrationReceived.nonFiatCurrencyOrNonFungibleTokenReceived + priorUndisputedNonFraudTransactions = + merchantPrearbitrationReceived.priorUndisputedNonFraudTransactions + reason = merchantPrearbitrationReceived.reason + additionalProperties = + merchantPrearbitrationReceived.additionalProperties.toMutableMap() + } + + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: CardholderNoLongerDisputes? + ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) + + /** + * Alias for calling [Builder.cardholderNoLongerDisputes] with + * `cardholderNoLongerDisputes.orElse(null)`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: Optional + ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) + + /** + * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderNoLongerDisputes] with a + * well-typed [CardholderNoLongerDisputes] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: JsonField + ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } + + /** + * Compelling evidence details. Present if and only if `reason` is + * `compelling_evidence`. + */ + fun compellingEvidence(compellingEvidence: CompellingEvidence?) = + compellingEvidence(JsonField.ofNullable(compellingEvidence)) + + /** + * Alias for calling [Builder.compellingEvidence] with + * `compellingEvidence.orElse(null)`. + */ + fun compellingEvidence(compellingEvidence: Optional) = + compellingEvidence(compellingEvidence.getOrNull()) + + /** + * Sets [Builder.compellingEvidence] to an arbitrary JSON value. + * + * You should usually call [Builder.compellingEvidence] with a well-typed + * [CompellingEvidence] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun compellingEvidence(compellingEvidence: JsonField) = + apply { + this.compellingEvidence = compellingEvidence + } + + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: CreditOrReversalProcessed? + ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) + + /** + * Alias for calling [Builder.creditOrReversalProcessed] with + * `creditOrReversalProcessed.orElse(null)`. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: Optional + ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) + + /** + * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. + * + * You should usually call [Builder.creditOrReversalProcessed] with a well-typed + * [CreditOrReversalProcessed] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: JsonField + ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } + + /** + * Delayed charge transaction details. Present if and only if `reason` is + * `delayed_charge_transaction`. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: DelayedChargeTransaction? + ) = delayedChargeTransaction(JsonField.ofNullable(delayedChargeTransaction)) + + /** + * Alias for calling [Builder.delayedChargeTransaction] with + * `delayedChargeTransaction.orElse(null)`. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: Optional + ) = delayedChargeTransaction(delayedChargeTransaction.getOrNull()) + + /** + * Sets [Builder.delayedChargeTransaction] to an arbitrary JSON value. + * + * You should usually call [Builder.delayedChargeTransaction] with a well-typed + * [DelayedChargeTransaction] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: JsonField + ) = apply { this.delayedChargeTransaction = delayedChargeTransaction } + + /** + * Evidence of imprint details. Present if and only if `reason` is + * `evidence_of_imprint`. + */ + fun evidenceOfImprint(evidenceOfImprint: EvidenceOfImprint?) = + evidenceOfImprint(JsonField.ofNullable(evidenceOfImprint)) + + /** + * Alias for calling [Builder.evidenceOfImprint] with + * `evidenceOfImprint.orElse(null)`. + */ + fun evidenceOfImprint(evidenceOfImprint: Optional) = + evidenceOfImprint(evidenceOfImprint.getOrNull()) + + /** + * Sets [Builder.evidenceOfImprint] to an arbitrary JSON value. + * + * You should usually call [Builder.evidenceOfImprint] with a well-typed + * [EvidenceOfImprint] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun evidenceOfImprint(evidenceOfImprint: JsonField) = apply { + this.evidenceOfImprint = evidenceOfImprint + } + + /** + * Invalid dispute details. Present if and only if `reason` is + * `invalid_dispute`. + */ + fun invalidDispute(invalidDispute: InvalidDispute?) = + invalidDispute(JsonField.ofNullable(invalidDispute)) + + /** + * Alias for calling [Builder.invalidDispute] with + * `invalidDispute.orElse(null)`. + */ + fun invalidDispute(invalidDispute: Optional) = + invalidDispute(invalidDispute.getOrNull()) + + /** + * Sets [Builder.invalidDispute] to an arbitrary JSON value. + * + * You should usually call [Builder.invalidDispute] with a well-typed + * [InvalidDispute] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun invalidDispute(invalidDispute: JsonField) = apply { + this.invalidDispute = invalidDispute + } + + /** + * Non-fiat currency or non-fungible token received details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived? + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) + ) + + /** + * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with + * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + Optional + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() + ) + + /** + * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON + * value. + * + * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] + * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField + ) = apply { + this.nonFiatCurrencyOrNonFungibleTokenReceived = + nonFiatCurrencyOrNonFungibleTokenReceived + } + + /** + * Prior undisputed non-fraud transactions details. Present if and only if + * `reason` is `prior_undisputed_non_fraud_transactions`. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions? + ) = + priorUndisputedNonFraudTransactions( + JsonField.ofNullable(priorUndisputedNonFraudTransactions) + ) + + /** + * Alias for calling [Builder.priorUndisputedNonFraudTransactions] with + * `priorUndisputedNonFraudTransactions.orElse(null)`. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: + Optional + ) = + priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions.getOrNull() + ) + + /** + * Sets [Builder.priorUndisputedNonFraudTransactions] to an arbitrary JSON + * value. + * + * You should usually call [Builder.priorUndisputedNonFraudTransactions] with a + * well-typed [PriorUndisputedNonFraudTransactions] value instead. This method + * is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: + JsonField + ) = apply { + this.priorUndisputedNonFraudTransactions = + priorUndisputedNonFraudTransactions + } + + /** The reason the merchant re-presented the dispute. */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [Reason] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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 [MerchantPrearbitrationReceived]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .compellingEvidence() + * .creditOrReversalProcessed() + * .delayedChargeTransaction() + * .evidenceOfImprint() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .priorUndisputedNonFraudTransactions() + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): MerchantPrearbitrationReceived = + MerchantPrearbitrationReceived( + checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), + checkRequired("compellingEvidence", compellingEvidence), + checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), + checkRequired("delayedChargeTransaction", delayedChargeTransaction), + checkRequired("evidenceOfImprint", evidenceOfImprint), + checkRequired("invalidDispute", invalidDispute), + checkRequired( + "nonFiatCurrencyOrNonFungibleTokenReceived", + nonFiatCurrencyOrNonFungibleTokenReceived, + ), + checkRequired( + "priorUndisputedNonFraudTransactions", + priorUndisputedNonFraudTransactions, + ), + checkRequired("reason", reason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): MerchantPrearbitrationReceived = apply { + if (validated) { + return@apply + } + + cardholderNoLongerDisputes().ifPresent { it.validate() } + compellingEvidence().ifPresent { it.validate() } + creditOrReversalProcessed().ifPresent { it.validate() } + delayedChargeTransaction().ifPresent { it.validate() } + evidenceOfImprint().ifPresent { it.validate() } + invalidDispute().ifPresent { it.validate() } + nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } + priorUndisputedNonFraudTransactions().ifPresent { it.validate() } + reason().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 = + (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + + (compellingEvidence.asKnown().getOrNull()?.validity() ?: 0) + + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + + (delayedChargeTransaction.asKnown().getOrNull()?.validity() ?: 0) + + (evidenceOfImprint.asKnown().getOrNull()?.validity() ?: 0) + + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() + ?: 0) + + (priorUndisputedNonFraudTransactions.asKnown().getOrNull()?.validity() + ?: 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + */ + class CardholderNoLongerDisputes + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val explanation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) + + /** + * Explanation for why the merchant believes the cardholder no longer disputes + * the transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + @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 + * [CardholderNoLongerDisputes]. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderNoLongerDisputes]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = + apply { + explanation = cardholderNoLongerDisputes.explanation + additionalProperties = + cardholderNoLongerDisputes.additionalProperties.toMutableMap() + } + + /** + * Explanation for why the merchant believes the cardholder no longer + * disputes the transaction. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. * * You should usually call [Builder.explanation] with a well-typed [String] * value instead. This method is primarily for setting the field to an @@ -6439,6 +7322,127 @@ private constructor( "MerchantPrearbitrationReceived{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, compellingEvidence=$compellingEvidence, creditOrReversalProcessed=$creditOrReversalProcessed, delayedChargeTransaction=$delayedChargeTransaction, evidenceOfImprint=$evidenceOfImprint, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, priorUndisputedNonFraudTransactions=$priorUndisputedNonFraudTransactions, reason=$reason, additionalProperties=$additionalProperties}" } + /** + * A Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event object. This + * field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant + * prearbitration timed out Visa Card Dispute Network Event, which represents that the + * user has timed out responding to the merchant's prearbitration request. + */ + class MerchantPrearbitrationTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [MerchantPrearbitrationTimedOut]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MerchantPrearbitrationTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + merchantPrearbitrationTimedOut: MerchantPrearbitrationTimedOut + ) = apply { + additionalProperties = + merchantPrearbitrationTimedOut.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [MerchantPrearbitrationTimedOut]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): MerchantPrearbitrationTimedOut = + MerchantPrearbitrationTimedOut(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): MerchantPrearbitrationTimedOut = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MerchantPrearbitrationTimedOut && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MerchantPrearbitrationTimedOut{additionalProperties=$additionalProperties}" + } + /** * A Card Dispute Re-presented Visa Network Event object. This field will be present in * the JSON response if and only if `category` is equal to `represented`. Contains the @@ -8262,165 +9266,626 @@ private constructor( } /** - * Returns an enum member corresponding to this class instance's value. + * 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) { + AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> + Known.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED + BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> + Known.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID + CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> + Known + .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE + CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> + Known.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE + CARDHOLDER_CANCELED_DIFFERENT_DATE -> + Known.CARDHOLDER_CANCELED_DIFFERENT_DATE + CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> + Known.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY + CARDHOLDER_RECEIVED_MERCHANDISE -> + Known.CARDHOLDER_RECEIVED_MERCHANDISE + COUNTRY_CODE_CORRECT -> Known.COUNTRY_CODE_CORRECT + CREDIT_PROCESSED_CORRECTLY -> Known.CREDIT_PROCESSED_CORRECTLY + CURRENCY_CORRECT -> Known.CURRENCY_CORRECT + DISPUTE_IS_FOR_QUALITY -> Known.DISPUTE_IS_FOR_QUALITY + DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> + Known.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> + Known.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> + Known + .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED + LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> + Known.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED + MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> + Known.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY + MERCHANDISE_MATCHES_DESCRIPTION -> + Known.MERCHANDISE_MATCHES_DESCRIPTION + MERCHANDISE_NOT_COUNTERFEIT -> Known.MERCHANDISE_NOT_COUNTERFEIT + MERCHANDISE_NOT_DAMAGED -> Known.MERCHANDISE_NOT_DAMAGED + MERCHANDISE_NOT_DEFECTIVE -> Known.MERCHANDISE_NOT_DEFECTIVE + MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Known.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE + MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> + Known.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION + MERCHANDISE_RETURN_NOT_ATTEMPTED -> + Known.MERCHANDISE_RETURN_NOT_ATTEMPTED + MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> + Known.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT + NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> + Known.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE + NO_CREDIT_RECEIPT_PROVIDED -> Known.NO_CREDIT_RECEIPT_PROVIDED + OTHER -> Known.OTHER + PROCESSING_ERROR_INCORRECT -> Known.PROCESSING_ERROR_INCORRECT + RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> + Known + .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY + SERVICES_MATCH_DESCRIPTION -> Known.SERVICES_MATCH_DESCRIPTION + SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Known.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE + SERVICES_USED_AFTER_CANCELLATION_DATE -> + Known.SERVICES_USED_AFTER_CANCELLATION_DATE + TERMS_OF_SERVICE_NOT_MISREPRESENTED -> + Known.TERMS_OF_SERVICE_NOT_MISREPRESENTED + TRANSACTION_CODE_CORRECT -> Known.TRANSACTION_CODE_CORRECT + else -> throw IncreaseInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && 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 InvalidDispute && + explanation == other.explanation && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, reason, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" + } + + /** + * Non-fiat currency or non-fungible token as described details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + */ + class NonFiatCurrencyOrNonFungibleTokenAsDescribed + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + NonFiatCurrencyOrNonFungibleTokenAsDescribed + ) = apply { + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenAsDescribed.additionalProperties + .toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = + NonFiatCurrencyOrNonFungibleTokenAsDescribed( + additionalProperties.toMutableMap() + ) + } + + private var validated: Boolean = false + + fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NonFiatCurrencyOrNonFungibleTokenAsDescribed && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" + } + + /** + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + */ + class NonFiatCurrencyOrNonFungibleTokenReceived + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val blockchainTransactionHash: JsonField, + private val destinationWalletAddress: JsonField, + private val priorApprovedTransactions: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("blockchain_transaction_hash") + @ExcludeMissing + blockchainTransactionHash: JsonField = JsonMissing.of(), + @JsonProperty("destination_wallet_address") + @ExcludeMissing + destinationWalletAddress: JsonField = JsonMissing.of(), + @JsonProperty("prior_approved_transactions") + @ExcludeMissing + priorApprovedTransactions: JsonField = JsonMissing.of(), + ) : this( + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, + mutableMapOf(), + ) + + /** + * Blockchain transaction hash. + * + * @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 blockchainTransactionHash(): String = + blockchainTransactionHash.getRequired("blockchain_transaction_hash") + + /** + * Destination wallet address. + * + * @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 destinationWalletAddress(): String = + destinationWalletAddress.getRequired("destination_wallet_address") + + /** + * Prior approved transactions. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun priorApprovedTransactions(): Optional = + priorApprovedTransactions.getOptional("prior_approved_transactions") + + /** + * Returns the raw JSON value of [blockchainTransactionHash]. + * + * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("blockchain_transaction_hash") + @ExcludeMissing + fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash + + /** + * Returns the raw JSON value of [destinationWalletAddress]. + * + * Unlike [destinationWalletAddress], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("destination_wallet_address") + @ExcludeMissing + fun _destinationWalletAddress(): JsonField = destinationWalletAddress + + /** + * Returns the raw JSON value of [priorApprovedTransactions]. + * + * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("prior_approved_transactions") + @ExcludeMissing + fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions + + @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 + * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * + * The following fields are required: + * ```java + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ + class Builder internal constructor() { + + private var blockchainTransactionHash: JsonField? = null + private var destinationWalletAddress: JsonField? = null + private var priorApprovedTransactions: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived + ) = apply { + blockchainTransactionHash = + nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash + destinationWalletAddress = + nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress + priorApprovedTransactions = + nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties + .toMutableMap() + } + + /** Blockchain transaction hash. */ + fun blockchainTransactionHash(blockchainTransactionHash: String) = + blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) + + /** + * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON 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. + * You should usually call [Builder.blockchainTransactionHash] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun blockchainTransactionHash( + blockchainTransactionHash: JsonField + ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } + + /** Destination wallet address. */ + fun destinationWalletAddress(destinationWalletAddress: String) = + destinationWalletAddress(JsonField.of(destinationWalletAddress)) + + /** + * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. * - * @throws IncreaseInvalidDataException if this class instance's value is a - * not a known member. + * You should usually call [Builder.destinationWalletAddress] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun known(): Known = - when (this) { - AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> - Known.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED - BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> - Known.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID - CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> - Known - .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE - CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> - Known.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE - CARDHOLDER_CANCELED_DIFFERENT_DATE -> - Known.CARDHOLDER_CANCELED_DIFFERENT_DATE - CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> - Known.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY - CARDHOLDER_RECEIVED_MERCHANDISE -> - Known.CARDHOLDER_RECEIVED_MERCHANDISE - COUNTRY_CODE_CORRECT -> Known.COUNTRY_CODE_CORRECT - CREDIT_PROCESSED_CORRECTLY -> Known.CREDIT_PROCESSED_CORRECTLY - CURRENCY_CORRECT -> Known.CURRENCY_CORRECT - DISPUTE_IS_FOR_QUALITY -> Known.DISPUTE_IS_FOR_QUALITY - DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> - Known.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> - Known.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> - Known - .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED - LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> - Known.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED - MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> - Known.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY - MERCHANDISE_MATCHES_DESCRIPTION -> - Known.MERCHANDISE_MATCHES_DESCRIPTION - MERCHANDISE_NOT_COUNTERFEIT -> Known.MERCHANDISE_NOT_COUNTERFEIT - MERCHANDISE_NOT_DAMAGED -> Known.MERCHANDISE_NOT_DAMAGED - MERCHANDISE_NOT_DEFECTIVE -> Known.MERCHANDISE_NOT_DEFECTIVE - MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Known.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE - MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> - Known.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION - MERCHANDISE_RETURN_NOT_ATTEMPTED -> - Known.MERCHANDISE_RETURN_NOT_ATTEMPTED - MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> - Known.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT - NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> - Known.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE - NO_CREDIT_RECEIPT_PROVIDED -> Known.NO_CREDIT_RECEIPT_PROVIDED - OTHER -> Known.OTHER - PROCESSING_ERROR_INCORRECT -> Known.PROCESSING_ERROR_INCORRECT - RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> - Known - .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY - SERVICES_MATCH_DESCRIPTION -> Known.SERVICES_MATCH_DESCRIPTION - SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Known.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE - SERVICES_USED_AFTER_CANCELLATION_DATE -> - Known.SERVICES_USED_AFTER_CANCELLATION_DATE - TERMS_OF_SERVICE_NOT_MISREPRESENTED -> - Known.TERMS_OF_SERVICE_NOT_MISREPRESENTED - TRANSACTION_CODE_CORRECT -> Known.TRANSACTION_CODE_CORRECT - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + fun destinationWalletAddress(destinationWalletAddress: JsonField) = + apply { + this.destinationWalletAddress = destinationWalletAddress } + /** Prior approved transactions. */ + fun priorApprovedTransactions(priorApprovedTransactions: String?) = + priorApprovedTransactions( + JsonField.ofNullable(priorApprovedTransactions) + ) + /** - * 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. + * Alias for calling [Builder.priorApprovedTransactions] with + * `priorApprovedTransactions.orElse(null)`. + */ + fun priorApprovedTransactions(priorApprovedTransactions: Optional) = + priorApprovedTransactions(priorApprovedTransactions.getOrNull()) + + /** + * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. * - * @throws IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. + * You should usually call [Builder.priorApprovedTransactions] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun priorApprovedTransactions( + priorApprovedTransactions: JsonField + ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): Reason = apply { - if (validated) { - return@apply - } + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } - known() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this - * object recursively. + * Returns an immutable instance of + * [NonFiatCurrencyOrNonFungibleTokenReceived]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = + NonFiatCurrencyOrNonFungibleTokenReceived( + checkRequired( + "blockchainTransactionHash", + blockchainTransactionHash, + ), + checkRequired("destinationWalletAddress", destinationWalletAddress), + checkRequired( + "priorApprovedTransactions", + priorApprovedTransactions, + ), + additionalProperties.toMutableMap(), + ) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is Reason && value == other.value + fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { + if (validated) { + return@apply } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + blockchainTransactionHash() + destinationWalletAddress() + priorApprovedTransactions() + 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 (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + + (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + + (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is InvalidDispute && - explanation == other.explanation && - reason == other.reason && + return other is NonFiatCurrencyOrNonFungibleTokenReceived && + blockchainTransactionHash == other.blockchainTransactionHash && + destinationWalletAddress == other.destinationWalletAddress && + priorApprovedTransactions == other.priorApprovedTransactions && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(explanation, reason, additionalProperties) + Objects.hash( + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" + "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" } /** - * Non-fiat currency or non-fungible token as described details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + * Proof of cash disbursement details. Present if and only if `reason` is + * `proof_of_cash_disbursement`. */ - class NonFiatCurrencyOrNonFungibleTokenAsDescribed + class ProofOfCashDisbursement @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val additionalProperties: MutableMap + private val explanation: JsonField, + private val additionalProperties: MutableMap, ) { - @JsonCreator private constructor() : this(mutableMapOf()) + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) + + /** + * Explanation for why the merchant believes the evidence provides proof of cash + * disbursement. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -8437,69 +9902,320 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. + * Returns a mutable builder for constructing an instance of + * [ProofOfCashDisbursement]. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ProofOfCashDisbursement]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(proofOfCashDisbursement: ProofOfCashDisbursement) = + apply { + explanation = proofOfCashDisbursement.explanation + additionalProperties = + proofOfCashDisbursement.additionalProperties.toMutableMap() + } + + /** + * Explanation for why the merchant believes the evidence provides proof of + * cash disbursement. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + 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 [ProofOfCashDisbursement]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ProofOfCashDisbursement = + ProofOfCashDisbursement( + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ProofOfCashDisbursement = apply { + if (validated) { + return@apply + } + + explanation() + 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 (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ProofOfCashDisbursement && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ProofOfCashDisbursement{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** The reason the merchant re-presented the dispute. */ + class Reason + @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 { + + /** Cardholder no longer disputes the transaction. */ + @JvmField + val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") + + /** Credit or reversal was processed. */ + @JvmField + val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") + + /** Invalid dispute. */ + @JvmField val INVALID_DISPUTE = of("invalid_dispute") + + /** + * Non-fiat currency or non-fungible token is as described by the merchant. + */ + @JvmField + val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED = + of("non_fiat_currency_or_non_fungible_token_as_described") + + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + @JvmField + val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = + of("non_fiat_currency_or_non_fungible_token_received") + + /** Proof of cash disbursement provided. */ + @JvmField val PROOF_OF_CASH_DISBURSEMENT = of("proof_of_cash_disbursement") + + /** Reversal issued by merchant. */ + @JvmField val REVERSAL_ISSUED = of("reversal_issued") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Invalid dispute. */ + INVALID_DISPUTE, + /** + * Non-fiat currency or non-fungible token is as described by the merchant. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Proof of cash disbursement provided. */ + PROOF_OF_CASH_DISBURSEMENT, + /** Reversal issued by merchant. */ + REVERSAL_ISSUED, + } + + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] 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 { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Invalid dispute. */ + INVALID_DISPUTE, + /** + * Non-fiat currency or non-fungible token is as described by the merchant. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Proof of cash disbursement provided. */ + PROOF_OF_CASH_DISBURSEMENT, + /** Reversal issued by merchant. */ + REVERSAL_ISSUED, + /** + * An enum member indicating that [Reason] was instantiated with an unknown + * value. */ - @JvmStatic fun builder() = Builder() + _UNKNOWN, } - /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - NonFiatCurrencyOrNonFungibleTokenAsDescribed - ) = apply { - additionalProperties = - nonFiatCurrencyOrNonFungibleTokenAsDescribed.additionalProperties - .toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) + /** + * 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) { + CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES + CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED + INVALID_DISPUTE -> Value.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> + Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PROOF_OF_CASH_DISBURSEMENT -> Value.PROOF_OF_CASH_DISBURSEMENT + REVERSAL_ISSUED -> Value.REVERSAL_ISSUED + else -> Value._UNKNOWN } - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) + /** + * 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) { + CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES + CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED + INVALID_DISPUTE -> Known.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> + Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PROOF_OF_CASH_DISBURSEMENT -> Known.PROOF_OF_CASH_DISBURSEMENT + REVERSAL_ISSUED -> Known.REVERSAL_ISSUED + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + /** + * 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") } - /** - * Returns an immutable instance of - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = - NonFiatCurrencyOrNonFungibleTokenAsDescribed( - additionalProperties.toMutableMap() - ) - } - private var validated: Boolean = false - fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { + fun validate(): Reason = apply { if (validated) { return@apply } + known() validated = true } @@ -8517,114 +10233,57 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = 0 + @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 NonFiatCurrencyOrNonFungibleTokenAsDescribed && - additionalProperties == other.additionalProperties + return other is Reason && value == other.value } - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode + override fun hashCode() = value.hashCode() - override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" + override fun toString() = value.toString() } /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * Reversal issued by merchant details. Present if and only if `reason` is + * `reversal_issued`. */ - class NonFiatCurrencyOrNonFungibleTokenReceived + class ReversalIssued @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val blockchainTransactionHash: JsonField, - private val destinationWalletAddress: JsonField, - private val priorApprovedTransactions: JsonField, + private val explanation: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("blockchain_transaction_hash") - @ExcludeMissing - blockchainTransactionHash: JsonField = JsonMissing.of(), - @JsonProperty("destination_wallet_address") - @ExcludeMissing - destinationWalletAddress: JsonField = JsonMissing.of(), - @JsonProperty("prior_approved_transactions") + @JsonProperty("explanation") @ExcludeMissing - priorApprovedTransactions: JsonField = JsonMissing.of(), - ) : this( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, - mutableMapOf(), - ) - - /** - * Blockchain transaction hash. - * - * @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 blockchainTransactionHash(): String = - blockchainTransactionHash.getRequired("blockchain_transaction_hash") - - /** - * Destination wallet address. - * - * @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 destinationWalletAddress(): String = - destinationWalletAddress.getRequired("destination_wallet_address") + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) /** - * Prior approved transactions. + * Explanation of the reversal issued by the merchant. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ - fun priorApprovedTransactions(): Optional = - priorApprovedTransactions.getOptional("prior_approved_transactions") - - /** - * Returns the raw JSON value of [blockchainTransactionHash]. - * - * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("blockchain_transaction_hash") - @ExcludeMissing - fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash - - /** - * Returns the raw JSON value of [destinationWalletAddress]. - * - * Unlike [destinationWalletAddress], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("destination_wallet_address") - @ExcludeMissing - fun _destinationWalletAddress(): JsonField = destinationWalletAddress + fun explanation(): Optional = explanation.getOptional("explanation") /** - * Returns the raw JSON value of [priorApprovedTransactions]. + * Returns the raw JSON value of [explanation]. * - * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON - * field has an unexpected type. + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("prior_approved_transactions") + @JsonProperty("explanation") @ExcludeMissing - fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions + fun _explanation(): JsonField = explanation @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -8642,97 +10301,50 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * [ReversalIssued]. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .explanation() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ + /** A builder for [ReversalIssued]. */ class Builder internal constructor() { - private var blockchainTransactionHash: JsonField? = null - private var destinationWalletAddress: JsonField? = null - private var priorApprovedTransactions: JsonField? = null + private var explanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived - ) = apply { - blockchainTransactionHash = - nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash - destinationWalletAddress = - nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress - priorApprovedTransactions = - nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions + internal fun from(reversalIssued: ReversalIssued) = apply { + explanation = reversalIssued.explanation additionalProperties = - nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties - .toMutableMap() + reversalIssued.additionalProperties.toMutableMap() } - /** Blockchain transaction hash. */ - fun blockchainTransactionHash(blockchainTransactionHash: String) = - blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) - - /** - * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON value. - * - * You should usually call [Builder.blockchainTransactionHash] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun blockchainTransactionHash( - blockchainTransactionHash: JsonField - ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } - - /** Destination wallet address. */ - fun destinationWalletAddress(destinationWalletAddress: String) = - destinationWalletAddress(JsonField.of(destinationWalletAddress)) - - /** - * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. - * - * You should usually call [Builder.destinationWalletAddress] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun destinationWalletAddress(destinationWalletAddress: JsonField) = - apply { - this.destinationWalletAddress = destinationWalletAddress - } - - /** Prior approved transactions. */ - fun priorApprovedTransactions(priorApprovedTransactions: String?) = - priorApprovedTransactions( - JsonField.ofNullable(priorApprovedTransactions) - ) + /** Explanation of the reversal issued by the merchant. */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) /** - * Alias for calling [Builder.priorApprovedTransactions] with - * `priorApprovedTransactions.orElse(null)`. + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. */ - fun priorApprovedTransactions(priorApprovedTransactions: Optional) = - priorApprovedTransactions(priorApprovedTransactions.getOrNull()) + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) /** - * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. + * Sets [Builder.explanation] to an arbitrary JSON value. * - * You should usually call [Builder.priorApprovedTransactions] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun priorApprovedTransactions( - priorApprovedTransactions: JsonField - ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } fun additionalProperties(additionalProperties: Map) = apply { @@ -8757,45 +10369,32 @@ private constructor( } /** - * Returns an immutable instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * Returns an immutable instance of [ReversalIssued]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .explanation() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = - NonFiatCurrencyOrNonFungibleTokenReceived( - checkRequired( - "blockchainTransactionHash", - blockchainTransactionHash, - ), - checkRequired("destinationWalletAddress", destinationWalletAddress), - checkRequired( - "priorApprovedTransactions", - priorApprovedTransactions, - ), + fun build(): ReversalIssued = + ReversalIssued( + checkRequired("explanation", explanation), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { + fun validate(): ReversalIssued = apply { if (validated) { return@apply } - blockchainTransactionHash() - destinationWalletAddress() - priorApprovedTransactions() + explanation() validated = true } @@ -8813,661 +10412,784 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = - (if (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + - (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + - (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) + @JvmSynthetic + internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ReversalIssued && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ReversalIssued{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Represented && + cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && + creditOrReversalProcessed == other.creditOrReversalProcessed && + invalidDispute == other.invalidDispute && + nonFiatCurrencyOrNonFungibleTokenAsDescribed == + other.nonFiatCurrencyOrNonFungibleTokenAsDescribed && + nonFiatCurrencyOrNonFungibleTokenReceived == + other.nonFiatCurrencyOrNonFungibleTokenReceived && + proofOfCashDisbursement == other.proofOfCashDisbursement && + reason == other.reason && + reversalIssued == other.reversalIssued && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderNoLongerDisputes, + creditOrReversalProcessed, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenAsDescribed, + nonFiatCurrencyOrNonFungibleTokenReceived, + proofOfCashDisbursement, + reason, + reversalIssued, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Represented{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, creditOrReversalProcessed=$creditOrReversalProcessed, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenAsDescribed=$nonFiatCurrencyOrNonFungibleTokenAsDescribed, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, proofOfCashDisbursement=$proofOfCashDisbursement, reason=$reason, reversalIssued=$reversalIssued, additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute Re-presentment Timed Out Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `representment_timed_out`. Contains the details specific to a re-presentment time-out + * Visa Card Dispute Network Event, which represents that the user did not respond to + * the re-presentment by the merchant within the time limit. + */ + class RepresentmentTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [RepresentmentTimedOut]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RepresentmentTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(representmentTimedOut: RepresentmentTimedOut) = apply { + additionalProperties = + representmentTimedOut.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [RepresentmentTimedOut]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): RepresentmentTimedOut = + RepresentmentTimedOut(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): RepresentmentTimedOut = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RepresentmentTimedOut && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RepresentmentTimedOut{additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_accepted`. Contains the details specific to a user + * prearbitration accepted Visa Card Dispute Network Event, which represents that the + * merchant has accepted the user's prearbitration request in the user's favor. + */ + class UserPrearbitrationAccepted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [UserPrearbitrationAccepted]. + */ + @JvmStatic fun builder() = Builder() + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** A builder for [UserPrearbitrationAccepted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationAccepted: UserPrearbitrationAccepted) = + apply { + additionalProperties = + userPrearbitrationAccepted.additionalProperties.toMutableMap() } - return other is NonFiatCurrencyOrNonFungibleTokenReceived && - blockchainTransactionHash == other.blockchainTransactionHash && - destinationWalletAddress == other.destinationWalletAddress && - priorApprovedTransactions == other.priorApprovedTransactions && - additionalProperties == other.additionalProperties + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private val hashCode: Int by lazy { - Objects.hash( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, - additionalProperties, - ) + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) } - override fun hashCode(): Int = hashCode - - override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** - * Proof of cash disbursement details. Present if and only if `reason` is - * `proof_of_cash_disbursement`. - */ - class ProofOfCashDisbursement - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Explanation for why the merchant believes the evidence provides proof of cash - * disbursement. + * Returns an immutable instance of [UserPrearbitrationAccepted]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Further updates to this [Builder] will not mutate the returned instance. */ - fun explanation(): Optional = explanation.getOptional("explanation") + fun build(): UserPrearbitrationAccepted = + UserPrearbitrationAccepted(additionalProperties.toMutableMap()) + } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + private var validated: Boolean = false - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + fun validate(): UserPrearbitrationAccepted = apply { + if (validated) { + return@apply } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + validated = true + } - fun toBuilder() = Builder().from(this) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - companion object { + /** + * 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 = 0 - /** - * Returns a mutable builder for constructing an instance of - * [ProofOfCashDisbursement]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** A builder for [ProofOfCashDisbursement]. */ - class Builder internal constructor() { + return other is UserPrearbitrationAccepted && + additionalProperties == other.additionalProperties + } - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - @JvmSynthetic - internal fun from(proofOfCashDisbursement: ProofOfCashDisbursement) = - apply { - explanation = proofOfCashDisbursement.explanation - additionalProperties = - proofOfCashDisbursement.additionalProperties.toMutableMap() - } + override fun hashCode(): Int = hashCode - /** - * Explanation for why the merchant believes the evidence provides proof of - * cash disbursement. - */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + override fun toString() = + "UserPrearbitrationAccepted{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_declined`. Contains the details specific to a user + * prearbitration declined Visa Card Dispute Network Event, which represents that the + * merchant has declined the user's prearbitration request. + */ + class UserPrearbitrationDeclined + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + @JsonCreator private constructor() : this(mutableMapOf()) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun toBuilder() = Builder().from(this) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + companion object { - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + /** + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationDeclined]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserPrearbitrationDeclined]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationDeclined: UserPrearbitrationDeclined) = + apply { + additionalProperties = + userPrearbitrationDeclined.additionalProperties.toMutableMap() } - /** - * Returns an immutable instance of [ProofOfCashDisbursement]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ProofOfCashDisbursement = - ProofOfCashDisbursement( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): ProofOfCashDisbursement = apply { - if (validated) { - return@apply + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [UserPrearbitrationDeclined]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): UserPrearbitrationDeclined = + UserPrearbitrationDeclined(additionalProperties.toMutableMap()) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is ProofOfCashDisbursement && - explanation == other.explanation && - additionalProperties == other.additionalProperties + fun validate(): UserPrearbitrationDeclined = apply { + if (validated) { + return@apply } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - override fun hashCode(): Int = hashCode + /** + * 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 = 0 - override fun toString() = - "ProofOfCashDisbursement{explanation=$explanation, additionalProperties=$additionalProperties}" + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is UserPrearbitrationDeclined && + additionalProperties == other.additionalProperties } - /** The reason the merchant re-presented the dispute. */ - class Reason - @JsonCreator - private constructor(private val value: JsonField) : Enum { + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * 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 + override fun hashCode(): Int = hashCode - companion object { + override fun toString() = + "UserPrearbitrationDeclined{additionalProperties=$additionalProperties}" + } - /** Cardholder no longer disputes the transaction. */ - @JvmField - val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") + /** + * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_submitted`. Contains the details specific to a user + * prearbitration submitted Visa Card Dispute Network Event, which represents that the + * user's request for prearbitration has been submitted to the network. + */ + class UserPrearbitrationSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** Credit or reversal was processed. */ - @JvmField - val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") + @JsonCreator private constructor() : this(mutableMapOf()) - /** Invalid dispute. */ - @JvmField val INVALID_DISPUTE = of("invalid_dispute") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - @JvmField - val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED = - of("non_fiat_currency_or_non_fungible_token_as_described") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - @JvmField - val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = - of("non_fiat_currency_or_non_fungible_token_received") + fun toBuilder() = Builder().from(this) - /** Proof of cash disbursement provided. */ - @JvmField val PROOF_OF_CASH_DISBURSEMENT = of("proof_of_cash_disbursement") + companion object { - /** Reversal issued by merchant. */ - @JvmField val REVERSAL_ISSUED = of("reversal_issued") + /** + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } + /** A builder for [UserPrearbitrationSubmitted]. */ + class Builder internal constructor() { - /** An enum containing [Reason]'s known values. */ - enum class Known { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Proof of cash disbursement provided. */ - PROOF_OF_CASH_DISBURSEMENT, - /** Reversal issued by merchant. */ - REVERSAL_ISSUED, + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationSubmitted: UserPrearbitrationSubmitted) = + apply { + additionalProperties = + userPrearbitrationSubmitted.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Reason] 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 { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Proof of cash disbursement provided. */ - PROOF_OF_CASH_DISBURSEMENT, - /** Reversal issued by merchant. */ - REVERSAL_ISSUED, - /** - * An enum member indicating that [Reason] was instantiated with an unknown - * value. - */ - _UNKNOWN, + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) } - /** - * 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) { - CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES - CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED - INVALID_DISPUTE -> Value.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> - Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PROOF_OF_CASH_DISBURSEMENT -> Value.PROOF_OF_CASH_DISBURSEMENT - REVERSAL_ISSUED -> Value.REVERSAL_ISSUED - else -> Value._UNKNOWN + 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 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. + * Returns an immutable instance of [UserPrearbitrationSubmitted]. * - * @throws IncreaseInvalidDataException if this class instance's value is a not - * a known member. + * Further updates to this [Builder] will not mutate the returned instance. */ - fun known(): Known = - when (this) { - CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES - CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED - INVALID_DISPUTE -> Known.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> - Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PROOF_OF_CASH_DISBURSEMENT -> Known.PROOF_OF_CASH_DISBURSEMENT - REVERSAL_ISSUED -> Known.REVERSAL_ISSUED - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") - } + fun build(): UserPrearbitrationSubmitted = + UserPrearbitrationSubmitted(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): UserPrearbitrationSubmitted = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is UserPrearbitrationSubmitted && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * 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") - } + override fun hashCode(): Int = hashCode - private var validated: Boolean = false + override fun toString() = + "UserPrearbitrationSubmitted{additionalProperties=$additionalProperties}" + } - fun validate(): Reason = apply { - if (validated) { - return@apply - } + /** + * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_timed_out`. Contains the details specific to a user + * prearbitration timed out Visa Card Dispute Network Event, which represents that the + * merchant has timed out responding to the user's prearbitration request. + */ + class UserPrearbitrationTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - known() - validated = true - } + @JsonCreator private constructor() : this(mutableMapOf()) - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + @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 score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationTimedOut]. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmStatic fun builder() = Builder() + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** A builder for [UserPrearbitrationTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationTimedOut: UserPrearbitrationTimedOut) = + apply { + additionalProperties = + userPrearbitrationTimedOut.additionalProperties.toMutableMap() } - return other is Reason && value == other.value + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - override fun hashCode() = value.hashCode() + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - override fun toString() = value.toString() - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** - * Reversal issued by merchant details. Present if and only if `reason` is - * `reversal_issued`. - */ - class ReversalIssued - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Explanation of the reversal issued by the merchant. + * Returns an immutable instance of [UserPrearbitrationTimedOut]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Further updates to this [Builder] will not mutate the returned instance. */ - fun explanation(): Optional = explanation.getOptional("explanation") + fun build(): UserPrearbitrationTimedOut = + UserPrearbitrationTimedOut(additionalProperties.toMutableMap()) + } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + private var validated: Boolean = false - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + fun validate(): UserPrearbitrationTimedOut = apply { + if (validated) { + return@apply } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + validated = true + } - fun toBuilder() = Builder().from(this) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - companion object { + /** + * 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 = 0 - /** - * Returns a mutable builder for constructing an instance of - * [ReversalIssued]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** A builder for [ReversalIssued]. */ - class Builder internal constructor() { + return other is UserPrearbitrationTimedOut && + additionalProperties == other.additionalProperties + } - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - @JvmSynthetic - internal fun from(reversalIssued: ReversalIssued) = apply { - explanation = reversalIssued.explanation - additionalProperties = - reversalIssued.additionalProperties.toMutableMap() - } + override fun hashCode(): Int = hashCode - /** Explanation of the reversal issued by the merchant. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + override fun toString() = + "UserPrearbitrationTimedOut{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field will + * be present in the JSON response if and only if `category` is equal to + * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal + * submitted Visa Card Dispute Network Event, which represents that the user's request + * to withdraw the dispute has been submitted to the network. + */ + class UserWithdrawalSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + @JsonCreator private constructor() : this(mutableMapOf()) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun toBuilder() = Builder().from(this) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + companion object { - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Returns a mutable builder for constructing an instance of + * [UserWithdrawalSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } - /** - * Returns an immutable instance of [ReversalIssued]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ReversalIssued = - ReversalIssued( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + /** A builder for [UserWithdrawalSubmitted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userWithdrawalSubmitted: UserWithdrawalSubmitted) = apply { + additionalProperties = + userWithdrawalSubmitted.additionalProperties.toMutableMap() } - private var validated: Boolean = false + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - fun validate(): ReversalIssued = apply { - if (validated) { - return@apply + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [UserWithdrawalSubmitted]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): UserWithdrawalSubmitted = + UserWithdrawalSubmitted(additionalProperties.toMutableMap()) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is ReversalIssued && - explanation == other.explanation && - additionalProperties == other.additionalProperties + fun validate(): UserWithdrawalSubmitted = apply { + if (validated) { + return@apply } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) - } + validated = true + } - override fun hashCode(): Int = hashCode + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - override fun toString() = - "ReversalIssued{explanation=$explanation, additionalProperties=$additionalProperties}" - } + /** + * 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 = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Represented && - cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && - creditOrReversalProcessed == other.creditOrReversalProcessed && - invalidDispute == other.invalidDispute && - nonFiatCurrencyOrNonFungibleTokenAsDescribed == - other.nonFiatCurrencyOrNonFungibleTokenAsDescribed && - nonFiatCurrencyOrNonFungibleTokenReceived == - other.nonFiatCurrencyOrNonFungibleTokenReceived && - proofOfCashDisbursement == other.proofOfCashDisbursement && - reason == other.reason && - reversalIssued == other.reversalIssued && + return other is UserWithdrawalSubmitted && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash( - cardholderNoLongerDisputes, - creditOrReversalProcessed, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenAsDescribed, - nonFiatCurrencyOrNonFungibleTokenReceived, - proofOfCashDisbursement, - reason, - reversalIssued, - additionalProperties, - ) - } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Represented{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, creditOrReversalProcessed=$creditOrReversalProcessed, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenAsDescribed=$nonFiatCurrencyOrNonFungibleTokenAsDescribed, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, proofOfCashDisbursement=$proofOfCashDisbursement, reason=$reason, reversalIssued=$reversalIssued, additionalProperties=$additionalProperties}" + "UserWithdrawalSubmitted{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -12991,7 +14713,7 @@ private constructor( private constructor( private val cardholderCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val purchaseExplanation: JsonField, private val receivedOrExpectedAt: JsonField, private val returnAttempted: JsonField, @@ -13012,7 +14734,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -13059,10 +14781,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Purchase explanation. @@ -13133,6 +14859,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -13224,7 +14960,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var purchaseExplanation: JsonField? = null private var receivedOrExpectedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -13296,7 +15032,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -13455,6 +15207,7 @@ private constructor( cardholderCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } purchaseExplanation() receivedOrExpectedAt() returnAttempted().ifPresent { it.validate() } @@ -13481,6 +15234,7 @@ private constructor( internal fun validity(): Int = (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -14290,6 +16044,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -16598,10 +18469,10 @@ private constructor( private val contractedAt: JsonField, private val guaranteedReservation: JsonField, private val merchantResolutionAttempted: JsonField, - private val other: JsonValue, + private val other: JsonField, private val purchaseExplanation: JsonField, private val serviceType: JsonField, - private val timeshare: JsonValue, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -16621,7 +18492,9 @@ private constructor( @ExcludeMissing merchantResolutionAttempted: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") + @ExcludeMissing + other: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -16630,7 +18503,7 @@ private constructor( serviceType: JsonField = JsonMissing.of(), @JsonProperty("timeshare") @ExcludeMissing - timeshare: JsonValue = JsonMissing.of(), + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -16685,8 +18558,11 @@ private constructor( /** * Other service type explanation. Present if and only if `service_type` is * `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * Purchase explanation. @@ -16709,10 +18585,11 @@ private constructor( /** * Timeshare explanation. Present if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("timeshare") - @ExcludeMissing - fun _timeshare(): JsonValue = timeshare + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -16757,6 +18634,14 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -16777,6 +18662,16 @@ private constructor( @ExcludeMissing fun _serviceType(): JsonField = serviceType + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -16820,10 +18715,10 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var purchaseExplanation: JsonField? = null private var serviceType: JsonField? = null - private var timeshare: JsonValue? = null + private var timeshare: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -16923,7 +18818,19 @@ private constructor( * Other service type explanation. Present if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** Purchase explanation. */ fun purchaseExplanation(purchaseExplanation: String) = @@ -16959,7 +18866,23 @@ private constructor( * Timeshare explanation. Present if and only if `service_type` is * `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare?) = + timeshare(JsonField.ofNullable(timeshare)) + + /** Alias for calling [Builder.timeshare] with `timeshare.orElse(null)`. */ + fun timeshare(timeshare: Optional) = + timeshare(timeshare.getOrNull()) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { @@ -17030,8 +18953,10 @@ private constructor( contractedAt() guaranteedReservation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + other().ifPresent { it.validate() } purchaseExplanation() serviceType().validate() + timeshare().ifPresent { it.validate() } validated = true } @@ -17055,8 +18980,10 @@ private constructor( (if (contractedAt.asKnown().isPresent) 1 else 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + - (serviceType.asKnown().getOrNull()?.validity() ?: 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -17995,7 +19922,279 @@ private constructor( return true } - return other is MerchantResolutionAttempted && value == other.value + return other is MerchantResolutionAttempted && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Other service type explanation. Present if and only if `service_type` is + * `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Other{additionalProperties=$additionalProperties}" + } + + /** Service type. */ + class ServiceType + @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 { + + /** Guaranteed reservation. */ + @JvmField val GUARANTEED_RESERVATION = of("guaranteed_reservation") + + /** Other. */ + @JvmField val OTHER = of("other") + + /** Timeshare. */ + @JvmField val TIMESHARE = of("timeshare") + + @JvmStatic fun of(value: String) = ServiceType(JsonField.of(value)) + } + + /** An enum containing [ServiceType]'s known values. */ + enum class Known { + /** Guaranteed reservation. */ + GUARANTEED_RESERVATION, + /** Other. */ + OTHER, + /** Timeshare. */ + TIMESHARE, + } + + /** + * An enum containing [ServiceType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ServiceType] 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 { + /** Guaranteed reservation. */ + GUARANTEED_RESERVATION, + /** Other. */ + OTHER, + /** Timeshare. */ + TIMESHARE, + /** + * An enum member indicating that [ServiceType] 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) { + GUARANTEED_RESERVATION -> Value.GUARANTEED_RESERVATION + OTHER -> Value.OTHER + TIMESHARE -> Value.TIMESHARE + 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) { + GUARANTEED_RESERVATION -> Known.GUARANTEED_RESERVATION + OTHER -> Known.OTHER + TIMESHARE -> Known.TIMESHARE + else -> + throw IncreaseInvalidDataException( + "Unknown ServiceType: $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(): ServiceType = 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 ServiceType && value == other.value } override fun hashCode() = value.hashCode() @@ -18003,128 +20202,87 @@ private constructor( override fun toString() = value.toString() } - /** Service type. */ - class ServiceType - @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 { + /** + * Timeshare explanation. Present if and only if `service_type` is `timeshare`. + */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { - /** Guaranteed reservation. */ - @JvmField val GUARANTEED_RESERVATION = of("guaranteed_reservation") + @JsonCreator private constructor() : this(mutableMapOf()) - /** Other. */ - @JvmField val OTHER = of("other") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** Timeshare. */ - @JvmField val TIMESHARE = of("timeshare") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - @JvmStatic fun of(value: String) = ServiceType(JsonField.of(value)) - } + fun toBuilder() = Builder().from(this) - /** An enum containing [ServiceType]'s known values. */ - enum class Known { - /** Guaranteed reservation. */ - GUARANTEED_RESERVATION, - /** Other. */ - OTHER, - /** Timeshare. */ - TIMESHARE, - } + companion object { - /** - * An enum containing [ServiceType]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [ServiceType] 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 { - /** Guaranteed reservation. */ - GUARANTEED_RESERVATION, - /** Other. */ - OTHER, - /** Timeshare. */ - TIMESHARE, /** - * An enum member indicating that [ServiceType] was instantiated with an - * unknown value. + * Returns a mutable builder for constructing an instance of + * [Timeshare]. */ - _UNKNOWN, + @JvmStatic fun builder() = Builder() } - /** - * 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) { - GUARANTEED_RESERVATION -> Value.GUARANTEED_RESERVATION - OTHER -> Value.OTHER - TIMESHARE -> Value.TIMESHARE - else -> Value._UNKNOWN + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.additionalProperties.toMutableMap() } - /** - * 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) { - GUARANTEED_RESERVATION -> Known.GUARANTEED_RESERVATION - OTHER -> Known.OTHER - TIMESHARE -> Known.TIMESHARE - else -> - throw IncreaseInvalidDataException( - "Unknown ServiceType: $value" - ) + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, 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") + 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 [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ServiceType = apply { + fun validate(): Timeshare = apply { if (validated) { return@apply } - known() validated = true } @@ -18142,20 +20300,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ServiceType && value == other.value + return other is Timeshare && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "Timeshare{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -18788,7 +20949,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnAttempted: JsonField, @@ -18805,7 +20966,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("order_and_issue_explanation") @ExcludeMissing orderAndIssueExplanation: JsonField = JsonMissing.of(), @@ -18842,10 +21003,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Order and issue explanation. @@ -18904,6 +21069,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [orderAndIssueExplanation]. * @@ -18992,7 +21167,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -19040,7 +21215,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -19195,6 +21386,7 @@ private constructor( } merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } orderAndIssueExplanation() receivedAt() returnAttempted().ifPresent { it.validate() } @@ -19220,6 +21412,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -19373,6 +21566,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -20680,7 +22990,7 @@ private constructor( private constructor( private val merchantResolutionAttempted: JsonField, private val misrepresentationExplanation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnAttempted: JsonField, @@ -20700,7 +23010,7 @@ private constructor( misrepresentationExplanation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -20748,10 +23058,14 @@ private constructor( fun misrepresentationExplanation(): String = misrepresentationExplanation.getRequired("misrepresentation_explanation") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Purchase explanation. @@ -20821,6 +23135,16 @@ private constructor( fun _misrepresentationExplanation(): JsonField = misrepresentationExplanation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -20911,7 +23235,7 @@ private constructor( JsonField? = null private var misrepresentationExplanation: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -20978,7 +23302,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -21138,6 +23478,7 @@ private constructor( merchantResolutionAttempted().validate() misrepresentationExplanation() + notReturned().ifPresent { it.validate() } purchaseExplanation() receivedAt() returnAttempted().ifPresent { it.validate() } @@ -21164,6 +23505,7 @@ private constructor( internal fun validity(): Int = (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (misrepresentationExplanation.asKnown().isPresent) 1 else 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -21317,6 +23659,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -24439,7 +26898,7 @@ private constructor( private val lastExpectedReceiptAt: JsonField, private val merchantCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val purchaseInfoAndExplanation: JsonField, private val additionalProperties: MutableMap, ) { @@ -24476,7 +26935,7 @@ private constructor( JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), @JsonProperty("purchase_info_and_explanation") @ExcludeMissing purchaseInfoAndExplanation: JsonField = JsonMissing.of(), @@ -24578,10 +27037,12 @@ private constructor( /** * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Purchase information and explanation. @@ -24678,6 +27139,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + /** * Returns the raw JSON value of [purchaseInfoAndExplanation]. * @@ -24740,7 +27211,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var noCancellation: JsonValue? = null + private var noCancellation: JsonField? = null private var purchaseInfoAndExplanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -24949,7 +27420,24 @@ private constructor( * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation?) = + noCancellation(JsonField.ofNullable(noCancellation)) + + /** + * Alias for calling [Builder.noCancellation] with + * `noCancellation.orElse(null)`. + */ + fun noCancellation(noCancellation: Optional) = + noCancellation(noCancellation.getOrNull()) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -25051,6 +27539,7 @@ private constructor( lastExpectedReceiptAt() merchantCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + noCancellation().ifPresent { it.validate() } purchaseInfoAndExplanation() validated = true } @@ -25082,6 +27571,7 @@ private constructor( (if (lastExpectedReceiptAt.asKnown().isPresent) 1 else 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) /** Cancellation outcome. */ @@ -25484,7 +27974,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val explanation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returnOutcome: JsonField, private val returned: JsonField, @@ -25498,7 +27988,7 @@ private constructor( explanation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -25528,10 +28018,12 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected + * type (e.g. if the server responded with an unexpected value). */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Return attempted. Present if and only if `return_outcome` is @@ -25571,6 +28063,16 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -25634,7 +28136,7 @@ private constructor( class Builder internal constructor() { private var explanation: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var returnAttempted: JsonField? = null private var returnOutcome: JsonField? = null private var returned: JsonField? = null @@ -25670,7 +28172,24 @@ private constructor( * Not returned. Present if and only if `return_outcome` is * `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with + * `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -25794,6 +28313,7 @@ private constructor( } explanation() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returnOutcome().validate() returned().ifPresent { it.validate() } @@ -25817,10 +28337,131 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties( + additionalProperties: Map + ) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -27094,6 +29735,126 @@ private constructor( override fun toString() = value.toString() } + /** + * No cancellation. Present if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -27642,7 +30403,7 @@ private constructor( private constructor( private val expectedAt: JsonField, private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, @@ -27663,7 +30424,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -27714,10 +30475,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing @@ -27796,6 +30561,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -27898,7 +30673,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var ongoingNegotiations: JsonField? = null private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null @@ -27960,7 +30735,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -28148,6 +30939,7 @@ private constructor( expectedAt() merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } purchaseInfoAndQualityIssue() receivedAt() @@ -28175,6 +30967,7 @@ private constructor( internal fun validity(): Int = (if (expectedAt.asKnown().isPresent) 1 else 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + @@ -28329,6 +31122,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Ongoing negotiations. Exclude if there is no evidence of ongoing * negotiations. @@ -33569,7 +36479,7 @@ private constructor( private val lastExpectedReceiptAt: JsonField, private val merchantCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val purchaseInfoAndExplanation: JsonField, private val additionalProperties: MutableMap, ) { @@ -33596,7 +36506,7 @@ private constructor( JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), @JsonProperty("purchase_info_and_explanation") @ExcludeMissing purchaseInfoAndExplanation: JsonField = JsonMissing.of(), @@ -33668,10 +36578,12 @@ private constructor( /** * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Purchase information and explanation. @@ -33737,6 +36649,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + /** * Returns the raw JSON value of [purchaseInfoAndExplanation]. * @@ -33792,7 +36714,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var noCancellation: JsonValue? = null + private var noCancellation: JsonField? = null private var purchaseInfoAndExplanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -33938,7 +36860,24 @@ private constructor( * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation?) = + noCancellation(JsonField.ofNullable(noCancellation)) + + /** + * Alias for calling [Builder.noCancellation] with + * `noCancellation.orElse(null)`. + */ + fun noCancellation(noCancellation: Optional) = + noCancellation(noCancellation.getOrNull()) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -34031,6 +36970,7 @@ private constructor( lastExpectedReceiptAt() merchantCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + noCancellation().ifPresent { it.validate() } purchaseInfoAndExplanation() validated = true } @@ -34059,6 +36999,7 @@ private constructor( (if (lastExpectedReceiptAt.asKnown().isPresent) 1 else 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) /** Cancellation outcome. */ @@ -34786,6 +37727,126 @@ private constructor( override fun toString() = value.toString() } + /** + * No cancellation. Present if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt index f595e7bd8..9fd2064d1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt @@ -1063,7 +1063,7 @@ private constructor( JsonField, private val consumerMerchandiseNotAsDescribed: JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -1120,7 +1120,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -1286,10 +1286,12 @@ private constructor( /** * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -1487,6 +1489,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -1622,7 +1635,8 @@ private constructor( JsonMissing.of() private var consumerMerchandiseNotReceived: JsonField = JsonMissing.of() - private var consumerNonReceiptOfCash: JsonValue = JsonMissing.of() + private var consumerNonReceiptOfCash: JsonField = + JsonMissing.of() private var consumerOriginalCreditTransactionNotAccepted: JsonField = JsonMissing.of() @@ -1885,9 +1899,19 @@ private constructor( * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + consumerNonReceiptOfCash(JsonField.of(consumerNonReceiptOfCash)) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -2112,6 +2136,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -2150,6 +2175,7 @@ private constructor( (consumerMerchandiseMisrepresentation.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted.asKnown().getOrNull()?.validity() ?: 0) + (consumerQualityMerchandise.asKnown().getOrNull()?.validity() ?: 0) + @@ -2808,7 +2834,7 @@ private constructor( private val receivedOrExpectedAt: JsonField, private val returnOutcome: JsonField, private val cardholderCancellation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -2834,7 +2860,7 @@ private constructor( cardholderCancellation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -2901,10 +2927,13 @@ private constructor( fun cardholderCancellation(): Optional = cardholderCancellation.getOptional("cardholder_cancellation") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -2975,6 +3004,16 @@ private constructor( fun _cardholderCancellation(): JsonField = cardholderCancellation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -3034,7 +3073,7 @@ private constructor( private var returnOutcome: JsonField? = null private var cardholderCancellation: JsonField = JsonMissing.of() - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3132,7 +3171,18 @@ private constructor( ) = apply { this.cardholderCancellation = cardholderCancellation } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -3226,6 +3276,7 @@ private constructor( receivedOrExpectedAt() returnOutcome().validate() cardholderCancellation().ifPresent { it.validate() } + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -3252,6 +3303,7 @@ private constructor( (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -4176,6 +4228,113 @@ private constructor( "CardholderCancellation{canceledAt=$canceledAt, canceledPriorToShipDate=$canceledPriorToShipDate, cancellationPolicyProvided=$cancellationPolicyProvided, reason=$reason, additionalProperties=$additionalProperties}" } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6160,8 +6319,8 @@ private constructor( private val purchaseExplanation: JsonField, private val serviceType: JsonField, private val guaranteedReservation: JsonField, - private val other: JsonValue, - private val timeshare: JsonValue, + private val other: JsonField, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -6186,8 +6345,10 @@ private constructor( @JsonProperty("guaranteed_reservation") @ExcludeMissing guaranteedReservation: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), - @JsonProperty("timeshare") @ExcludeMissing timeshare: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), + @JsonProperty("timeshare") + @ExcludeMissing + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -6260,11 +6421,19 @@ private constructor( /** * Other service type explanation. Required if and only if `service_type` is `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") - /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - @JsonProperty("timeshare") @ExcludeMissing fun _timeshare(): JsonValue = timeshare + /** + * Timeshare explanation. Required if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -6328,6 +6497,23 @@ private constructor( @ExcludeMissing fun _guaranteedReservation(): JsonField = guaranteedReservation + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6369,8 +6555,8 @@ private constructor( private var serviceType: JsonField? = null private var guaranteedReservation: JsonField = JsonMissing.of() - private var other: JsonValue = JsonMissing.of() - private var timeshare: JsonValue = JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var timeshare: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6485,10 +6671,30 @@ private constructor( * Other service type explanation. Required if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other) = other(JsonField.of(other)) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare) = timeshare(JsonField.of(timeshare)) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -6555,6 +6761,8 @@ private constructor( purchaseExplanation() serviceType().validate() guaranteedReservation().ifPresent { it.validate() } + other().ifPresent { it.validate() } + timeshare().ifPresent { it.validate() } validated = true } @@ -6579,7 +6787,9 @@ private constructor( (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + - (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -7640,84 +7850,298 @@ private constructor( "GuaranteedReservation{explanation=$explanation, additionalProperties=$additionalProperties}" } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Other service type explanation. Required if and only if `service_type` is `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is ConsumerCanceledServices && - cardholderCancellation == other.cardholderCancellation && - contractedAt == other.contractedAt && - merchantResolutionAttempted == other.merchantResolutionAttempted && - purchaseExplanation == other.purchaseExplanation && - serviceType == other.serviceType && - guaranteedReservation == other.guaranteedReservation && - this.other == other.other && - timeshare == other.timeshare && - additionalProperties == other.additionalProperties - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - private val hashCode: Int by lazy { - Objects.hash( - cardholderCancellation, - contractedAt, - merchantResolutionAttempted, - purchaseExplanation, - serviceType, - guaranteedReservation, - other, - timeshare, - additionalProperties, - ) - } + fun toBuilder() = Builder().from(this) - override fun hashCode(): Int = hashCode + companion object { - override fun toString() = - "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" - } + /** Returns a mutable builder for constructing an instance of [Other]. */ + @JvmStatic fun builder() = Builder() + } - /** - * Counterfeit merchandise. Required if and only if `category` is - * `consumer_counterfeit_merchandise`. - */ - class ConsumerCounterfeitMerchandise - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val counterfeitExplanation: JsonField, - private val dispositionExplanation: JsonField, - private val orderExplanation: JsonField, - private val receivedAt: JsonField, - private val additionalProperties: MutableMap, - ) { + /** A builder for [Other]. */ + class Builder internal constructor() { - @JsonCreator - private constructor( - @JsonProperty("counterfeit_explanation") - @ExcludeMissing - counterfeitExplanation: JsonField = JsonMissing.of(), - @JsonProperty("disposition_explanation") - @ExcludeMissing - dispositionExplanation: JsonField = JsonMissing.of(), - @JsonProperty("order_explanation") - @ExcludeMissing - orderExplanation: JsonField = JsonMissing.of(), - @JsonProperty("received_at") - @ExcludeMissing - receivedAt: JsonField = JsonMissing.of(), - ) : this( - counterfeitExplanation, - dispositionExplanation, - orderExplanation, - receivedAt, - mutableMapOf(), - ) + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Counterfeit explanation. - * - * @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 + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + + /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Timeshare]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Timeshare = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Timeshare && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Timeshare{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerCanceledServices && + cardholderCancellation == other.cardholderCancellation && + contractedAt == other.contractedAt && + merchantResolutionAttempted == other.merchantResolutionAttempted && + purchaseExplanation == other.purchaseExplanation && + serviceType == other.serviceType && + guaranteedReservation == other.guaranteedReservation && + this.other == other.other && + timeshare == other.timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderCancellation, + contractedAt, + merchantResolutionAttempted, + purchaseExplanation, + serviceType, + guaranteedReservation, + other, + timeshare, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" + } + + /** + * Counterfeit merchandise. Required if and only if `category` is + * `consumer_counterfeit_merchandise`. + */ + class ConsumerCounterfeitMerchandise + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val counterfeitExplanation: JsonField, + private val dispositionExplanation: JsonField, + private val orderExplanation: JsonField, + private val receivedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("counterfeit_explanation") + @ExcludeMissing + counterfeitExplanation: JsonField = JsonMissing.of(), + @JsonProperty("disposition_explanation") + @ExcludeMissing + dispositionExplanation: JsonField = JsonMissing.of(), + @JsonProperty("order_explanation") + @ExcludeMissing + orderExplanation: JsonField = JsonMissing.of(), + @JsonProperty("received_at") + @ExcludeMissing + receivedAt: JsonField = JsonMissing.of(), + ) : this( + counterfeitExplanation, + dispositionExplanation, + orderExplanation, + receivedAt, + mutableMapOf(), + ) + + /** + * Counterfeit explanation. + * + * @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 counterfeitExplanation(): String = @@ -8236,7 +8660,7 @@ private constructor( private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -8259,7 +8683,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -8315,10 +8739,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8378,6 +8805,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -8435,7 +8872,7 @@ private constructor( private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -8518,7 +8955,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8610,6 +9058,7 @@ private constructor( orderAndIssueExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -8635,6 +9084,7 @@ private constructor( (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -8932,6 +9382,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -10029,7 +10586,7 @@ private constructor( private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -10055,7 +10612,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -10122,10 +10679,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10193,7 +10753,17 @@ private constructor( */ @JsonProperty("return_outcome") @ExcludeMissing - fun _returnOutcome(): JsonField = returnOutcome + fun _returnOutcome(): JsonField = returnOutcome + + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned /** * Returns the raw JSON value of [returnAttempted]. @@ -10254,7 +10824,7 @@ private constructor( private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10354,7 +10924,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10449,6 +11030,7 @@ private constructor( purchaseExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -10475,6 +11057,7 @@ private constructor( (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -10772,6 +11355,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -13591,7 +14281,7 @@ private constructor( private val delayed: JsonField, private val deliveredToWrongLocation: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -13629,7 +14319,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, deliveryIssue, @@ -13736,10 +14426,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -13832,6 +14524,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -13878,7 +14580,7 @@ private constructor( private var deliveredToWrongLocation: JsonField = JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -14063,7 +14765,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -14137,6 +14849,7 @@ private constructor( delayed().ifPresent { it.validate() } deliveredToWrongLocation().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -14165,7 +14878,8 @@ private constructor( ?: 0) + (delayed.asKnown().getOrNull()?.validity() ?: 0) + (deliveredToWrongLocation.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -14838,7 +15552,7 @@ private constructor( private constructor( private val explanation: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -14854,7 +15568,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -14888,10 +15602,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -14930,6 +15647,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -14981,7 +15708,7 @@ private constructor( private var explanation: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -15026,7 +15753,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -15115,6 +15852,7 @@ private constructor( explanation() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -15138,6 +15876,7 @@ private constructor( internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -15221,46 +15960,156 @@ private constructor( 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) { - NOT_RETURNED -> Known.NOT_RETURNED - RETURNED -> Known.RETURNED - RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED - else -> - throw IncreaseInvalidDataException("Unknown ReturnOutcome: $value") + /** + * 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) { + NOT_RETURNED -> Known.NOT_RETURNED + RETURNED -> Known.RETURNED + RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED + else -> + throw IncreaseInvalidDataException("Unknown ReturnOutcome: $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(): ReturnOutcome = 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 ReturnOutcome && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - /** - * 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") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ReturnOutcome = apply { + fun validate(): NotReturned = apply { if (validated) { return@apply } - known() validated = true } @@ -15278,20 +16127,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ReturnOutcome && value == other.value + return other is NotReturned && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" } /** @@ -16085,6 +16937,119 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -16105,26 +17070,142 @@ private constructor( additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash( - cancellationOutcome, - deliveryIssue, - lastExpectedReceiptAt, - merchantResolutionAttempted, - purchaseInfoAndExplanation, - cardholderCancellationPriorToExpectedReceipt, - delayed, - deliveredToWrongLocation, - merchantCancellation, - noCancellation, - additionalProperties, - ) - } + private val hashCode: Int by lazy { + Objects.hash( + cancellationOutcome, + deliveryIssue, + lastExpectedReceiptAt, + merchantResolutionAttempted, + purchaseInfoAndExplanation, + cardholderCancellationPriorToExpectedReceipt, + delayed, + deliveredToWrongLocation, + merchantCancellation, + noCancellation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + } + + /** + * Non-receipt of cash. Required if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = apply { + additionalProperties = + consumerNonReceiptOfCash.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" } /** @@ -16503,7 +17584,7 @@ private constructor( private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, @@ -16530,7 +17611,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -16600,10 +17681,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -16682,6 +17766,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -16751,7 +17845,7 @@ private constructor( private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var ongoingNegotiations: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() @@ -16850,7 +17944,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -16964,6 +18069,7 @@ private constructor( purchaseInfoAndQualityIssue() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } @@ -16991,6 +18097,7 @@ private constructor( (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -17289,6 +18396,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. */ class OngoingNegotiations @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -22140,7 +23354,7 @@ private constructor( private val cardholderCancellationPriorToExpectedReceipt: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -22169,7 +23383,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, lastExpectedReceiptAt, @@ -22246,10 +23460,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -22314,6 +23530,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -22355,7 +23581,7 @@ private constructor( JsonField = JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -22490,7 +23716,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -22557,6 +23793,7 @@ private constructor( purchaseInfoAndExplanation() cardholderCancellationPriorToExpectedReceipt().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -22582,7 +23819,8 @@ private constructor( (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) + (cardholderCancellationPriorToExpectedReceipt.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -23286,6 +24524,119 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt index d70b15821..fd9c0cad3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt @@ -1442,7 +1442,7 @@ private constructor( private val consumerMerchandiseNotAsDescribed: JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -1504,7 +1504,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -1679,10 +1679,12 @@ private constructor( /** * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -1886,6 +1888,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -2024,7 +2037,8 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField = JsonMissing.of() - private var consumerNonReceiptOfCash: JsonValue = JsonMissing.of() + private var consumerNonReceiptOfCash: JsonField = + JsonMissing.of() private var consumerOriginalCreditTransactionNotAccepted: JsonField = JsonMissing.of() @@ -2298,9 +2312,19 @@ private constructor( * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + consumerNonReceiptOfCash(JsonField.of(consumerNonReceiptOfCash)) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Required if and only if @@ -2535,6 +2559,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -2573,6 +2598,7 @@ private constructor( (consumerMerchandiseMisrepresentation.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted.asKnown().getOrNull()?.validity() ?: 0) + (consumerQualityMerchandise.asKnown().getOrNull()?.validity() ?: 0) + @@ -3248,7 +3274,7 @@ private constructor( private val receivedOrExpectedAt: JsonField, private val returnOutcome: JsonField, private val cardholderCancellation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -3274,7 +3300,7 @@ private constructor( cardholderCancellation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -3341,10 +3367,13 @@ private constructor( fun cardholderCancellation(): Optional = cardholderCancellation.getOptional("cardholder_cancellation") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -3415,6 +3444,16 @@ private constructor( fun _cardholderCancellation(): JsonField = cardholderCancellation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -3475,7 +3514,7 @@ private constructor( private var returnOutcome: JsonField? = null private var cardholderCancellation: JsonField = JsonMissing.of() - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3575,7 +3614,17 @@ private constructor( ) = apply { this.cardholderCancellation = cardholderCancellation } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -3675,6 +3724,7 @@ private constructor( receivedOrExpectedAt() returnOutcome().validate() cardholderCancellation().ifPresent { it.validate() } + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -3701,6 +3751,7 @@ private constructor( (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -4645,6 +4696,119 @@ private constructor( "CardholderCancellation{canceledAt=$canceledAt, canceledPriorToShipDate=$canceledPriorToShipDate, cancellationPolicyProvided=$cancellationPolicyProvided, reason=$reason, additionalProperties=$additionalProperties}" } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -6654,8 +6818,8 @@ private constructor( private val purchaseExplanation: JsonField, private val serviceType: JsonField, private val guaranteedReservation: JsonField, - private val other: JsonValue, - private val timeshare: JsonValue, + private val other: JsonField, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -6680,10 +6844,12 @@ private constructor( @JsonProperty("guaranteed_reservation") @ExcludeMissing guaranteedReservation: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") + @ExcludeMissing + other: JsonField = JsonMissing.of(), @JsonProperty("timeshare") @ExcludeMissing - timeshare: JsonValue = JsonMissing.of(), + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -6757,11 +6923,19 @@ private constructor( /** * Other service type explanation. Required if and only if `service_type` is * `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") - /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - @JsonProperty("timeshare") @ExcludeMissing fun _timeshare(): JsonValue = timeshare + /** + * Timeshare explanation. Required if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -6826,6 +7000,24 @@ private constructor( fun _guaranteedReservation(): JsonField = guaranteedReservation + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6868,8 +7060,8 @@ private constructor( private var serviceType: JsonField? = null private var guaranteedReservation: JsonField = JsonMissing.of() - private var other: JsonValue = JsonMissing.of() - private var timeshare: JsonValue = JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var timeshare: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6986,12 +7178,32 @@ private constructor( * Other service type explanation. Required if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other) = other(JsonField.of(other)) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare) = timeshare(JsonField.of(timeshare)) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -7061,6 +7273,8 @@ private constructor( purchaseExplanation() serviceType().validate() guaranteedReservation().ifPresent { it.validate() } + other().ifPresent { it.validate() } + timeshare().ifPresent { it.validate() } validated = true } @@ -7085,7 +7299,9 @@ private constructor( (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + - (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -8166,75 +8382,300 @@ private constructor( "GuaranteedReservation{explanation=$explanation, additionalProperties=$additionalProperties}" } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Other service type explanation. Required if and only if `service_type` is + * `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is ConsumerCanceledServices && - cardholderCancellation == other.cardholderCancellation && - contractedAt == other.contractedAt && - merchantResolutionAttempted == other.merchantResolutionAttempted && - purchaseExplanation == other.purchaseExplanation && - serviceType == other.serviceType && - guaranteedReservation == other.guaranteedReservation && - this.other == other.other && - timeshare == other.timeshare && - additionalProperties == other.additionalProperties - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - private val hashCode: Int by lazy { - Objects.hash( - cardholderCancellation, - contractedAt, - merchantResolutionAttempted, - purchaseExplanation, - serviceType, - guaranteedReservation, - other, - timeshare, - additionalProperties, - ) - } + fun toBuilder() = Builder().from(this) - override fun hashCode(): Int = hashCode + companion object { - override fun toString() = - "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" - } + /** Returns a mutable builder for constructing an instance of [Other]. */ + @JvmStatic fun builder() = Builder() + } - /** - * Counterfeit merchandise. Required if and only if `category` is - * `consumer_counterfeit_merchandise`. - */ - class ConsumerCounterfeitMerchandise - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val counterfeitExplanation: JsonField, - private val dispositionExplanation: JsonField, - private val orderExplanation: JsonField, - private val receivedAt: JsonField, - private val additionalProperties: MutableMap, - ) { + /** A builder for [Other]. */ + class Builder internal constructor() { - @JsonCreator - private constructor( - @JsonProperty("counterfeit_explanation") - @ExcludeMissing - counterfeitExplanation: JsonField = JsonMissing.of(), - @JsonProperty("disposition_explanation") - @ExcludeMissing - dispositionExplanation: JsonField = JsonMissing.of(), - @JsonProperty("order_explanation") - @ExcludeMissing - orderExplanation: JsonField = JsonMissing.of(), - @JsonProperty("received_at") - @ExcludeMissing - receivedAt: JsonField = JsonMissing.of(), - ) : this( - counterfeitExplanation, - dispositionExplanation, - orderExplanation, + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + + /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Timeshare]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Timeshare = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Timeshare{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerCanceledServices && + cardholderCancellation == other.cardholderCancellation && + contractedAt == other.contractedAt && + merchantResolutionAttempted == other.merchantResolutionAttempted && + purchaseExplanation == other.purchaseExplanation && + serviceType == other.serviceType && + guaranteedReservation == other.guaranteedReservation && + this.other == other.other && + timeshare == other.timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderCancellation, + contractedAt, + merchantResolutionAttempted, + purchaseExplanation, + serviceType, + guaranteedReservation, + other, + timeshare, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" + } + + /** + * Counterfeit merchandise. Required if and only if `category` is + * `consumer_counterfeit_merchandise`. + */ + class ConsumerCounterfeitMerchandise + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val counterfeitExplanation: JsonField, + private val dispositionExplanation: JsonField, + private val orderExplanation: JsonField, + private val receivedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("counterfeit_explanation") + @ExcludeMissing + counterfeitExplanation: JsonField = JsonMissing.of(), + @JsonProperty("disposition_explanation") + @ExcludeMissing + dispositionExplanation: JsonField = JsonMissing.of(), + @JsonProperty("order_explanation") + @ExcludeMissing + orderExplanation: JsonField = JsonMissing.of(), + @JsonProperty("received_at") + @ExcludeMissing + receivedAt: JsonField = JsonMissing.of(), + ) : this( + counterfeitExplanation, + dispositionExplanation, + orderExplanation, receivedAt, mutableMapOf(), ) @@ -8764,7 +9205,7 @@ private constructor( private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -8787,7 +9228,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -8843,10 +9284,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8906,6 +9350,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -8964,7 +9418,7 @@ private constructor( private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9050,7 +9504,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -9148,6 +9612,7 @@ private constructor( orderAndIssueExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -9173,6 +9638,7 @@ private constructor( (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -9476,6 +9942,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -10587,7 +11166,7 @@ private constructor( private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -10613,7 +11192,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -10680,10 +11259,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10752,7 +11334,17 @@ private constructor( */ @JsonProperty("return_outcome") @ExcludeMissing - fun _returnOutcome(): JsonField = returnOutcome + fun _returnOutcome(): JsonField = returnOutcome + + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned /** * Returns the raw JSON value of [returnAttempted]. @@ -10814,7 +11406,7 @@ private constructor( private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10915,7 +11507,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -11019,6 +11621,7 @@ private constructor( purchaseExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -11045,6 +11648,7 @@ private constructor( (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -11348,6 +11952,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -14207,7 +14924,7 @@ private constructor( private val delayed: JsonField, private val deliveredToWrongLocation: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -14246,7 +14963,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, deliveryIssue, @@ -14354,10 +15071,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -14453,6 +15172,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -14501,7 +15230,7 @@ private constructor( JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -14690,7 +15419,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -14767,6 +15506,7 @@ private constructor( delayed().ifPresent { it.validate() } deliveredToWrongLocation().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -14797,7 +15537,8 @@ private constructor( ?.validity() ?: 0) + (delayed.asKnown().getOrNull()?.validity() ?: 0) + (deliveredToWrongLocation.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -15482,7 +16223,7 @@ private constructor( private constructor( private val explanation: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -15498,7 +16239,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -15532,10 +16273,14 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is @@ -15575,6 +16320,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -15626,7 +16381,7 @@ private constructor( private var explanation: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -15675,7 +16430,17 @@ private constructor( /** * Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -15766,6 +16531,7 @@ private constructor( explanation() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -15789,6 +16555,7 @@ private constructor( internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -15872,48 +16639,162 @@ private constructor( 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) { - NOT_RETURNED -> Known.NOT_RETURNED - RETURNED -> Known.RETURNED - RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED - else -> - throw IncreaseInvalidDataException( - "Unknown ReturnOutcome: $value" - ) + /** + * 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) { + NOT_RETURNED -> Known.NOT_RETURNED + RETURNED -> Known.RETURNED + RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED + else -> + throw IncreaseInvalidDataException( + "Unknown ReturnOutcome: $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(): ReturnOutcome = 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 ReturnOutcome && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - /** - * 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") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ReturnOutcome = apply { + fun validate(): NotReturned = apply { if (validated) { return@apply } - known() validated = true } @@ -15931,20 +16812,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ReturnOutcome && value == other.value + return other is NotReturned && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" } /** @@ -16753,6 +17637,125 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -16792,7 +17795,123 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + } + + /** + * Non-receipt of cash. Required if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = apply { + additionalProperties = + consumerNonReceiptOfCash.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" } /** @@ -17178,7 +18297,7 @@ private constructor( private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, @@ -17205,7 +18324,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -17275,10 +18394,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -17357,6 +18479,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -17427,7 +18559,7 @@ private constructor( private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var ongoingNegotiations: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() @@ -17528,7 +18660,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -17652,6 +18794,7 @@ private constructor( purchaseInfoAndQualityIssue() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } @@ -17679,6 +18822,7 @@ private constructor( (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -17983,6 +19127,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. */ @@ -22918,7 +24175,7 @@ private constructor( private val cardholderCancellationPriorToExpectedReceipt: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -22947,7 +24204,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, lastExpectedReceiptAt, @@ -23025,10 +24282,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -23093,6 +24352,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -23136,7 +24405,7 @@ private constructor( JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -23275,7 +24544,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -23345,6 +24624,7 @@ private constructor( purchaseInfoAndExplanation() cardholderCancellationPriorToExpectedReceipt().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -23372,7 +24652,8 @@ private constructor( .asKnown() .getOrNull() ?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -24086,6 +25367,125 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 691012030..87597f9dd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -525,6 +525,7 @@ private constructor( private val cardAuthorization: JsonField, private val cardAuthorizationExpiration: JsonField, private val cardDecline: JsonField, + private val cardFinancial: JsonField, private val cardFuelConfirmation: JsonField, private val cardIncrement: JsonField, private val cardRefund: JsonField, @@ -533,7 +534,7 @@ private constructor( private val cardValidation: JsonField, private val category: JsonField, private val createdAt: JsonField, - private val other: JsonValue, + private val other: JsonField, private val additionalProperties: MutableMap, ) { @@ -551,6 +552,9 @@ private constructor( @JsonProperty("card_decline") @ExcludeMissing cardDecline: JsonField = JsonMissing.of(), + @JsonProperty("card_financial") + @ExcludeMissing + cardFinancial: JsonField = JsonMissing.of(), @JsonProperty("card_fuel_confirmation") @ExcludeMissing cardFuelConfirmation: JsonField = JsonMissing.of(), @@ -575,12 +579,13 @@ private constructor( @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), ) : this( cardAuthentication, cardAuthorization, cardAuthorizationExpiration, cardDecline, + cardFinancial, cardFuelConfirmation, cardIncrement, cardRefund, @@ -635,6 +640,16 @@ private constructor( */ fun cardDecline(): Optional = cardDecline.getOptional("card_decline") + /** + * A Card Financial object. This field will be present in the JSON response if and only if + * `category` is equal to `card_financial`. Card Financials are temporary holds placed on a + * customers funds with the intent to later clear a transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cardFinancial(): Optional = cardFinancial.getOptional("card_financial") + /** * A Card Fuel Confirmation object. This field will be present in the JSON response if and * only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations update @@ -722,8 +737,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * Returns the raw JSON value of [cardAuthentication]. @@ -765,6 +783,16 @@ private constructor( @ExcludeMissing fun _cardDecline(): JsonField = cardDecline + /** + * Returns the raw JSON value of [cardFinancial]. + * + * Unlike [cardFinancial], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("card_financial") + @ExcludeMissing + fun _cardFinancial(): JsonField = cardFinancial + /** * Returns the raw JSON value of [cardFuelConfirmation]. * @@ -840,6 +868,13 @@ private constructor( @ExcludeMissing fun _createdAt(): JsonField = createdAt + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -863,6 +898,7 @@ private constructor( * .cardAuthorization() * .cardAuthorizationExpiration() * .cardDecline() + * .cardFinancial() * .cardFuelConfirmation() * .cardIncrement() * .cardRefund() @@ -884,6 +920,7 @@ private constructor( private var cardAuthorization: JsonField? = null private var cardAuthorizationExpiration: JsonField? = null private var cardDecline: JsonField? = null + private var cardFinancial: JsonField? = null private var cardFuelConfirmation: JsonField? = null private var cardIncrement: JsonField? = null private var cardRefund: JsonField? = null @@ -892,7 +929,7 @@ private constructor( private var cardValidation: JsonField? = null private var category: JsonField? = null private var createdAt: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -901,6 +938,7 @@ private constructor( cardAuthorization = element.cardAuthorization cardAuthorizationExpiration = element.cardAuthorizationExpiration cardDecline = element.cardDecline + cardFinancial = element.cardFinancial cardFuelConfirmation = element.cardFuelConfirmation cardIncrement = element.cardIncrement cardRefund = element.cardRefund @@ -1016,6 +1054,29 @@ private constructor( this.cardDecline = cardDecline } + /** + * A Card Financial object. This field will be present in the JSON response if and only + * if `category` is equal to `card_financial`. Card Financials are temporary holds + * placed on a customers funds with the intent to later clear a transaction. + */ + fun cardFinancial(cardFinancial: CardFinancial?) = + cardFinancial(JsonField.ofNullable(cardFinancial)) + + /** Alias for calling [Builder.cardFinancial] with `cardFinancial.orElse(null)`. */ + fun cardFinancial(cardFinancial: Optional) = + cardFinancial(cardFinancial.getOrNull()) + + /** + * Sets [Builder.cardFinancial] to an arbitrary JSON value. + * + * You should usually call [Builder.cardFinancial] with a well-typed [CardFinancial] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun cardFinancial(cardFinancial: JsonField) = apply { + this.cardFinancial = cardFinancial + } + /** * A Card Fuel Confirmation object. This field will be present in the JSON response if * and only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations @@ -1196,7 +1257,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1228,6 +1301,7 @@ private constructor( * .cardAuthorization() * .cardAuthorizationExpiration() * .cardDecline() + * .cardFinancial() * .cardFuelConfirmation() * .cardIncrement() * .cardRefund() @@ -1247,6 +1321,7 @@ private constructor( checkRequired("cardAuthorization", cardAuthorization), checkRequired("cardAuthorizationExpiration", cardAuthorizationExpiration), checkRequired("cardDecline", cardDecline), + checkRequired("cardFinancial", cardFinancial), checkRequired("cardFuelConfirmation", cardFuelConfirmation), checkRequired("cardIncrement", cardIncrement), checkRequired("cardRefund", cardRefund), @@ -1271,6 +1346,7 @@ private constructor( cardAuthorization().ifPresent { it.validate() } cardAuthorizationExpiration().ifPresent { it.validate() } cardDecline().ifPresent { it.validate() } + cardFinancial().ifPresent { it.validate() } cardFuelConfirmation().ifPresent { it.validate() } cardIncrement().ifPresent { it.validate() } cardRefund().ifPresent { it.validate() } @@ -1279,6 +1355,7 @@ private constructor( cardValidation().ifPresent { it.validate() } category().validate() createdAt() + other().ifPresent { it.validate() } validated = true } @@ -1302,6 +1379,7 @@ private constructor( (cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorizationExpiration.asKnown().getOrNull()?.validity() ?: 0) + (cardDecline.asKnown().getOrNull()?.validity() ?: 0) + + (cardFinancial.asKnown().getOrNull()?.validity() ?: 0) + (cardFuelConfirmation.asKnown().getOrNull()?.validity() ?: 0) + (cardIncrement.asKnown().getOrNull()?.validity() ?: 0) + (cardRefund.asKnown().getOrNull()?.validity() ?: 0) + @@ -1309,7 +1387,8 @@ private constructor( (cardSettlement.asKnown().getOrNull()?.validity() ?: 0) + (cardValidation.asKnown().getOrNull()?.validity() ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) /** * A Card Authentication object. This field will be present in the JSON response if and only @@ -4336,7 +4415,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -5130,7 +5210,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -5673,6 +5754,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -5691,6 +5773,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -5715,6 +5800,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -5741,6 +5827,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -5816,6 +5910,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -5906,6 +6010,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -5923,6 +6028,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -5936,6 +6042,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -5976,6 +6083,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -6142,6 +6264,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -6157,6 +6280,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -6177,6 +6301,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -6205,6 +6330,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -6667,6 +6793,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8270,6 +8623,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -8284,6 +8638,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -8298,7 +8653,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -8633,6 +8988,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -8642,8 +8998,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -8654,6 +9013,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -8672,6 +9039,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -8700,6 +9075,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -8710,12 +9086,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -8732,6 +9110,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -8777,6 +9170,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -8785,6 +9179,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -8798,6 +9193,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -8819,6 +9215,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -8842,13 +9239,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -8864,6 +9266,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -8881,6 +9285,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -8896,6 +9301,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -8954,6 +9360,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -10115,24 +10630,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -10141,6 +10658,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -10150,7 +10670,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -10181,6 +10719,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -10231,6 +10780,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -10242,6 +10792,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -10249,6 +10800,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -10256,6 +10809,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -10358,6 +10948,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -10367,6 +10958,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -10381,6 +10976,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -10403,7 +10999,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -10413,6 +11010,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -10421,6 +11020,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -10431,7 +11031,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -12667,13 +13267,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -12688,6 +13293,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -12705,6 +13312,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -12720,6 +13328,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -13283,7 +13892,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -14117,7 +14727,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -14667,6 +15278,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -14685,6 +15297,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -14709,6 +15324,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -14735,6 +15351,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -14810,6 +15434,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -14900,6 +15534,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -14917,6 +15552,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -14930,6 +15566,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -14970,6 +15607,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -15136,6 +15788,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -15151,6 +15804,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -15171,6 +15825,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -15199,6 +15854,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -15661,8 +16317,8 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The part of this transaction amount that was for healthcare prescriptions. */ - class Prescription + /** The original pre-authorized amount. */ + class Original @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -15734,7 +16390,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Prescription]. + * Returns a mutable builder for constructing an instance of [Original]. * * The following fields are required: * ```java @@ -15745,7 +16401,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Prescription]. */ + /** A builder for [Original]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -15754,10 +16410,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(prescription: Prescription) = apply { - amount = prescription.amount - currency = prescription.currency - additionalProperties = prescription.additionalProperties.toMutableMap() + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() } /** @@ -15816,7 +16472,7 @@ private constructor( } /** - * Returns an immutable instance of [Prescription]. + * Returns an immutable instance of [Original]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -15828,8 +16484,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Prescription = - Prescription( + fun build(): Original = + Original( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -15838,7 +16494,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Prescription = apply { + fun validate(): Original = apply { if (validated) { return@apply } @@ -15872,7 +16528,7 @@ private constructor( return true } - return other is Prescription && + return other is Original && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -15885,11 +16541,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The surcharge amount charged for this transaction by the merchant. */ - class Surcharge + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -15961,7 +16617,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Surcharge]. + * Returns a mutable builder for constructing an instance of [Prescription]. * * The following fields are required: * ```java @@ -15972,7 +16628,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Surcharge]. */ + /** A builder for [Prescription]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -15981,10 +16637,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(surcharge: Surcharge) = apply { - amount = surcharge.amount - currency = surcharge.currency - additionalProperties = surcharge.additionalProperties.toMutableMap() + internal fun from(prescription: Prescription) = apply { + amount = prescription.amount + currency = prescription.currency + additionalProperties = prescription.additionalProperties.toMutableMap() } /** @@ -16043,7 +16699,7 @@ private constructor( } /** - * Returns an immutable instance of [Surcharge]. + * Returns an immutable instance of [Prescription]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -16055,8 +16711,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Surcharge = - Surcharge( + fun build(): Prescription = + Prescription( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -16065,7 +16721,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Surcharge = apply { + fun validate(): Prescription = apply { if (validated) { return@apply } @@ -16099,7 +16755,7 @@ private constructor( return true } - return other is Surcharge && + return other is Prescription && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -16112,13 +16768,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** - * The total amount of a series of incremental authorizations, optionally provided. - */ - class TotalCumulative + /** The surcharge amount charged for this transaction by the merchant. */ + class Surcharge @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -16190,8 +16844,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [TotalCumulative]. + * Returns a mutable builder for constructing an instance of [Surcharge]. * * The following fields are required: * ```java @@ -16202,7 +16855,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [TotalCumulative]. */ + /** A builder for [Surcharge]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -16211,11 +16864,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(totalCumulative: TotalCumulative) = apply { - amount = totalCumulative.amount - currency = totalCumulative.currency - additionalProperties = - totalCumulative.additionalProperties.toMutableMap() + internal fun from(surcharge: Surcharge) = apply { + amount = surcharge.amount + currency = surcharge.currency + additionalProperties = surcharge.additionalProperties.toMutableMap() } /** @@ -16274,7 +16926,7 @@ private constructor( } /** - * Returns an immutable instance of [TotalCumulative]. + * Returns an immutable instance of [Surcharge]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -16286,8 +16938,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): TotalCumulative = - TotalCumulative( + fun build(): Surcharge = + Surcharge( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -16296,7 +16948,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TotalCumulative = apply { + fun validate(): Surcharge = apply { if (validated) { return@apply } @@ -16330,7 +16982,7 @@ private constructor( return true } - return other is TotalCumulative && + return other is Surcharge && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -16343,11 +16995,13 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The total amount of healthcare-related additional amounts. */ - class TotalHealthcare + /** + * The total amount of a series of incremental authorizations, optionally provided. + */ + class TotalCumulative @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -16420,7 +17074,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [TotalHealthcare]. + * [TotalCumulative]. * * The following fields are required: * ```java @@ -16431,7 +17085,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [TotalHealthcare]. */ + /** A builder for [TotalCumulative]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -16440,11 +17094,240 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(totalHealthcare: TotalHealthcare) = apply { - amount = totalHealthcare.amount - currency = totalHealthcare.currency + internal fun from(totalCumulative: TotalCumulative) = apply { + amount = totalCumulative.amount + currency = totalCumulative.currency additionalProperties = - totalHealthcare.additionalProperties.toMutableMap() + totalCumulative.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [TotalCumulative]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalCumulative = + TotalCumulative( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalCumulative = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalCumulative && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The total amount of healthcare-related additional amounts. */ + class TotalHealthcare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalHealthcare]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalHealthcare]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalHealthcare: TotalHealthcare) = apply { + amount = totalHealthcare.amount + currency = totalHealthcare.currency + additionalProperties = + totalHealthcare.additionalProperties.toMutableMap() } /** @@ -17264,6 +18147,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -17278,6 +18162,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -17292,7 +18177,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -17627,6 +18512,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -17636,8 +18522,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -17648,6 +18537,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -17666,6 +18563,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -17694,6 +18599,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -17704,12 +18610,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -17726,6 +18634,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -17771,6 +18694,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -17779,6 +18703,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -17792,6 +18717,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -17813,6 +18739,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -17836,13 +18763,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -17858,6 +18790,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -17875,6 +18809,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -17890,6 +18825,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -17948,6 +18884,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -19109,24 +20154,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -19135,6 +20182,9006 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + retrievalReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("trace_number") + @ExcludeMissing + traceNumber: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun retrievalReferenceNumber(): Optional = + retrievalReferenceNumber.getOptional("retrieval_reference_number") + + /** + * A counter used to verify an individual authorization. Expected to be unique per + * acquirer within a window of time. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun traceNumber(): Optional = traceNumber.getOptional("trace_number") + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * 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 [retrievalReferenceNumber]. + * + * Unlike [retrievalReferenceNumber], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + fun _retrievalReferenceNumber(): JsonField = retrievalReferenceNumber + + /** + * Returns the raw JSON value of [traceNumber]. + * + * Unlike [traceNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("trace_number") + @ExcludeMissing + fun _traceNumber(): JsonField = traceNumber + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + @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 + * [NetworkIdentifiers]. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkIdentifiers]. */ + class Builder internal constructor() { + + private var authorizationIdentificationResponse: JsonField? = null + private var retrievalReferenceNumber: JsonField? = null + private var traceNumber: JsonField? = null + private var transactionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse + retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber + traceNumber = networkIdentifiers.traceNumber + transactionId = networkIdentifiers.transactionId + additionalProperties = + networkIdentifiers.additionalProperties.toMutableMap() + } + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: String?) = + retrievalReferenceNumber(JsonField.ofNullable(retrievalReferenceNumber)) + + /** + * Alias for calling [Builder.retrievalReferenceNumber] with + * `retrievalReferenceNumber.orElse(null)`. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: Optional) = + retrievalReferenceNumber(retrievalReferenceNumber.getOrNull()) + + /** + * Sets [Builder.retrievalReferenceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.retrievalReferenceNumber] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: JsonField) = + apply { + this.retrievalReferenceNumber = retrievalReferenceNumber + } + + /** + * A counter used to verify an individual authorization. Expected to be unique + * per acquirer within a window of time. + */ + fun traceNumber(traceNumber: String?) = + traceNumber(JsonField.ofNullable(traceNumber)) + + /** Alias for calling [Builder.traceNumber] with `traceNumber.orElse(null)`. */ + fun traceNumber(traceNumber: Optional) = + traceNumber(traceNumber.getOrNull()) + + /** + * Sets [Builder.traceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.traceNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun traceNumber(traceNumber: JsonField) = apply { + this.traceNumber = traceNumber + } + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** + * Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. + */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + 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 [NetworkIdentifiers]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkIdentifiers = + NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), + checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), + checkRequired("traceNumber", traceNumber), + checkRequired("transactionId", transactionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkIdentifiers = apply { + if (validated) { + return@apply + } + + authorizationIdentificationResponse() + retrievalReferenceNumber() + traceNumber() + transactionId() + 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 (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (traceNumber.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && + retrievalReferenceNumber == other.retrievalReferenceNumber && + traceNumber == other.traceNumber && + transactionId == other.transactionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + } + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + class ProcessingCategory + @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 funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + @JvmField val ACCOUNT_FUNDING = of("account_funding") + + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + @JvmField val AUTOMATIC_FUEL_DISPENSER = of("automatic_fuel_dispenser") + + /** A transaction used to pay a bill. */ + @JvmField val BILL_PAYMENT = of("bill_payment") + + /** Original credit transactions are used to send money to a cardholder. */ + @JvmField val ORIGINAL_CREDIT = of("original_credit") + + /** A regular purchase. */ + @JvmField val PURCHASE = of("purchase") + + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + @JvmField val QUASI_CASH = of("quasi_cash") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + @JvmField val CASH_DISBURSEMENT = of("cash_disbursement") + + /** The processing category is unknown. */ + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic fun of(value: String) = ProcessingCategory(JsonField.of(value)) + } + + /** An enum containing [ProcessingCategory]'s known values. */ + enum class Known { + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** The processing category is unknown. */ + UNKNOWN, + } + + /** + * An enum containing [ProcessingCategory]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ProcessingCategory] 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 funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** The processing category is unknown. */ + UNKNOWN, + /** + * An enum member indicating that [ProcessingCategory] 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_FUNDING -> Value.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Value.BILL_PAYMENT + ORIGINAL_CREDIT -> Value.ORIGINAL_CREDIT + PURCHASE -> Value.PURCHASE + QUASI_CASH -> Value.QUASI_CASH + REFUND -> Value.REFUND + CASH_DISBURSEMENT -> Value.CASH_DISBURSEMENT + UNKNOWN -> Value.UNKNOWN + 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_FUNDING -> Known.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Known.BILL_PAYMENT + ORIGINAL_CREDIT -> Known.ORIGINAL_CREDIT + PURCHASE -> Known.PURCHASE + QUASI_CASH -> Known.QUASI_CASH + REFUND -> Known.REFUND + CASH_DISBURSEMENT -> Known.CASH_DISBURSEMENT + UNKNOWN -> Known.UNKNOWN + else -> + throw IncreaseInvalidDataException("Unknown ProcessingCategory: $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(): ProcessingCategory = 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 ProcessingCategory && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** This is present if a specific decline reason was given in the real-time decision. */ + class RealTimeDecisionReason + @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 cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") + + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") + + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") + + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") + + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = RealTimeDecisionReason(JsonField.of(value)) + } + + /** An enum containing [RealTimeDecisionReason]'s known values. */ + enum class Known { + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + } + + /** + * An enum containing [RealTimeDecisionReason]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [RealTimeDecisionReason] 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 cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + /** + * An enum member indicating that [RealTimeDecisionReason] 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) { + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + OTHER -> Value.OTHER + 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) { + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD + OTHER -> Known.OTHER + else -> + throw IncreaseInvalidDataException( + "Unknown RealTimeDecisionReason: $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(): RealTimeDecisionReason = 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 RealTimeDecisionReason && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Why the transaction was declined. */ + class Reason @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 account has been closed. */ + @JvmField val ACCOUNT_CLOSED = of("account_closed") + + /** The Card was not active. */ + @JvmField val CARD_NOT_ACTIVE = of("card_not_active") + + /** The Card has been canceled. */ + @JvmField val CARD_CANCELED = of("card_canceled") + + /** The Physical Card was not active. */ + @JvmField val PHYSICAL_CARD_NOT_ACTIVE = of("physical_card_not_active") + + /** The account's entity was not active. */ + @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") + + /** The account was inactive. */ + @JvmField val GROUP_LOCKED = of("group_locked") + + /** The Card's Account did not have a sufficient available balance. */ + @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") + + /** The given CVV2 did not match the card's value. */ + @JvmField val CVV2_MISMATCH = of("cvv2_mismatch") + + /** The given PIN did not match the card's value. */ + @JvmField val PIN_MISMATCH = of("pin_mismatch") + + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + @JvmField val CARD_EXPIRATION_MISMATCH = of("card_expiration_mismatch") + + /** The attempted card transaction is not allowed per Increase's terms. */ + @JvmField val TRANSACTION_NOT_ALLOWED = of("transaction_not_allowed") + + /** The transaction was blocked by a Limit. */ + @JvmField val BREACHES_LIMIT = of("breaches_limit") + + /** Your application declined the transaction via webhook. */ + @JvmField val WEBHOOK_DECLINED = of("webhook_declined") + + /** Your application webhook did not respond without the required timeout. */ + @JvmField val WEBHOOK_TIMED_OUT = of("webhook_timed_out") + + /** Declined by stand-in processing. */ + @JvmField + val DECLINED_BY_STAND_IN_PROCESSING = of("declined_by_stand_in_processing") + + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") + + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + @JvmField + val MISSING_ORIGINAL_AUTHORIZATION = of("missing_original_authorization") + + /** The transaction was declined because the 3DS authentication failed. */ + @JvmField val FAILED_3DS_AUTHENTICATION = of("failed_3ds_authentication") + + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + @JvmField val SUSPECTED_CARD_TESTING = of("suspected_card_testing") + + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** The account has been closed. */ + ACCOUNT_CLOSED, + /** The Card was not active. */ + CARD_NOT_ACTIVE, + /** The Card has been canceled. */ + CARD_CANCELED, + /** The Physical Card was not active. */ + PHYSICAL_CARD_NOT_ACTIVE, + /** The account's entity was not active. */ + ENTITY_NOT_ACTIVE, + /** The account was inactive. */ + GROUP_LOCKED, + /** The Card's Account did not have a sufficient available balance. */ + INSUFFICIENT_FUNDS, + /** The given CVV2 did not match the card's value. */ + CVV2_MISMATCH, + /** The given PIN did not match the card's value. */ + PIN_MISMATCH, + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + CARD_EXPIRATION_MISMATCH, + /** The attempted card transaction is not allowed per Increase's terms. */ + TRANSACTION_NOT_ALLOWED, + /** The transaction was blocked by a Limit. */ + BREACHES_LIMIT, + /** Your application declined the transaction via webhook. */ + WEBHOOK_DECLINED, + /** Your application webhook did not respond without the required timeout. */ + WEBHOOK_TIMED_OUT, + /** Declined by stand-in processing. */ + DECLINED_BY_STAND_IN_PROCESSING, + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + MISSING_ORIGINAL_AUTHORIZATION, + /** The transaction was declined because the 3DS authentication failed. */ + FAILED_3DS_AUTHENTICATION, + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + SUSPECTED_CARD_TESTING, + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + SUSPECTED_FRAUD, + } + + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] 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 account has been closed. */ + ACCOUNT_CLOSED, + /** The Card was not active. */ + CARD_NOT_ACTIVE, + /** The Card has been canceled. */ + CARD_CANCELED, + /** The Physical Card was not active. */ + PHYSICAL_CARD_NOT_ACTIVE, + /** The account's entity was not active. */ + ENTITY_NOT_ACTIVE, + /** The account was inactive. */ + GROUP_LOCKED, + /** The Card's Account did not have a sufficient available balance. */ + INSUFFICIENT_FUNDS, + /** The given CVV2 did not match the card's value. */ + CVV2_MISMATCH, + /** The given PIN did not match the card's value. */ + PIN_MISMATCH, + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + CARD_EXPIRATION_MISMATCH, + /** The attempted card transaction is not allowed per Increase's terms. */ + TRANSACTION_NOT_ALLOWED, + /** The transaction was blocked by a Limit. */ + BREACHES_LIMIT, + /** Your application declined the transaction via webhook. */ + WEBHOOK_DECLINED, + /** Your application webhook did not respond without the required timeout. */ + WEBHOOK_TIMED_OUT, + /** Declined by stand-in processing. */ + DECLINED_BY_STAND_IN_PROCESSING, + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + MISSING_ORIGINAL_AUTHORIZATION, + /** The transaction was declined because the 3DS authentication failed. */ + FAILED_3DS_AUTHENTICATION, + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + SUSPECTED_CARD_TESTING, + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + SUSPECTED_FRAUD, + /** + * An enum member indicating that [Reason] 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_CLOSED -> Value.ACCOUNT_CLOSED + CARD_NOT_ACTIVE -> Value.CARD_NOT_ACTIVE + CARD_CANCELED -> Value.CARD_CANCELED + PHYSICAL_CARD_NOT_ACTIVE -> Value.PHYSICAL_CARD_NOT_ACTIVE + ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE + GROUP_LOCKED -> Value.GROUP_LOCKED + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + CVV2_MISMATCH -> Value.CVV2_MISMATCH + PIN_MISMATCH -> Value.PIN_MISMATCH + CARD_EXPIRATION_MISMATCH -> Value.CARD_EXPIRATION_MISMATCH + TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED + BREACHES_LIMIT -> Value.BREACHES_LIMIT + WEBHOOK_DECLINED -> Value.WEBHOOK_DECLINED + WEBHOOK_TIMED_OUT -> Value.WEBHOOK_TIMED_OUT + DECLINED_BY_STAND_IN_PROCESSING -> Value.DECLINED_BY_STAND_IN_PROCESSING + INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD + MISSING_ORIGINAL_AUTHORIZATION -> Value.MISSING_ORIGINAL_AUTHORIZATION + FAILED_3DS_AUTHENTICATION -> Value.FAILED_3DS_AUTHENTICATION + SUSPECTED_CARD_TESTING -> Value.SUSPECTED_CARD_TESTING + SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + 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_CLOSED -> Known.ACCOUNT_CLOSED + CARD_NOT_ACTIVE -> Known.CARD_NOT_ACTIVE + CARD_CANCELED -> Known.CARD_CANCELED + PHYSICAL_CARD_NOT_ACTIVE -> Known.PHYSICAL_CARD_NOT_ACTIVE + ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE + GROUP_LOCKED -> Known.GROUP_LOCKED + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + CVV2_MISMATCH -> Known.CVV2_MISMATCH + PIN_MISMATCH -> Known.PIN_MISMATCH + CARD_EXPIRATION_MISMATCH -> Known.CARD_EXPIRATION_MISMATCH + TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED + BREACHES_LIMIT -> Known.BREACHES_LIMIT + WEBHOOK_DECLINED -> Known.WEBHOOK_DECLINED + WEBHOOK_TIMED_OUT -> Known.WEBHOOK_TIMED_OUT + DECLINED_BY_STAND_IN_PROCESSING -> Known.DECLINED_BY_STAND_IN_PROCESSING + INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD + MISSING_ORIGINAL_AUTHORIZATION -> Known.MISSING_ORIGINAL_AUTHORIZATION + FAILED_3DS_AUTHENTICATION -> Known.FAILED_3DS_AUTHENTICATION + SUSPECTED_CARD_TESTING -> Known.SUSPECTED_CARD_TESTING + SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD + else -> throw IncreaseInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields related to verification of cardholder-provided values. */ + class Verification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardVerificationCode: JsonField, + private val cardholderAddress: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("card_verification_code") + @ExcludeMissing + cardVerificationCode: JsonField = JsonMissing.of(), + @JsonProperty("cardholder_address") + @ExcludeMissing + cardholderAddress: JsonField = JsonMissing.of(), + ) : this(cardVerificationCode, cardholderAddress, mutableMapOf()) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + * + * @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 cardVerificationCode(): CardVerificationCode = + cardVerificationCode.getRequired("card_verification_code") + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + * + * @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 cardholderAddress(): CardholderAddress = + cardholderAddress.getRequired("cardholder_address") + + /** + * Returns the raw JSON value of [cardVerificationCode]. + * + * Unlike [cardVerificationCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("card_verification_code") + @ExcludeMissing + fun _cardVerificationCode(): JsonField = cardVerificationCode + + /** + * Returns the raw JSON value of [cardholderAddress]. + * + * Unlike [cardholderAddress], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("cardholder_address") + @ExcludeMissing + fun _cardholderAddress(): JsonField = cardholderAddress + + @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 [Verification]. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Verification]. */ + class Builder internal constructor() { + + private var cardVerificationCode: JsonField? = null + private var cardholderAddress: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(verification: Verification) = apply { + cardVerificationCode = verification.cardVerificationCode + cardholderAddress = verification.cardholderAddress + additionalProperties = verification.additionalProperties.toMutableMap() + } + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code + * on the back of the card. + */ + fun cardVerificationCode(cardVerificationCode: CardVerificationCode) = + cardVerificationCode(JsonField.of(cardVerificationCode)) + + /** + * Sets [Builder.cardVerificationCode] to an arbitrary JSON value. + * + * You should usually call [Builder.cardVerificationCode] with a well-typed + * [CardVerificationCode] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun cardVerificationCode( + cardVerificationCode: JsonField + ) = apply { this.cardVerificationCode = cardVerificationCode } + + /** + * Cardholder address provided in the authorization request and the address on + * file we verified it against. + */ + fun cardholderAddress(cardholderAddress: CardholderAddress) = + cardholderAddress(JsonField.of(cardholderAddress)) + + /** + * Sets [Builder.cardholderAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderAddress] with a well-typed + * [CardholderAddress] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun cardholderAddress(cardholderAddress: JsonField) = apply { + this.cardholderAddress = cardholderAddress + } + + 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 [Verification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Verification = + Verification( + checkRequired("cardVerificationCode", cardVerificationCode), + checkRequired("cardholderAddress", cardholderAddress), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Verification = apply { + if (validated) { + return@apply + } + + cardVerificationCode().validate() + cardholderAddress().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 = + (cardVerificationCode.asKnown().getOrNull()?.validity() ?: 0) + + (cardholderAddress.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + */ + class CardVerificationCode + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of() + ) : this(result, mutableMapOf()) + + /** + * The result of verifying the Card Verification Code. + * + * @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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardVerificationCode]. + * + * The following fields are required: + * ```java + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardVerificationCode]. */ + class Builder internal constructor() { + + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardVerificationCode: CardVerificationCode) = apply { + result = cardVerificationCode.result + additionalProperties = + cardVerificationCode.additionalProperties.toMutableMap() + } + + /** The result of verifying the Card Verification Code. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + fun 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 [CardVerificationCode]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardVerificationCode = + CardVerificationCode( + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardVerificationCode = apply { + if (validated) { + return@apply + } + + result().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 = (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The result of verifying the Card Verification Code. */ + class Result + @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 { + + /** + * No card verification code was provided in the authorization request. + */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** The card verification code matched the one on file. */ + @JvmField val MATCH = of("match") + + /** The card verification code did not match the one on file. */ + @JvmField val NO_MATCH = of("no_match") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] 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 { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + /** + * An enum member indicating that [Result] 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) { + NOT_CHECKED -> Value.NOT_CHECKED + 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) { + NOT_CHECKED -> Known.NOT_CHECKED + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + else -> throw IncreaseInvalidDataException("Unknown Result: $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(): Result = 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 Result && 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 CardVerificationCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(result, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardVerificationCode{result=$result, additionalProperties=$additionalProperties}" + } + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + */ + class CardholderAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val actualLine1: JsonField, + private val actualPostalCode: JsonField, + private val providedLine1: JsonField, + private val providedPostalCode: JsonField, + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("actual_line1") + @ExcludeMissing + actualLine1: JsonField = JsonMissing.of(), + @JsonProperty("actual_postal_code") + @ExcludeMissing + actualPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("provided_line1") + @ExcludeMissing + providedLine1: JsonField = JsonMissing.of(), + @JsonProperty("provided_postal_code") + @ExcludeMissing + providedPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of(), + ) : this( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + mutableMapOf(), + ) + + /** + * Line 1 of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualLine1(): Optional = actualLine1.getOptional("actual_line1") + + /** + * The postal code of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualPostalCode(): Optional = + actualPostalCode.getOptional("actual_postal_code") + + /** + * The cardholder address line 1 provided for verification in the authorization + * request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedLine1(): Optional = + providedLine1.getOptional("provided_line1") + + /** + * The postal code provided for verification in the authorization request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedPostalCode(): Optional = + providedPostalCode.getOptional("provided_postal_code") + + /** + * The address verification result returned to the card network. + * + * @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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [actualLine1]. + * + * Unlike [actualLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_line1") + @ExcludeMissing + fun _actualLine1(): JsonField = actualLine1 + + /** + * Returns the raw JSON value of [actualPostalCode]. + * + * Unlike [actualPostalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_postal_code") + @ExcludeMissing + fun _actualPostalCode(): JsonField = actualPostalCode + + /** + * Returns the raw JSON value of [providedLine1]. + * + * Unlike [providedLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("provided_line1") + @ExcludeMissing + fun _providedLine1(): JsonField = providedLine1 + + /** + * Returns the raw JSON value of [providedPostalCode]. + * + * Unlike [providedPostalCode], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("provided_postal_code") + @ExcludeMissing + fun _providedPostalCode(): JsonField = providedPostalCode + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardholderAddress]. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderAddress]. */ + class Builder internal constructor() { + + private var actualLine1: JsonField? = null + private var actualPostalCode: JsonField? = null + private var providedLine1: JsonField? = null + private var providedPostalCode: JsonField? = null + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardholderAddress: CardholderAddress) = apply { + actualLine1 = cardholderAddress.actualLine1 + actualPostalCode = cardholderAddress.actualPostalCode + providedLine1 = cardholderAddress.providedLine1 + providedPostalCode = cardholderAddress.providedPostalCode + result = cardholderAddress.result + additionalProperties = + cardholderAddress.additionalProperties.toMutableMap() + } + + /** Line 1 of the address on file for the cardholder. */ + fun actualLine1(actualLine1: String?) = + actualLine1(JsonField.ofNullable(actualLine1)) + + /** + * Alias for calling [Builder.actualLine1] with `actualLine1.orElse(null)`. + */ + fun actualLine1(actualLine1: Optional) = + actualLine1(actualLine1.getOrNull()) + + /** + * Sets [Builder.actualLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.actualLine1] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun actualLine1(actualLine1: JsonField) = apply { + this.actualLine1 = actualLine1 + } + + /** The postal code of the address on file for the cardholder. */ + fun actualPostalCode(actualPostalCode: String?) = + actualPostalCode(JsonField.ofNullable(actualPostalCode)) + + /** + * Alias for calling [Builder.actualPostalCode] with + * `actualPostalCode.orElse(null)`. + */ + fun actualPostalCode(actualPostalCode: Optional) = + actualPostalCode(actualPostalCode.getOrNull()) + + /** + * Sets [Builder.actualPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.actualPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun actualPostalCode(actualPostalCode: JsonField) = apply { + this.actualPostalCode = actualPostalCode + } + + /** + * The cardholder address line 1 provided for verification in the + * authorization request. + */ + fun providedLine1(providedLine1: String?) = + providedLine1(JsonField.ofNullable(providedLine1)) + + /** + * Alias for calling [Builder.providedLine1] with + * `providedLine1.orElse(null)`. + */ + fun providedLine1(providedLine1: Optional) = + providedLine1(providedLine1.getOrNull()) + + /** + * Sets [Builder.providedLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.providedLine1] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedLine1(providedLine1: JsonField) = apply { + this.providedLine1 = providedLine1 + } + + /** + * The postal code provided for verification in the authorization request. + */ + fun providedPostalCode(providedPostalCode: String?) = + providedPostalCode(JsonField.ofNullable(providedPostalCode)) + + /** + * Alias for calling [Builder.providedPostalCode] with + * `providedPostalCode.orElse(null)`. + */ + fun providedPostalCode(providedPostalCode: Optional) = + providedPostalCode(providedPostalCode.getOrNull()) + + /** + * Sets [Builder.providedPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.providedPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedPostalCode(providedPostalCode: JsonField) = apply { + this.providedPostalCode = providedPostalCode + } + + /** The address verification result returned to the card network. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + fun 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 [CardholderAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardholderAddress = + CardholderAddress( + checkRequired("actualLine1", actualLine1), + checkRequired("actualPostalCode", actualPostalCode), + checkRequired("providedLine1", providedLine1), + checkRequired("providedPostalCode", providedPostalCode), + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardholderAddress = apply { + if (validated) { + return@apply + } + + actualLine1() + actualPostalCode() + providedLine1() + providedPostalCode() + result().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 (actualLine1.asKnown().isPresent) 1 else 0) + + (if (actualPostalCode.asKnown().isPresent) 1 else 0) + + (if (providedLine1.asKnown().isPresent) 1 else 0) + + (if (providedPostalCode.asKnown().isPresent) 1 else 0) + + (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The address verification result returned to the card network. */ + class Result + @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 { + + /** No address information was provided in the authorization request. */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = + of("postal_code_match_address_no_match") + + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + @JvmField + val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = + of("postal_code_no_match_address_match") + + /** Postal code and street address match. */ + @JvmField val MATCH = of("match") + + /** Postal code and street address do not match. */ + @JvmField val NO_MATCH = of("no_match") + + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] 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 { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + /** + * An enum member indicating that [Result] 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) { + NOT_CHECKED -> Value.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + 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) { + NOT_CHECKED -> Known.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + else -> throw IncreaseInvalidDataException("Unknown Result: $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(): Result = 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 Result && 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 CardholderAddress && + actualLine1 == other.actualLine1 && + actualPostalCode == other.actualPostalCode && + providedLine1 == other.providedLine1 && + providedPostalCode == other.providedPostalCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardholderAddress{actualLine1=$actualLine1, actualPostalCode=$actualPostalCode, providedLine1=$providedLine1, providedPostalCode=$providedPostalCode, result=$result, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Verification && + cardVerificationCode == other.cardVerificationCode && + cardholderAddress == other.cardholderAddress && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(cardVerificationCode, cardholderAddress, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Verification{cardVerificationCode=$cardVerificationCode, cardholderAddress=$cardholderAddress, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardDecline && + id == other.id && + actioner == other.actioner && + additionalAmounts == other.additionalAmounts && + amount == other.amount && + cardPaymentId == other.cardPaymentId && + currency == other.currency && + declinedTransactionId == other.declinedTransactionId && + digitalWalletTokenId == other.digitalWalletTokenId && + direction == other.direction && + incrementedCardAuthorizationId == other.incrementedCardAuthorizationId && + merchantAcceptorId == other.merchantAcceptorId && + merchantCategoryCode == other.merchantCategoryCode && + merchantCity == other.merchantCity && + merchantCountry == other.merchantCountry && + merchantDescriptor == other.merchantDescriptor && + merchantPostalCode == other.merchantPostalCode && + merchantState == other.merchantState && + networkDetails == other.networkDetails && + networkIdentifiers == other.networkIdentifiers && + networkRiskScore == other.networkRiskScore && + physicalCardId == other.physicalCardId && + presentmentAmount == other.presentmentAmount && + presentmentCurrency == other.presentmentCurrency && + processingCategory == other.processingCategory && + realTimeDecisionId == other.realTimeDecisionId && + realTimeDecisionReason == other.realTimeDecisionReason && + reason == other.reason && + terminalId == other.terminalId && + verification == other.verification && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + actioner, + additionalAmounts, + amount, + cardPaymentId, + currency, + declinedTransactionId, + digitalWalletTokenId, + direction, + incrementedCardAuthorizationId, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + presentmentAmount, + presentmentCurrency, + processingCategory, + realTimeDecisionId, + realTimeDecisionReason, + reason, + terminalId, + verification, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardDecline{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, incrementedCardAuthorizationId=$incrementedCardAuthorizationId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, realTimeDecisionReason=$realTimeDecisionReason, reason=$reason, terminalId=$terminalId, verification=$verification, additionalProperties=$additionalProperties}" + } + + /** + * A Card Financial object. This field will be present in the JSON response if and only if + * `category` is equal to `card_financial`. Card Financials are temporary holds placed on a + * customers funds with the intent to later clear a transaction. + */ + class CardFinancial + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val actioner: JsonField, + private val additionalAmounts: JsonField, + private val amount: JsonField, + private val cardPaymentId: JsonField, + private val currency: JsonField, + private val digitalWalletTokenId: JsonField, + private val direction: JsonField, + private val merchantAcceptorId: JsonField, + private val merchantCategoryCode: JsonField, + private val merchantCity: JsonField, + private val merchantCountry: JsonField, + private val merchantDescriptor: JsonField, + private val merchantPostalCode: JsonField, + private val merchantState: JsonField, + private val networkDetails: JsonField, + private val networkIdentifiers: JsonField, + private val networkRiskScore: JsonField, + private val physicalCardId: JsonField, + private val presentmentAmount: JsonField, + private val presentmentCurrency: JsonField, + private val processingCategory: JsonField, + private val realTimeDecisionId: JsonField, + private val terminalId: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val verification: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("actioner") + @ExcludeMissing + actioner: JsonField = JsonMissing.of(), + @JsonProperty("additional_amounts") + @ExcludeMissing + additionalAmounts: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("card_payment_id") + @ExcludeMissing + cardPaymentId: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + digitalWalletTokenId: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + direction: JsonField = JsonMissing.of(), + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + merchantAcceptorId: JsonField = JsonMissing.of(), + @JsonProperty("merchant_category_code") + @ExcludeMissing + merchantCategoryCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_city") + @ExcludeMissing + merchantCity: JsonField = JsonMissing.of(), + @JsonProperty("merchant_country") + @ExcludeMissing + merchantCountry: JsonField = JsonMissing.of(), + @JsonProperty("merchant_descriptor") + @ExcludeMissing + merchantDescriptor: JsonField = JsonMissing.of(), + @JsonProperty("merchant_postal_code") + @ExcludeMissing + merchantPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_state") + @ExcludeMissing + merchantState: JsonField = JsonMissing.of(), + @JsonProperty("network_details") + @ExcludeMissing + networkDetails: JsonField = JsonMissing.of(), + @JsonProperty("network_identifiers") + @ExcludeMissing + networkIdentifiers: JsonField = JsonMissing.of(), + @JsonProperty("network_risk_score") + @ExcludeMissing + networkRiskScore: JsonField = JsonMissing.of(), + @JsonProperty("physical_card_id") + @ExcludeMissing + physicalCardId: JsonField = JsonMissing.of(), + @JsonProperty("presentment_amount") + @ExcludeMissing + presentmentAmount: JsonField = JsonMissing.of(), + @JsonProperty("presentment_currency") + @ExcludeMissing + presentmentCurrency: JsonField = JsonMissing.of(), + @JsonProperty("processing_category") + @ExcludeMissing + processingCategory: JsonField = JsonMissing.of(), + @JsonProperty("real_time_decision_id") + @ExcludeMissing + realTimeDecisionId: JsonField = JsonMissing.of(), + @JsonProperty("terminal_id") + @ExcludeMissing + terminalId: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("verification") + @ExcludeMissing + verification: JsonField = JsonMissing.of(), + ) : this( + id, + actioner, + additionalAmounts, + amount, + cardPaymentId, + currency, + digitalWalletTokenId, + direction, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + presentmentAmount, + presentmentCurrency, + processingCategory, + realTimeDecisionId, + terminalId, + transactionId, + type, + verification, + mutableMapOf(), + ) + + /** + * The Card Financial 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") + + /** + * Whether this financial was approved by Increase, the card network through stand-in + * processing, or the user through a real-time decision. + * + * @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 actioner(): Actioner = actioner.getRequired("actioner") + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + * + * @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 additionalAmounts(): AdditionalAmounts = + additionalAmounts.getRequired("additional_amounts") + + /** + * The pending amount in the minor unit of the transaction's currency. For dollars, for + * example, this is 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") + + /** + * The ID of the Card Payment this transaction belongs to. + * + * @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 cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction'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 authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun digitalWalletTokenId(): Optional = + digitalWalletTokenId.getOptional("digital_wallet_token_id") + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + * + * @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 direction(): Direction = direction.getRequired("direction") + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + * + * @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 merchantAcceptorId(): String = + merchantAcceptorId.getRequired("merchant_acceptor_id") + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is + * transacting with. + * + * @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 the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantCity(): Optional = merchantCity.getOptional("merchant_city") + + /** + * The country the merchant resides in. + * + * @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 merchantCountry(): String = merchantCountry.getRequired("merchant_country") + + /** + * The merchant descriptor of the merchant the card is transacting with. + * + * @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 merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor") + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP + * code, where the first 5 and last 4 are separated by a dash. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantPostalCode(): Optional = + merchantPostalCode.getOptional("merchant_postal_code") + + /** + * The state the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantState(): Optional = merchantState.getOptional("merchant_state") + + /** + * Fields specific to the `network`. + * + * @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 networkDetails(): NetworkDetails = networkDetails.getRequired("network_details") + + /** + * Network-specific identifiers for a specific request or transaction. + * + * @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 networkIdentifiers(): NetworkIdentifiers = + networkIdentifiers.getRequired("network_identifiers") + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun networkRiskScore(): Optional = + networkRiskScore.getOptional("network_risk_score") + + /** + * If the authorization was made in-person with a physical card, the Physical Card that + * was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id") + + /** + * The pending amount in the minor unit of the transaction's presentment 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 presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment 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 presentmentCurrency(): String = + presentmentCurrency.getRequired("presentment_currency") + + /** + * The processing category describes the intent behind the financial, such as whether it + * was used for bill payments or an automatic fuel dispenser. + * + * @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 processingCategory(): ProcessingCategory = + processingCategory.getRequired("processing_category") + + /** + * The identifier of the Real-Time Decision sent to approve or decline this transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun realTimeDecisionId(): Optional = + realTimeDecisionId.getOptional("real_time_decision_id") + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun terminalId(): Optional = terminalId.getOptional("terminal_id") + + /** + * The identifier of the Transaction associated with this Transaction. + * + * @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 transactionId(): String = transactionId.getRequired("transaction_id") + + /** + * A constant representing the object's type. For this resource it will always be + * `card_financial`. + * + * @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") + + /** + * Fields related to verification of cardholder-provided values. + * + * @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 verification(): Verification = verification.getRequired("verification") + + /** + * 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 [actioner]. + * + * Unlike [actioner], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("actioner") + @ExcludeMissing + fun _actioner(): JsonField = actioner + + /** + * Returns the raw JSON value of [additionalAmounts]. + * + * Unlike [additionalAmounts], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("additional_amounts") + @ExcludeMissing + fun _additionalAmounts(): JsonField = additionalAmounts + + /** + * 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 [cardPaymentId]. + * + * Unlike [cardPaymentId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("card_payment_id") + @ExcludeMissing + fun _cardPaymentId(): JsonField = cardPaymentId + + /** + * 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 [digitalWalletTokenId]. + * + * Unlike [digitalWalletTokenId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + fun _digitalWalletTokenId(): JsonField = digitalWalletTokenId + + /** + * Returns the raw JSON value of [direction]. + * + * Unlike [direction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("direction") + @ExcludeMissing + fun _direction(): JsonField = direction + + /** + * Returns the raw JSON value of [merchantAcceptorId]. + * + * Unlike [merchantAcceptorId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + fun _merchantAcceptorId(): JsonField = merchantAcceptorId + + /** + * 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 [merchantCity]. + * + * Unlike [merchantCity], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("merchant_city") + @ExcludeMissing + fun _merchantCity(): JsonField = merchantCity + + /** + * Returns the raw JSON value of [merchantCountry]. + * + * Unlike [merchantCountry], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_country") + @ExcludeMissing + fun _merchantCountry(): JsonField = merchantCountry + + /** + * Returns the raw JSON value of [merchantDescriptor]. + * + * Unlike [merchantDescriptor], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_descriptor") + @ExcludeMissing + fun _merchantDescriptor(): JsonField = merchantDescriptor + + /** + * 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 [networkDetails]. + * + * Unlike [networkDetails], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_details") + @ExcludeMissing + fun _networkDetails(): JsonField = networkDetails + + /** + * Returns the raw JSON value of [networkIdentifiers]. + * + * Unlike [networkIdentifiers], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_identifiers") + @ExcludeMissing + fun _networkIdentifiers(): JsonField = networkIdentifiers + + /** + * Returns the raw JSON value of [networkRiskScore]. + * + * Unlike [networkRiskScore], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_risk_score") + @ExcludeMissing + fun _networkRiskScore(): JsonField = networkRiskScore + + /** + * Returns the raw JSON value of [physicalCardId]. + * + * Unlike [physicalCardId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("physical_card_id") + @ExcludeMissing + fun _physicalCardId(): JsonField = physicalCardId + + /** + * Returns the raw JSON value of [presentmentAmount]. + * + * Unlike [presentmentAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_amount") + @ExcludeMissing + fun _presentmentAmount(): JsonField = presentmentAmount + + /** + * Returns the raw JSON value of [presentmentCurrency]. + * + * Unlike [presentmentCurrency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_currency") + @ExcludeMissing + fun _presentmentCurrency(): JsonField = presentmentCurrency + + /** + * Returns the raw JSON value of [processingCategory]. + * + * Unlike [processingCategory], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("processing_category") + @ExcludeMissing + fun _processingCategory(): JsonField = processingCategory + + /** + * Returns the raw JSON value of [realTimeDecisionId]. + * + * Unlike [realTimeDecisionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_decision_id") + @ExcludeMissing + fun _realTimeDecisionId(): JsonField = realTimeDecisionId + + /** + * Returns the raw JSON value of [terminalId]. + * + * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("terminal_id") + @ExcludeMissing + fun _terminalId(): JsonField = terminalId + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * 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 + + /** + * Returns the raw JSON value of [verification]. + * + * Unlike [verification], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("verification") + @ExcludeMissing + fun _verification(): JsonField = verification + + @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 [CardFinancial]. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .digitalWalletTokenId() + * .direction() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .terminalId() + * .transactionId() + * .type() + * .verification() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardFinancial]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var actioner: JsonField? = null + private var additionalAmounts: JsonField? = null + private var amount: JsonField? = null + private var cardPaymentId: JsonField? = null + private var currency: JsonField? = null + private var digitalWalletTokenId: JsonField? = null + private var direction: JsonField? = null + private var merchantAcceptorId: JsonField? = null + private var merchantCategoryCode: JsonField? = null + private var merchantCity: JsonField? = null + private var merchantCountry: JsonField? = null + private var merchantDescriptor: JsonField? = null + private var merchantPostalCode: JsonField? = null + private var merchantState: JsonField? = null + private var networkDetails: JsonField? = null + private var networkIdentifiers: JsonField? = null + private var networkRiskScore: JsonField? = null + private var physicalCardId: JsonField? = null + private var presentmentAmount: JsonField? = null + private var presentmentCurrency: JsonField? = null + private var processingCategory: JsonField? = null + private var realTimeDecisionId: JsonField? = null + private var terminalId: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null + private var verification: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardFinancial: CardFinancial) = apply { + id = cardFinancial.id + actioner = cardFinancial.actioner + additionalAmounts = cardFinancial.additionalAmounts + amount = cardFinancial.amount + cardPaymentId = cardFinancial.cardPaymentId + currency = cardFinancial.currency + digitalWalletTokenId = cardFinancial.digitalWalletTokenId + direction = cardFinancial.direction + merchantAcceptorId = cardFinancial.merchantAcceptorId + merchantCategoryCode = cardFinancial.merchantCategoryCode + merchantCity = cardFinancial.merchantCity + merchantCountry = cardFinancial.merchantCountry + merchantDescriptor = cardFinancial.merchantDescriptor + merchantPostalCode = cardFinancial.merchantPostalCode + merchantState = cardFinancial.merchantState + networkDetails = cardFinancial.networkDetails + networkIdentifiers = cardFinancial.networkIdentifiers + networkRiskScore = cardFinancial.networkRiskScore + physicalCardId = cardFinancial.physicalCardId + presentmentAmount = cardFinancial.presentmentAmount + presentmentCurrency = cardFinancial.presentmentCurrency + processingCategory = cardFinancial.processingCategory + realTimeDecisionId = cardFinancial.realTimeDecisionId + terminalId = cardFinancial.terminalId + transactionId = cardFinancial.transactionId + type = cardFinancial.type + verification = cardFinancial.verification + additionalProperties = cardFinancial.additionalProperties.toMutableMap() + } + + /** The Card Financial 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 } + + /** + * Whether this financial was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + */ + fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner)) + + /** + * Sets [Builder.actioner] to an arbitrary JSON value. + * + * You should usually call [Builder.actioner] with a well-typed [Actioner] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun actioner(actioner: JsonField) = apply { this.actioner = actioner } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide + * more detailed information about the transaction. + */ + fun additionalAmounts(additionalAmounts: AdditionalAmounts) = + additionalAmounts(JsonField.of(additionalAmounts)) + + /** + * Sets [Builder.additionalAmounts] to an arbitrary JSON value. + * + * You should usually call [Builder.additionalAmounts] with a well-typed + * [AdditionalAmounts] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun additionalAmounts(additionalAmounts: JsonField) = apply { + this.additionalAmounts = additionalAmounts + } + + /** + * The pending amount in the minor unit of the transaction's currency. For dollars, + * for example, this is 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 } + + /** The ID of the Card Payment this transaction belongs to. */ + fun cardPaymentId(cardPaymentId: String) = + cardPaymentId(JsonField.of(cardPaymentId)) + + /** + * Sets [Builder.cardPaymentId] to an arbitrary JSON value. + * + * You should usually call [Builder.cardPaymentId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun cardPaymentId(cardPaymentId: JsonField) = apply { + this.cardPaymentId = cardPaymentId + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction'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 authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + */ + fun digitalWalletTokenId(digitalWalletTokenId: String?) = + digitalWalletTokenId(JsonField.ofNullable(digitalWalletTokenId)) + + /** + * Alias for calling [Builder.digitalWalletTokenId] with + * `digitalWalletTokenId.orElse(null)`. + */ + fun digitalWalletTokenId(digitalWalletTokenId: Optional) = + digitalWalletTokenId(digitalWalletTokenId.getOrNull()) + + /** + * Sets [Builder.digitalWalletTokenId] to an arbitrary JSON value. + * + * You should usually call [Builder.digitalWalletTokenId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply { + this.digitalWalletTokenId = digitalWalletTokenId + } + + /** + * The direction describes the direction the funds will move, either from the + * cardholder to the merchant or from the merchant to the cardholder. + */ + fun direction(direction: Direction) = direction(JsonField.of(direction)) + + /** + * Sets [Builder.direction] to an arbitrary JSON value. + * + * You should usually call [Builder.direction] with a well-typed [Direction] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun direction(direction: JsonField) = apply { + this.direction = direction + } + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + */ + fun merchantAcceptorId(merchantAcceptorId: String) = + merchantAcceptorId(JsonField.of(merchantAcceptorId)) + + /** + * Sets [Builder.merchantAcceptorId] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantAcceptorId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantAcceptorId(merchantAcceptorId: JsonField) = apply { + this.merchantAcceptorId = merchantAcceptorId + } + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card + * is transacting with. + */ + 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 the merchant resides in. */ + fun merchantCity(merchantCity: String?) = + merchantCity(JsonField.ofNullable(merchantCity)) + + /** Alias for calling [Builder.merchantCity] with `merchantCity.orElse(null)`. */ + fun merchantCity(merchantCity: Optional) = + merchantCity(merchantCity.getOrNull()) + + /** + * Sets [Builder.merchantCity] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCity] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun merchantCity(merchantCity: JsonField) = apply { + this.merchantCity = merchantCity + } + + /** The country the merchant resides in. */ + fun merchantCountry(merchantCountry: String) = + merchantCountry(JsonField.of(merchantCountry)) + + /** + * Sets [Builder.merchantCountry] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCountry] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantCountry(merchantCountry: JsonField) = apply { + this.merchantCountry = merchantCountry + } + + /** The merchant descriptor of the merchant the card is transacting with. */ + fun merchantDescriptor(merchantDescriptor: String) = + merchantDescriptor(JsonField.of(merchantDescriptor)) + + /** + * Sets [Builder.merchantDescriptor] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantDescriptor] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantDescriptor(merchantDescriptor: JsonField) = apply { + this.merchantDescriptor = merchantDescriptor + } + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + * ZIP code, where the first 5 and last 4 are separated by a dash. + */ + fun merchantPostalCode(merchantPostalCode: String?) = + merchantPostalCode(JsonField.ofNullable(merchantPostalCode)) + + /** + * Alias for calling [Builder.merchantPostalCode] with + * `merchantPostalCode.orElse(null)`. + */ + fun merchantPostalCode(merchantPostalCode: Optional) = + merchantPostalCode(merchantPostalCode.getOrNull()) + + /** + * 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 the merchant resides in. */ + fun merchantState(merchantState: String?) = + merchantState(JsonField.ofNullable(merchantState)) + + /** Alias for calling [Builder.merchantState] with `merchantState.orElse(null)`. */ + fun merchantState(merchantState: Optional) = + merchantState(merchantState.getOrNull()) + + /** + * 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 + } + + /** Fields specific to the `network`. */ + fun networkDetails(networkDetails: NetworkDetails) = + networkDetails(JsonField.of(networkDetails)) + + /** + * Sets [Builder.networkDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.networkDetails] with a well-typed + * [NetworkDetails] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun networkDetails(networkDetails: JsonField) = apply { + this.networkDetails = networkDetails + } + + /** Network-specific identifiers for a specific request or transaction. */ + fun networkIdentifiers(networkIdentifiers: NetworkIdentifiers) = + networkIdentifiers(JsonField.of(networkIdentifiers)) + + /** + * Sets [Builder.networkIdentifiers] to an arbitrary JSON value. + * + * You should usually call [Builder.networkIdentifiers] with a well-typed + * [NetworkIdentifiers] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun networkIdentifiers(networkIdentifiers: JsonField) = apply { + this.networkIdentifiers = networkIdentifiers + } + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. + */ + fun networkRiskScore(networkRiskScore: Long?) = + networkRiskScore(JsonField.ofNullable(networkRiskScore)) + + /** + * Alias for [Builder.networkRiskScore]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun networkRiskScore(networkRiskScore: Long) = + networkRiskScore(networkRiskScore as Long?) + + /** + * Alias for calling [Builder.networkRiskScore] with + * `networkRiskScore.orElse(null)`. + */ + fun networkRiskScore(networkRiskScore: Optional) = + networkRiskScore(networkRiskScore.getOrNull()) + + /** + * Sets [Builder.networkRiskScore] to an arbitrary JSON value. + * + * You should usually call [Builder.networkRiskScore] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun networkRiskScore(networkRiskScore: JsonField) = apply { + this.networkRiskScore = networkRiskScore + } + + /** + * If the authorization was made in-person with a physical card, the Physical Card + * that was used. + */ + fun physicalCardId(physicalCardId: String?) = + physicalCardId(JsonField.ofNullable(physicalCardId)) + + /** + * Alias for calling [Builder.physicalCardId] with `physicalCardId.orElse(null)`. + */ + fun physicalCardId(physicalCardId: Optional) = + physicalCardId(physicalCardId.getOrNull()) + + /** + * Sets [Builder.physicalCardId] to an arbitrary JSON value. + * + * You should usually call [Builder.physicalCardId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun physicalCardId(physicalCardId: JsonField) = apply { + this.physicalCardId = physicalCardId + } + + /** + * The pending amount in the minor unit of the transaction's presentment currency. + */ + fun presentmentAmount(presentmentAmount: Long) = + presentmentAmount(JsonField.of(presentmentAmount)) + + /** + * Sets [Builder.presentmentAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentAmount(presentmentAmount: JsonField) = apply { + this.presentmentAmount = presentmentAmount + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment currency. + */ + fun presentmentCurrency(presentmentCurrency: String) = + presentmentCurrency(JsonField.of(presentmentCurrency)) + + /** + * Sets [Builder.presentmentCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentCurrency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentCurrency(presentmentCurrency: JsonField) = apply { + this.presentmentCurrency = presentmentCurrency + } + + /** + * The processing category describes the intent behind the financial, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + fun processingCategory(processingCategory: ProcessingCategory) = + processingCategory(JsonField.of(processingCategory)) + + /** + * Sets [Builder.processingCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.processingCategory] with a well-typed + * [ProcessingCategory] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun processingCategory(processingCategory: JsonField) = apply { + this.processingCategory = processingCategory + } + + /** + * The identifier of the Real-Time Decision sent to approve or decline this + * transaction. + */ + fun realTimeDecisionId(realTimeDecisionId: String?) = + realTimeDecisionId(JsonField.ofNullable(realTimeDecisionId)) + + /** + * Alias for calling [Builder.realTimeDecisionId] with + * `realTimeDecisionId.orElse(null)`. + */ + fun realTimeDecisionId(realTimeDecisionId: Optional) = + realTimeDecisionId(realTimeDecisionId.getOrNull()) + + /** + * Sets [Builder.realTimeDecisionId] to an arbitrary JSON value. + * + * You should usually call [Builder.realTimeDecisionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun realTimeDecisionId(realTimeDecisionId: JsonField) = apply { + this.realTimeDecisionId = realTimeDecisionId + } + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + */ + fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId)) + + /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */ + fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull()) + + /** + * Sets [Builder.terminalId] to an arbitrary JSON value. + * + * You should usually call [Builder.terminalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun terminalId(terminalId: JsonField) = apply { + this.terminalId = terminalId + } + + /** The identifier of the Transaction associated with this Transaction. */ + fun transactionId(transactionId: String) = + transactionId(JsonField.of(transactionId)) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + /** + * A constant representing the object's type. For this resource it will always be + * `card_financial`. + */ + 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 } + + /** Fields related to verification of cardholder-provided values. */ + fun verification(verification: Verification) = + verification(JsonField.of(verification)) + + /** + * Sets [Builder.verification] to an arbitrary JSON value. + * + * You should usually call [Builder.verification] with a well-typed [Verification] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun verification(verification: JsonField) = apply { + this.verification = verification + } + + 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 [CardFinancial]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .digitalWalletTokenId() + * .direction() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .terminalId() + * .transactionId() + * .type() + * .verification() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardFinancial = + CardFinancial( + checkRequired("id", id), + checkRequired("actioner", actioner), + checkRequired("additionalAmounts", additionalAmounts), + checkRequired("amount", amount), + checkRequired("cardPaymentId", cardPaymentId), + checkRequired("currency", currency), + checkRequired("digitalWalletTokenId", digitalWalletTokenId), + checkRequired("direction", direction), + checkRequired("merchantAcceptorId", merchantAcceptorId), + checkRequired("merchantCategoryCode", merchantCategoryCode), + checkRequired("merchantCity", merchantCity), + checkRequired("merchantCountry", merchantCountry), + checkRequired("merchantDescriptor", merchantDescriptor), + checkRequired("merchantPostalCode", merchantPostalCode), + checkRequired("merchantState", merchantState), + checkRequired("networkDetails", networkDetails), + checkRequired("networkIdentifiers", networkIdentifiers), + checkRequired("networkRiskScore", networkRiskScore), + checkRequired("physicalCardId", physicalCardId), + checkRequired("presentmentAmount", presentmentAmount), + checkRequired("presentmentCurrency", presentmentCurrency), + checkRequired("processingCategory", processingCategory), + checkRequired("realTimeDecisionId", realTimeDecisionId), + checkRequired("terminalId", terminalId), + checkRequired("transactionId", transactionId), + checkRequired("type", type), + checkRequired("verification", verification), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardFinancial = apply { + if (validated) { + return@apply + } + + id() + actioner().validate() + additionalAmounts().validate() + amount() + cardPaymentId() + currency().validate() + digitalWalletTokenId() + direction().validate() + merchantAcceptorId() + merchantCategoryCode() + merchantCity() + merchantCountry() + merchantDescriptor() + merchantPostalCode() + merchantState() + networkDetails().validate() + networkIdentifiers().validate() + networkRiskScore() + physicalCardId() + presentmentAmount() + presentmentCurrency() + processingCategory().validate() + realTimeDecisionId() + terminalId() + transactionId() + type().validate() + verification().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) + + (actioner.asKnown().getOrNull()?.validity() ?: 0) + + (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (cardPaymentId.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + + (direction.asKnown().getOrNull()?.validity() ?: 0) + + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + + (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + + (if (merchantCity.asKnown().isPresent) 1 else 0) + + (if (merchantCountry.asKnown().isPresent) 1 else 0) + + (if (merchantDescriptor.asKnown().isPresent) 1 else 0) + + (if (merchantPostalCode.asKnown().isPresent) 1 else 0) + + (if (merchantState.asKnown().isPresent) 1 else 0) + + (networkDetails.asKnown().getOrNull()?.validity() ?: 0) + + (networkIdentifiers.asKnown().getOrNull()?.validity() ?: 0) + + (if (networkRiskScore.asKnown().isPresent) 1 else 0) + + (if (physicalCardId.asKnown().isPresent) 1 else 0) + + (if (presentmentAmount.asKnown().isPresent) 1 else 0) + + (if (presentmentCurrency.asKnown().isPresent) 1 else 0) + + (processingCategory.asKnown().getOrNull()?.validity() ?: 0) + + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + + (if (terminalId.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (verification.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Whether this financial was approved by Increase, the card network through stand-in + * processing, or the user through a real-time decision. + */ + class Actioner @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 { + + /** This object was actioned by the user through a real-time decision. */ + @JvmField val USER = of("user") + + /** This object was actioned by Increase without user intervention. */ + @JvmField val INCREASE = of("increase") + + /** This object was actioned by the network, through stand-in processing. */ + @JvmField val NETWORK = of("network") + + @JvmStatic fun of(value: String) = Actioner(JsonField.of(value)) + } + + /** An enum containing [Actioner]'s known values. */ + enum class Known { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + } + + /** + * An enum containing [Actioner]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Actioner] 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 { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + /** + * An enum member indicating that [Actioner] 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) { + USER -> Value.USER + INCREASE -> Value.INCREASE + NETWORK -> Value.NETWORK + 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) { + USER -> Known.USER + INCREASE -> Known.INCREASE + NETWORK -> Known.NETWORK + else -> throw IncreaseInvalidDataException("Unknown Actioner: $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(): Actioner = 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 Actioner && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + */ + class AdditionalAmounts + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val clinic: JsonField, + private val dental: JsonField, + private val original: JsonField, + private val prescription: JsonField, + private val surcharge: JsonField, + private val totalCumulative: JsonField, + private val totalHealthcare: JsonField, + private val transit: JsonField, + private val unknown: JsonField, + private val vision: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("clinic") + @ExcludeMissing + clinic: JsonField = JsonMissing.of(), + @JsonProperty("dental") + @ExcludeMissing + dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), + @JsonProperty("prescription") + @ExcludeMissing + prescription: JsonField = JsonMissing.of(), + @JsonProperty("surcharge") + @ExcludeMissing + surcharge: JsonField = JsonMissing.of(), + @JsonProperty("total_cumulative") + @ExcludeMissing + totalCumulative: JsonField = JsonMissing.of(), + @JsonProperty("total_healthcare") + @ExcludeMissing + totalHealthcare: JsonField = JsonMissing.of(), + @JsonProperty("transit") + @ExcludeMissing + transit: JsonField = JsonMissing.of(), + @JsonProperty("unknown") + @ExcludeMissing + unknown: JsonField = JsonMissing.of(), + @JsonProperty("vision") + @ExcludeMissing + vision: JsonField = JsonMissing.of(), + ) : this( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + mutableMapOf(), + ) + + /** + * The part of this transaction amount that was for clinic-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun clinic(): Optional = clinic.getOptional("clinic") + + /** + * The part of this transaction amount that was for dental-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun dental(): Optional = dental.getOptional("dental") + + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + + /** + * The part of this transaction amount that was for healthcare prescriptions. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun prescription(): Optional = + prescription.getOptional("prescription") + + /** + * The surcharge amount charged for this transaction by the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun surcharge(): Optional = surcharge.getOptional("surcharge") + + /** + * The total amount of a series of incremental authorizations, optionally provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalCumulative(): Optional = + totalCumulative.getOptional("total_cumulative") + + /** + * The total amount of healthcare-related additional amounts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalHealthcare(): Optional = + totalHealthcare.getOptional("total_healthcare") + + /** + * The part of this transaction amount that was for transit-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transit(): Optional = transit.getOptional("transit") + + /** + * An unknown additional amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun unknown(): Optional = unknown.getOptional("unknown") + + /** + * The part of this transaction amount that was for vision-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun vision(): Optional = vision.getOptional("vision") + + /** + * Returns the raw JSON value of [clinic]. + * + * Unlike [clinic], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("clinic") @ExcludeMissing fun _clinic(): JsonField = clinic + + /** + * Returns the raw JSON value of [dental]. + * + * Unlike [dental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + + /** + * Returns the raw JSON value of [prescription]. + * + * Unlike [prescription], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("prescription") + @ExcludeMissing + fun _prescription(): JsonField = prescription + + /** + * Returns the raw JSON value of [surcharge]. + * + * Unlike [surcharge], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("surcharge") + @ExcludeMissing + fun _surcharge(): JsonField = surcharge + + /** + * Returns the raw JSON value of [totalCumulative]. + * + * Unlike [totalCumulative], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_cumulative") + @ExcludeMissing + fun _totalCumulative(): JsonField = totalCumulative + + /** + * Returns the raw JSON value of [totalHealthcare]. + * + * Unlike [totalHealthcare], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_healthcare") + @ExcludeMissing + fun _totalHealthcare(): JsonField = totalHealthcare + + /** + * Returns the raw JSON value of [transit]. + * + * Unlike [transit], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transit") + @ExcludeMissing + fun _transit(): JsonField = transit + + /** + * Returns the raw JSON value of [unknown]. + * + * Unlike [unknown], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unknown") + @ExcludeMissing + fun _unknown(): JsonField = unknown + + /** + * Returns the raw JSON value of [vision]. + * + * Unlike [vision], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("vision") @ExcludeMissing fun _vision(): JsonField = vision + + @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 + * [AdditionalAmounts]. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AdditionalAmounts]. */ + class Builder internal constructor() { + + private var clinic: JsonField? = null + private var dental: JsonField? = null + private var original: JsonField? = null + private var prescription: JsonField? = null + private var surcharge: JsonField? = null + private var totalCumulative: JsonField? = null + private var totalHealthcare: JsonField? = null + private var transit: JsonField? = null + private var unknown: JsonField? = null + private var vision: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(additionalAmounts: AdditionalAmounts) = apply { + clinic = additionalAmounts.clinic + dental = additionalAmounts.dental + original = additionalAmounts.original + prescription = additionalAmounts.prescription + surcharge = additionalAmounts.surcharge + totalCumulative = additionalAmounts.totalCumulative + totalHealthcare = additionalAmounts.totalHealthcare + transit = additionalAmounts.transit + unknown = additionalAmounts.unknown + vision = additionalAmounts.vision + additionalProperties = additionalAmounts.additionalProperties.toMutableMap() + } + + /** The part of this transaction amount that was for clinic-related services. */ + fun clinic(clinic: Clinic?) = clinic(JsonField.ofNullable(clinic)) + + /** Alias for calling [Builder.clinic] with `clinic.orElse(null)`. */ + fun clinic(clinic: Optional) = clinic(clinic.getOrNull()) + + /** + * Sets [Builder.clinic] to an arbitrary JSON value. + * + * You should usually call [Builder.clinic] with a well-typed [Clinic] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun clinic(clinic: JsonField) = apply { this.clinic = clinic } + + /** The part of this transaction amount that was for dental-related services. */ + fun dental(dental: Dental?) = dental(JsonField.ofNullable(dental)) + + /** Alias for calling [Builder.dental] with `dental.orElse(null)`. */ + fun dental(dental: Optional) = dental(dental.getOrNull()) + + /** + * Sets [Builder.dental] to an arbitrary JSON value. + * + * You should usually call [Builder.dental] with a well-typed [Dental] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dental(dental: JsonField) = apply { this.dental = dental } + + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + + /** + * The part of this transaction amount that was for healthcare prescriptions. + */ + fun prescription(prescription: Prescription?) = + prescription(JsonField.ofNullable(prescription)) + + /** + * Alias for calling [Builder.prescription] with `prescription.orElse(null)`. + */ + fun prescription(prescription: Optional) = + prescription(prescription.getOrNull()) + + /** + * Sets [Builder.prescription] to an arbitrary JSON value. + * + * You should usually call [Builder.prescription] with a well-typed + * [Prescription] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun prescription(prescription: JsonField) = apply { + this.prescription = prescription + } + + /** The surcharge amount charged for this transaction by the merchant. */ + fun surcharge(surcharge: Surcharge?) = + surcharge(JsonField.ofNullable(surcharge)) + + /** Alias for calling [Builder.surcharge] with `surcharge.orElse(null)`. */ + fun surcharge(surcharge: Optional) = surcharge(surcharge.getOrNull()) + + /** + * Sets [Builder.surcharge] to an arbitrary JSON value. + * + * You should usually call [Builder.surcharge] with a well-typed [Surcharge] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun surcharge(surcharge: JsonField) = apply { + this.surcharge = surcharge + } + + /** + * The total amount of a series of incremental authorizations, optionally + * provided. + */ + fun totalCumulative(totalCumulative: TotalCumulative?) = + totalCumulative(JsonField.ofNullable(totalCumulative)) + + /** + * Alias for calling [Builder.totalCumulative] with + * `totalCumulative.orElse(null)`. + */ + fun totalCumulative(totalCumulative: Optional) = + totalCumulative(totalCumulative.getOrNull()) + + /** + * Sets [Builder.totalCumulative] to an arbitrary JSON value. + * + * You should usually call [Builder.totalCumulative] with a well-typed + * [TotalCumulative] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalCumulative(totalCumulative: JsonField) = apply { + this.totalCumulative = totalCumulative + } + + /** The total amount of healthcare-related additional amounts. */ + fun totalHealthcare(totalHealthcare: TotalHealthcare?) = + totalHealthcare(JsonField.ofNullable(totalHealthcare)) + + /** + * Alias for calling [Builder.totalHealthcare] with + * `totalHealthcare.orElse(null)`. + */ + fun totalHealthcare(totalHealthcare: Optional) = + totalHealthcare(totalHealthcare.getOrNull()) + + /** + * Sets [Builder.totalHealthcare] to an arbitrary JSON value. + * + * You should usually call [Builder.totalHealthcare] with a well-typed + * [TotalHealthcare] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalHealthcare(totalHealthcare: JsonField) = apply { + this.totalHealthcare = totalHealthcare + } + + /** + * The part of this transaction amount that was for transit-related services. + */ + fun transit(transit: Transit?) = transit(JsonField.ofNullable(transit)) + + /** Alias for calling [Builder.transit] with `transit.orElse(null)`. */ + fun transit(transit: Optional) = transit(transit.getOrNull()) + + /** + * Sets [Builder.transit] to an arbitrary JSON value. + * + * You should usually call [Builder.transit] with a well-typed [Transit] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun transit(transit: JsonField) = apply { this.transit = transit } + + /** An unknown additional amount. */ + fun unknown(unknown: Unknown?) = unknown(JsonField.ofNullable(unknown)) + + /** Alias for calling [Builder.unknown] with `unknown.orElse(null)`. */ + fun unknown(unknown: Optional) = unknown(unknown.getOrNull()) + + /** + * Sets [Builder.unknown] to an arbitrary JSON value. + * + * You should usually call [Builder.unknown] with a well-typed [Unknown] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun unknown(unknown: JsonField) = apply { this.unknown = unknown } + + /** The part of this transaction amount that was for vision-related services. */ + fun vision(vision: Vision?) = vision(JsonField.ofNullable(vision)) + + /** Alias for calling [Builder.vision] with `vision.orElse(null)`. */ + fun vision(vision: Optional) = vision(vision.getOrNull()) + + /** + * Sets [Builder.vision] to an arbitrary JSON value. + * + * You should usually call [Builder.vision] with a well-typed [Vision] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vision(vision: JsonField) = apply { this.vision = vision } + + 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 [AdditionalAmounts]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AdditionalAmounts = + AdditionalAmounts( + checkRequired("clinic", clinic), + checkRequired("dental", dental), + checkRequired("original", original), + checkRequired("prescription", prescription), + checkRequired("surcharge", surcharge), + checkRequired("totalCumulative", totalCumulative), + checkRequired("totalHealthcare", totalHealthcare), + checkRequired("transit", transit), + checkRequired("unknown", unknown), + checkRequired("vision", vision), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): AdditionalAmounts = apply { + if (validated) { + return@apply + } + + clinic().ifPresent { it.validate() } + dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } + prescription().ifPresent { it.validate() } + surcharge().ifPresent { it.validate() } + totalCumulative().ifPresent { it.validate() } + totalHealthcare().ifPresent { it.validate() } + transit().ifPresent { it.validate() } + unknown().ifPresent { it.validate() } + vision().ifPresent { it.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 = + (clinic.asKnown().getOrNull()?.validity() ?: 0) + + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + + (prescription.asKnown().getOrNull()?.validity() ?: 0) + + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + + (totalHealthcare.asKnown().getOrNull()?.validity() ?: 0) + + (transit.asKnown().getOrNull()?.validity() ?: 0) + + (unknown.asKnown().getOrNull()?.validity() ?: 0) + + (vision.asKnown().getOrNull()?.validity() ?: 0) + + /** The part of this transaction amount that was for clinic-related services. */ + class Clinic + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Clinic]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Clinic]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(clinic: Clinic) = apply { + amount = clinic.amount + currency = clinic.currency + additionalProperties = clinic.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Clinic]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Clinic = + Clinic( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Clinic = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Clinic && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for dental-related services. */ + class Dental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Dental]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Dental]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(dental: Dental) = apply { + amount = dental.amount + currency = dental.currency + additionalProperties = dental.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Dental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Dental = + Dental( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Dental = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Dental && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Prescription]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Prescription]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(prescription: Prescription) = apply { + amount = prescription.amount + currency = prescription.currency + additionalProperties = prescription.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Prescription]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Prescription = + Prescription( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Prescription = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Prescription && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The surcharge amount charged for this transaction by the merchant. */ + class Surcharge + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Surcharge]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Surcharge]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(surcharge: Surcharge) = apply { + amount = surcharge.amount + currency = surcharge.currency + additionalProperties = surcharge.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Surcharge]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Surcharge = + Surcharge( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Surcharge = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Surcharge && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** + * The total amount of a series of incremental authorizations, optionally provided. + */ + class TotalCumulative + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalCumulative]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalCumulative]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalCumulative: TotalCumulative) = apply { + amount = totalCumulative.amount + currency = totalCumulative.currency + additionalProperties = + totalCumulative.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [TotalCumulative]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalCumulative = + TotalCumulative( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalCumulative = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalCumulative && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The total amount of healthcare-related additional amounts. */ + class TotalHealthcare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalHealthcare]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalHealthcare]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalHealthcare: TotalHealthcare) = apply { + amount = totalHealthcare.amount + currency = totalHealthcare.currency + additionalProperties = + totalHealthcare.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [TotalHealthcare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalHealthcare = + TotalHealthcare( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalHealthcare = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalHealthcare && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalHealthcare{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for transit-related services. */ + class Transit + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Transit]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Transit]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(transit: Transit) = apply { + amount = transit.amount + currency = transit.currency + additionalProperties = transit.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Transit]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Transit = + Transit( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Transit = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Transit && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Transit{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** An unknown additional amount. */ + class Unknown + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Unknown]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unknown]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(unknown: Unknown) = apply { + amount = unknown.amount + currency = unknown.currency + additionalProperties = unknown.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Unknown]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unknown = + Unknown( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unknown = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unknown && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unknown{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for vision-related services. */ + class Vision + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Vision]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Vision]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(vision: Vision) = apply { + amount = vision.amount + currency = vision.currency + additionalProperties = vision.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Vision]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Vision = + Vision( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Vision = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vision && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Vision{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AdditionalAmounts && + clinic == other.clinic && + dental == other.dental && + original == other.original && + prescription == other.prescription && + surcharge == other.surcharge && + totalCumulative == other.totalCumulative && + totalHealthcare == other.totalHealthcare && + transit == other.transit && + unknown == other.unknown && + vision == other.vision && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * currency. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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(): Currency = 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + */ + class Direction @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 { + + /** A regular card authorization where funds are debited from the cardholder. */ + @JvmField val SETTLEMENT = of("settlement") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + @JvmStatic fun of(value: String) = Direction(JsonField.of(value)) + } + + /** An enum containing [Direction]'s known values. */ + enum class Known { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + } + + /** + * An enum containing [Direction]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Direction] 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 { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * An enum member indicating that [Direction] 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) { + SETTLEMENT -> Value.SETTLEMENT + REFUND -> Value.REFUND + 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) { + SETTLEMENT -> Known.SETTLEMENT + REFUND -> Known.REFUND + else -> throw IncreaseInvalidDataException("Unknown Direction: $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(): Direction = 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 Direction && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `network`. */ + class NetworkDetails + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val pulse: JsonField, + private val visa: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), + @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), + ) : this(category, pulse, visa, mutableMapOf()) + + /** + * The payment network used to process this card authorization. + * + * @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") + + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + + /** + * Fields specific to the `visa` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun visa(): Optional = visa.getOptional("visa") + + /** + * 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 [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + + /** + * Returns the raw JSON value of [visa]. + * + * Unlike [visa], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa + + @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 [NetworkDetails]. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkDetails]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var pulse: JsonField? = null + private var visa: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkDetails: NetworkDetails) = apply { + category = networkDetails.category + pulse = networkDetails.pulse + visa = networkDetails.visa + additionalProperties = networkDetails.additionalProperties.toMutableMap() + } + + /** The payment network used to process this card authorization. */ + 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) = apply { this.category = category } + + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + + /** Fields specific to the `visa` network. */ + fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) + + /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */ + fun visa(visa: Optional) = visa(visa.getOrNull()) + + /** + * Sets [Builder.visa] to an arbitrary JSON value. + * + * You should usually call [Builder.visa] with a well-typed [Visa] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun visa(visa: JsonField) = apply { this.visa = visa } + + 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 [NetworkDetails]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkDetails = + NetworkDetails( + checkRequired("category", category), + checkRequired("pulse", pulse), + checkRequired("visa", visa), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkDetails = apply { + if (validated) { + return@apply + } + + category().validate() + pulse().ifPresent { it.validate() } + visa().ifPresent { it.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 = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + + (visa.asKnown().getOrNull()?.validity() ?: 0) + + /** The payment network used to process this card authorization. */ + class Category + @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 { + + /** Visa */ + @JvmField val VISA = of("visa") + + /** Pulse */ + @JvmField val PULSE = of("pulse") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Category] 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 { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + /** + * An enum member indicating that [Category] 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) { + VISA -> Value.VISA + PULSE -> Value.PULSE + 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) { + VISA -> Known.VISA + PULSE -> Known.PULSE + else -> throw IncreaseInvalidDataException("Unknown Category: $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(): Category = 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + + /** Fields specific to the `visa` network. */ + class Visa + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val electronicCommerceIndicator: JsonField, + private val pointOfServiceEntryMode: JsonField, + private val standInProcessingReason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + electronicCommerceIndicator: JsonField = + JsonMissing.of(), + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + pointOfServiceEntryMode: JsonField = + JsonMissing.of(), + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + standInProcessingReason: JsonField = + JsonMissing.of(), + ) : this( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + mutableMapOf(), + ) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun electronicCommerceIndicator(): Optional = + electronicCommerceIndicator.getOptional("electronic_commerce_indicator") + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pointOfServiceEntryMode(): Optional = + pointOfServiceEntryMode.getOptional("point_of_service_entry_mode") + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun standInProcessingReason(): Optional = + standInProcessingReason.getOptional("stand_in_processing_reason") + + /** + * Returns the raw JSON value of [electronicCommerceIndicator]. + * + * Unlike [electronicCommerceIndicator], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + fun _electronicCommerceIndicator(): JsonField = + electronicCommerceIndicator + + /** + * Returns the raw JSON value of [pointOfServiceEntryMode]. + * + * Unlike [pointOfServiceEntryMode], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + fun _pointOfServiceEntryMode(): JsonField = + pointOfServiceEntryMode + + /** + * Returns the raw JSON value of [standInProcessingReason]. + * + * Unlike [standInProcessingReason], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + fun _standInProcessingReason(): JsonField = + standInProcessingReason + + @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 [Visa]. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Visa]. */ + class Builder internal constructor() { + + private var electronicCommerceIndicator: + JsonField? = + null + private var pointOfServiceEntryMode: JsonField? = + null + private var standInProcessingReason: JsonField? = + null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(visa: Visa) = apply { + electronicCommerceIndicator = visa.electronicCommerceIndicator + pointOfServiceEntryMode = visa.pointOfServiceEntryMode + standInProcessingReason = visa.standInProcessingReason + additionalProperties = visa.additionalProperties.toMutableMap() + } + + /** + * For electronic commerce transactions, this identifies the level of + * security used in obtaining the customer's payment credential. For mail or + * telephone order transactions, identifies the type of mail or telephone + * order. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: ElectronicCommerceIndicator? + ) = + electronicCommerceIndicator( + JsonField.ofNullable(electronicCommerceIndicator) + ) + + /** + * Alias for calling [Builder.electronicCommerceIndicator] with + * `electronicCommerceIndicator.orElse(null)`. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: Optional + ) = electronicCommerceIndicator(electronicCommerceIndicator.getOrNull()) + + /** + * Sets [Builder.electronicCommerceIndicator] to an arbitrary JSON value. + * + * You should usually call [Builder.electronicCommerceIndicator] with a + * well-typed [ElectronicCommerceIndicator] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: JsonField + ) = apply { this.electronicCommerceIndicator = electronicCommerceIndicator } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: PointOfServiceEntryMode? + ) = pointOfServiceEntryMode(JsonField.ofNullable(pointOfServiceEntryMode)) + + /** + * Alias for calling [Builder.pointOfServiceEntryMode] with + * `pointOfServiceEntryMode.orElse(null)`. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: Optional + ) = pointOfServiceEntryMode(pointOfServiceEntryMode.getOrNull()) + + /** + * Sets [Builder.pointOfServiceEntryMode] to an arbitrary JSON value. + * + * You should usually call [Builder.pointOfServiceEntryMode] with a + * well-typed [PointOfServiceEntryMode] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: JsonField + ) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode } + + /** + * Only present when `actioner: network`. Describes why a card authorization + * was approved or declined by Visa through stand-in processing. + */ + fun standInProcessingReason( + standInProcessingReason: StandInProcessingReason? + ) = standInProcessingReason(JsonField.ofNullable(standInProcessingReason)) + + /** + * Alias for calling [Builder.standInProcessingReason] with + * `standInProcessingReason.orElse(null)`. + */ + fun standInProcessingReason( + standInProcessingReason: Optional + ) = standInProcessingReason(standInProcessingReason.getOrNull()) + + /** + * Sets [Builder.standInProcessingReason] to an arbitrary JSON value. + * + * You should usually call [Builder.standInProcessingReason] with a + * well-typed [StandInProcessingReason] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun standInProcessingReason( + standInProcessingReason: JsonField + ) = apply { this.standInProcessingReason = standInProcessingReason } + + 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 [Visa]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Visa = + Visa( + checkRequired( + "electronicCommerceIndicator", + electronicCommerceIndicator, + ), + checkRequired("pointOfServiceEntryMode", pointOfServiceEntryMode), + checkRequired("standInProcessingReason", standInProcessingReason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Visa = apply { + if (validated) { + return@apply + } + + electronicCommerceIndicator().ifPresent { it.validate() } + pointOfServiceEntryMode().ifPresent { it.validate() } + standInProcessingReason().ifPresent { it.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 = + (electronicCommerceIndicator.asKnown().getOrNull()?.validity() ?: 0) + + (pointOfServiceEntryMode.asKnown().getOrNull()?.validity() ?: 0) + + (standInProcessingReason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + */ + class ElectronicCommerceIndicator + @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 { + + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + @JvmField val MAIL_PHONE_ORDER = of("mail_phone_order") + + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + @JvmField val RECURRING = of("recurring") + + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + @JvmField val INSTALLMENT = of("installment") + + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + @JvmField val UNKNOWN_MAIL_PHONE_ORDER = of("unknown_mail_phone_order") + + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + @JvmField + val SECURE_ELECTRONIC_COMMERCE = of("secure_electronic_commerce") + + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT = + of("non_authenticated_security_transaction_at_3ds_capable_merchant") + + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION = + of("non_authenticated_security_transaction") + + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + @JvmField val NON_SECURE_TRANSACTION = of("non_secure_transaction") + + @JvmStatic + fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value)) + } + + /** An enum containing [ElectronicCommerceIndicator]'s known values. */ + enum class Known { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + } + + /** + * An enum containing [ElectronicCommerceIndicator]'s known values, as well + * as an [_UNKNOWN] member. + * + * An instance of [ElectronicCommerceIndicator] 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 { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + /** + * An enum member indicating that [ElectronicCommerceIndicator] 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) { + MAIL_PHONE_ORDER -> Value.MAIL_PHONE_ORDER + RECURRING -> Value.RECURRING + INSTALLMENT -> Value.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Value.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Value.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Value + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Value.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Value.NON_SECURE_TRANSACTION + 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) { + MAIL_PHONE_ORDER -> Known.MAIL_PHONE_ORDER + RECURRING -> Known.RECURRING + INSTALLMENT -> Known.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Known.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Known.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Known + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Known.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Known.NON_SECURE_TRANSACTION + else -> + throw IncreaseInvalidDataException( + "Unknown ElectronicCommerceIndicator: $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(): ElectronicCommerceIndicator = 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 ElectronicCommerceIndicator && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + class PointOfServiceEntryMode + @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 { + + /** Unknown */ + @JvmField val UNKNOWN = of("unknown") + + /** Manual key entry */ + @JvmField val MANUAL = of("manual") + + /** Magnetic stripe read, without card verification value */ + @JvmField val MAGNETIC_STRIPE_NO_CVV = of("magnetic_stripe_no_cvv") + + /** Optical code */ + @JvmField val OPTICAL_CODE = of("optical_code") + + /** Contact chip card */ + @JvmField val INTEGRATED_CIRCUIT_CARD = of("integrated_circuit_card") + + /** Contactless read of chip card */ + @JvmField val CONTACTLESS = of("contactless") + + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + @JvmField val CREDENTIAL_ON_FILE = of("credential_on_file") + + /** Magnetic stripe read */ + @JvmField val MAGNETIC_STRIPE = of("magnetic_stripe") + + /** Contactless read of magnetic stripe data */ + @JvmField + val CONTACTLESS_MAGNETIC_STRIPE = of("contactless_magnetic_stripe") + + /** Contact chip card, without card verification value */ + @JvmField + val INTEGRATED_CIRCUIT_CARD_NO_CVV = + of("integrated_circuit_card_no_cvv") + + @JvmStatic + fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value)) + } + + /** An enum containing [PointOfServiceEntryMode]'s known values. */ + enum class Known { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + } + + /** + * An enum containing [PointOfServiceEntryMode]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [PointOfServiceEntryMode] 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 { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + /** + * An enum member indicating that [PointOfServiceEntryMode] 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) { + UNKNOWN -> Value.UNKNOWN + MANUAL -> Value.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Value.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Value.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Value.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Value.CONTACTLESS + CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Value.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Value.INTEGRATED_CIRCUIT_CARD_NO_CVV + 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) { + UNKNOWN -> Known.UNKNOWN + MANUAL -> Known.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Known.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Known.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Known.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Known.CONTACTLESS + CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Known.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Known.INTEGRATED_CIRCUIT_CARD_NO_CVV + else -> + throw IncreaseInvalidDataException( + "Unknown PointOfServiceEntryMode: $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(): PointOfServiceEntryMode = 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 PointOfServiceEntryMode && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + */ + class StandInProcessingReason + @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 { + + /** Increase failed to process the authorization in a timely manner. */ + @JvmField val ISSUER_ERROR = of("issuer_error") + + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") + + /** The 3DS cardholder authentication verification value was invalid. */ + @JvmField + val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE = + of("invalid_cardholder_authentication_verification_value") + + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + @JvmField val INTERNAL_VISA_ERROR = of("internal_visa_error") + + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + @JvmField + val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED = + of("merchant_transaction_advisory_service_authentication_required") + + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + @JvmField + val PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK = + of("payment_fraud_disruption_acquirer_block") + + /** An unspecific reason for stand-in processing. */ + @JvmField val OTHER = of("other") + + @JvmStatic + fun of(value: String) = StandInProcessingReason(JsonField.of(value)) + } + + /** An enum containing [StandInProcessingReason]'s known values. */ + enum class Known { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + } + + /** + * An enum containing [StandInProcessingReason]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [StandInProcessingReason] 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 { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + /** + * An enum member indicating that [StandInProcessingReason] 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) { + ISSUER_ERROR -> Value.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Value.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Value.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Value + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Value.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Value.OTHER + 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) { + ISSUER_ERROR -> Known.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Known.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Known.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Known + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Known.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Known.OTHER + else -> + throw IncreaseInvalidDataException( + "Unknown StandInProcessingReason: $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(): StandInProcessingReason = 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 StandInProcessingReason && 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 Visa && + electronicCommerceIndicator == other.electronicCommerceIndicator && + pointOfServiceEntryMode == other.pointOfServiceEntryMode && + standInProcessingReason == other.standInProcessingReason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, standInProcessingReason=$standInProcessingReason, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkDetails && + category == other.category && + pulse == other.pulse && + visa == other.visa && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, pulse, visa, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" + } + + /** Network-specific identifiers for a specific request or transaction. */ + class NetworkIdentifiers + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val authorizationIdentificationResponse: JsonField, + private val retrievalReferenceNumber: JsonField, + private val traceNumber: JsonField, + private val transactionId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -19144,7 +29191,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -19175,6 +29240,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -19225,6 +29301,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -19236,6 +29313,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -19243,6 +29321,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -19250,6 +29330,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -19352,6 +29469,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -19361,6 +29479,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -19375,6 +29497,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -19397,7 +29520,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -19407,6 +29531,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -19415,6 +29541,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -19425,12 +29552,12 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. + * The processing category describes the intent behind the financial, such as whether it + * was used for bill payments or an automatic fuel dispenser. */ class ProcessingCategory @JsonCreator @@ -19676,241 +29803,7 @@ private constructor( return true } - return other is ProcessingCategory && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** This is present if a specific decline reason was given in the real-time decision. */ - class RealTimeDecisionReason - @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 cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") - - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") - - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") - - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") - - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") - - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = RealTimeDecisionReason(JsonField.of(value)) - } - - /** An enum containing [RealTimeDecisionReason]'s known values. */ - enum class Known { - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - } - - /** - * An enum containing [RealTimeDecisionReason]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [RealTimeDecisionReason] 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 cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - /** - * An enum member indicating that [RealTimeDecisionReason] 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) { - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD - OTHER -> Value.OTHER - 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) { - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - OTHER -> Known.OTHER - else -> - throw IncreaseInvalidDataException( - "Unknown RealTimeDecisionReason: $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(): RealTimeDecisionReason = 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 RealTimeDecisionReason && value == other.value + return other is ProcessingCategory && value == other.value } override fun hashCode() = value.hashCode() @@ -19918,8 +29811,11 @@ private constructor( override fun toString() = value.toString() } - /** Why the transaction was declined. */ - class Reason @JsonCreator private constructor(private val value: JsonField) : + /** + * A constant representing the object's type. For this resource it will always be + * `card_financial`. + */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -19934,210 +29830,29 @@ private constructor( companion object { - /** The account has been closed. */ - @JvmField val ACCOUNT_CLOSED = of("account_closed") - - /** The Card was not active. */ - @JvmField val CARD_NOT_ACTIVE = of("card_not_active") - - /** The Card has been canceled. */ - @JvmField val CARD_CANCELED = of("card_canceled") - - /** The Physical Card was not active. */ - @JvmField val PHYSICAL_CARD_NOT_ACTIVE = of("physical_card_not_active") - - /** The account's entity was not active. */ - @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") - - /** The account was inactive. */ - @JvmField val GROUP_LOCKED = of("group_locked") - - /** The Card's Account did not have a sufficient available balance. */ - @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") - - /** The given CVV2 did not match the card's value. */ - @JvmField val CVV2_MISMATCH = of("cvv2_mismatch") - - /** The given PIN did not match the card's value. */ - @JvmField val PIN_MISMATCH = of("pin_mismatch") - - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - @JvmField val CARD_EXPIRATION_MISMATCH = of("card_expiration_mismatch") - - /** The attempted card transaction is not allowed per Increase's terms. */ - @JvmField val TRANSACTION_NOT_ALLOWED = of("transaction_not_allowed") - - /** The transaction was blocked by a Limit. */ - @JvmField val BREACHES_LIMIT = of("breaches_limit") - - /** Your application declined the transaction via webhook. */ - @JvmField val WEBHOOK_DECLINED = of("webhook_declined") - - /** Your application webhook did not respond without the required timeout. */ - @JvmField val WEBHOOK_TIMED_OUT = of("webhook_timed_out") - - /** Declined by stand-in processing. */ - @JvmField - val DECLINED_BY_STAND_IN_PROCESSING = of("declined_by_stand_in_processing") - - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") - - /** - * The original card authorization for this incremental authorization does not - * exist. - */ - @JvmField - val MISSING_ORIGINAL_AUTHORIZATION = of("missing_original_authorization") - - /** The transaction was declined because the 3DS authentication failed. */ - @JvmField val FAILED_3DS_AUTHENTICATION = of("failed_3ds_authentication") - - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - @JvmField val SUSPECTED_CARD_TESTING = of("suspected_card_testing") - - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + @JvmField val CARD_FINANCIAL = of("card_financial") - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - /** An enum containing [Reason]'s known values. */ + /** An enum containing [Type]'s known values. */ enum class Known { - /** The account has been closed. */ - ACCOUNT_CLOSED, - /** The Card was not active. */ - CARD_NOT_ACTIVE, - /** The Card has been canceled. */ - CARD_CANCELED, - /** The Physical Card was not active. */ - PHYSICAL_CARD_NOT_ACTIVE, - /** The account's entity was not active. */ - ENTITY_NOT_ACTIVE, - /** The account was inactive. */ - GROUP_LOCKED, - /** The Card's Account did not have a sufficient available balance. */ - INSUFFICIENT_FUNDS, - /** The given CVV2 did not match the card's value. */ - CVV2_MISMATCH, - /** The given PIN did not match the card's value. */ - PIN_MISMATCH, - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - CARD_EXPIRATION_MISMATCH, - /** The attempted card transaction is not allowed per Increase's terms. */ - TRANSACTION_NOT_ALLOWED, - /** The transaction was blocked by a Limit. */ - BREACHES_LIMIT, - /** Your application declined the transaction via webhook. */ - WEBHOOK_DECLINED, - /** Your application webhook did not respond without the required timeout. */ - WEBHOOK_TIMED_OUT, - /** Declined by stand-in processing. */ - DECLINED_BY_STAND_IN_PROCESSING, - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - INVALID_PHYSICAL_CARD, - /** - * The original card authorization for this incremental authorization does not - * exist. - */ - MISSING_ORIGINAL_AUTHORIZATION, - /** The transaction was declined because the 3DS authentication failed. */ - FAILED_3DS_AUTHENTICATION, - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - SUSPECTED_CARD_TESTING, - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - SUSPECTED_FRAUD, + CARD_FINANCIAL } /** - * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [Reason] can contain an unknown value in a couple of cases: + * An instance of [Type] can contain an unknown value in a couple of cases: * - It was deserialized from data that doesn't match any known member. For example, * if the SDK is on an older version than the API, then the API may respond with * new members that the SDK is unaware of. * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** The account has been closed. */ - ACCOUNT_CLOSED, - /** The Card was not active. */ - CARD_NOT_ACTIVE, - /** The Card has been canceled. */ - CARD_CANCELED, - /** The Physical Card was not active. */ - PHYSICAL_CARD_NOT_ACTIVE, - /** The account's entity was not active. */ - ENTITY_NOT_ACTIVE, - /** The account was inactive. */ - GROUP_LOCKED, - /** The Card's Account did not have a sufficient available balance. */ - INSUFFICIENT_FUNDS, - /** The given CVV2 did not match the card's value. */ - CVV2_MISMATCH, - /** The given PIN did not match the card's value. */ - PIN_MISMATCH, - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - CARD_EXPIRATION_MISMATCH, - /** The attempted card transaction is not allowed per Increase's terms. */ - TRANSACTION_NOT_ALLOWED, - /** The transaction was blocked by a Limit. */ - BREACHES_LIMIT, - /** Your application declined the transaction via webhook. */ - WEBHOOK_DECLINED, - /** Your application webhook did not respond without the required timeout. */ - WEBHOOK_TIMED_OUT, - /** Declined by stand-in processing. */ - DECLINED_BY_STAND_IN_PROCESSING, - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - INVALID_PHYSICAL_CARD, - /** - * The original card authorization for this incremental authorization does not - * exist. - */ - MISSING_ORIGINAL_AUTHORIZATION, - /** The transaction was declined because the 3DS authentication failed. */ - FAILED_3DS_AUTHENTICATION, - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - SUSPECTED_CARD_TESTING, - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - SUSPECTED_FRAUD, + CARD_FINANCIAL, /** - * An enum member indicating that [Reason] was instantiated with an unknown - * value. + * An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -20151,26 +29866,7 @@ private constructor( */ fun value(): Value = when (this) { - ACCOUNT_CLOSED -> Value.ACCOUNT_CLOSED - CARD_NOT_ACTIVE -> Value.CARD_NOT_ACTIVE - CARD_CANCELED -> Value.CARD_CANCELED - PHYSICAL_CARD_NOT_ACTIVE -> Value.PHYSICAL_CARD_NOT_ACTIVE - ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE - GROUP_LOCKED -> Value.GROUP_LOCKED - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - CVV2_MISMATCH -> Value.CVV2_MISMATCH - PIN_MISMATCH -> Value.PIN_MISMATCH - CARD_EXPIRATION_MISMATCH -> Value.CARD_EXPIRATION_MISMATCH - TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED - BREACHES_LIMIT -> Value.BREACHES_LIMIT - WEBHOOK_DECLINED -> Value.WEBHOOK_DECLINED - WEBHOOK_TIMED_OUT -> Value.WEBHOOK_TIMED_OUT - DECLINED_BY_STAND_IN_PROCESSING -> Value.DECLINED_BY_STAND_IN_PROCESSING - INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD - MISSING_ORIGINAL_AUTHORIZATION -> Value.MISSING_ORIGINAL_AUTHORIZATION - FAILED_3DS_AUTHENTICATION -> Value.FAILED_3DS_AUTHENTICATION - SUSPECTED_CARD_TESTING -> Value.SUSPECTED_CARD_TESTING - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + CARD_FINANCIAL -> Value.CARD_FINANCIAL else -> Value._UNKNOWN } @@ -20185,27 +29881,8 @@ private constructor( */ fun known(): Known = when (this) { - ACCOUNT_CLOSED -> Known.ACCOUNT_CLOSED - CARD_NOT_ACTIVE -> Known.CARD_NOT_ACTIVE - CARD_CANCELED -> Known.CARD_CANCELED - PHYSICAL_CARD_NOT_ACTIVE -> Known.PHYSICAL_CARD_NOT_ACTIVE - ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE - GROUP_LOCKED -> Known.GROUP_LOCKED - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - CVV2_MISMATCH -> Known.CVV2_MISMATCH - PIN_MISMATCH -> Known.PIN_MISMATCH - CARD_EXPIRATION_MISMATCH -> Known.CARD_EXPIRATION_MISMATCH - TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED - BREACHES_LIMIT -> Known.BREACHES_LIMIT - WEBHOOK_DECLINED -> Known.WEBHOOK_DECLINED - WEBHOOK_TIMED_OUT -> Known.WEBHOOK_TIMED_OUT - DECLINED_BY_STAND_IN_PROCESSING -> Known.DECLINED_BY_STAND_IN_PROCESSING - INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD - MISSING_ORIGINAL_AUTHORIZATION -> Known.MISSING_ORIGINAL_AUTHORIZATION - FAILED_3DS_AUTHENTICATION -> Known.FAILED_3DS_AUTHENTICATION - SUSPECTED_CARD_TESTING -> Known.SUSPECTED_CARD_TESTING - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + CARD_FINANCIAL -> Known.CARD_FINANCIAL + else -> throw IncreaseInvalidDataException("Unknown Type: $value") } /** @@ -20224,7 +29901,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Reason = apply { + fun validate(): Type = apply { if (validated) { return@apply } @@ -20254,7 +29931,7 @@ private constructor( return true } - return other is Reason && value == other.value + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -21460,17 +31137,15 @@ private constructor( return true } - return other is CardDecline && + return other is CardFinancial && id == other.id && actioner == other.actioner && additionalAmounts == other.additionalAmounts && amount == other.amount && cardPaymentId == other.cardPaymentId && currency == other.currency && - declinedTransactionId == other.declinedTransactionId && digitalWalletTokenId == other.digitalWalletTokenId && direction == other.direction && - incrementedCardAuthorizationId == other.incrementedCardAuthorizationId && merchantAcceptorId == other.merchantAcceptorId && merchantCategoryCode == other.merchantCategoryCode && merchantCity == other.merchantCity && @@ -21486,9 +31161,9 @@ private constructor( presentmentCurrency == other.presentmentCurrency && processingCategory == other.processingCategory && realTimeDecisionId == other.realTimeDecisionId && - realTimeDecisionReason == other.realTimeDecisionReason && - reason == other.reason && terminalId == other.terminalId && + transactionId == other.transactionId && + type == other.type && verification == other.verification && additionalProperties == other.additionalProperties } @@ -21501,10 +31176,8 @@ private constructor( amount, cardPaymentId, currency, - declinedTransactionId, digitalWalletTokenId, direction, - incrementedCardAuthorizationId, merchantAcceptorId, merchantCategoryCode, merchantCity, @@ -21520,9 +31193,9 @@ private constructor( presentmentCurrency, processingCategory, realTimeDecisionId, - realTimeDecisionReason, - reason, terminalId, + transactionId, + type, verification, additionalProperties, ) @@ -21531,7 +31204,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardDecline{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, incrementedCardAuthorizationId=$incrementedCardAuthorizationId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, realTimeDecisionReason=$realTimeDecisionReason, reason=$reason, terminalId=$terminalId, verification=$verification, additionalProperties=$additionalProperties}" + "CardFinancial{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, transactionId=$transactionId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" } /** @@ -22217,13 +31890,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -22238,6 +31916,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -22255,6 +31935,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -22270,6 +31951,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -22331,6 +32013,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -22339,6 +32022,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -22348,7 +32034,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -22379,6 +32083,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -22429,6 +32144,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -22440,6 +32156,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -22447,6 +32164,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -22454,6 +32173,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -22556,6 +32312,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -22565,6 +32322,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -22579,6 +32340,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -22601,7 +32363,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -22611,6 +32374,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -22619,6 +32384,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -22629,7 +32395,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -23807,6 +33573,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -23825,6 +33592,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -23849,6 +33619,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -23875,6 +33646,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -23950,6 +33729,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -24040,6 +33829,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -24057,6 +33847,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -24070,6 +33861,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -24110,6 +33902,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -24276,6 +34083,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -24291,6 +34099,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -24311,6 +34120,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -24339,6 +34149,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -24801,6 +34612,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -26404,6 +36442,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -26418,6 +36457,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -26432,7 +36472,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -26631,13 +36671,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -26652,6 +36697,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -26669,6 +36716,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -26684,6 +36732,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -26745,6 +36794,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -26753,6 +36803,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -26762,7 +36815,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -26793,6 +36864,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -26843,6 +36925,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -26854,6 +36937,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -26861,6 +36945,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -26868,6 +36954,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -26970,6 +37093,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -26979,6 +37103,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -26993,6 +37121,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -27015,7 +37144,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -27025,6 +37155,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -27033,6 +37165,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -27043,7 +37176,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -29275,6 +39408,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -29287,10 +39421,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -29313,6 +39456,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -29342,6 +39497,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * 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 [transactionId]. * @@ -29374,6 +39540,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -29385,6 +39552,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -29392,6 +39560,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -29431,6 +39601,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -29486,6 +39693,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -29495,6 +39703,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -29509,6 +39721,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -29531,6 +39744,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -29541,6 +39755,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -29549,6 +39765,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -29557,7 +39774,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -38101,13 +48318,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -38122,6 +48344,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -38139,6 +48363,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -38154,6 +48379,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -38215,6 +48441,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -38223,6 +48450,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -38232,7 +48462,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -38263,6 +48511,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -38313,6 +48572,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -38324,6 +48584,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -38331,6 +48592,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -38338,6 +48601,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -38440,6 +48740,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -38449,6 +48750,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -38463,6 +48768,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -38485,7 +48791,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -38495,6 +48802,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -38503,6 +48812,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -38513,7 +48823,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** Why this reversal was initiated. */ @@ -41133,13 +51443,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -41154,6 +51469,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -41171,6 +51488,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -41186,6 +51504,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -41249,6 +51568,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -41261,10 +51581,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -41287,6 +51616,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -41316,6 +51657,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * 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 [transactionId]. * @@ -41348,6 +51700,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -41359,6 +51712,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -41366,6 +51720,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -41405,6 +51761,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -41460,6 +51853,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -41469,6 +51863,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -41483,6 +51881,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -41505,6 +51904,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -41515,6 +51915,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -41523,6 +51925,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -41531,7 +51934,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -49222,7 +59625,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -49839,7 +60243,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -50279,6 +60684,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -50297,6 +60703,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -50321,6 +60730,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -50347,6 +60757,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -50422,6 +60840,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -50512,6 +60940,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -50529,6 +60958,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -50542,6 +60972,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -50582,6 +61013,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -50748,6 +61194,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -50763,6 +61210,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -50783,6 +61231,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -50811,6 +61260,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -51273,6 +61723,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -52876,6 +63553,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -52890,6 +63568,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -52904,7 +63583,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -53089,6 +63768,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -53098,8 +63778,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -53110,6 +63793,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -53128,6 +63819,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -53156,6 +63855,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -53166,12 +63866,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -53188,6 +63890,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -53233,6 +63950,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -53241,6 +63959,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -53254,6 +63973,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -53275,6 +63995,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -53298,13 +64019,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -53320,6 +64046,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -53337,6 +64065,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -53352,6 +64081,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -53410,6 +64140,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -54571,24 +65410,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -54597,6 +65438,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -54606,7 +65450,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -54637,6 +65499,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -54687,6 +65560,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -54698,6 +65572,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -54705,6 +65580,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -54712,6 +65589,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -54814,6 +65728,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -54823,6 +65738,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -54837,6 +65756,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -54859,7 +65779,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -54869,6 +65790,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -54877,6 +65800,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -54887,7 +65811,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -56329,6 +67253,9 @@ private constructor( */ @JvmField val CARD_FUEL_CONFIRMATION = of("card_fuel_confirmation") + /** Card Financial: details will be under the `card_financial` object. */ + @JvmField val CARD_FINANCIAL = of("card_financial") + /** Unknown card payment element. */ @JvmField val OTHER = of("other") @@ -56363,6 +67290,8 @@ private constructor( * object. */ CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, /** Unknown card payment element. */ OTHER, } @@ -56403,6 +67332,8 @@ private constructor( * object. */ CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, /** Unknown card payment element. */ OTHER, /** @@ -56430,6 +67361,7 @@ private constructor( CARD_SETTLEMENT -> Value.CARD_SETTLEMENT CARD_REFUND -> Value.CARD_REFUND CARD_FUEL_CONFIRMATION -> Value.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Value.CARD_FINANCIAL OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -56455,6 +67387,7 @@ private constructor( CARD_SETTLEMENT -> Known.CARD_SETTLEMENT CARD_REFUND -> Known.CARD_REFUND CARD_FUEL_CONFIRMATION -> Known.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Known.CARD_FINANCIAL OTHER -> Known.OTHER else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -56513,6 +67446,115 @@ private constructor( override fun toString() = value.toString() } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -56523,6 +67565,7 @@ private constructor( cardAuthorization == other.cardAuthorization && cardAuthorizationExpiration == other.cardAuthorizationExpiration && cardDecline == other.cardDecline && + cardFinancial == other.cardFinancial && cardFuelConfirmation == other.cardFuelConfirmation && cardIncrement == other.cardIncrement && cardRefund == other.cardRefund && @@ -56541,6 +67584,7 @@ private constructor( cardAuthorization, cardAuthorizationExpiration, cardDecline, + cardFinancial, cardFuelConfirmation, cardIncrement, cardRefund, @@ -56557,7 +67601,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" + "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" } /** The summarized state of this card payment. */ @@ -56567,6 +67611,7 @@ private constructor( private val authorizedAmount: JsonField, private val fuelConfirmedAmount: JsonField, private val incrementedAmount: JsonField, + private val refundAuthorizedAmount: JsonField, private val refundedAmount: JsonField, private val reversedAmount: JsonField, private val settledAmount: JsonField, @@ -56584,6 +67629,9 @@ private constructor( @JsonProperty("incremented_amount") @ExcludeMissing incrementedAmount: JsonField = JsonMissing.of(), + @JsonProperty("refund_authorized_amount") + @ExcludeMissing + refundAuthorizedAmount: JsonField = JsonMissing.of(), @JsonProperty("refunded_amount") @ExcludeMissing refundedAmount: JsonField = JsonMissing.of(), @@ -56597,6 +67645,7 @@ private constructor( authorizedAmount, fuelConfirmedAmount, incrementedAmount, + refundAuthorizedAmount, refundedAmount, reversedAmount, settledAmount, @@ -56630,6 +67679,16 @@ private constructor( */ fun incrementedAmount(): Long = incrementedAmount.getRequired("incremented_amount") + /** + * The total refund authorized amount in the minor unit of the transaction's currency. For + * dollars, for example, this is 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 refundAuthorizedAmount(): Long = + refundAuthorizedAmount.getRequired("refund_authorized_amount") + /** * The total refunded amount in the minor unit of the transaction's currency. For dollars, * for example, this is cents. @@ -56687,6 +67746,16 @@ private constructor( @ExcludeMissing fun _incrementedAmount(): JsonField = incrementedAmount + /** + * Returns the raw JSON value of [refundAuthorizedAmount]. + * + * Unlike [refundAuthorizedAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("refund_authorized_amount") + @ExcludeMissing + fun _refundAuthorizedAmount(): JsonField = refundAuthorizedAmount + /** * Returns the raw JSON value of [refundedAmount]. * @@ -56739,6 +67808,7 @@ private constructor( * .authorizedAmount() * .fuelConfirmedAmount() * .incrementedAmount() + * .refundAuthorizedAmount() * .refundedAmount() * .reversedAmount() * .settledAmount() @@ -56753,6 +67823,7 @@ private constructor( private var authorizedAmount: JsonField? = null private var fuelConfirmedAmount: JsonField? = null private var incrementedAmount: JsonField? = null + private var refundAuthorizedAmount: JsonField? = null private var refundedAmount: JsonField? = null private var reversedAmount: JsonField? = null private var settledAmount: JsonField? = null @@ -56763,6 +67834,7 @@ private constructor( authorizedAmount = state.authorizedAmount fuelConfirmedAmount = state.fuelConfirmedAmount incrementedAmount = state.incrementedAmount + refundAuthorizedAmount = state.refundAuthorizedAmount refundedAmount = state.refundedAmount reversedAmount = state.reversedAmount settledAmount = state.settledAmount @@ -56823,6 +67895,24 @@ private constructor( this.incrementedAmount = incrementedAmount } + /** + * The total refund authorized amount in the minor unit of the transaction's currency. + * For dollars, for example, this is cents. + */ + fun refundAuthorizedAmount(refundAuthorizedAmount: Long) = + refundAuthorizedAmount(JsonField.of(refundAuthorizedAmount)) + + /** + * Sets [Builder.refundAuthorizedAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.refundAuthorizedAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun refundAuthorizedAmount(refundAuthorizedAmount: JsonField) = apply { + this.refundAuthorizedAmount = refundAuthorizedAmount + } + /** * The total refunded amount in the minor unit of the transaction's currency. For * dollars, for example, this is cents. @@ -56903,6 +67993,7 @@ private constructor( * .authorizedAmount() * .fuelConfirmedAmount() * .incrementedAmount() + * .refundAuthorizedAmount() * .refundedAmount() * .reversedAmount() * .settledAmount() @@ -56915,6 +68006,7 @@ private constructor( checkRequired("authorizedAmount", authorizedAmount), checkRequired("fuelConfirmedAmount", fuelConfirmedAmount), checkRequired("incrementedAmount", incrementedAmount), + checkRequired("refundAuthorizedAmount", refundAuthorizedAmount), checkRequired("refundedAmount", refundedAmount), checkRequired("reversedAmount", reversedAmount), checkRequired("settledAmount", settledAmount), @@ -56932,6 +68024,7 @@ private constructor( authorizedAmount() fuelConfirmedAmount() incrementedAmount() + refundAuthorizedAmount() refundedAmount() reversedAmount() settledAmount() @@ -56957,6 +68050,7 @@ private constructor( (if (authorizedAmount.asKnown().isPresent) 1 else 0) + (if (fuelConfirmedAmount.asKnown().isPresent) 1 else 0) + (if (incrementedAmount.asKnown().isPresent) 1 else 0) + + (if (refundAuthorizedAmount.asKnown().isPresent) 1 else 0) + (if (refundedAmount.asKnown().isPresent) 1 else 0) + (if (reversedAmount.asKnown().isPresent) 1 else 0) + (if (settledAmount.asKnown().isPresent) 1 else 0) @@ -56970,6 +68064,7 @@ private constructor( authorizedAmount == other.authorizedAmount && fuelConfirmedAmount == other.fuelConfirmedAmount && incrementedAmount == other.incrementedAmount && + refundAuthorizedAmount == other.refundAuthorizedAmount && refundedAmount == other.refundedAmount && reversedAmount == other.reversedAmount && settledAmount == other.settledAmount && @@ -56981,6 +68076,7 @@ private constructor( authorizedAmount, fuelConfirmedAmount, incrementedAmount, + refundAuthorizedAmount, refundedAmount, reversedAmount, settledAmount, @@ -56991,7 +68087,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "State{authorizedAmount=$authorizedAmount, fuelConfirmedAmount=$fuelConfirmedAmount, incrementedAmount=$incrementedAmount, refundedAmount=$refundedAmount, reversedAmount=$reversedAmount, settledAmount=$settledAmount, additionalProperties=$additionalProperties}" + "State{authorizedAmount=$authorizedAmount, fuelConfirmedAmount=$fuelConfirmedAmount, incrementedAmount=$incrementedAmount, refundAuthorizedAmount=$refundAuthorizedAmount, refundedAmount=$refundedAmount, reversedAmount=$reversedAmount, settledAmount=$settledAmount, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt index 8bd543e48..6e6ae71e0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt @@ -152,8 +152,8 @@ private constructor( fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") /** - * If your deposit is successfully parsed and accepted by Increase, this will contain details of - * the parsed check. + * Once your deposit is successfully parsed and accepted by Increase, this will contain details + * of the parsed check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -579,7 +579,7 @@ private constructor( fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** - * If your deposit is successfully parsed and accepted by Increase, this will contain + * Once your deposit is successfully parsed and accepted by Increase, this will contain * details of the parsed check. */ fun depositAcceptance(depositAcceptance: DepositAcceptance?) = @@ -957,8 +957,8 @@ private constructor( (type.asKnown().getOrNull()?.validity() ?: 0) /** - * If your deposit is successfully parsed and accepted by Increase, this will contain details of - * the parsed check. + * Once your deposit is successfully parsed and accepted by Increase, this will contain details + * of the parsed check. */ class DepositAcceptance @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1006,7 +1006,8 @@ private constructor( ) /** - * The account number printed on the check. + * The account number printed on the check. This is an account at the bank that issued the + * check. * * @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). @@ -1049,7 +1050,8 @@ private constructor( fun currency(): Currency = currency.getRequired("currency") /** - * The routing number printed on the check. + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. * * @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). @@ -1184,7 +1186,10 @@ private constructor( additionalProperties = depositAcceptance.additionalProperties.toMutableMap() } - /** The account number printed on the check. */ + /** + * The account number printed on the check. This is an account at the bank that issued + * the check. + */ fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) /** @@ -1265,7 +1270,10 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The routing number printed on the check. */ + /** + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. + */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt index 2640eef1d..9a1e2680a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt @@ -1463,12 +1463,15 @@ private constructor( /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ @JvmField val FULL = of("full") /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ @JvmField val NONE = of("none") @@ -1479,11 +1482,14 @@ private constructor( enum class Known { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ NONE, } @@ -1500,11 +1506,14 @@ private constructor( enum class Value { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ NONE, /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt index 78eaefde9..52bf09fa0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt @@ -63,6 +63,15 @@ private constructor( */ fun sourceAccountNumberId(): String = body.sourceAccountNumberId() + /** + * How the account's available balance should be checked. If omitted, the default behavior is + * `balance_check: full`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun balanceCheck(): Optional = body.balanceCheck() + /** * The check number Increase should use for the check. This should not contain leading zeroes * and must be unique across the `source_account_number`. If this is omitted, Increase will @@ -131,6 +140,13 @@ private constructor( */ fun _sourceAccountNumberId(): JsonField = body._sourceAccountNumberId() + /** + * Returns the raw JSON value of [balanceCheck]. + * + * Unlike [balanceCheck], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _balanceCheck(): JsonField = body._balanceCheck() + /** * Returns the raw JSON value of [checkNumber]. * @@ -208,7 +224,7 @@ private constructor( * - [amount] * - [fulfillmentMethod] * - [sourceAccountNumberId] - * - [checkNumber] + * - [balanceCheck] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -271,6 +287,23 @@ private constructor( body.sourceAccountNumberId(sourceAccountNumberId) } + /** + * How the account's available balance should be checked. If omitted, the default behavior + * is `balance_check: full`. + */ + fun balanceCheck(balanceCheck: BalanceCheck) = apply { body.balanceCheck(balanceCheck) } + + /** + * Sets [Builder.balanceCheck] to an arbitrary JSON value. + * + * You should usually call [Builder.balanceCheck] with a well-typed [BalanceCheck] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun balanceCheck(balanceCheck: JsonField) = apply { + body.balanceCheck(balanceCheck) + } + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -492,6 +525,7 @@ private constructor( private val amount: JsonField, private val fulfillmentMethod: JsonField, private val sourceAccountNumberId: JsonField, + private val balanceCheck: JsonField, private val checkNumber: JsonField, private val physicalCheck: JsonField, private val requireApproval: JsonField, @@ -511,6 +545,9 @@ private constructor( @JsonProperty("source_account_number_id") @ExcludeMissing sourceAccountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("balance_check") + @ExcludeMissing + balanceCheck: JsonField = JsonMissing.of(), @JsonProperty("check_number") @ExcludeMissing checkNumber: JsonField = JsonMissing.of(), @@ -528,6 +565,7 @@ private constructor( amount, fulfillmentMethod, sourceAccountNumberId, + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -570,6 +608,15 @@ private constructor( fun sourceAccountNumberId(): String = sourceAccountNumberId.getRequired("source_account_number_id") + /** + * How the account's available balance should be checked. If omitted, the default behavior + * is `balance_check: full`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun balanceCheck(): Optional = balanceCheck.getOptional("balance_check") + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -642,6 +689,16 @@ private constructor( @ExcludeMissing fun _sourceAccountNumberId(): JsonField = sourceAccountNumberId + /** + * Returns the raw JSON value of [balanceCheck]. + * + * Unlike [balanceCheck], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("balance_check") + @ExcludeMissing + fun _balanceCheck(): JsonField = balanceCheck + /** * Returns the raw JSON value of [checkNumber]. * @@ -715,6 +772,7 @@ private constructor( private var amount: JsonField? = null private var fulfillmentMethod: JsonField? = null private var sourceAccountNumberId: JsonField? = null + private var balanceCheck: JsonField = JsonMissing.of() private var checkNumber: JsonField = JsonMissing.of() private var physicalCheck: JsonField = JsonMissing.of() private var requireApproval: JsonField = JsonMissing.of() @@ -727,6 +785,7 @@ private constructor( amount = body.amount fulfillmentMethod = body.fulfillmentMethod sourceAccountNumberId = body.sourceAccountNumberId + balanceCheck = body.balanceCheck checkNumber = body.checkNumber physicalCheck = body.physicalCheck requireApproval = body.requireApproval @@ -791,6 +850,23 @@ private constructor( this.sourceAccountNumberId = sourceAccountNumberId } + /** + * How the account's available balance should be checked. If omitted, the default + * behavior is `balance_check: full`. + */ + fun balanceCheck(balanceCheck: BalanceCheck) = balanceCheck(JsonField.of(balanceCheck)) + + /** + * Sets [Builder.balanceCheck] to an arbitrary JSON value. + * + * You should usually call [Builder.balanceCheck] with a well-typed [BalanceCheck] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun balanceCheck(balanceCheck: JsonField) = apply { + this.balanceCheck = balanceCheck + } + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -901,6 +977,7 @@ private constructor( checkRequired("amount", amount), checkRequired("fulfillmentMethod", fulfillmentMethod), checkRequired("sourceAccountNumberId", sourceAccountNumberId), + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -920,6 +997,7 @@ private constructor( amount() fulfillmentMethod().validate() sourceAccountNumberId() + balanceCheck().ifPresent { it.validate() } checkNumber() physicalCheck().ifPresent { it.validate() } requireApproval() @@ -947,6 +1025,7 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (fulfillmentMethod.asKnown().getOrNull()?.validity() ?: 0) + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (balanceCheck.asKnown().getOrNull()?.validity() ?: 0) + (if (checkNumber.asKnown().isPresent) 1 else 0) + (physicalCheck.asKnown().getOrNull()?.validity() ?: 0) + (if (requireApproval.asKnown().isPresent) 1 else 0) + @@ -962,6 +1041,7 @@ private constructor( amount == other.amount && fulfillmentMethod == other.fulfillmentMethod && sourceAccountNumberId == other.sourceAccountNumberId && + balanceCheck == other.balanceCheck && checkNumber == other.checkNumber && physicalCheck == other.physicalCheck && requireApproval == other.requireApproval && @@ -975,6 +1055,7 @@ private constructor( amount, fulfillmentMethod, sourceAccountNumberId, + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -986,7 +1067,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{accountId=$accountId, amount=$amount, fulfillmentMethod=$fulfillmentMethod, sourceAccountNumberId=$sourceAccountNumberId, checkNumber=$checkNumber, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}" + "Body{accountId=$accountId, amount=$amount, fulfillmentMethod=$fulfillmentMethod, sourceAccountNumberId=$sourceAccountNumberId, balanceCheck=$balanceCheck, checkNumber=$checkNumber, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}" } /** Whether Increase will print and mail the check or if you will do it yourself. */ @@ -1136,6 +1217,170 @@ private constructor( override fun toString() = value.toString() } + /** + * How the account's available balance should be checked. If omitted, the default behavior is + * `balance_check: full`. + */ + class BalanceCheck @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 available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. + */ + @JvmField val FULL = of("full") + + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + @JvmField val NONE = of("none") + + @JvmStatic fun of(value: String) = BalanceCheck(JsonField.of(value)) + } + + /** An enum containing [BalanceCheck]'s known values. */ + enum class Known { + /** + * The available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. + */ + FULL, + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + NONE, + } + + /** + * An enum containing [BalanceCheck]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [BalanceCheck] 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 available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. + */ + FULL, + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + NONE, + /** + * An enum member indicating that [BalanceCheck] 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) { + FULL -> Value.FULL + NONE -> Value.NONE + 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) { + FULL -> Known.FULL + NONE -> Known.NONE + else -> throw IncreaseInvalidDataException("Unknown BalanceCheck: $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(): BalanceCheck = 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 BalanceCheck && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * Details relating to the physical check that Increase will print and mail. This is required if * `fulfillment_method` is equal to `physical_check`. It must not be included if any other diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index 6ff0f1512..8b1e3e84b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -878,7 +878,7 @@ private constructor( private val inboundFednowTransferDecline: JsonField, private val inboundRealTimePaymentsTransferDecline: JsonField, - private val other: JsonValue, + private val other: JsonField, private val wireDecline: JsonField, private val additionalProperties: MutableMap, ) { @@ -909,7 +909,7 @@ private constructor( inboundRealTimePaymentsTransferDecline: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("wire_decline") @ExcludeMissing wireDecline: JsonField = JsonMissing.of(), @@ -999,8 +999,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Wire Decline object. This field will be present in the JSON response if and only if @@ -1079,6 +1082,13 @@ private constructor( JsonField = inboundRealTimePaymentsTransferDecline + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [wireDecline]. * @@ -1134,7 +1144,7 @@ private constructor( private var inboundRealTimePaymentsTransferDecline: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var wireDecline: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1327,7 +1337,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Wire Decline object. This field will be present in the JSON response if and only if @@ -1422,6 +1444,7 @@ private constructor( checkDepositRejection().ifPresent { it.validate() } inboundFednowTransferDecline().ifPresent { it.validate() } inboundRealTimePaymentsTransferDecline().ifPresent { it.validate() } + other().ifPresent { it.validate() } wireDecline().ifPresent { it.validate() } validated = true } @@ -1449,6 +1472,7 @@ private constructor( (checkDepositRejection.asKnown().getOrNull()?.validity() ?: 0) + (inboundFednowTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + (inboundRealTimePaymentsTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (wireDecline.asKnown().getOrNull()?.validity() ?: 0) /** @@ -2967,7 +2991,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3801,7 +3826,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -4351,6 +4377,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -4369,6 +4396,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -4393,6 +4423,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -4419,6 +4450,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -4494,6 +4533,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -4584,6 +4633,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4601,6 +4651,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -4614,6 +4665,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -4654,6 +4706,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -4820,6 +4887,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4835,6 +4903,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -4855,6 +4924,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -4883,6 +4953,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -5345,6 +5416,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6948,6 +7246,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -6962,6 +7261,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -6976,7 +7276,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -7311,6 +7611,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7320,8 +7621,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -7332,6 +7636,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -7350,6 +7662,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -7378,6 +7698,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -7388,12 +7709,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -7410,6 +7733,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7455,6 +7793,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -7463,6 +7802,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -7476,6 +7816,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -7497,6 +7838,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -7520,13 +7862,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -7542,6 +7889,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -7559,6 +7908,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7574,6 +7924,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -7632,6 +7983,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8793,24 +9253,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -8819,6 +9281,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -8828,7 +9293,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -8859,6 +9342,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -8909,6 +9403,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -8920,6 +9415,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -8927,6 +9423,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -8934,6 +9432,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -9036,6 +9571,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -9045,6 +9581,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -9059,6 +9599,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -9081,7 +9622,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -9091,6 +9633,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -9099,6 +9643,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -9109,7 +9654,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -14428,6 +14973,115 @@ private constructor( "InboundRealTimePaymentsTransferDecline{amount=$amount, creditorName=$creditorName, currency=$currency, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, reason=$reason, remittanceInformation=$remittanceInformation, transactionIdentification=$transactionIdentification, transferId=$transferId, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Wire Decline object. This field will be present in the JSON response if and only if * `category` is equal to `wire_decline`. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt index c0a89973d..737d95231 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt @@ -4854,6 +4854,13 @@ private constructor( /** A public entity acting on behalf of the federal or a state government. */ @JvmField val PUBLIC_ENTITY = of("public_entity") + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + @JvmField val OTHER = of("other") + @JvmStatic fun of(value: String) = BeneficialOwnershipExemptionReason(JsonField.of(value)) } @@ -4866,6 +4873,12 @@ private constructor( PUBLICLY_TRADED_COMPANY, /** A public entity acting on behalf of the federal or a state government. */ PUBLIC_ENTITY, + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + OTHER, } /** @@ -4886,6 +4899,12 @@ private constructor( PUBLICLY_TRADED_COMPANY, /** A public entity acting on behalf of the federal or a state government. */ PUBLIC_ENTITY, + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + OTHER, /** * An enum member indicating that [BeneficialOwnershipExemptionReason] was * instantiated with an unknown value. @@ -4905,6 +4924,7 @@ private constructor( REGULATED_FINANCIAL_INSTITUTION -> Value.REGULATED_FINANCIAL_INSTITUTION PUBLICLY_TRADED_COMPANY -> Value.PUBLICLY_TRADED_COMPANY PUBLIC_ENTITY -> Value.PUBLIC_ENTITY + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -4922,6 +4942,7 @@ private constructor( REGULATED_FINANCIAL_INSTITUTION -> Known.REGULATED_FINANCIAL_INSTITUTION PUBLICLY_TRADED_COMPANY -> Known.PUBLICLY_TRADED_COMPANY PUBLIC_ENTITY -> Known.PUBLIC_ENTITY + OTHER -> Known.OTHER else -> throw IncreaseInvalidDataException( "Unknown BeneficialOwnershipExemptionReason: $value" diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt index 139b94f88..5096a94c5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt @@ -617,20 +617,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -903,14 +889,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1139,14 +1117,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1304,10 +1274,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1433,10 +1399,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt index 08edc95ef..4d602f1f4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt @@ -629,22 +629,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField - val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField - val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -919,14 +903,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1157,14 +1133,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1325,10 +1293,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1455,10 +1419,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt index 515b11409..9edcb1147 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt @@ -728,20 +728,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -1014,14 +1000,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1251,14 +1229,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1419,10 +1389,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1548,10 +1514,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt index a7be6d41a..90274b1c6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt @@ -978,20 +978,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -1264,14 +1250,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1501,14 +1479,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1669,10 +1639,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1798,10 +1764,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt index 6b94ba47d..907e1eb7b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt @@ -91,8 +91,13 @@ private constructor( */ fun transactionCsv(): Optional = body.transactionCsv() - /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun _vendorCsv(): JsonValue = body._vendorCsv() + /** + * Options for the created export. Required if `category` is equal to `vendor_csv`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun vendorCsv(): Optional = body.vendorCsv() /** * Returns the raw JSON value of [category]. @@ -147,6 +152,13 @@ private constructor( */ fun _transactionCsv(): JsonField = body._transactionCsv() + /** + * Returns the raw JSON value of [vendorCsv]. + * + * Unlike [vendorCsv], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _vendorCsv(): JsonField = body._vendorCsv() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -308,7 +320,16 @@ private constructor( } /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun vendorCsv(vendorCsv: JsonValue) = apply { body.vendorCsv(vendorCsv) } + fun vendorCsv(vendorCsv: VendorCsv) = apply { body.vendorCsv(vendorCsv) } + + /** + * Sets [Builder.vendorCsv] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorCsv] with a well-typed [VendorCsv] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun vendorCsv(vendorCsv: JsonField) = apply { body.vendorCsv(vendorCsv) } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) @@ -463,7 +484,7 @@ private constructor( private val bookkeepingAccountBalanceCsv: JsonField, private val entityCsv: JsonField, private val transactionCsv: JsonField, - private val vendorCsv: JsonValue, + private val vendorCsv: JsonField, private val additionalProperties: MutableMap, ) { @@ -491,7 +512,9 @@ private constructor( @JsonProperty("transaction_csv") @ExcludeMissing transactionCsv: JsonField = JsonMissing.of(), - @JsonProperty("vendor_csv") @ExcludeMissing vendorCsv: JsonValue = JsonMissing.of(), + @JsonProperty("vendor_csv") + @ExcludeMissing + vendorCsv: JsonField = JsonMissing.of(), ) : this( category, accountStatementBai2, @@ -567,8 +590,13 @@ private constructor( fun transactionCsv(): Optional = transactionCsv.getOptional("transaction_csv") - /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - @JsonProperty("vendor_csv") @ExcludeMissing fun _vendorCsv(): JsonValue = vendorCsv + /** + * Options for the created export. Required if `category` is equal to `vendor_csv`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun vendorCsv(): Optional = vendorCsv.getOptional("vendor_csv") /** * Returns the raw JSON value of [category]. @@ -636,6 +664,15 @@ private constructor( @ExcludeMissing fun _transactionCsv(): JsonField = transactionCsv + /** + * Returns the raw JSON value of [vendorCsv]. + * + * Unlike [vendorCsv], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor_csv") + @ExcludeMissing + fun _vendorCsv(): JsonField = vendorCsv + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -672,7 +709,7 @@ private constructor( JsonMissing.of() private var entityCsv: JsonField = JsonMissing.of() private var transactionCsv: JsonField = JsonMissing.of() - private var vendorCsv: JsonValue = JsonMissing.of() + private var vendorCsv: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -800,7 +837,16 @@ private constructor( } /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun vendorCsv(vendorCsv: JsonValue) = apply { this.vendorCsv = vendorCsv } + fun vendorCsv(vendorCsv: VendorCsv) = vendorCsv(JsonField.of(vendorCsv)) + + /** + * Sets [Builder.vendorCsv] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorCsv] with a well-typed [VendorCsv] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendorCsv(vendorCsv: JsonField) = apply { this.vendorCsv = vendorCsv } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -861,6 +907,7 @@ private constructor( bookkeepingAccountBalanceCsv().ifPresent { it.validate() } entityCsv().ifPresent { it.validate() } transactionCsv().ifPresent { it.validate() } + vendorCsv().ifPresent { it.validate() } validated = true } @@ -886,7 +933,8 @@ private constructor( (balanceCsv.asKnown().getOrNull()?.validity() ?: 0) + (bookkeepingAccountBalanceCsv.asKnown().getOrNull()?.validity() ?: 0) + (entityCsv.asKnown().getOrNull()?.validity() ?: 0) + - (transactionCsv.asKnown().getOrNull()?.validity() ?: 0) + (transactionCsv.asKnown().getOrNull()?.validity() ?: 0) + + (vendorCsv.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1130,6 +1178,7 @@ private constructor( private constructor( private val accountId: JsonField, private val effectiveDate: JsonField, + private val programId: JsonField, private val additionalProperties: MutableMap, ) { @@ -1141,7 +1190,10 @@ private constructor( @JsonProperty("effective_date") @ExcludeMissing effectiveDate: JsonField = JsonMissing.of(), - ) : this(accountId, effectiveDate, mutableMapOf()) + @JsonProperty("program_id") + @ExcludeMissing + programId: JsonField = JsonMissing.of(), + ) : this(accountId, effectiveDate, programId, mutableMapOf()) /** * The Account to create a BAI2 report for. If not provided, all open accounts will be @@ -1162,6 +1214,15 @@ private constructor( */ fun effectiveDate(): Optional = effectiveDate.getOptional("effective_date") + /** + * The Program to create a BAI2 report for. If not provided, all open accounts will be + * included. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun programId(): Optional = programId.getOptional("program_id") + /** * Returns the raw JSON value of [accountId]. * @@ -1179,6 +1240,13 @@ private constructor( @ExcludeMissing fun _effectiveDate(): JsonField = effectiveDate + /** + * Returns the raw JSON value of [programId]. + * + * Unlike [programId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("program_id") @ExcludeMissing fun _programId(): JsonField = programId + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1202,12 +1270,14 @@ private constructor( private var accountId: JsonField = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var programId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountStatementBai2: AccountStatementBai2) = apply { accountId = accountStatementBai2.accountId effectiveDate = accountStatementBai2.effectiveDate + programId = accountStatementBai2.programId additionalProperties = accountStatementBai2.additionalProperties.toMutableMap() } @@ -1244,6 +1314,21 @@ private constructor( this.effectiveDate = effectiveDate } + /** + * The Program to create a BAI2 report for. If not provided, all open accounts will be + * included. + */ + fun programId(programId: String) = programId(JsonField.of(programId)) + + /** + * Sets [Builder.programId] to an arbitrary JSON value. + * + * You should usually call [Builder.programId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun programId(programId: JsonField) = apply { this.programId = programId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1269,7 +1354,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): AccountStatementBai2 = - AccountStatementBai2(accountId, effectiveDate, additionalProperties.toMutableMap()) + AccountStatementBai2( + accountId, + effectiveDate, + programId, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -1281,6 +1371,7 @@ private constructor( accountId() effectiveDate() + programId() validated = true } @@ -1301,7 +1392,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (accountId.asKnown().isPresent) 1 else 0) + - (if (effectiveDate.asKnown().isPresent) 1 else 0) + (if (effectiveDate.asKnown().isPresent) 1 else 0) + + (if (programId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1311,17 +1403,18 @@ private constructor( return other is AccountStatementBai2 && accountId == other.accountId && effectiveDate == other.effectiveDate && + programId == other.programId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(accountId, effectiveDate, additionalProperties) + Objects.hash(accountId, effectiveDate, programId, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "AccountStatementBai2{accountId=$accountId, effectiveDate=$effectiveDate, additionalProperties=$additionalProperties}" + "AccountStatementBai2{accountId=$accountId, effectiveDate=$effectiveDate, programId=$programId, additionalProperties=$additionalProperties}" } /** @@ -3833,6 +3926,109 @@ private constructor( "TransactionCsv{accountId=$accountId, createdAt=$createdAt, programId=$programId, additionalProperties=$additionalProperties}" } + /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ + class VendorCsv + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [VendorCsv]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [VendorCsv]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(vendorCsv: VendorCsv) = apply { + additionalProperties = vendorCsv.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [VendorCsv]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): VendorCsv = VendorCsv(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): VendorCsv = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is VendorCsv && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "VendorCsv{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt new file mode 100644 index 000000000..2a3cc27fc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt @@ -0,0 +1,3714 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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 + +/** + * FedNow transfers move funds, within seconds, between your Increase account and any other account + * supporting FedNow. + */ +class FednowTransfer +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val accountId: JsonField, + private val accountNumber: JsonField, + private val acknowledgement: JsonField, + private val amount: JsonField, + private val createdAt: JsonField, + private val createdBy: JsonField, + private val creditorName: JsonField, + private val currency: JsonField, + private val debtorName: JsonField, + private val externalAccountId: JsonField, + private val idempotencyKey: JsonField, + private val pendingTransactionId: JsonField, + private val rejection: JsonField, + private val routingNumber: JsonField, + private val sourceAccountNumberId: JsonField, + private val status: JsonField, + private val submission: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val uniqueEndToEndTransactionReference: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("acknowledgement") + @ExcludeMissing + acknowledgement: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("created_by") + @ExcludeMissing + createdBy: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("external_account_id") + @ExcludeMissing + externalAccountId: JsonField = JsonMissing.of(), + @JsonProperty("idempotency_key") + @ExcludeMissing + idempotencyKey: JsonField = JsonMissing.of(), + @JsonProperty("pending_transaction_id") + @ExcludeMissing + pendingTransactionId: JsonField = JsonMissing.of(), + @JsonProperty("rejection") + @ExcludeMissing + rejection: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + routingNumber: 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("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("unique_end_to_end_transaction_reference") + @ExcludeMissing + uniqueEndToEndTransactionReference: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + id, + accountId, + accountNumber, + acknowledgement, + amount, + createdAt, + createdBy, + creditorName, + currency, + debtorName, + externalAccountId, + idempotencyKey, + pendingTransactionId, + rejection, + routingNumber, + sourceAccountNumberId, + status, + submission, + transactionId, + type, + uniqueEndToEndTransactionReference, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The FedNow 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") + + /** + * 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 destination account number. + * + * @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 accountNumber(): String = accountNumber.getRequired("account_number") + + /** + * If the transfer is acknowledged 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 acknowledgement(): Optional = + acknowledgement.getOptional("acknowledgement") + + /** + * 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") + + /** + * 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 name of the transfer's recipient. This is set by the sender when creating 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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * FedNow transfers this is always equal to `USD`. + * + * @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") + + /** + * The name of the transfer's sender. If not provided, defaults to the name of the account's + * entity. + * + * @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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The identifier of the External Account the transfer was made to, if any. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalAccountId(): Optional = externalAccountId.getOptional("external_account_id") + + /** + * 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 ID for the pending transaction representing the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun pendingTransactionId(): Optional = + pendingTransactionId.getOptional("pending_transaction_id") + + /** + * If the transfer is rejected by FedNow 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 rejection(): Optional = rejection.getOptional("rejection") + + /** + * The destination American Bankers' Association (ABA) Routing Transit Number (RTN). + * + * @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 routingNumber(): String = routingNumber.getRequired("routing_number") + + /** + * 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 FedNow, 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") + + /** + * The Transaction funding the transfer once it is complete. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_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") + + /** + * The Unique End-to-end Transaction Reference + * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) 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 uniqueEndToEndTransactionReference(): String = + uniqueEndToEndTransactionReference.getRequired("unique_end_to_end_transaction_reference") + + /** + * Unstructured information that will show on the recipient's bank statement. + * + * @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 unstructuredRemittanceInformation(): String = + unstructuredRemittanceInformation.getRequired("unstructured_remittance_information") + + /** + * 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 [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 [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_number") + @ExcludeMissing + fun _accountNumber(): JsonField = accountNumber + + /** + * Returns the raw JSON value of [acknowledgement]. + * + * Unlike [acknowledgement], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("acknowledgement") + @ExcludeMissing + fun _acknowledgement(): JsonField = acknowledgement + + /** + * 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 [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 [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * 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 [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") @ExcludeMissing fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_account_id") + @ExcludeMissing + fun _externalAccountId(): JsonField = externalAccountId + + /** + * 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 [pendingTransactionId]. + * + * Unlike [pendingTransactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pending_transaction_id") + @ExcludeMissing + fun _pendingTransactionId(): JsonField = pendingTransactionId + + /** + * Returns the raw JSON value of [rejection]. + * + * Unlike [rejection], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rejection") @ExcludeMissing fun _rejection(): JsonField = rejection + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber(): JsonField = routingNumber + + /** + * 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 [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * 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 + + /** + * Returns the raw JSON value of [uniqueEndToEndTransactionReference]. + * + * Unlike [uniqueEndToEndTransactionReference], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unique_end_to_end_transaction_reference") + @ExcludeMissing + fun _uniqueEndToEndTransactionReference(): JsonField = + uniqueEndToEndTransactionReference + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = unstructuredRemittanceInformation + + @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 [FednowTransfer]. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumber() + * .acknowledgement() + * .amount() + * .createdAt() + * .createdBy() + * .creditorName() + * .currency() + * .debtorName() + * .externalAccountId() + * .idempotencyKey() + * .pendingTransactionId() + * .rejection() + * .routingNumber() + * .sourceAccountNumberId() + * .status() + * .submission() + * .transactionId() + * .type() + * .uniqueEndToEndTransactionReference() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransfer]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var accountId: JsonField? = null + private var accountNumber: JsonField? = null + private var acknowledgement: JsonField? = null + private var amount: JsonField? = null + private var createdAt: JsonField? = null + private var createdBy: JsonField? = null + private var creditorName: JsonField? = null + private var currency: JsonField? = null + private var debtorName: JsonField? = null + private var externalAccountId: JsonField? = null + private var idempotencyKey: JsonField? = null + private var pendingTransactionId: JsonField? = null + private var rejection: JsonField? = null + private var routingNumber: JsonField? = null + private var sourceAccountNumberId: JsonField? = null + private var status: JsonField? = null + private var submission: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null + private var uniqueEndToEndTransactionReference: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransfer: FednowTransfer) = apply { + id = fednowTransfer.id + accountId = fednowTransfer.accountId + accountNumber = fednowTransfer.accountNumber + acknowledgement = fednowTransfer.acknowledgement + amount = fednowTransfer.amount + createdAt = fednowTransfer.createdAt + createdBy = fednowTransfer.createdBy + creditorName = fednowTransfer.creditorName + currency = fednowTransfer.currency + debtorName = fednowTransfer.debtorName + externalAccountId = fednowTransfer.externalAccountId + idempotencyKey = fednowTransfer.idempotencyKey + pendingTransactionId = fednowTransfer.pendingTransactionId + rejection = fednowTransfer.rejection + routingNumber = fednowTransfer.routingNumber + sourceAccountNumberId = fednowTransfer.sourceAccountNumberId + status = fednowTransfer.status + submission = fednowTransfer.submission + transactionId = fednowTransfer.transactionId + type = fednowTransfer.type + uniqueEndToEndTransactionReference = fednowTransfer.uniqueEndToEndTransactionReference + unstructuredRemittanceInformation = fednowTransfer.unstructuredRemittanceInformation + additionalProperties = fednowTransfer.additionalProperties.toMutableMap() + } + + /** The FedNow 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 } + + /** 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 destination account number. */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber + } + + /** + * If the transfer is acknowledged by the recipient bank, this will contain supplemental + * details. + */ + fun acknowledgement(acknowledgement: Acknowledgement?) = + acknowledgement(JsonField.ofNullable(acknowledgement)) + + /** Alias for calling [Builder.acknowledgement] with `acknowledgement.orElse(null)`. */ + fun acknowledgement(acknowledgement: Optional) = + acknowledgement(acknowledgement.getOrNull()) + + /** + * Sets [Builder.acknowledgement] to an arbitrary JSON value. + * + * You should usually call [Builder.acknowledgement] with a well-typed [Acknowledgement] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun acknowledgement(acknowledgement: JsonField) = apply { + this.acknowledgement = acknowledgement + } + + /** 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 } + + /** + * 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 name of the transfer's recipient. This is set by the sender when creating the + * transfer. + */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. + * For FedNow transfers this is always equal to `USD`. + */ + 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 } + + /** + * The name of the transfer's sender. If not provided, defaults to the name of the account's + * entity. + */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The identifier of the External Account the transfer was made to, if any. */ + fun externalAccountId(externalAccountId: String?) = + externalAccountId(JsonField.ofNullable(externalAccountId)) + + /** Alias for calling [Builder.externalAccountId] with `externalAccountId.orElse(null)`. */ + fun externalAccountId(externalAccountId: Optional) = + externalAccountId(externalAccountId.getOrNull()) + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + this.externalAccountId = externalAccountId + } + + /** + * 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 ID for the pending transaction representing the transfer. */ + fun pendingTransactionId(pendingTransactionId: String?) = + pendingTransactionId(JsonField.ofNullable(pendingTransactionId)) + + /** + * Alias for calling [Builder.pendingTransactionId] with + * `pendingTransactionId.orElse(null)`. + */ + fun pendingTransactionId(pendingTransactionId: Optional) = + pendingTransactionId(pendingTransactionId.getOrNull()) + + /** + * Sets [Builder.pendingTransactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.pendingTransactionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pendingTransactionId(pendingTransactionId: JsonField) = apply { + this.pendingTransactionId = pendingTransactionId + } + + /** + * If the transfer is rejected by FedNow or the destination financial institution, this will + * contain supplemental details. + */ + fun rejection(rejection: Rejection?) = rejection(JsonField.ofNullable(rejection)) + + /** Alias for calling [Builder.rejection] with `rejection.orElse(null)`. */ + fun rejection(rejection: Optional) = rejection(rejection.getOrNull()) + + /** + * Sets [Builder.rejection] to an arbitrary JSON value. + * + * You should usually call [Builder.rejection] with a well-typed [Rejection] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun rejection(rejection: JsonField) = apply { this.rejection = rejection } + + /** The destination American Bankers' Association (ABA) Routing Transit Number (RTN). */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } + + /** 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 FedNow, 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 } + + /** The Transaction funding the transfer once it is complete. */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_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 } + + /** + * The Unique End-to-end Transaction Reference + * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + * of the transfer. + */ + fun uniqueEndToEndTransactionReference(uniqueEndToEndTransactionReference: String) = + uniqueEndToEndTransactionReference(JsonField.of(uniqueEndToEndTransactionReference)) + + /** + * Sets [Builder.uniqueEndToEndTransactionReference] to an arbitrary JSON value. + * + * You should usually call [Builder.uniqueEndToEndTransactionReference] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun uniqueEndToEndTransactionReference( + uniqueEndToEndTransactionReference: JsonField + ) = apply { this.uniqueEndToEndTransactionReference = uniqueEndToEndTransactionReference } + + /** Unstructured information that will show on the recipient's bank statement. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [FednowTransfer]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumber() + * .acknowledgement() + * .amount() + * .createdAt() + * .createdBy() + * .creditorName() + * .currency() + * .debtorName() + * .externalAccountId() + * .idempotencyKey() + * .pendingTransactionId() + * .rejection() + * .routingNumber() + * .sourceAccountNumberId() + * .status() + * .submission() + * .transactionId() + * .type() + * .uniqueEndToEndTransactionReference() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransfer = + FednowTransfer( + checkRequired("id", id), + checkRequired("accountId", accountId), + checkRequired("accountNumber", accountNumber), + checkRequired("acknowledgement", acknowledgement), + checkRequired("amount", amount), + checkRequired("createdAt", createdAt), + checkRequired("createdBy", createdBy), + checkRequired("creditorName", creditorName), + checkRequired("currency", currency), + checkRequired("debtorName", debtorName), + checkRequired("externalAccountId", externalAccountId), + checkRequired("idempotencyKey", idempotencyKey), + checkRequired("pendingTransactionId", pendingTransactionId), + checkRequired("rejection", rejection), + checkRequired("routingNumber", routingNumber), + checkRequired("sourceAccountNumberId", sourceAccountNumberId), + checkRequired("status", status), + checkRequired("submission", submission), + checkRequired("transactionId", transactionId), + checkRequired("type", type), + checkRequired( + "uniqueEndToEndTransactionReference", + uniqueEndToEndTransactionReference, + ), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): FednowTransfer = apply { + if (validated) { + return@apply + } + + id() + accountId() + accountNumber() + acknowledgement().ifPresent { it.validate() } + amount() + createdAt() + createdBy().ifPresent { it.validate() } + creditorName() + currency().validate() + debtorName() + externalAccountId() + idempotencyKey() + pendingTransactionId() + rejection().ifPresent { it.validate() } + routingNumber() + sourceAccountNumberId() + status().validate() + submission().ifPresent { it.validate() } + transactionId() + type().validate() + uniqueEndToEndTransactionReference() + unstructuredRemittanceInformation() + 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) + + (if (accountId.asKnown().isPresent) 1 else 0) + + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (acknowledgement.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (createdBy.asKnown().getOrNull()?.validity() ?: 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (externalAccountId.asKnown().isPresent) 1 else 0) + + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + + (rejection.asKnown().getOrNull()?.validity() ?: 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (submission.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (uniqueEndToEndTransactionReference.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + /** + * If the transfer is acknowledged by the recipient bank, this will contain supplemental + * details. + */ + class Acknowledgement + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val acknowledgedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("acknowledged_at") + @ExcludeMissing + acknowledgedAt: JsonField = JsonMissing.of() + ) : this(acknowledgedAt, mutableMapOf()) + + /** + * When the transfer was acknowledged. + * + * @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 acknowledgedAt(): OffsetDateTime = acknowledgedAt.getRequired("acknowledged_at") + + /** + * Returns the raw JSON value of [acknowledgedAt]. + * + * Unlike [acknowledgedAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("acknowledged_at") + @ExcludeMissing + fun _acknowledgedAt(): JsonField = acknowledgedAt + + @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 [Acknowledgement]. + * + * The following fields are required: + * ```java + * .acknowledgedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Acknowledgement]. */ + class Builder internal constructor() { + + private var acknowledgedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(acknowledgement: Acknowledgement) = apply { + acknowledgedAt = acknowledgement.acknowledgedAt + additionalProperties = acknowledgement.additionalProperties.toMutableMap() + } + + /** When the transfer was acknowledged. */ + fun acknowledgedAt(acknowledgedAt: OffsetDateTime) = + acknowledgedAt(JsonField.of(acknowledgedAt)) + + /** + * Sets [Builder.acknowledgedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.acknowledgedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun acknowledgedAt(acknowledgedAt: JsonField) = apply { + this.acknowledgedAt = acknowledgedAt + } + + 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 [Acknowledgement]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .acknowledgedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Acknowledgement = + Acknowledgement( + checkRequired("acknowledgedAt", acknowledgedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Acknowledgement = apply { + if (validated) { + return@apply + } + + acknowledgedAt() + 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 (acknowledgedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Acknowledgement && + acknowledgedAt == other.acknowledgedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(acknowledgedAt, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Acknowledgement{acknowledgedAt=$acknowledgedAt, additionalProperties=$additionalProperties}" + } + + /** What object created the transfer, either via the API or the dashboard. */ + class CreatedBy + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + 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) = apply { this.category = category } + + /** If present, details about the OAuth Application that created the transfer. */ + fun oauthApplication(oauthApplication: OAuthApplication?) = + oauthApplication(JsonField.ofNullable(oauthApplication)) + + /** + * Alias for calling [Builder.oauthApplication] with `oauthApplication.orElse(null)`. + */ + fun oauthApplication(oauthApplication: Optional) = + oauthApplication(oauthApplication.getOrNull()) + + /** + * Sets [Builder.oauthApplication] to an arbitrary JSON value. + * + * You should usually call [Builder.oauthApplication] with a well-typed + * [OAuthApplication] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun oauthApplication(oauthApplication: JsonField) = apply { + this.oauthApplication = oauthApplication + } + + /** If present, details about the User that created the transfer. */ + fun user(user: User?) = user(JsonField.ofNullable(user)) + + /** Alias for calling [Builder.user] with `user.orElse(null)`. */ + fun user(user: Optional) = user(user.getOrNull()) + + /** + * Sets [Builder.user] to an arbitrary JSON value. + * + * You should usually call [Builder.user] with a well-typed [User] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun user(user: JsonField) = apply { this.user = user } + + 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 [CreatedBy]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .apiKey() + * .category() + * .oauthApplication() + * .user() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreatedBy = + CreatedBy( + checkRequired("apiKey", apiKey), + checkRequired("category", category), + checkRequired("oauthApplication", oauthApplication), + checkRequired("user", user), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreatedBy = apply { + if (validated) { + return@apply + } + + apiKey().ifPresent { it.validate() } + category().validate() + oauthApplication().ifPresent { it.validate() } + user().ifPresent { it.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 = + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + + (user.asKnown().getOrNull()?.validity() ?: 0) + + /** If present, details about the API key that created the transfer. */ + class ApiKey + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val description: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of() + ) : this(description, mutableMapOf()) + + /** + * The description set for the API key when it was created. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun description(): Optional = description.getOptional("description") + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + @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 [ApiKey]. + * + * The following fields are required: + * ```java + * .description() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ApiKey]. */ + class Builder internal constructor() { + + private var description: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(apiKey: ApiKey) = apply { + description = apiKey.description + additionalProperties = apiKey.additionalProperties.toMutableMap() + } + + /** The description set for the API key when it was created. */ + fun description(description: String?) = + description(JsonField.ofNullable(description)) + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = + description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + 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 [ApiKey]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .description() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ApiKey = + ApiKey( + checkRequired("description", description), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ApiKey = apply { + if (validated) { + return@apply + } + + description() + 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 (description.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ApiKey && + description == other.description && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(description, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ApiKey{description=$description, additionalProperties=$additionalProperties}" + } + + /** The type of object that created this transfer. */ + class Category @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 { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] 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 { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] 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) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + 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) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $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(): Category = 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** If present, details about the OAuth Application that created the transfer. */ + class OAuthApplication + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of() + ) : this(name, mutableMapOf()) + + /** + * The name of the OAuth Application. + * + * @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 name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [OAuthApplication]. + * + * The following fields are required: + * ```java + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthApplication]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(oauthApplication: OAuthApplication) = apply { + name = oauthApplication.name + additionalProperties = oauthApplication.additionalProperties.toMutableMap() + } + + /** The name of the OAuth Application. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [OAuthApplication]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthApplication = + OAuthApplication( + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): OAuthApplication = apply { + if (validated) { + return@apply + } + + name() + 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 (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthApplication && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "OAuthApplication{name=$name, additionalProperties=$additionalProperties}" + } + + /** If present, details about the User that created the transfer. */ + class User + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val email: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("email") @ExcludeMissing email: JsonField = JsonMissing.of() + ) : this(email, mutableMapOf()) + + /** + * The email address of the User. + * + * @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 email(): String = email.getRequired("email") + + /** + * Returns the raw JSON value of [email]. + * + * Unlike [email], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("email") @ExcludeMissing fun _email(): JsonField = email + + @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 [User]. + * + * The following fields are required: + * ```java + * .email() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [User]. */ + class Builder internal constructor() { + + private var email: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(user: User) = apply { + email = user.email + additionalProperties = user.additionalProperties.toMutableMap() + } + + /** The email address of the User. */ + fun email(email: String) = email(JsonField.of(email)) + + /** + * Sets [Builder.email] to an arbitrary JSON value. + * + * You should usually call [Builder.email] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun email(email: JsonField) = apply { this.email = email } + + 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 [User]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .email() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): User = + User(checkRequired("email", email), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): User = apply { + if (validated) { + return@apply + } + + email() + 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 (email.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is User && + email == other.email && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(email, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "User{email=$email, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedBy && + apiKey == other.apiKey && + category == other.category && + oauthApplication == other.oauthApplication && + user == other.user && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * FedNow transfers this is always equal to `USD`. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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(): Currency = 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * If the transfer is rejected by FedNow or the destination financial institution, this will + * contain supplemental details. + */ + class Rejection + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val rejectReasonAdditionalInformation: JsonField, + private val rejectReasonCode: JsonField, + private val rejectedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reject_reason_additional_information") + @ExcludeMissing + rejectReasonAdditionalInformation: JsonField = JsonMissing.of(), + @JsonProperty("reject_reason_code") + @ExcludeMissing + rejectReasonCode: JsonField = JsonMissing.of(), + @JsonProperty("rejected_at") + @ExcludeMissing + rejectedAt: JsonField = JsonMissing.of(), + ) : this(rejectReasonAdditionalInformation, rejectReasonCode, rejectedAt, mutableMapOf()) + + /** + * Additional information about the rejection provided by the recipient bank. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun rejectReasonAdditionalInformation(): Optional = + rejectReasonAdditionalInformation.getOptional("reject_reason_additional_information") + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + * + * @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 rejectReasonCode(): RejectReasonCode = + rejectReasonCode.getRequired("reject_reason_code") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was rejected. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun rejectedAt(): Optional = rejectedAt.getOptional("rejected_at") + + /** + * Returns the raw JSON value of [rejectReasonAdditionalInformation]. + * + * Unlike [rejectReasonAdditionalInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("reject_reason_additional_information") + @ExcludeMissing + fun _rejectReasonAdditionalInformation(): JsonField = + rejectReasonAdditionalInformation + + /** + * Returns the raw JSON value of [rejectReasonCode]. + * + * Unlike [rejectReasonCode], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reject_reason_code") + @ExcludeMissing + fun _rejectReasonCode(): JsonField = rejectReasonCode + + /** + * Returns the raw JSON value of [rejectedAt]. + * + * Unlike [rejectedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rejected_at") + @ExcludeMissing + fun _rejectedAt(): JsonField = rejectedAt + + @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 [Rejection]. + * + * The following fields are required: + * ```java + * .rejectReasonAdditionalInformation() + * .rejectReasonCode() + * .rejectedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Rejection]. */ + class Builder internal constructor() { + + private var rejectReasonAdditionalInformation: JsonField? = null + private var rejectReasonCode: JsonField? = null + private var rejectedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(rejection: Rejection) = apply { + rejectReasonAdditionalInformation = rejection.rejectReasonAdditionalInformation + rejectReasonCode = rejection.rejectReasonCode + rejectedAt = rejection.rejectedAt + additionalProperties = rejection.additionalProperties.toMutableMap() + } + + /** Additional information about the rejection provided by the recipient bank. */ + fun rejectReasonAdditionalInformation(rejectReasonAdditionalInformation: String?) = + rejectReasonAdditionalInformation( + JsonField.ofNullable(rejectReasonAdditionalInformation) + ) + + /** + * Alias for calling [Builder.rejectReasonAdditionalInformation] with + * `rejectReasonAdditionalInformation.orElse(null)`. + */ + fun rejectReasonAdditionalInformation( + rejectReasonAdditionalInformation: Optional + ) = rejectReasonAdditionalInformation(rejectReasonAdditionalInformation.getOrNull()) + + /** + * Sets [Builder.rejectReasonAdditionalInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectReasonAdditionalInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun rejectReasonAdditionalInformation( + rejectReasonAdditionalInformation: JsonField + ) = apply { this.rejectReasonAdditionalInformation = rejectReasonAdditionalInformation } + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + */ + fun rejectReasonCode(rejectReasonCode: RejectReasonCode) = + rejectReasonCode(JsonField.of(rejectReasonCode)) + + /** + * Sets [Builder.rejectReasonCode] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectReasonCode] with a well-typed + * [RejectReasonCode] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun rejectReasonCode(rejectReasonCode: JsonField) = apply { + this.rejectReasonCode = rejectReasonCode + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was rejected. + */ + fun rejectedAt(rejectedAt: OffsetDateTime?) = + rejectedAt(JsonField.ofNullable(rejectedAt)) + + /** Alias for calling [Builder.rejectedAt] with `rejectedAt.orElse(null)`. */ + fun rejectedAt(rejectedAt: Optional) = + rejectedAt(rejectedAt.getOrNull()) + + /** + * Sets [Builder.rejectedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun rejectedAt(rejectedAt: JsonField) = apply { + this.rejectedAt = rejectedAt + } + + 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 [Rejection]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .rejectReasonAdditionalInformation() + * .rejectReasonCode() + * .rejectedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Rejection = + Rejection( + checkRequired( + "rejectReasonAdditionalInformation", + rejectReasonAdditionalInformation, + ), + checkRequired("rejectReasonCode", rejectReasonCode), + checkRequired("rejectedAt", rejectedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Rejection = apply { + if (validated) { + return@apply + } + + rejectReasonAdditionalInformation() + rejectReasonCode().validate() + rejectedAt() + 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 (rejectReasonAdditionalInformation.asKnown().isPresent) 1 else 0) + + (rejectReasonCode.asKnown().getOrNull()?.validity() ?: 0) + + (if (rejectedAt.asKnown().isPresent) 1 else 0) + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + */ + class RejectReasonCode + @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 destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + @JvmField val ACCOUNT_CLOSED = of("account_closed") + + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + @JvmField val ACCOUNT_BLOCKED = of("account_blocked") + + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + @JvmField val INVALID_CREDITOR_ACCOUNT_TYPE = of("invalid_creditor_account_type") + + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + @JvmField + val INVALID_CREDITOR_ACCOUNT_NUMBER = of("invalid_creditor_account_number") + + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + @JvmField + val INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER = + of("invalid_creditor_financial_institution_identifier") + + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + @JvmField val END_CUSTOMER_DECEASED = of("end_customer_deceased") + + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + @JvmField val NARRATIVE = of("narrative") + + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + @JvmField val TRANSACTION_FORBIDDEN = of("transaction_forbidden") + + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + @JvmField val TRANSACTION_TYPE_NOT_SUPPORTED = of("transaction_type_not_supported") + + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + @JvmField val AMOUNT_EXCEEDS_BANK_LIMITS = of("amount_exceeds_bank_limits") + + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + @JvmField val INVALID_CREDITOR_ADDRESS = of("invalid_creditor_address") + + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + @JvmField val INVALID_DEBTOR_ADDRESS = of("invalid_debtor_address") + + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + @JvmField val TIMEOUT = of("timeout") + + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + @JvmField val PROCESSING_ERROR = of("processing_error") + + /** Some other error or issue has occurred. */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = RejectReasonCode(JsonField.of(value)) + } + + /** An enum containing [RejectReasonCode]'s known values. */ + enum class Known { + /** + * The destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + ACCOUNT_CLOSED, + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + ACCOUNT_BLOCKED, + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + INVALID_CREDITOR_ACCOUNT_TYPE, + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + INVALID_CREDITOR_ACCOUNT_NUMBER, + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER, + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + END_CUSTOMER_DECEASED, + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + NARRATIVE, + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + TRANSACTION_FORBIDDEN, + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + TRANSACTION_TYPE_NOT_SUPPORTED, + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + AMOUNT_EXCEEDS_BANK_LIMITS, + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + INVALID_CREDITOR_ADDRESS, + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + INVALID_DEBTOR_ADDRESS, + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + TIMEOUT, + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + PROCESSING_ERROR, + /** Some other error or issue has occurred. */ + OTHER, + } + + /** + * An enum containing [RejectReasonCode]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [RejectReasonCode] 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 destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + ACCOUNT_CLOSED, + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + ACCOUNT_BLOCKED, + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + INVALID_CREDITOR_ACCOUNT_TYPE, + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + INVALID_CREDITOR_ACCOUNT_NUMBER, + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER, + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + END_CUSTOMER_DECEASED, + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + NARRATIVE, + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + TRANSACTION_FORBIDDEN, + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + TRANSACTION_TYPE_NOT_SUPPORTED, + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + AMOUNT_EXCEEDS_BANK_LIMITS, + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + INVALID_CREDITOR_ADDRESS, + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + INVALID_DEBTOR_ADDRESS, + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + TIMEOUT, + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + PROCESSING_ERROR, + /** Some other error or issue has occurred. */ + OTHER, + /** + * An enum member indicating that [RejectReasonCode] 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_CLOSED -> Value.ACCOUNT_CLOSED + ACCOUNT_BLOCKED -> Value.ACCOUNT_BLOCKED + INVALID_CREDITOR_ACCOUNT_TYPE -> Value.INVALID_CREDITOR_ACCOUNT_TYPE + INVALID_CREDITOR_ACCOUNT_NUMBER -> Value.INVALID_CREDITOR_ACCOUNT_NUMBER + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER -> + Value.INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER + END_CUSTOMER_DECEASED -> Value.END_CUSTOMER_DECEASED + NARRATIVE -> Value.NARRATIVE + TRANSACTION_FORBIDDEN -> Value.TRANSACTION_FORBIDDEN + TRANSACTION_TYPE_NOT_SUPPORTED -> Value.TRANSACTION_TYPE_NOT_SUPPORTED + AMOUNT_EXCEEDS_BANK_LIMITS -> Value.AMOUNT_EXCEEDS_BANK_LIMITS + INVALID_CREDITOR_ADDRESS -> Value.INVALID_CREDITOR_ADDRESS + INVALID_DEBTOR_ADDRESS -> Value.INVALID_DEBTOR_ADDRESS + TIMEOUT -> Value.TIMEOUT + PROCESSING_ERROR -> Value.PROCESSING_ERROR + OTHER -> Value.OTHER + 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_CLOSED -> Known.ACCOUNT_CLOSED + ACCOUNT_BLOCKED -> Known.ACCOUNT_BLOCKED + INVALID_CREDITOR_ACCOUNT_TYPE -> Known.INVALID_CREDITOR_ACCOUNT_TYPE + INVALID_CREDITOR_ACCOUNT_NUMBER -> Known.INVALID_CREDITOR_ACCOUNT_NUMBER + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER -> + Known.INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER + END_CUSTOMER_DECEASED -> Known.END_CUSTOMER_DECEASED + NARRATIVE -> Known.NARRATIVE + TRANSACTION_FORBIDDEN -> Known.TRANSACTION_FORBIDDEN + TRANSACTION_TYPE_NOT_SUPPORTED -> Known.TRANSACTION_TYPE_NOT_SUPPORTED + AMOUNT_EXCEEDS_BANK_LIMITS -> Known.AMOUNT_EXCEEDS_BANK_LIMITS + INVALID_CREDITOR_ADDRESS -> Known.INVALID_CREDITOR_ADDRESS + INVALID_DEBTOR_ADDRESS -> Known.INVALID_DEBTOR_ADDRESS + TIMEOUT -> Known.TIMEOUT + PROCESSING_ERROR -> Known.PROCESSING_ERROR + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown RejectReasonCode: $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(): RejectReasonCode = 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 RejectReasonCode && 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 Rejection && + rejectReasonAdditionalInformation == other.rejectReasonAdditionalInformation && + rejectReasonCode == other.rejectReasonCode && + rejectedAt == other.rejectedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + rejectReasonAdditionalInformation, + rejectReasonCode, + rejectedAt, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Rejection{rejectReasonAdditionalInformation=$rejectReasonAdditionalInformation, rejectReasonCode=$rejectReasonCode, rejectedAt=$rejectedAt, additionalProperties=$additionalProperties}" + } + + /** The lifecycle status of the transfer. */ + class Status @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 transfer is pending review by Increase. */ + @JvmField val PENDING_REVIEWING = of("pending_reviewing") + + /** The transfer has been canceled. */ + @JvmField val CANCELED = of("canceled") + + /** The transfer has been rejected by Increase. */ + @JvmField val REVIEWING_REJECTED = of("reviewing_rejected") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + /** The transfer is pending approval. */ + @JvmField val PENDING_APPROVAL = of("pending_approval") + + /** The transfer is queued to be submitted to FedNow. */ + @JvmField val PENDING_SUBMITTING = of("pending_submitting") + + /** The transfer has been submitted and is pending a response from FedNow. */ + @JvmField val PENDING_RESPONSE = of("pending_response") + + /** The transfer has been sent successfully and is complete. */ + @JvmField val COMPLETE = of("complete") + + /** The transfer was rejected by the network or the recipient's bank. */ + @JvmField val REJECTED = of("rejected") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] 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 transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING_REVIEWING -> Value.PENDING_REVIEWING + CANCELED -> Value.CANCELED + REVIEWING_REJECTED -> Value.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + PENDING_APPROVAL -> Value.PENDING_APPROVAL + PENDING_SUBMITTING -> Value.PENDING_SUBMITTING + PENDING_RESPONSE -> Value.PENDING_RESPONSE + COMPLETE -> Value.COMPLETE + REJECTED -> Value.REJECTED + 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) { + PENDING_REVIEWING -> Known.PENDING_REVIEWING + CANCELED -> Known.CANCELED + REVIEWING_REJECTED -> Known.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + PENDING_APPROVAL -> Known.PENDING_APPROVAL + PENDING_SUBMITTING -> Known.PENDING_SUBMITTING + PENDING_RESPONSE -> Known.PENDING_RESPONSE + COMPLETE -> Known.COMPLETE + REJECTED -> Known.REJECTED + else -> throw IncreaseInvalidDataException("Unknown Status: $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(): Status = 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 Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** After the transfer is submitted to FedNow, this will contain supplemental details. */ + class Submission + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val messageIdentification: JsonField, + private val submittedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("message_identification") + @ExcludeMissing + messageIdentification: JsonField = JsonMissing.of(), + @JsonProperty("submitted_at") + @ExcludeMissing + submittedAt: JsonField = JsonMissing.of(), + ) : this(messageIdentification, submittedAt, mutableMapOf()) + + /** + * The FedNow network identification of the message submitted. + * + * @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 messageIdentification(): String = + messageIdentification.getRequired("message_identification") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was submitted to FedNow. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun submittedAt(): Optional = submittedAt.getOptional("submitted_at") + + /** + * Returns the raw JSON value of [messageIdentification]. + * + * Unlike [messageIdentification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("message_identification") + @ExcludeMissing + fun _messageIdentification(): JsonField = messageIdentification + + /** + * Returns the raw JSON value of [submittedAt]. + * + * Unlike [submittedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("submitted_at") + @ExcludeMissing + fun _submittedAt(): JsonField = submittedAt + + @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 [Submission]. + * + * The following fields are required: + * ```java + * .messageIdentification() + * .submittedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Submission]. */ + class Builder internal constructor() { + + private var messageIdentification: JsonField? = null + private var submittedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(submission: Submission) = apply { + messageIdentification = submission.messageIdentification + submittedAt = submission.submittedAt + additionalProperties = submission.additionalProperties.toMutableMap() + } + + /** The FedNow network identification of the message submitted. */ + fun messageIdentification(messageIdentification: String) = + messageIdentification(JsonField.of(messageIdentification)) + + /** + * Sets [Builder.messageIdentification] to an arbitrary JSON value. + * + * You should usually call [Builder.messageIdentification] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun messageIdentification(messageIdentification: JsonField) = apply { + this.messageIdentification = messageIdentification + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was submitted to FedNow. + */ + fun submittedAt(submittedAt: OffsetDateTime?) = + submittedAt(JsonField.ofNullable(submittedAt)) + + /** Alias for calling [Builder.submittedAt] with `submittedAt.orElse(null)`. */ + fun submittedAt(submittedAt: Optional) = + submittedAt(submittedAt.getOrNull()) + + /** + * Sets [Builder.submittedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.submittedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun submittedAt(submittedAt: JsonField) = apply { + this.submittedAt = submittedAt + } + + 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 [Submission]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .messageIdentification() + * .submittedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Submission = + Submission( + checkRequired("messageIdentification", messageIdentification), + checkRequired("submittedAt", submittedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Submission = apply { + if (validated) { + return@apply + } + + messageIdentification() + submittedAt() + 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 (messageIdentification.asKnown().isPresent) 1 else 0) + + (if (submittedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Submission && + messageIdentification == other.messageIdentification && + submittedAt == other.submittedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(messageIdentification, submittedAt, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Submission{messageIdentification=$messageIdentification, submittedAt=$submittedAt, additionalProperties=$additionalProperties}" + } + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_transfer`. + */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val FEDNOW_TRANSFER = of("fednow_transfer") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + FEDNOW_TRANSFER + } + + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + FEDNOW_TRANSFER, + /** An enum member indicating that [Type] 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) { + FEDNOW_TRANSFER -> Value.FEDNOW_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) { + FEDNOW_TRANSFER -> Known.FEDNOW_TRANSFER + else -> throw IncreaseInvalidDataException("Unknown Type: $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(): Type = 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 Type && 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 FednowTransfer && + id == other.id && + accountId == other.accountId && + accountNumber == other.accountNumber && + acknowledgement == other.acknowledgement && + amount == other.amount && + createdAt == other.createdAt && + createdBy == other.createdBy && + creditorName == other.creditorName && + currency == other.currency && + debtorName == other.debtorName && + externalAccountId == other.externalAccountId && + idempotencyKey == other.idempotencyKey && + pendingTransactionId == other.pendingTransactionId && + rejection == other.rejection && + routingNumber == other.routingNumber && + sourceAccountNumberId == other.sourceAccountNumberId && + status == other.status && + submission == other.submission && + transactionId == other.transactionId && + type == other.type && + uniqueEndToEndTransactionReference == other.uniqueEndToEndTransactionReference && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + accountId, + accountNumber, + acknowledgement, + amount, + createdAt, + createdBy, + creditorName, + currency, + debtorName, + externalAccountId, + idempotencyKey, + pendingTransactionId, + rejection, + routingNumber, + sourceAccountNumberId, + status, + submission, + transactionId, + type, + uniqueEndToEndTransactionReference, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FednowTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, acknowledgement=$acknowledgement, amount=$amount, createdAt=$createdAt, createdBy=$createdBy, creditorName=$creditorName, currency=$currency, debtorName=$debtorName, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, pendingTransactionId=$pendingTransactionId, rejection=$rejection, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, uniqueEndToEndTransactionReference=$uniqueEndToEndTransactionReference, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt new file mode 100644 index 000000000..f1fbb4299 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Approve a FedNow Transfer */ +class FednowTransferApproveParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + /** The identifier of the FedNow Transfer to approve. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferApproveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferApproveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferApproveParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferApproveParams: FednowTransferApproveParams) = apply { + fednowTransferId = fednowTransferApproveParams.fednowTransferId + additionalHeaders = fednowTransferApproveParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferApproveParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + fednowTransferApproveParams.additionalBodyProperties.toMutableMap() + } + + /** The identifier of the FedNow Transfer to approve. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [FednowTransferApproveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferApproveParams = + FednowTransferApproveParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferApproveParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash( + fednowTransferId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) + + override fun toString() = + "FednowTransferApproveParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt new file mode 100644 index 000000000..bbcbb6f04 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Cancel a pending FedNow Transfer */ +class FednowTransferCancelParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + /** The identifier of the pending FedNow Transfer to cancel. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferCancelParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferCancelParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferCancelParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferCancelParams: FednowTransferCancelParams) = apply { + fednowTransferId = fednowTransferCancelParams.fednowTransferId + additionalHeaders = fednowTransferCancelParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferCancelParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + fednowTransferCancelParams.additionalBodyProperties.toMutableMap() + } + + /** The identifier of the pending FedNow Transfer to cancel. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [FednowTransferCancelParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferCancelParams = + FednowTransferCancelParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferCancelParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash( + fednowTransferId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) + + override fun toString() = + "FednowTransferCancelParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt new file mode 100644 index 000000000..5448ef511 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt @@ -0,0 +1,1838 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.checkRequired +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Create a FedNow Transfer */ +class FednowTransferCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The identifier for the account that will send 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 accountId(): String = body.accountId() + + /** + * The amount, in minor units, to send to the creditor. + * + * @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 = body.amount() + + /** + * The creditor's name. + * + * @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 creditorName(): String = body.creditorName() + + /** + * The debtor's name. + * + * @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 debtorName(): String = body.debtorName() + + /** + * The Account Number to include in the transfer as the debtor's account number. + * + * @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 = body.sourceAccountNumberId() + + /** + * Unstructured remittance information to include in 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 unstructuredRemittanceInformation(): String = body.unstructuredRemittanceInformation() + + /** + * The creditor's account number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accountNumber(): Optional = body.accountNumber() + + /** + * The creditor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditorAddress(): Optional = body.creditorAddress() + + /** + * The debtor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorAddress(): Optional = body.debtorAddress() + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalAccountId(): Optional = body.externalAccountId() + + /** + * Whether the transfer requires explicit approval via the dashboard or API. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun requireApproval(): Optional = body.requireApproval() + + /** + * The creditor's bank account routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun routingNumber(): Optional = body.routingNumber() + + /** + * Returns the raw JSON value of [accountId]. + * + * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountId(): JsonField = body._accountId() + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + + /** + * Returns the raw JSON value of [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _creditorName(): JsonField = body._creditorName() + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorName(): JsonField = body._debtorName() + + /** + * Returns the raw JSON value of [sourceAccountNumberId]. + * + * Unlike [sourceAccountNumberId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _sourceAccountNumberId(): JsonField = body._sourceAccountNumberId() + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + fun _unstructuredRemittanceInformation(): JsonField = + body._unstructuredRemittanceInformation() + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountNumber(): JsonField = body._accountNumber() + + /** + * Returns the raw JSON value of [creditorAddress]. + * + * Unlike [creditorAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _creditorAddress(): JsonField = body._creditorAddress() + + /** + * Returns the raw JSON value of [debtorAddress]. + * + * Unlike [debtorAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorAddress(): JsonField = body._debtorAddress() + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _externalAccountId(): JsonField = body._externalAccountId() + + /** + * Returns the raw JSON value of [requireApproval]. + * + * Unlike [requireApproval], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _requireApproval(): JsonField = body._requireApproval() + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _routingNumber(): JsonField = body._routingNumber() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferCreateParams]. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferCreateParams: FednowTransferCreateParams) = apply { + body = fednowTransferCreateParams.body.toBuilder() + additionalHeaders = fednowTransferCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [accountId] + * - [amount] + * - [creditorName] + * - [debtorName] + * - [sourceAccountNumberId] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The identifier for the account that will send the transfer. */ + fun accountId(accountId: String) = apply { body.accountId(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 { body.accountId(accountId) } + + /** The amount, in minor units, to send to the creditor. */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + + /** The creditor's name. */ + fun creditorName(creditorName: String) = apply { body.creditorName(creditorName) } + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + body.creditorName(creditorName) + } + + /** The debtor's name. */ + fun debtorName(debtorName: String) = apply { body.debtorName(debtorName) } + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { body.debtorName(debtorName) } + + /** The Account Number to include in the transfer as the debtor's account number. */ + fun sourceAccountNumberId(sourceAccountNumberId: String) = apply { + body.sourceAccountNumberId(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 { + body.sourceAccountNumberId(sourceAccountNumberId) + } + + /** Unstructured remittance information to include in the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = apply { + body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) + } + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) } + + /** The creditor's account number. */ + fun accountNumber(accountNumber: String) = apply { body.accountNumber(accountNumber) } + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + body.accountNumber(accountNumber) + } + + /** The creditor's address. */ + fun creditorAddress(creditorAddress: CreditorAddress) = apply { + body.creditorAddress(creditorAddress) + } + + /** + * Sets [Builder.creditorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorAddress] with a well-typed [CreditorAddress] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun creditorAddress(creditorAddress: JsonField) = apply { + body.creditorAddress(creditorAddress) + } + + /** The debtor's address. */ + fun debtorAddress(debtorAddress: DebtorAddress) = apply { + body.debtorAddress(debtorAddress) + } + + /** + * Sets [Builder.debtorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAddress] with a well-typed [DebtorAddress] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAddress(debtorAddress: JsonField) = apply { + body.debtorAddress(debtorAddress) + } + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + */ + fun externalAccountId(externalAccountId: String) = apply { + body.externalAccountId(externalAccountId) + } + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + body.externalAccountId(externalAccountId) + } + + /** Whether the transfer requires explicit approval via the dashboard or API. */ + fun requireApproval(requireApproval: Boolean) = apply { + body.requireApproval(requireApproval) + } + + /** + * Sets [Builder.requireApproval] to an arbitrary JSON value. + * + * You should usually call [Builder.requireApproval] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun requireApproval(requireApproval: JsonField) = apply { + body.requireApproval(requireApproval) + } + + /** The creditor's bank account routing number. */ + fun routingNumber(routingNumber: String) = apply { body.routingNumber(routingNumber) } + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + body.routingNumber(routingNumber) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferCreateParams = + FednowTransferCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val accountId: JsonField, + private val amount: JsonField, + private val creditorName: JsonField, + private val debtorName: JsonField, + private val sourceAccountNumberId: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val accountNumber: JsonField, + private val creditorAddress: JsonField, + private val debtorAddress: JsonField, + private val externalAccountId: JsonField, + private val requireApproval: JsonField, + private val routingNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("account_id") + @ExcludeMissing + accountId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("source_account_number_id") + @ExcludeMissing + sourceAccountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("creditor_address") + @ExcludeMissing + creditorAddress: JsonField = JsonMissing.of(), + @JsonProperty("debtor_address") + @ExcludeMissing + debtorAddress: JsonField = JsonMissing.of(), + @JsonProperty("external_account_id") + @ExcludeMissing + externalAccountId: JsonField = JsonMissing.of(), + @JsonProperty("require_approval") + @ExcludeMissing + requireApproval: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + routingNumber: JsonField = JsonMissing.of(), + ) : this( + accountId, + amount, + creditorName, + debtorName, + sourceAccountNumberId, + unstructuredRemittanceInformation, + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + mutableMapOf(), + ) + + /** + * The identifier for the account that will send 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 accountId(): String = accountId.getRequired("account_id") + + /** + * The amount, in minor units, to send to the creditor. + * + * @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") + + /** + * The creditor's name. + * + * @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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The debtor's name. + * + * @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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The Account Number to include in the transfer as the debtor's account number. + * + * @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") + + /** + * Unstructured remittance information to include in 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 unstructuredRemittanceInformation(): String = + unstructuredRemittanceInformation.getRequired("unstructured_remittance_information") + + /** + * The creditor's account number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun accountNumber(): Optional = accountNumber.getOptional("account_number") + + /** + * The creditor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun creditorAddress(): Optional = + creditorAddress.getOptional("creditor_address") + + /** + * The debtor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorAddress(): Optional = debtorAddress.getOptional("debtor_address") + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalAccountId(): Optional = + externalAccountId.getOptional("external_account_id") + + /** + * Whether the transfer requires explicit approval via the dashboard or API. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun requireApproval(): Optional = requireApproval.getOptional("require_approval") + + /** + * The creditor's bank account routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun routingNumber(): Optional = routingNumber.getOptional("routing_number") + + /** + * 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 [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") + @ExcludeMissing + fun _debtorName(): JsonField = debtorName + + /** + * 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 [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = + unstructuredRemittanceInformation + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("account_number") + @ExcludeMissing + fun _accountNumber(): JsonField = accountNumber + + /** + * Returns the raw JSON value of [creditorAddress]. + * + * Unlike [creditorAddress], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("creditor_address") + @ExcludeMissing + fun _creditorAddress(): JsonField = creditorAddress + + /** + * Returns the raw JSON value of [debtorAddress]. + * + * Unlike [debtorAddress], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_address") + @ExcludeMissing + fun _debtorAddress(): JsonField = debtorAddress + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_account_id") + @ExcludeMissing + fun _externalAccountId(): JsonField = externalAccountId + + /** + * Returns the raw JSON value of [requireApproval]. + * + * Unlike [requireApproval], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("require_approval") + @ExcludeMissing + fun _requireApproval(): JsonField = requireApproval + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber(): JsonField = routingNumber + + @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 [Body]. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var accountId: JsonField? = null + private var amount: JsonField? = null + private var creditorName: JsonField? = null + private var debtorName: JsonField? = null + private var sourceAccountNumberId: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var accountNumber: JsonField = JsonMissing.of() + private var creditorAddress: JsonField = JsonMissing.of() + private var debtorAddress: JsonField = JsonMissing.of() + private var externalAccountId: JsonField = JsonMissing.of() + private var requireApproval: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + accountId = body.accountId + amount = body.amount + creditorName = body.creditorName + debtorName = body.debtorName + sourceAccountNumberId = body.sourceAccountNumberId + unstructuredRemittanceInformation = body.unstructuredRemittanceInformation + accountNumber = body.accountNumber + creditorAddress = body.creditorAddress + debtorAddress = body.debtorAddress + externalAccountId = body.externalAccountId + requireApproval = body.requireApproval + routingNumber = body.routingNumber + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The identifier for the account that will send the transfer. */ + 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 amount, in minor units, to send to the creditor. */ + 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 } + + /** The creditor's name. */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** The debtor's name. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The Account Number to include in the transfer as the debtor's account number. */ + 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 + } + + /** Unstructured remittance information to include in the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + /** The creditor's account number. */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber + } + + /** The creditor's address. */ + fun creditorAddress(creditorAddress: CreditorAddress) = + creditorAddress(JsonField.of(creditorAddress)) + + /** + * Sets [Builder.creditorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorAddress] with a well-typed [CreditorAddress] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun creditorAddress(creditorAddress: JsonField) = apply { + this.creditorAddress = creditorAddress + } + + /** The debtor's address. */ + fun debtorAddress(debtorAddress: DebtorAddress) = + debtorAddress(JsonField.of(debtorAddress)) + + /** + * Sets [Builder.debtorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAddress] with a well-typed [DebtorAddress] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorAddress(debtorAddress: JsonField) = apply { + this.debtorAddress = debtorAddress + } + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is + * provided, `account_number` and `routing_number` must be absent. + */ + fun externalAccountId(externalAccountId: String) = + externalAccountId(JsonField.of(externalAccountId)) + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + this.externalAccountId = externalAccountId + } + + /** Whether the transfer requires explicit approval via the dashboard or API. */ + fun requireApproval(requireApproval: Boolean) = + requireApproval(JsonField.of(requireApproval)) + + /** + * Sets [Builder.requireApproval] to an arbitrary JSON value. + * + * You should usually call [Builder.requireApproval] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun requireApproval(requireApproval: JsonField) = apply { + this.requireApproval = requireApproval + } + + /** The creditor's bank account routing number. */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("accountId", accountId), + checkRequired("amount", amount), + checkRequired("creditorName", creditorName), + checkRequired("debtorName", debtorName), + checkRequired("sourceAccountNumberId", sourceAccountNumberId), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + accountId() + amount() + creditorName() + debtorName() + sourceAccountNumberId() + unstructuredRemittanceInformation() + accountNumber() + creditorAddress().ifPresent { it.validate() } + debtorAddress().ifPresent { it.validate() } + externalAccountId() + requireApproval() + routingNumber() + 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 (accountId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (creditorAddress.asKnown().getOrNull()?.validity() ?: 0) + + (debtorAddress.asKnown().getOrNull()?.validity() ?: 0) + + (if (externalAccountId.asKnown().isPresent) 1 else 0) + + (if (requireApproval.asKnown().isPresent) 1 else 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + accountId == other.accountId && + amount == other.amount && + creditorName == other.creditorName && + debtorName == other.debtorName && + sourceAccountNumberId == other.sourceAccountNumberId && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + accountNumber == other.accountNumber && + creditorAddress == other.creditorAddress && + debtorAddress == other.debtorAddress && + externalAccountId == other.externalAccountId && + requireApproval == other.requireApproval && + routingNumber == other.routingNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountId, + amount, + creditorName, + debtorName, + sourceAccountNumberId, + unstructuredRemittanceInformation, + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{accountId=$accountId, amount=$amount, creditorName=$creditorName, debtorName=$debtorName, sourceAccountNumberId=$sourceAccountNumberId, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, accountNumber=$accountNumber, creditorAddress=$creditorAddress, debtorAddress=$debtorAddress, externalAccountId=$externalAccountId, requireApproval=$requireApproval, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" + } + + /** The creditor's address. */ + class CreditorAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val postalCode: JsonField, + private val state: JsonField, + private val line1: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + ) : this(city, postalCode, state, line1, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @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 city(): String = city.getRequired("city") + + /** + * The postal code component of the address. + * + * @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 postalCode(): String = postalCode.getRequired("postal_code") + + /** + * The US state component of the address. + * + * @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 state(): String = state.getRequired("state") + + /** + * The first line of the address. This is usually the street number and street. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + /** + * Returns the raw JSON value of [state]. + * + * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + @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 [CreditorAddress]. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditorAddress]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var postalCode: JsonField? = null + private var state: JsonField? = null + private var line1: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditorAddress: CreditorAddress) = apply { + city = creditorAddress.city + postalCode = creditorAddress.postalCode + state = creditorAddress.state + line1 = creditorAddress.line1 + additionalProperties = creditorAddress.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String) = city(JsonField.of(city)) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The postal code component of the address. */ + fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } + + /** The US state component of the address. */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The first line of the address. This is usually the street number and street. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + 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 [CreditorAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditorAddress = + CreditorAddress( + checkRequired("city", city), + checkRequired("postalCode", postalCode), + checkRequired("state", state), + line1, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditorAddress = apply { + if (validated) { + return@apply + } + + city() + postalCode() + state() + line1() + 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 (city.asKnown().isPresent) 1 else 0) + + (if (postalCode.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditorAddress && + city == other.city && + postalCode == other.postalCode && + state == other.state && + line1 == other.line1 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, postalCode, state, line1, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditorAddress{city=$city, postalCode=$postalCode, state=$state, line1=$line1, additionalProperties=$additionalProperties}" + } + + /** The debtor's address. */ + class DebtorAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val postalCode: JsonField, + private val state: JsonField, + private val line1: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + ) : this(city, postalCode, state, line1, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @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 city(): String = city.getRequired("city") + + /** + * The postal code component of the address. + * + * @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 postalCode(): String = postalCode.getRequired("postal_code") + + /** + * The US state component of the address. + * + * @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 state(): String = state.getRequired("state") + + /** + * The first line of the address. This is usually the street number and street. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + /** + * Returns the raw JSON value of [state]. + * + * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + @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 [DebtorAddress]. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DebtorAddress]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var postalCode: JsonField? = null + private var state: JsonField? = null + private var line1: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtorAddress: DebtorAddress) = apply { + city = debtorAddress.city + postalCode = debtorAddress.postalCode + state = debtorAddress.state + line1 = debtorAddress.line1 + additionalProperties = debtorAddress.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String) = city(JsonField.of(city)) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The postal code component of the address. */ + fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } + + /** The US state component of the address. */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The first line of the address. This is usually the street number and street. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + 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 [DebtorAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DebtorAddress = + DebtorAddress( + checkRequired("city", city), + checkRequired("postalCode", postalCode), + checkRequired("state", state), + line1, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DebtorAddress = apply { + if (validated) { + return@apply + } + + city() + postalCode() + state() + line1() + 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 (city.asKnown().isPresent) 1 else 0) + + (if (postalCode.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DebtorAddress && + city == other.city && + postalCode == other.postalCode && + state == other.state && + line1 == other.line1 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, postalCode, state, line1, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DebtorAddress{city=$city, postalCode=$postalCode, state=$state, line1=$line1, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "FednowTransferCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt new file mode 100644 index 000000000..d0e10bbdb --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.FednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferService.list */ +class FednowTransferListPage +private constructor( + private val service: FednowTransferService, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): FednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: FednowTransferService? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPage: FednowTransferListPage) = apply { + service = fednowTransferListPage.service + params = fednowTransferListPage.params + response = fednowTransferListPage.response + } + + fun service(service: FednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPage = + FednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "FednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt new file mode 100644 index 000000000..c8812f290 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.FednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferServiceAsync.list */ +class FednowTransferListPageAsync +private constructor( + private val service: FednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: FednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPageAsync: FednowTransferListPageAsync) = apply { + service = fednowTransferListPageAsync.service + streamHandlerExecutor = fednowTransferListPageAsync.streamHandlerExecutor + params = fednowTransferListPageAsync.params + response = fednowTransferListPageAsync.response + } + + fun service(service: FednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPageAsync = + FednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "FednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt new file mode 100644 index 000000000..42b40ec21 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt @@ -0,0 +1,241 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown +import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A list of FedNow Transfer objects. */ +class FednowTransferListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val nextCursor: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("next_cursor") + @ExcludeMissing + nextCursor: JsonField = JsonMissing.of(), + ) : this(data, nextCursor, mutableMapOf()) + + /** + * The contents of the list. + * + * @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 data(): List = data.getRequired("data") + + /** + * A pointer to a place in the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [nextCursor]. + * + * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + + @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 + * [FednowTransferListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferListPageResponse: FednowTransferListPageResponse) = apply { + data = fednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = fednowTransferListPageResponse.nextCursor + additionalProperties = + fednowTransferListPageResponse.additionalProperties.toMutableMap() + } + + /** The contents of the list. */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [FednowTransfer] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: FednowTransfer) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** A pointer to a place in the list. */ + fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + + /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + + /** + * Sets [Builder.nextCursor] to an arbitrary JSON value. + * + * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + + 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 [FednowTransferListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPageResponse = + FednowTransferListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): FednowTransferListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + nextCursor() + 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 = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (nextCursor.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPageResponse && + data == other.data && + nextCursor == other.nextCursor && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt new file mode 100644 index 000000000..f912be17c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt @@ -0,0 +1,850 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.annotation.JsonCreator +import com.increase.api.core.Enum +import com.increase.api.core.JsonField +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** List FedNow Transfers */ +class FednowTransferListParams +private constructor( + private val accountId: String?, + private val createdAt: CreatedAt?, + private val cursor: String?, + private val externalAccountId: String?, + private val idempotencyKey: String?, + private val limit: Long?, + private val status: Status?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Filter FedNow Transfers to those that originated from the specified Account. */ + fun accountId(): Optional = Optional.ofNullable(accountId) + + fun createdAt(): Optional = Optional.ofNullable(createdAt) + + /** Return the page of entries after this one. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** Filter FedNow Transfers to those made to the specified External Account. */ + fun externalAccountId(): Optional = Optional.ofNullable(externalAccountId) + + /** + * Filter records to the one with the specified `idempotency_key` you chose for that 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(): Optional = Optional.ofNullable(idempotencyKey) + + /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */ + fun limit(): Optional = Optional.ofNullable(limit) + + fun status(): Optional = Optional.ofNullable(status) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferListParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [FednowTransferListParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListParams]. */ + class Builder internal constructor() { + + private var accountId: String? = null + private var createdAt: CreatedAt? = null + private var cursor: String? = null + private var externalAccountId: String? = null + private var idempotencyKey: String? = null + private var limit: Long? = null + private var status: Status? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferListParams: FednowTransferListParams) = apply { + accountId = fednowTransferListParams.accountId + createdAt = fednowTransferListParams.createdAt + cursor = fednowTransferListParams.cursor + externalAccountId = fednowTransferListParams.externalAccountId + idempotencyKey = fednowTransferListParams.idempotencyKey + limit = fednowTransferListParams.limit + status = fednowTransferListParams.status + additionalHeaders = fednowTransferListParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferListParams.additionalQueryParams.toBuilder() + } + + /** Filter FedNow Transfers to those that originated from the specified Account. */ + fun accountId(accountId: String?) = apply { this.accountId = accountId } + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt } + + /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ + fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull()) + + /** Return the page of entries after this one. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** Filter FedNow Transfers to those made to the specified External Account. */ + fun externalAccountId(externalAccountId: String?) = apply { + this.externalAccountId = externalAccountId + } + + /** Alias for calling [Builder.externalAccountId] with `externalAccountId.orElse(null)`. */ + fun externalAccountId(externalAccountId: Optional) = + externalAccountId(externalAccountId.getOrNull()) + + /** + * Filter records to the one with the specified `idempotency_key` you chose for that 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?) = apply { this.idempotencyKey = idempotencyKey } + + /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */ + fun idempotencyKey(idempotencyKey: Optional) = + idempotencyKey(idempotencyKey.getOrNull()) + + /** + * Limit the size of the list that is returned. The default (and maximum) is 100 objects. + */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun status(status: Status?) = apply { this.status = status } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferListParams = + FednowTransferListParams( + accountId, + createdAt, + cursor, + externalAccountId, + idempotencyKey, + limit, + status, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + accountId?.let { put("account_id", it) } + createdAt?.let { + it.after().ifPresent { + put("created_at.after", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.before().ifPresent { + put("created_at.before", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.onOrAfter().ifPresent { + put( + "created_at.on_or_after", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it.onOrBefore().ifPresent { + put( + "created_at.on_or_before", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("created_at.$key", value) + } + } + } + cursor?.let { put("cursor", it) } + externalAccountId?.let { put("external_account_id", it) } + idempotencyKey?.let { put("idempotency_key", it) } + limit?.let { put("limit", it.toString()) } + status?.let { + it.in_().ifPresent { put("status.in", it.joinToString(",") { it.toString() }) } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("status.$key", value) + } + } + } + putAll(additionalQueryParams) + } + .build() + + class CreatedAt + private constructor( + private val after: OffsetDateTime?, + private val before: OffsetDateTime?, + private val onOrAfter: OffsetDateTime?, + private val onOrBefore: OffsetDateTime?, + private val additionalProperties: QueryParams, + ) { + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun after(): Optional = Optional.ofNullable(after) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun before(): Optional = Optional.ofNullable(before) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(): Optional = Optional.ofNullable(onOrAfter) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(): Optional = Optional.ofNullable(onOrBefore) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [CreatedAt]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreatedAt]. */ + class Builder internal constructor() { + + private var after: OffsetDateTime? = null + private var before: OffsetDateTime? = null + private var onOrAfter: OffsetDateTime? = null + private var onOrBefore: OffsetDateTime? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(createdAt: CreatedAt) = apply { + after = createdAt.after + before = createdAt.before + onOrAfter = createdAt.onOrAfter + onOrBefore = createdAt.onOrBefore + additionalProperties = createdAt.additionalProperties.toBuilder() + } + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun after(after: OffsetDateTime?) = apply { this.after = after } + + /** Alias for calling [Builder.after] with `after.orElse(null)`. */ + fun after(after: Optional) = after(after.getOrNull()) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun before(before: OffsetDateTime?) = apply { this.before = before } + + /** Alias for calling [Builder.before] with `before.orElse(null)`. */ + fun before(before: Optional) = before(before.getOrNull()) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(onOrAfter: OffsetDateTime?) = apply { this.onOrAfter = onOrAfter } + + /** Alias for calling [Builder.onOrAfter] with `onOrAfter.orElse(null)`. */ + fun onOrAfter(onOrAfter: Optional) = onOrAfter(onOrAfter.getOrNull()) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(onOrBefore: OffsetDateTime?) = apply { this.onOrBefore = onOrBefore } + + /** Alias for calling [Builder.onOrBefore] with `onOrBefore.orElse(null)`. */ + fun onOrBefore(onOrBefore: Optional) = + onOrBefore(onOrBefore.getOrNull()) + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [CreatedAt]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): CreatedAt = + CreatedAt(after, before, onOrAfter, onOrBefore, additionalProperties.build()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedAt && + after == other.after && + before == other.before && + onOrAfter == other.onOrAfter && + onOrBefore == other.onOrBefore && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(after, before, onOrAfter, onOrBefore, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedAt{after=$after, before=$before, onOrAfter=$onOrAfter, onOrBefore=$onOrBefore, additionalProperties=$additionalProperties}" + } + + class Status + private constructor(private val in_: List?, private val additionalProperties: QueryParams) { + + /** + * Return results whose value is in the provided list. For GET requests, this should be + * encoded as a comma-delimited string, such as `?in=one,two,three`. + */ + fun in_(): Optional> = Optional.ofNullable(in_) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Status]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Status]. */ + class Builder internal constructor() { + + private var in_: MutableList? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(status: Status) = apply { + in_ = status.in_?.toMutableList() + additionalProperties = status.additionalProperties.toBuilder() + } + + /** + * Return results whose value is in the provided list. For GET requests, this should be + * encoded as a comma-delimited string, such as `?in=one,two,three`. + */ + fun in_(in_: List?) = apply { this.in_ = in_?.toMutableList() } + + /** Alias for calling [Builder.in_] with `in_.orElse(null)`. */ + fun in_(in_: Optional>) = in_(in_.getOrNull()) + + /** + * Adds a single [In] to [Builder.in_]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIn(in_: In) = apply { + this.in_ = (this.in_ ?: mutableListOf()).apply { add(in_) } + } + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [Status]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Status = Status(in_?.toImmutable(), additionalProperties.build()) + } + + class In @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 transfer is pending review by Increase. */ + @JvmField val PENDING_REVIEWING = of("pending_reviewing") + + /** The transfer has been canceled. */ + @JvmField val CANCELED = of("canceled") + + /** The transfer has been rejected by Increase. */ + @JvmField val REVIEWING_REJECTED = of("reviewing_rejected") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + /** The transfer is pending approval. */ + @JvmField val PENDING_APPROVAL = of("pending_approval") + + /** The transfer is queued to be submitted to FedNow. */ + @JvmField val PENDING_SUBMITTING = of("pending_submitting") + + /** The transfer has been submitted and is pending a response from FedNow. */ + @JvmField val PENDING_RESPONSE = of("pending_response") + + /** The transfer has been sent successfully and is complete. */ + @JvmField val COMPLETE = of("complete") + + /** The transfer was rejected by the network or the recipient's bank. */ + @JvmField val REJECTED = of("rejected") + + @JvmStatic fun of(value: String) = In(JsonField.of(value)) + } + + /** An enum containing [In]'s known values. */ + enum class Known { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + } + + /** + * An enum containing [In]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [In] 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 transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + /** An enum member indicating that [In] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING_REVIEWING -> Value.PENDING_REVIEWING + CANCELED -> Value.CANCELED + REVIEWING_REJECTED -> Value.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + PENDING_APPROVAL -> Value.PENDING_APPROVAL + PENDING_SUBMITTING -> Value.PENDING_SUBMITTING + PENDING_RESPONSE -> Value.PENDING_RESPONSE + COMPLETE -> Value.COMPLETE + REJECTED -> Value.REJECTED + 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) { + PENDING_REVIEWING -> Known.PENDING_REVIEWING + CANCELED -> Known.CANCELED + REVIEWING_REJECTED -> Known.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + PENDING_APPROVAL -> Known.PENDING_APPROVAL + PENDING_SUBMITTING -> Known.PENDING_SUBMITTING + PENDING_RESPONSE -> Known.PENDING_RESPONSE + COMPLETE -> Known.COMPLETE + REJECTED -> Known.REJECTED + else -> throw IncreaseInvalidDataException("Unknown In: $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(): In = 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 In && 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 Status && + in_ == other.in_ && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(in_, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Status{in_=$in_, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListParams && + accountId == other.accountId && + createdAt == other.createdAt && + cursor == other.cursor && + externalAccountId == other.externalAccountId && + idempotencyKey == other.idempotencyKey && + limit == other.limit && + status == other.status && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + createdAt, + cursor, + externalAccountId, + idempotencyKey, + limit, + status, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "FednowTransferListParams{accountId=$accountId, createdAt=$createdAt, cursor=$cursor, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, limit=$limit, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt new file mode 100644 index 000000000..a297b1156 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Retrieve a FedNow Transfer */ +class FednowTransferRetrieveParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the FedNow Transfer. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferRetrieveParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferRetrieveParams: FednowTransferRetrieveParams) = apply { + fednowTransferId = fednowTransferRetrieveParams.fednowTransferId + additionalHeaders = fednowTransferRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferRetrieveParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the FedNow Transfer. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferRetrieveParams = + FednowTransferRetrieveParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferRetrieveParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(fednowTransferId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "FednowTransferRetrieveParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt new file mode 100644 index 000000000..e1e64d3aa --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt @@ -0,0 +1,1863 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +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 + +/** + * An Inbound FedNow Transfer is a FedNow transfer initiated outside of Increase to your account. + */ +class InboundFednowTransfer +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val accountId: JsonField, + private val accountNumberId: JsonField, + private val amount: JsonField, + private val confirmation: JsonField, + private val createdAt: JsonField, + private val creditorName: JsonField, + private val currency: JsonField, + private val debtorAccountNumber: JsonField, + private val debtorName: JsonField, + private val debtorRoutingNumber: JsonField, + private val decline: JsonField, + private val status: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("account_number_id") + @ExcludeMissing + accountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("confirmation") + @ExcludeMissing + confirmation: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor_account_number") + @ExcludeMissing + debtorAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_routing_number") + @ExcludeMissing + debtorRoutingNumber: JsonField = JsonMissing.of(), + @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + id, + accountId, + accountNumberId, + amount, + confirmation, + createdAt, + creditorName, + currency, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + decline, + status, + transactionId, + type, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The inbound FedNow 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") + + /** + * The Account to 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 identifier of the Account Number to which this 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 accountNumberId(): String = accountNumberId.getRequired("account_number_id") + + /** + * The 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 transfer is confirmed, this will contain details of the confirmation. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun confirmation(): Optional = confirmation.getOptional("confirmation") + + /** + * 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") + + /** + * The name the sender of the transfer specified as the recipient 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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. This + * will always be "USD" for a FedNow 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 currency(): Currency = currency.getRequired("currency") + + /** + * The account number of the account that 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 debtorAccountNumber(): String = debtorAccountNumber.getRequired("debtor_account_number") + + /** + * The name provided by the sender 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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The routing number of the account that 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 debtorRoutingNumber(): String = debtorRoutingNumber.getRequired("debtor_routing_number") + + /** + * If your transfer is declined, this will contain details of the decline. + * + * @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 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") + + /** + * The identifier of the Transaction object created when the transfer was confirmed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_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") + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + unstructuredRemittanceInformation.getOptional("unstructured_remittance_information") + + /** + * 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 [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 [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_number_id") + @ExcludeMissing + fun _accountNumberId(): JsonField = accountNumberId + + /** + * 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 [confirmation]. + * + * Unlike [confirmation], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("confirmation") + @ExcludeMissing + fun _confirmation(): JsonField = confirmation + + /** + * 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 [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * 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 [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_account_number") + @ExcludeMissing + fun _debtorAccountNumber(): JsonField = debtorAccountNumber + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") @ExcludeMissing fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_routing_number") + @ExcludeMissing + fun _debtorRoutingNumber(): JsonField = debtorRoutingNumber + + /** + * 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 [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 [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * 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 + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = unstructuredRemittanceInformation + + @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 [InboundFednowTransfer]. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumberId() + * .amount() + * .confirmation() + * .createdAt() + * .creditorName() + * .currency() + * .debtorAccountNumber() + * .debtorName() + * .debtorRoutingNumber() + * .decline() + * .status() + * .transactionId() + * .type() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransfer]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var accountId: JsonField? = null + private var accountNumberId: JsonField? = null + private var amount: JsonField? = null + private var confirmation: JsonField? = null + private var createdAt: JsonField? = null + private var creditorName: JsonField? = null + private var currency: JsonField? = null + private var debtorAccountNumber: JsonField? = null + private var debtorName: JsonField? = null + private var debtorRoutingNumber: JsonField? = null + private var decline: JsonField? = null + private var status: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(inboundFednowTransfer: InboundFednowTransfer) = apply { + id = inboundFednowTransfer.id + accountId = inboundFednowTransfer.accountId + accountNumberId = inboundFednowTransfer.accountNumberId + amount = inboundFednowTransfer.amount + confirmation = inboundFednowTransfer.confirmation + createdAt = inboundFednowTransfer.createdAt + creditorName = inboundFednowTransfer.creditorName + currency = inboundFednowTransfer.currency + debtorAccountNumber = inboundFednowTransfer.debtorAccountNumber + debtorName = inboundFednowTransfer.debtorName + debtorRoutingNumber = inboundFednowTransfer.debtorRoutingNumber + decline = inboundFednowTransfer.decline + status = inboundFednowTransfer.status + transactionId = inboundFednowTransfer.transactionId + type = inboundFednowTransfer.type + unstructuredRemittanceInformation = + inboundFednowTransfer.unstructuredRemittanceInformation + additionalProperties = inboundFednowTransfer.additionalProperties.toMutableMap() + } + + /** The inbound FedNow 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 } + + /** The Account to 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 identifier of the Account Number to which this transfer was sent. */ + fun accountNumberId(accountNumberId: String) = + accountNumberId(JsonField.of(accountNumberId)) + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + this.accountNumberId = accountNumberId + } + + /** The 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 transfer is confirmed, this will contain details of the confirmation. */ + fun confirmation(confirmation: Confirmation?) = + confirmation(JsonField.ofNullable(confirmation)) + + /** Alias for calling [Builder.confirmation] with `confirmation.orElse(null)`. */ + fun confirmation(confirmation: Optional) = + confirmation(confirmation.getOrNull()) + + /** + * Sets [Builder.confirmation] to an arbitrary JSON value. + * + * You should usually call [Builder.confirmation] with a well-typed [Confirmation] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun confirmation(confirmation: JsonField) = apply { + this.confirmation = confirmation + } + + /** + * 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 } + + /** The name the sender of the transfer specified as the recipient of the transfer. */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. + * This will always be "USD" for a FedNow transfer. + */ + 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 } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = + debtorAccountNumber(JsonField.of(debtorAccountNumber)) + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + this.debtorAccountNumber = debtorAccountNumber + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = + debtorRoutingNumber(JsonField.of(debtorRoutingNumber)) + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + this.debtorRoutingNumber = debtorRoutingNumber + } + + /** If your transfer is declined, this will contain details of the decline. */ + 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 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 } + + /** The identifier of the Transaction object created when the transfer was confirmed. */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_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 } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String?) = + unstructuredRemittanceInformation( + JsonField.ofNullable(unstructuredRemittanceInformation) + ) + + /** + * Alias for calling [Builder.unstructuredRemittanceInformation] with + * `unstructuredRemittanceInformation.orElse(null)`. + */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: Optional) = + unstructuredRemittanceInformation(unstructuredRemittanceInformation.getOrNull()) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [InboundFednowTransfer]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumberId() + * .amount() + * .confirmation() + * .createdAt() + * .creditorName() + * .currency() + * .debtorAccountNumber() + * .debtorName() + * .debtorRoutingNumber() + * .decline() + * .status() + * .transactionId() + * .type() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransfer = + InboundFednowTransfer( + checkRequired("id", id), + checkRequired("accountId", accountId), + checkRequired("accountNumberId", accountNumberId), + checkRequired("amount", amount), + checkRequired("confirmation", confirmation), + checkRequired("createdAt", createdAt), + checkRequired("creditorName", creditorName), + checkRequired("currency", currency), + checkRequired("debtorAccountNumber", debtorAccountNumber), + checkRequired("debtorName", debtorName), + checkRequired("debtorRoutingNumber", debtorRoutingNumber), + checkRequired("decline", decline), + checkRequired("status", status), + checkRequired("transactionId", transactionId), + checkRequired("type", type), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InboundFednowTransfer = apply { + if (validated) { + return@apply + } + + id() + accountId() + accountNumberId() + amount() + confirmation().ifPresent { it.validate() } + createdAt() + creditorName() + currency().validate() + debtorAccountNumber() + debtorName() + debtorRoutingNumber() + decline().ifPresent { it.validate() } + status().validate() + transactionId() + type().validate() + unstructuredRemittanceInformation() + 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) + + (if (accountId.asKnown().isPresent) 1 else 0) + + (if (accountNumberId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (confirmation.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (debtorAccountNumber.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (debtorRoutingNumber.asKnown().isPresent) 1 else 0) + + (decline.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + /** If your transfer is confirmed, this will contain details of the confirmation. */ + class Confirmation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of() + ) : this(transferId, mutableMapOf()) + + /** + * The identifier of the FedNow Transfer that led to this Transaction. + * + * @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 transferId(): String = transferId.getRequired("transfer_id") + + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @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 [Confirmation]. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Confirmation]. */ + class Builder internal constructor() { + + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(confirmation: Confirmation) = apply { + transferId = confirmation.transferId + additionalProperties = confirmation.additionalProperties.toMutableMap() + } + + /** The identifier of the FedNow Transfer that led to this Transaction. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transferId(transferId: JsonField) = apply { this.transferId = transferId } + + 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 [Confirmation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Confirmation = + Confirmation( + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Confirmation = apply { + if (validated) { + return@apply + } + + transferId() + 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 (transferId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Confirmation && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(transferId, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Confirmation{transferId=$transferId, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. This + * will always be "USD" for a FedNow transfer. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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(): Currency = 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** If your transfer is declined, this will contain details of the decline. */ + class Decline + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val reason: JsonField, + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of(), + ) : this(reason, transferId, mutableMapOf()) + + /** + * Why the transfer was declined. + * + * @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 reason(): Reason = reason.getRequired("reason") + + /** + * The identifier of the FedNow Transfer that led to this declined transaction. + * + * @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 transferId(): String = transferId.getRequired("transfer_id") + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @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 [Decline]. + * + * The following fields are required: + * ```java + * .reason() + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Decline]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(decline: Decline) = apply { + reason = decline.reason + transferId = decline.transferId + additionalProperties = decline.additionalProperties.toMutableMap() + } + + /** Why the transfer was declined. */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [Reason] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** The identifier of the FedNow Transfer that led to this declined transaction. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transferId(transferId: JsonField) = apply { this.transferId = transferId } + + 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 [Decline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Decline = + Decline( + checkRequired("reason", reason), + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Decline = apply { + if (validated) { + return@apply + } + + reason().validate() + transferId() + 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 = + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (if (transferId.asKnown().isPresent) 1 else 0) + + /** Why the transfer was declined. */ + class Reason @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 account number is canceled. */ + @JvmField val ACCOUNT_NUMBER_CANCELED = of("account_number_canceled") + + /** The account number is disabled. */ + @JvmField val ACCOUNT_NUMBER_DISABLED = of("account_number_disabled") + + /** Your account is restricted. */ + @JvmField val ACCOUNT_RESTRICTED = of("account_restricted") + + /** Your account is inactive. */ + @JvmField val GROUP_LOCKED = of("group_locked") + + /** The account's entity is not active. */ + @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") + + /** Your account is not enabled to receive FedNow transfers. */ + @JvmField val FEDNOW_NOT_ENABLED = of("fednow_not_enabled") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** The account number is canceled. */ + ACCOUNT_NUMBER_CANCELED, + /** The account number is disabled. */ + ACCOUNT_NUMBER_DISABLED, + /** Your account is restricted. */ + ACCOUNT_RESTRICTED, + /** Your account is inactive. */ + GROUP_LOCKED, + /** The account's entity is not active. */ + ENTITY_NOT_ACTIVE, + /** Your account is not enabled to receive FedNow transfers. */ + FEDNOW_NOT_ENABLED, + } + + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] 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 account number is canceled. */ + ACCOUNT_NUMBER_CANCELED, + /** The account number is disabled. */ + ACCOUNT_NUMBER_DISABLED, + /** Your account is restricted. */ + ACCOUNT_RESTRICTED, + /** Your account is inactive. */ + GROUP_LOCKED, + /** The account's entity is not active. */ + ENTITY_NOT_ACTIVE, + /** Your account is not enabled to receive FedNow transfers. */ + FEDNOW_NOT_ENABLED, + /** + * An enum member indicating that [Reason] 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_NUMBER_CANCELED -> Value.ACCOUNT_NUMBER_CANCELED + ACCOUNT_NUMBER_DISABLED -> Value.ACCOUNT_NUMBER_DISABLED + ACCOUNT_RESTRICTED -> Value.ACCOUNT_RESTRICTED + GROUP_LOCKED -> Value.GROUP_LOCKED + ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE + FEDNOW_NOT_ENABLED -> Value.FEDNOW_NOT_ENABLED + 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_NUMBER_CANCELED -> Known.ACCOUNT_NUMBER_CANCELED + ACCOUNT_NUMBER_DISABLED -> Known.ACCOUNT_NUMBER_DISABLED + ACCOUNT_RESTRICTED -> Known.ACCOUNT_RESTRICTED + GROUP_LOCKED -> Known.GROUP_LOCKED + ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE + FEDNOW_NOT_ENABLED -> Known.FEDNOW_NOT_ENABLED + else -> throw IncreaseInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && 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 Decline && + reason == other.reason && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, transferId, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Decline{reason=$reason, transferId=$transferId, additionalProperties=$additionalProperties}" + } + + /** The lifecycle status of the transfer. */ + class Status @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 transfer is pending confirmation. */ + @JvmField val PENDING_CONFIRMING = of("pending_confirming") + + /** The transfer was not responded to in time. */ + @JvmField val TIMED_OUT = of("timed_out") + + /** The transfer has been received successfully and is confirmed. */ + @JvmField val CONFIRMED = of("confirmed") + + /** The transfer has been declined. */ + @JvmField val DECLINED = of("declined") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The transfer is pending confirmation. */ + PENDING_CONFIRMING, + /** The transfer was not responded to in time. */ + TIMED_OUT, + /** The transfer has been received successfully and is confirmed. */ + CONFIRMED, + /** The transfer has been declined. */ + DECLINED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] 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 transfer is pending confirmation. */ + PENDING_CONFIRMING, + /** The transfer was not responded to in time. */ + TIMED_OUT, + /** The transfer has been received successfully and is confirmed. */ + CONFIRMED, + /** The transfer has been declined. */ + DECLINED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING_CONFIRMING -> Value.PENDING_CONFIRMING + TIMED_OUT -> Value.TIMED_OUT + CONFIRMED -> Value.CONFIRMED + DECLINED -> Value.DECLINED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + 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) { + PENDING_CONFIRMING -> Known.PENDING_CONFIRMING + TIMED_OUT -> Known.TIMED_OUT + CONFIRMED -> Known.CONFIRMED + DECLINED -> Known.DECLINED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + else -> throw IncreaseInvalidDataException("Unknown Status: $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(): Status = 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 Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_transfer`. + */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val INBOUND_FEDNOW_TRANSFER = of("inbound_fednow_transfer") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + INBOUND_FEDNOW_TRANSFER + } + + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + INBOUND_FEDNOW_TRANSFER, + /** An enum member indicating that [Type] 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) { + INBOUND_FEDNOW_TRANSFER -> Value.INBOUND_FEDNOW_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) { + INBOUND_FEDNOW_TRANSFER -> Known.INBOUND_FEDNOW_TRANSFER + else -> throw IncreaseInvalidDataException("Unknown Type: $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(): Type = 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 Type && 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 InboundFednowTransfer && + id == other.id && + accountId == other.accountId && + accountNumberId == other.accountNumberId && + amount == other.amount && + confirmation == other.confirmation && + createdAt == other.createdAt && + creditorName == other.creditorName && + currency == other.currency && + debtorAccountNumber == other.debtorAccountNumber && + debtorName == other.debtorName && + debtorRoutingNumber == other.debtorRoutingNumber && + decline == other.decline && + status == other.status && + transactionId == other.transactionId && + type == other.type && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + accountId, + accountNumberId, + amount, + confirmation, + createdAt, + creditorName, + currency, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + decline, + status, + transactionId, + type, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InboundFednowTransfer{id=$id, accountId=$accountId, accountNumberId=$accountNumberId, amount=$amount, confirmation=$confirmation, createdAt=$createdAt, creditorName=$creditorName, currency=$currency, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, decline=$decline, status=$status, transactionId=$transactionId, type=$type, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt new file mode 100644 index 000000000..88d87e5d4 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundFednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferService.list */ +class InboundFednowTransferListPage +private constructor( + private val service: InboundFednowTransferService, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundFednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferService? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPage: InboundFednowTransferListPage) = apply { + service = inboundFednowTransferListPage.service + params = inboundFednowTransferListPage.params + response = inboundFednowTransferListPage.response + } + + fun service(service: InboundFednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPage = + InboundFednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundFednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt new file mode 100644 index 000000000..95c6b183e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundFednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferServiceAsync.list */ +class InboundFednowTransferListPageAsync +private constructor( + private val service: InboundFednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPageAsync: InboundFednowTransferListPageAsync) = + apply { + service = inboundFednowTransferListPageAsync.service + streamHandlerExecutor = inboundFednowTransferListPageAsync.streamHandlerExecutor + params = inboundFednowTransferListPageAsync.params + response = inboundFednowTransferListPageAsync.response + } + + fun service(service: InboundFednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPageAsync = + InboundFednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundFednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt new file mode 100644 index 000000000..7ba304261 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt @@ -0,0 +1,243 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +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.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown +import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A list of Inbound FedNow Transfer objects. */ +class InboundFednowTransferListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val nextCursor: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("next_cursor") + @ExcludeMissing + nextCursor: JsonField = JsonMissing.of(), + ) : this(data, nextCursor, mutableMapOf()) + + /** + * The contents of the list. + * + * @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 data(): List = data.getRequired("data") + + /** + * A pointer to a place in the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [nextCursor]. + * + * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + + @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 + * [InboundFednowTransferListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + inboundFednowTransferListPageResponse: InboundFednowTransferListPageResponse + ) = apply { + data = inboundFednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundFednowTransferListPageResponse.nextCursor + additionalProperties = + inboundFednowTransferListPageResponse.additionalProperties.toMutableMap() + } + + /** The contents of the list. */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [InboundFednowTransfer] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: InboundFednowTransfer) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** A pointer to a place in the list. */ + fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + + /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + + /** + * Sets [Builder.nextCursor] to an arbitrary JSON value. + * + * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + + 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 [InboundFednowTransferListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InboundFednowTransferListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + nextCursor() + 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 = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (nextCursor.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPageResponse && + data == other.data && + nextCursor == other.nextCursor && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InboundFednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt new file mode 100644 index 000000000..021f85294 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt @@ -0,0 +1,483 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** List Inbound FedNow Transfers */ +class InboundFednowTransferListParams +private constructor( + private val accountId: String?, + private val accountNumberId: String?, + private val createdAt: CreatedAt?, + private val cursor: String?, + private val limit: Long?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Filter Inbound FedNow Transfers to those belonging to the specified Account. */ + fun accountId(): Optional = Optional.ofNullable(accountId) + + /** Filter Inbound FedNow Transfers to ones belonging to the specified Account Number. */ + fun accountNumberId(): Optional = Optional.ofNullable(accountNumberId) + + fun createdAt(): Optional = Optional.ofNullable(createdAt) + + /** Return the page of entries after this one. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): InboundFednowTransferListParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListParams]. */ + class Builder internal constructor() { + + private var accountId: String? = null + private var accountNumberId: String? = null + private var createdAt: CreatedAt? = null + private var cursor: String? = null + private var limit: Long? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(inboundFednowTransferListParams: InboundFednowTransferListParams) = + apply { + accountId = inboundFednowTransferListParams.accountId + accountNumberId = inboundFednowTransferListParams.accountNumberId + createdAt = inboundFednowTransferListParams.createdAt + cursor = inboundFednowTransferListParams.cursor + limit = inboundFednowTransferListParams.limit + additionalHeaders = inboundFednowTransferListParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferListParams.additionalQueryParams.toBuilder() + } + + /** Filter Inbound FedNow Transfers to those belonging to the specified Account. */ + fun accountId(accountId: String?) = apply { this.accountId = accountId } + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + /** Filter Inbound FedNow Transfers to ones belonging to the specified Account Number. */ + fun accountNumberId(accountNumberId: String?) = apply { + this.accountNumberId = accountNumberId + } + + /** Alias for calling [Builder.accountNumberId] with `accountNumberId.orElse(null)`. */ + fun accountNumberId(accountNumberId: Optional) = + accountNumberId(accountNumberId.getOrNull()) + + fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt } + + /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ + fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull()) + + /** Return the page of entries after this one. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** + * Limit the size of the list that is returned. The default (and maximum) is 100 objects. + */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InboundFednowTransferListParams = + InboundFednowTransferListParams( + accountId, + accountNumberId, + createdAt, + cursor, + limit, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + accountId?.let { put("account_id", it) } + accountNumberId?.let { put("account_number_id", it) } + createdAt?.let { + it.after().ifPresent { + put("created_at.after", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.before().ifPresent { + put("created_at.before", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.onOrAfter().ifPresent { + put( + "created_at.on_or_after", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it.onOrBefore().ifPresent { + put( + "created_at.on_or_before", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("created_at.$key", value) + } + } + } + cursor?.let { put("cursor", it) } + limit?.let { put("limit", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + class CreatedAt + private constructor( + private val after: OffsetDateTime?, + private val before: OffsetDateTime?, + private val onOrAfter: OffsetDateTime?, + private val onOrBefore: OffsetDateTime?, + private val additionalProperties: QueryParams, + ) { + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun after(): Optional = Optional.ofNullable(after) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun before(): Optional = Optional.ofNullable(before) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(): Optional = Optional.ofNullable(onOrAfter) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(): Optional = Optional.ofNullable(onOrBefore) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [CreatedAt]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreatedAt]. */ + class Builder internal constructor() { + + private var after: OffsetDateTime? = null + private var before: OffsetDateTime? = null + private var onOrAfter: OffsetDateTime? = null + private var onOrBefore: OffsetDateTime? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(createdAt: CreatedAt) = apply { + after = createdAt.after + before = createdAt.before + onOrAfter = createdAt.onOrAfter + onOrBefore = createdAt.onOrBefore + additionalProperties = createdAt.additionalProperties.toBuilder() + } + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun after(after: OffsetDateTime?) = apply { this.after = after } + + /** Alias for calling [Builder.after] with `after.orElse(null)`. */ + fun after(after: Optional) = after(after.getOrNull()) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun before(before: OffsetDateTime?) = apply { this.before = before } + + /** Alias for calling [Builder.before] with `before.orElse(null)`. */ + fun before(before: Optional) = before(before.getOrNull()) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(onOrAfter: OffsetDateTime?) = apply { this.onOrAfter = onOrAfter } + + /** Alias for calling [Builder.onOrAfter] with `onOrAfter.orElse(null)`. */ + fun onOrAfter(onOrAfter: Optional) = onOrAfter(onOrAfter.getOrNull()) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(onOrBefore: OffsetDateTime?) = apply { this.onOrBefore = onOrBefore } + + /** Alias for calling [Builder.onOrBefore] with `onOrBefore.orElse(null)`. */ + fun onOrBefore(onOrBefore: Optional) = + onOrBefore(onOrBefore.getOrNull()) + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [CreatedAt]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): CreatedAt = + CreatedAt(after, before, onOrAfter, onOrBefore, additionalProperties.build()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedAt && + after == other.after && + before == other.before && + onOrAfter == other.onOrAfter && + onOrBefore == other.onOrBefore && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(after, before, onOrAfter, onOrBefore, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedAt{after=$after, before=$before, onOrAfter=$onOrAfter, onOrBefore=$onOrBefore, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListParams && + accountId == other.accountId && + accountNumberId == other.accountNumberId && + createdAt == other.createdAt && + cursor == other.cursor && + limit == other.limit && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + accountNumberId, + createdAt, + cursor, + limit, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "InboundFednowTransferListParams{accountId=$accountId, accountNumberId=$accountNumberId, createdAt=$createdAt, cursor=$cursor, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt new file mode 100644 index 000000000..d5162d99a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Retrieve an Inbound FedNow Transfer */ +class InboundFednowTransferRetrieveParams +private constructor( + private val inboundFednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the Inbound FedNow Transfer to get details for. */ + fun inboundFednowTransferId(): Optional = Optional.ofNullable(inboundFednowTransferId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): InboundFednowTransferRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferRetrieveParams]. */ + class Builder internal constructor() { + + private var inboundFednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from( + inboundFednowTransferRetrieveParams: InboundFednowTransferRetrieveParams + ) = apply { + inboundFednowTransferId = inboundFednowTransferRetrieveParams.inboundFednowTransferId + additionalHeaders = inboundFednowTransferRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferRetrieveParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the Inbound FedNow Transfer to get details for. */ + fun inboundFednowTransferId(inboundFednowTransferId: String?) = apply { + this.inboundFednowTransferId = inboundFednowTransferId + } + + /** + * Alias for calling [Builder.inboundFednowTransferId] with + * `inboundFednowTransferId.orElse(null)`. + */ + fun inboundFednowTransferId(inboundFednowTransferId: Optional) = + inboundFednowTransferId(inboundFednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams( + inboundFednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> inboundFednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferRetrieveParams && + inboundFednowTransferId == other.inboundFednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(inboundFednowTransferId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "InboundFednowTransferRetrieveParams{inboundFednowTransferId=$inboundFednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt index 856fd2ef2..3eccb06f4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt @@ -25,6 +25,7 @@ class OAuthToken @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val accessToken: JsonField, + private val groupId: JsonField, private val tokenType: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, @@ -35,11 +36,12 @@ private constructor( @JsonProperty("access_token") @ExcludeMissing accessToken: JsonField = JsonMissing.of(), + @JsonProperty("group_id") @ExcludeMissing groupId: JsonField = JsonMissing.of(), @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - ) : this(accessToken, tokenType, type, mutableMapOf()) + ) : this(accessToken, groupId, tokenType, type, mutableMapOf()) /** * You may use this token in place of an API key to make OAuth requests on a user's behalf. @@ -49,6 +51,14 @@ private constructor( */ fun accessToken(): String = accessToken.getRequired("access_token") + /** + * The Group's identifier. A Group is the top-level organization in Increase. + * + * @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 groupId(): String = groupId.getRequired("group_id") + /** * The type of OAuth token. * @@ -74,6 +84,13 @@ private constructor( @ExcludeMissing fun _accessToken(): JsonField = accessToken + /** + * Returns the raw JSON value of [groupId]. + * + * Unlike [groupId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("group_id") @ExcludeMissing fun _groupId(): JsonField = groupId + /** * Returns the raw JSON value of [tokenType]. * @@ -108,6 +125,7 @@ private constructor( * The following fields are required: * ```java * .accessToken() + * .groupId() * .tokenType() * .type() * ``` @@ -119,6 +137,7 @@ private constructor( class Builder internal constructor() { private var accessToken: JsonField? = null + private var groupId: JsonField? = null private var tokenType: JsonField? = null private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -126,6 +145,7 @@ private constructor( @JvmSynthetic internal fun from(oauthToken: OAuthToken) = apply { accessToken = oauthToken.accessToken + groupId = oauthToken.groupId tokenType = oauthToken.tokenType type = oauthToken.type additionalProperties = oauthToken.additionalProperties.toMutableMap() @@ -145,6 +165,17 @@ private constructor( */ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + /** The Group's identifier. A Group is the top-level organization in Increase. */ + fun groupId(groupId: String) = groupId(JsonField.of(groupId)) + + /** + * Sets [Builder.groupId] to an arbitrary JSON value. + * + * You should usually call [Builder.groupId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun groupId(groupId: JsonField) = apply { this.groupId = groupId } + /** The type of OAuth token. */ fun tokenType(tokenType: TokenType) = tokenType(JsonField.of(tokenType)) @@ -198,6 +229,7 @@ private constructor( * The following fields are required: * ```java * .accessToken() + * .groupId() * .tokenType() * .type() * ``` @@ -207,6 +239,7 @@ private constructor( fun build(): OAuthToken = OAuthToken( checkRequired("accessToken", accessToken), + checkRequired("groupId", groupId), checkRequired("tokenType", tokenType), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -221,6 +254,7 @@ private constructor( } accessToken() + groupId() tokenType().validate() type().validate() validated = true @@ -242,6 +276,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (accessToken.asKnown().isPresent) 1 else 0) + + (if (groupId.asKnown().isPresent) 1 else 0) + (tokenType.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) @@ -500,17 +535,18 @@ private constructor( return other is OAuthToken && accessToken == other.accessToken && + groupId == other.groupId && tokenType == other.tokenType && type == other.type && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(accessToken, tokenType, type, additionalProperties) + Objects.hash(accessToken, groupId, tokenType, type, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "OAuthToken{accessToken=$accessToken, tokenType=$tokenType, type=$type, additionalProperties=$additionalProperties}" + "OAuthToken{accessToken=$accessToken, groupId=$groupId, tokenType=$tokenType, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 97ce41b6a..ffd305483 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -12,6 +12,7 @@ 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.core.toImmutable import com.increase.api.errors.IncreaseInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -30,11 +31,11 @@ private constructor( private val id: JsonField, private val accountId: JsonField, private val amount: JsonField, - private val balanceImpact: JsonField, private val completedAt: JsonField, private val createdAt: JsonField, private val currency: JsonField, private val description: JsonField, + private val heldAmount: JsonField, private val routeId: JsonField, private val routeType: JsonField, private val source: JsonField, @@ -48,9 +49,6 @@ private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("balance_impact") - @ExcludeMissing - balanceImpact: JsonField = JsonMissing.of(), @JsonProperty("completed_at") @ExcludeMissing completedAt: JsonField = JsonMissing.of(), @@ -61,6 +59,7 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("held_amount") @ExcludeMissing heldAmount: JsonField = JsonMissing.of(), @JsonProperty("route_id") @ExcludeMissing routeId: JsonField = JsonMissing.of(), @JsonProperty("route_type") @ExcludeMissing @@ -72,11 +71,11 @@ private constructor( id, accountId, amount, - balanceImpact, completedAt, createdAt, currency, description, + heldAmount, routeId, routeType, source, @@ -110,14 +109,6 @@ private constructor( */ fun amount(): Long = amount.getRequired("amount") - /** - * How the Pending Transaction affects the balance of its Account while its status is `pending`. - * - * @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 balanceImpact(): BalanceImpact = balanceImpact.getRequired("balance_impact") - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending Transaction * was completed. @@ -154,6 +145,15 @@ private constructor( */ fun description(): String = description.getRequired("description") + /** + * The amount that this Pending Transaction decrements the available balance of its Account. + * This is usually the same as `amount`, but will differ if the amount is positive. + * + * @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 heldAmount(): Long = heldAmount.getRequired("held_amount") + /** * The identifier for the route this Pending Transaction came through. Routes are things like * cards and ACH details. @@ -219,15 +219,6 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - /** - * Returns the raw JSON value of [balanceImpact]. - * - * Unlike [balanceImpact], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("balance_impact") - @ExcludeMissing - fun _balanceImpact(): JsonField = balanceImpact - /** * Returns the raw JSON value of [completedAt]. * @@ -260,6 +251,13 @@ private constructor( */ @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [heldAmount]. + * + * Unlike [heldAmount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("held_amount") @ExcludeMissing fun _heldAmount(): JsonField = heldAmount + /** * Returns the raw JSON value of [routeId]. * @@ -317,11 +315,11 @@ private constructor( * .id() * .accountId() * .amount() - * .balanceImpact() * .completedAt() * .createdAt() * .currency() * .description() + * .heldAmount() * .routeId() * .routeType() * .source() @@ -338,11 +336,11 @@ private constructor( private var id: JsonField? = null private var accountId: JsonField? = null private var amount: JsonField? = null - private var balanceImpact: JsonField? = null private var completedAt: JsonField? = null private var createdAt: JsonField? = null private var currency: JsonField? = null private var description: JsonField? = null + private var heldAmount: JsonField? = null private var routeId: JsonField? = null private var routeType: JsonField? = null private var source: JsonField? = null @@ -355,11 +353,11 @@ private constructor( id = pendingTransaction.id accountId = pendingTransaction.accountId amount = pendingTransaction.amount - balanceImpact = pendingTransaction.balanceImpact completedAt = pendingTransaction.completedAt createdAt = pendingTransaction.createdAt currency = pendingTransaction.currency description = pendingTransaction.description + heldAmount = pendingTransaction.heldAmount routeId = pendingTransaction.routeId routeType = pendingTransaction.routeType source = pendingTransaction.source @@ -405,23 +403,6 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** - * How the Pending Transaction affects the balance of its Account while its status is - * `pending`. - */ - fun balanceImpact(balanceImpact: BalanceImpact) = balanceImpact(JsonField.of(balanceImpact)) - - /** - * Sets [Builder.balanceImpact] to an arbitrary JSON value. - * - * You should usually call [Builder.balanceImpact] with a well-typed [BalanceImpact] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun balanceImpact(balanceImpact: JsonField) = apply { - this.balanceImpact = balanceImpact - } - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending * Transaction was completed. @@ -489,6 +470,20 @@ private constructor( */ fun description(description: JsonField) = apply { this.description = description } + /** + * The amount that this Pending Transaction decrements the available balance of its Account. + * This is usually the same as `amount`, but will differ if the amount is positive. + */ + fun heldAmount(heldAmount: Long) = heldAmount(JsonField.of(heldAmount)) + + /** + * Sets [Builder.heldAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.heldAmount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun heldAmount(heldAmount: JsonField) = apply { this.heldAmount = heldAmount } + /** * The identifier for the route this Pending Transaction came through. Routes are things * like cards and ACH details. @@ -590,11 +585,11 @@ private constructor( * .id() * .accountId() * .amount() - * .balanceImpact() * .completedAt() * .createdAt() * .currency() * .description() + * .heldAmount() * .routeId() * .routeType() * .source() @@ -609,11 +604,11 @@ private constructor( checkRequired("id", id), checkRequired("accountId", accountId), checkRequired("amount", amount), - checkRequired("balanceImpact", balanceImpact), checkRequired("completedAt", completedAt), checkRequired("createdAt", createdAt), checkRequired("currency", currency), checkRequired("description", description), + checkRequired("heldAmount", heldAmount), checkRequired("routeId", routeId), checkRequired("routeType", routeType), checkRequired("source", source), @@ -633,11 +628,11 @@ private constructor( id() accountId() amount() - balanceImpact().validate() completedAt() createdAt() currency().validate() description() + heldAmount() routeId() routeType().ifPresent { it.validate() } source().validate() @@ -664,166 +659,17 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (accountId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + - (balanceImpact.asKnown().getOrNull()?.validity() ?: 0) + (if (completedAt.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (heldAmount.asKnown().isPresent) 1 else 0) + (if (routeId.asKnown().isPresent) 1 else 0) + (routeType.asKnown().getOrNull()?.validity() ?: 0) + (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) - /** - * How the Pending Transaction affects the balance of its Account while its status is `pending`. - */ - class BalanceImpact @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 { - - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - @JvmField val AFFECTS_AVAILABLE_BALANCE = of("affects_available_balance") - - /** This Pending Transaction does not affect the available balance on the Account. */ - @JvmField val NONE = of("none") - - @JvmStatic fun of(value: String) = BalanceImpact(JsonField.of(value)) - } - - /** An enum containing [BalanceImpact]'s known values. */ - enum class Known { - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - AFFECTS_AVAILABLE_BALANCE, - /** This Pending Transaction does not affect the available balance on the Account. */ - NONE, - } - - /** - * An enum containing [BalanceImpact]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [BalanceImpact] 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 { - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - AFFECTS_AVAILABLE_BALANCE, - /** This Pending Transaction does not affect the available balance on the Account. */ - NONE, - /** - * An enum member indicating that [BalanceImpact] 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) { - AFFECTS_AVAILABLE_BALANCE -> Value.AFFECTS_AVAILABLE_BALANCE - NONE -> Value.NONE - 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) { - AFFECTS_AVAILABLE_BALANCE -> Known.AFFECTS_AVAILABLE_BALANCE - NONE -> Known.NONE - else -> throw IncreaseInvalidDataException("Unknown BalanceImpact: $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(): BalanceImpact = 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 BalanceImpact && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending Transaction's * currency. This will match the currency on the Pending Transaction's Account. @@ -1160,11 +1006,11 @@ private constructor( private val fednowTransferInstruction: JsonField, private val inboundFundsHold: JsonField, private val inboundWireTransferReversal: JsonField, - private val other: JsonValue, + private val other: JsonField, private val realTimePaymentsTransferInstruction: JsonField, private val swiftTransferInstruction: JsonField, - private val userInitiatedHold: JsonValue, + private val userInitiatedHold: JsonField, private val wireTransferInstruction: JsonField, private val additionalProperties: MutableMap, ) { @@ -1201,7 +1047,7 @@ private constructor( @JsonProperty("inbound_wire_transfer_reversal") @ExcludeMissing inboundWireTransferReversal: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("real_time_payments_transfer_instruction") @ExcludeMissing realTimePaymentsTransferInstruction: JsonField = @@ -1211,7 +1057,7 @@ private constructor( swiftTransferInstruction: JsonField = JsonMissing.of(), @JsonProperty("user_initiated_hold") @ExcludeMissing - userInitiatedHold: JsonValue = JsonMissing.of(), + userInitiatedHold: JsonField = JsonMissing.of(), @JsonProperty("wire_transfer_instruction") @ExcludeMissing wireTransferInstruction: JsonField = JsonMissing.of(), @@ -1341,8 +1187,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Real-Time Payments Transfer Instruction object. This field will be present in the JSON @@ -1370,10 +1219,12 @@ private constructor( * An User Initiated Hold object. This field will be present in the JSON response if and * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a * hold on funds in their account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("user_initiated_hold") - @ExcludeMissing - fun _userInitiatedHold(): JsonValue = userInitiatedHold + fun userInitiatedHold(): Optional = + userInitiatedHold.getOptional("user_initiated_hold") /** * A Wire Transfer Instruction object. This field will be present in the JSON response if @@ -1487,6 +1338,13 @@ private constructor( fun _inboundWireTransferReversal(): JsonField = inboundWireTransferReversal + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [realTimePaymentsTransferInstruction]. * @@ -1509,6 +1367,16 @@ private constructor( fun _swiftTransferInstruction(): JsonField = swiftTransferInstruction + /** + * Returns the raw JSON value of [userInitiatedHold]. + * + * Unlike [userInitiatedHold], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_initiated_hold") + @ExcludeMissing + fun _userInitiatedHold(): JsonField = userInitiatedHold + /** * Returns the raw JSON value of [wireTransferInstruction]. * @@ -1571,12 +1439,12 @@ private constructor( private var fednowTransferInstruction: JsonField? = null private var inboundFundsHold: JsonField? = null private var inboundWireTransferReversal: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var realTimePaymentsTransferInstruction: JsonField? = null private var swiftTransferInstruction: JsonField? = null - private var userInitiatedHold: JsonValue? = null + private var userInitiatedHold: JsonField? = null private var wireTransferInstruction: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1858,7 +1726,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Real-Time Payments Transfer Instruction object. This field will be present in the @@ -1924,7 +1804,23 @@ private constructor( * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a * hold on funds in their account. */ - fun userInitiatedHold(userInitiatedHold: JsonValue) = apply { + fun userInitiatedHold(userInitiatedHold: UserInitiatedHold?) = + userInitiatedHold(JsonField.ofNullable(userInitiatedHold)) + + /** + * Alias for calling [Builder.userInitiatedHold] with `userInitiatedHold.orElse(null)`. + */ + fun userInitiatedHold(userInitiatedHold: Optional) = + userInitiatedHold(userInitiatedHold.getOrNull()) + + /** + * Sets [Builder.userInitiatedHold] to an arbitrary JSON value. + * + * You should usually call [Builder.userInitiatedHold] with a well-typed + * [UserInitiatedHold] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun userInitiatedHold(userInitiatedHold: JsonField) = apply { this.userInitiatedHold = userInitiatedHold } @@ -2040,8 +1936,10 @@ private constructor( fednowTransferInstruction().ifPresent { it.validate() } inboundFundsHold().ifPresent { it.validate() } inboundWireTransferReversal().ifPresent { it.validate() } + other().ifPresent { it.validate() } realTimePaymentsTransferInstruction().ifPresent { it.validate() } swiftTransferInstruction().ifPresent { it.validate() } + userInitiatedHold().ifPresent { it.validate() } wireTransferInstruction().ifPresent { it.validate() } validated = true } @@ -2072,8 +1970,10 @@ private constructor( (fednowTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (inboundFundsHold.asKnown().getOrNull()?.validity() ?: 0) + (inboundWireTransferReversal.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (realTimePaymentsTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (swiftTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + + (userInitiatedHold.asKnown().getOrNull()?.validity() ?: 0) + (wireTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) /** @@ -3068,7 +2968,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3862,7 +3763,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -4405,6 +4307,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -4423,6 +4326,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -4447,6 +4353,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -4473,6 +4380,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -4548,6 +4463,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -4638,6 +4563,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4655,6 +4581,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -4668,6 +4595,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -4708,6 +4636,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -4874,6 +4817,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4889,6 +4833,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -4909,6 +4854,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -4937,6 +4883,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -5399,8 +5346,8 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The part of this transaction amount that was for healthcare prescriptions. */ - class Prescription + /** The original pre-authorized amount. */ + class Original @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -5472,7 +5419,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Prescription]. + * Returns a mutable builder for constructing an instance of [Original]. * * The following fields are required: * ```java @@ -5483,7 +5430,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Prescription]. */ + /** A builder for [Original]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -5492,10 +5439,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(prescription: Prescription) = apply { - amount = prescription.amount - currency = prescription.currency - additionalProperties = prescription.additionalProperties.toMutableMap() + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() } /** @@ -5554,7 +5501,7 @@ private constructor( } /** - * Returns an immutable instance of [Prescription]. + * Returns an immutable instance of [Original]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -5566,8 +5513,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Prescription = - Prescription( + fun build(): Original = + Original( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -5576,7 +5523,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Prescription = apply { + fun validate(): Original = apply { if (validated) { return@apply } @@ -5610,7 +5557,7 @@ private constructor( return true } - return other is Prescription && + return other is Original && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -5623,11 +5570,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The surcharge amount charged for this transaction by the merchant. */ - class Surcharge + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -5699,7 +5646,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Surcharge]. + * Returns a mutable builder for constructing an instance of [Prescription]. * * The following fields are required: * ```java @@ -5710,7 +5657,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Surcharge]. */ + /** A builder for [Prescription]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -5719,10 +5666,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(surcharge: Surcharge) = apply { - amount = surcharge.amount - currency = surcharge.currency - additionalProperties = surcharge.additionalProperties.toMutableMap() + internal fun from(prescription: Prescription) = apply { + amount = prescription.amount + currency = prescription.currency + additionalProperties = prescription.additionalProperties.toMutableMap() } /** @@ -5781,7 +5728,7 @@ private constructor( } /** - * Returns an immutable instance of [Surcharge]. + * Returns an immutable instance of [Prescription]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -5793,8 +5740,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Surcharge = - Surcharge( + fun build(): Prescription = + Prescription( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -5803,7 +5750,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Surcharge = apply { + fun validate(): Prescription = apply { if (validated) { return@apply } @@ -5837,7 +5784,7 @@ private constructor( return true } - return other is Surcharge && + return other is Prescription && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -5850,10 +5797,237 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** + /** The surcharge amount charged for this transaction by the merchant. */ + class Surcharge + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Surcharge]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Surcharge]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(surcharge: Surcharge) = apply { + amount = surcharge.amount + currency = surcharge.currency + additionalProperties = surcharge.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Surcharge]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Surcharge = + Surcharge( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Surcharge = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Surcharge && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** * The total amount of a series of incremental authorizations, optionally provided. */ class TotalCumulative @@ -7002,6 +7176,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -7016,6 +7191,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -7030,7 +7206,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -7365,6 +7541,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7374,8 +7551,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -7386,6 +7566,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -7404,6 +7592,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -7432,6 +7628,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -7442,12 +7639,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -7464,6 +7663,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7509,6 +7723,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -7517,6 +7732,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -7530,6 +7746,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -7551,6 +7768,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -7574,13 +7792,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -7596,6 +7819,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -7613,6 +7838,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7628,31 +7854,140 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $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") + /** + * 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(): Category = 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): Pulse = apply { if (validated) { return@apply } - known() validated = true } @@ -7670,20 +8005,21 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is Pulse && additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" } /** Fields specific to the `visa` network. */ @@ -8847,24 +9183,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -8873,6 +9211,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -8882,7 +9223,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -8913,6 +9272,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -8963,6 +9333,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -8974,6 +9345,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -8981,6 +9353,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -8988,6 +9362,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -9090,6 +9501,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -9099,6 +9511,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -9113,6 +9529,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -9135,7 +9552,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -9145,6 +9563,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -9153,6 +9573,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -9163,7 +9584,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -13777,6 +14198,115 @@ private constructor( "InboundWireTransferReversal{inboundWireTransferId=$inboundWireTransferId, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Real-Time Payments Transfer Instruction object. This field will be present in the JSON * response if and only if `category` is equal to `real_time_payments_transfer_instruction`. @@ -14178,6 +14708,118 @@ private constructor( "SwiftTransferInstruction{transferId=$transferId, additionalProperties=$additionalProperties}" } + /** + * An User Initiated Hold object. This field will be present in the JSON response if and + * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a + * hold on funds in their account. + */ + class UserInitiatedHold + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [UserInitiatedHold]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserInitiatedHold]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userInitiatedHold: UserInitiatedHold) = apply { + additionalProperties = userInitiatedHold.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [UserInitiatedHold]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserInitiatedHold = + UserInitiatedHold(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): UserInitiatedHold = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is UserInitiatedHold && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UserInitiatedHold{additionalProperties=$additionalProperties}" + } + /** * A Wire Transfer Instruction object. This field will be present in the JSON response if * and only if `category` is equal to `wire_transfer_instruction`. @@ -14884,11 +15526,11 @@ private constructor( id == other.id && accountId == other.accountId && amount == other.amount && - balanceImpact == other.balanceImpact && completedAt == other.completedAt && createdAt == other.createdAt && currency == other.currency && description == other.description && + heldAmount == other.heldAmount && routeId == other.routeId && routeType == other.routeType && source == other.source && @@ -14902,11 +15544,11 @@ private constructor( id, accountId, amount, - balanceImpact, completedAt, createdAt, currency, description, + heldAmount, routeId, routeType, source, @@ -14919,5 +15561,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PendingTransaction{id=$id, accountId=$accountId, amount=$amount, balanceImpact=$balanceImpact, completedAt=$completedAt, createdAt=$createdAt, currency=$currency, description=$description, routeId=$routeId, routeType=$routeType, source=$source, status=$status, type=$type, additionalProperties=$additionalProperties}" + "PendingTransaction{id=$id, accountId=$accountId, amount=$amount, completedAt=$completedAt, createdAt=$createdAt, currency=$currency, description=$description, heldAmount=$heldAmount, routeId=$routeId, routeType=$routeType, source=$source, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index f7afda169..e6f630c54 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -1840,7 +1840,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score is + * from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -2585,7 +2586,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -2974,6 +2976,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -2992,6 +2995,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -3014,6 +3020,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -3040,6 +3047,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -3112,6 +3127,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -3194,6 +3219,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -3211,6 +3237,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -3224,6 +3251,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -3264,6 +3292,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** The part of this transaction amount that was for healthcare prescriptions. */ fun prescription(prescription: Prescription?) = prescription(JsonField.ofNullable(prescription)) @@ -3420,6 +3463,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -3435,6 +3479,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -3455,6 +3500,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -3483,6 +3529,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -3939,6 +3986,230 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if it + * is added to the amount (such as an ATM surcharge fee) and negative if it is + * subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + * amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -5515,6 +5786,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -5529,6 +5801,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -5543,7 +5816,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** Whether or not the authorization was approved. */ @@ -6002,6 +6275,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -6011,8 +6285,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -6023,6 +6298,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -6041,6 +6324,13 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -6068,6 +6358,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -6078,12 +6369,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -6100,6 +6393,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -6145,6 +6453,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -6153,6 +6462,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -6166,6 +6476,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -6187,6 +6498,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -6208,13 +6520,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -6229,6 +6546,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an unknown * value. @@ -6236,56 +6555,162 @@ private constructor( _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) { - VISA -> Value.VISA - else -> 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) { + VISA -> Value.VISA + PULSE -> Value.PULSE + 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) { + VISA -> Known.VISA + PULSE -> Known.PULSE + else -> throw IncreaseInvalidDataException("Unknown Category: $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(): Category = 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() } - /** - * 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) { - VISA -> Known.VISA - else -> throw IncreaseInvalidDataException("Unknown Category: $value") + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * 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") + 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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): Pulse = apply { if (validated) { return@apply } - known() validated = true } @@ -6303,19 +6728,21 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is Pulse && additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" } /** Fields specific to the `visa` network. */ @@ -7455,22 +7882,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(category, visa, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(category, pulse, visa, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -7479,6 +7910,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -7488,7 +7922,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code sent + * back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. Expected @@ -7519,6 +7971,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -7568,6 +8031,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -7579,6 +8043,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -7586,12 +8051,49 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -7691,6 +8193,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -7700,6 +8203,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -7714,6 +8221,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -7736,7 +8244,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -7746,6 +8255,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -7754,6 +8265,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -7764,7 +8276,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -8028,7 +8540,7 @@ private constructor( private constructor( private val category: JsonField, private val incrementalAuthorization: JsonField, - private val initialAuthorization: JsonValue, + private val initialAuthorization: JsonField, private val additionalProperties: MutableMap, ) { @@ -8042,7 +8554,7 @@ private constructor( incrementalAuthorization: JsonField = JsonMissing.of(), @JsonProperty("initial_authorization") @ExcludeMissing - initialAuthorization: JsonValue = JsonMissing.of(), + initialAuthorization: JsonField = JsonMissing.of(), ) : this(category, incrementalAuthorization, initialAuthorization, mutableMapOf()) /** @@ -8064,10 +8576,14 @@ private constructor( fun incrementalAuthorization(): Optional = incrementalAuthorization.getOptional("incremental_authorization") - /** Fields specific to the category `initial_authorization`. */ - @JsonProperty("initial_authorization") - @ExcludeMissing - fun _initialAuthorization(): JsonValue = initialAuthorization + /** + * Fields specific to the category `initial_authorization`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun initialAuthorization(): Optional = + initialAuthorization.getOptional("initial_authorization") /** * Returns the raw JSON value of [category]. @@ -8090,6 +8606,16 @@ private constructor( fun _incrementalAuthorization(): JsonField = incrementalAuthorization + /** + * Returns the raw JSON value of [initialAuthorization]. + * + * Unlike [initialAuthorization], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("initial_authorization") + @ExcludeMissing + fun _initialAuthorization(): JsonField = initialAuthorization + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -8122,7 +8648,7 @@ private constructor( private var category: JsonField? = null private var incrementalAuthorization: JsonField? = null - private var initialAuthorization: JsonValue? = null + private var initialAuthorization: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -8172,9 +8698,27 @@ private constructor( ) = apply { this.incrementalAuthorization = incrementalAuthorization } /** Fields specific to the category `initial_authorization`. */ - fun initialAuthorization(initialAuthorization: JsonValue) = apply { - this.initialAuthorization = initialAuthorization - } + fun initialAuthorization(initialAuthorization: InitialAuthorization?) = + initialAuthorization(JsonField.ofNullable(initialAuthorization)) + + /** + * Alias for calling [Builder.initialAuthorization] with + * `initialAuthorization.orElse(null)`. + */ + fun initialAuthorization(initialAuthorization: Optional) = + initialAuthorization(initialAuthorization.getOrNull()) + + /** + * Sets [Builder.initialAuthorization] to an arbitrary JSON value. + * + * You should usually call [Builder.initialAuthorization] with a well-typed + * [InitialAuthorization] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun initialAuthorization(initialAuthorization: JsonField) = + apply { + this.initialAuthorization = initialAuthorization + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -8230,6 +8774,7 @@ private constructor( category().validate() incrementalAuthorization().ifPresent { it.validate() } + initialAuthorization().ifPresent { it.validate() } validated = true } @@ -8250,7 +8795,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + - (incrementalAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (incrementalAuthorization.asKnown().getOrNull()?.validity() ?: 0) + + (initialAuthorization.asKnown().getOrNull()?.validity() ?: 0) /** * The type of this request (e.g., an initial authorization or an incremental @@ -8631,6 +9177,119 @@ private constructor( "IncrementalAuthorization{cardPaymentId=$cardPaymentId, originalCardAuthorizationId=$originalCardAuthorizationId, additionalProperties=$additionalProperties}" } + /** Fields specific to the category `initial_authorization`. */ + class InitialAuthorization + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [InitialAuthorization]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InitialAuthorization]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(initialAuthorization: InitialAuthorization) = apply { + additionalProperties = + initialAuthorization.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [InitialAuthorization]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InitialAuthorization = + InitialAuthorization(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): InitialAuthorization = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InitialAuthorization && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InitialAuthorization{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -10950,7 +11609,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val cardId: JsonField, - private val cardProfileId: JsonField, private val decision: JsonField, private val device: JsonField, private val digitalWallet: JsonField, @@ -10960,9 +11618,6 @@ private constructor( @JsonCreator private constructor( @JsonProperty("card_id") @ExcludeMissing cardId: JsonField = JsonMissing.of(), - @JsonProperty("card_profile_id") - @ExcludeMissing - cardProfileId: JsonField = JsonMissing.of(), @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), @@ -10970,7 +11625,7 @@ private constructor( @JsonProperty("digital_wallet") @ExcludeMissing digitalWallet: JsonField = JsonMissing.of(), - ) : this(cardId, cardProfileId, decision, device, digitalWallet, mutableMapOf()) + ) : this(cardId, decision, device, digitalWallet, mutableMapOf()) /** * The identifier of the Card that is being tokenized. @@ -10980,16 +11635,6 @@ private constructor( */ fun cardId(): String = cardId.getRequired("card_id") - /** - * The identifier of the Card Profile that was set via the real time decision. This will be - * null until the real time decision is responded to or if the real time decision did not - * set a card profile. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun cardProfileId(): Optional = cardProfileId.getOptional("card_profile_id") - /** * Whether or not the provisioning request was approved. This will be null until the real * time decision is responded to. @@ -11022,16 +11667,6 @@ private constructor( */ @JsonProperty("card_id") @ExcludeMissing fun _cardId(): JsonField = cardId - /** - * Returns the raw JSON value of [cardProfileId]. - * - * Unlike [cardProfileId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("card_profile_id") - @ExcludeMissing - fun _cardProfileId(): JsonField = cardProfileId - /** * Returns the raw JSON value of [decision]. * @@ -11076,7 +11711,6 @@ private constructor( * The following fields are required: * ```java * .cardId() - * .cardProfileId() * .decision() * .device() * .digitalWallet() @@ -11089,7 +11723,6 @@ private constructor( class Builder internal constructor() { private var cardId: JsonField? = null - private var cardProfileId: JsonField? = null private var decision: JsonField? = null private var device: JsonField? = null private var digitalWallet: JsonField? = null @@ -11098,7 +11731,6 @@ private constructor( @JvmSynthetic internal fun from(digitalWalletToken: DigitalWalletToken) = apply { cardId = digitalWalletToken.cardId - cardProfileId = digitalWalletToken.cardProfileId decision = digitalWalletToken.decision device = digitalWalletToken.device digitalWallet = digitalWalletToken.digitalWallet @@ -11117,29 +11749,6 @@ private constructor( */ fun cardId(cardId: JsonField) = apply { this.cardId = cardId } - /** - * The identifier of the Card Profile that was set via the real time decision. This will - * be null until the real time decision is responded to or if the real time decision did - * not set a card profile. - */ - fun cardProfileId(cardProfileId: String?) = - cardProfileId(JsonField.ofNullable(cardProfileId)) - - /** Alias for calling [Builder.cardProfileId] with `cardProfileId.orElse(null)`. */ - fun cardProfileId(cardProfileId: Optional) = - cardProfileId(cardProfileId.getOrNull()) - - /** - * Sets [Builder.cardProfileId] to an arbitrary JSON value. - * - * You should usually call [Builder.cardProfileId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun cardProfileId(cardProfileId: JsonField) = apply { - this.cardProfileId = cardProfileId - } - /** * Whether or not the provisioning request was approved. This will be null until the * real time decision is responded to. @@ -11212,7 +11821,6 @@ private constructor( * The following fields are required: * ```java * .cardId() - * .cardProfileId() * .decision() * .device() * .digitalWallet() @@ -11223,7 +11831,6 @@ private constructor( fun build(): DigitalWalletToken = DigitalWalletToken( checkRequired("cardId", cardId), - checkRequired("cardProfileId", cardProfileId), checkRequired("decision", decision), checkRequired("device", device), checkRequired("digitalWallet", digitalWallet), @@ -11239,7 +11846,6 @@ private constructor( } cardId() - cardProfileId() decision().ifPresent { it.validate() } device().validate() digitalWallet().validate() @@ -11263,7 +11869,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (cardId.asKnown().isPresent) 1 else 0) + - (if (cardProfileId.asKnown().isPresent) 1 else 0) + (decision.asKnown().getOrNull()?.validity() ?: 0) + (device.asKnown().getOrNull()?.validity() ?: 0) + (digitalWallet.asKnown().getOrNull()?.validity() ?: 0) @@ -11745,7 +12350,6 @@ private constructor( return other is DigitalWalletToken && cardId == other.cardId && - cardProfileId == other.cardProfileId && decision == other.decision && device == other.device && digitalWallet == other.digitalWallet && @@ -11753,20 +12357,13 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash( - cardId, - cardProfileId, - decision, - device, - digitalWallet, - additionalProperties, - ) + Objects.hash(cardId, decision, device, digitalWallet, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "DigitalWalletToken{cardId=$cardId, cardProfileId=$cardProfileId, decision=$decision, device=$device, digitalWallet=$digitalWallet, additionalProperties=$additionalProperties}" + "DigitalWalletToken{cardId=$cardId, decision=$decision, device=$device, digitalWallet=$digitalWallet, additionalProperties=$additionalProperties}" } /** The status of the Real-Time Decision. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt index 76e5009a7..cd9678ff3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt @@ -2595,6 +2595,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val refund: JsonField, private val additionalProperties: MutableMap, ) { @@ -2602,8 +2603,9 @@ private constructor( private constructor( @JsonProperty("category") @ExcludeMissing - category: JsonField = JsonMissing.of() - ) : this(category, mutableMapOf()) + category: JsonField = JsonMissing.of(), + @JsonProperty("refund") @ExcludeMissing refund: JsonField = JsonMissing.of(), + ) : this(category, refund, mutableMapOf()) /** * The processing category describes the intent behind the authorization, such as whether it @@ -2614,6 +2616,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Details related to refund authorizations. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun refund(): Optional = refund.getOptional("refund") + /** * Returns the raw JSON value of [category]. * @@ -2621,6 +2631,13 @@ private constructor( */ @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [refund]. + * + * Unlike [refund], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("refund") @ExcludeMissing fun _refund(): JsonField = refund + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -2650,11 +2667,13 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var refund: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(processingCategory: ProcessingCategory) = apply { category = processingCategory.category + refund = processingCategory.refund additionalProperties = processingCategory.additionalProperties.toMutableMap() } @@ -2673,6 +2692,18 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Details related to refund authorizations. */ + fun refund(refund: Refund) = refund(JsonField.of(refund)) + + /** + * Sets [Builder.refund] to an arbitrary JSON value. + * + * You should usually call [Builder.refund] with a well-typed [Refund] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun refund(refund: JsonField) = apply { this.refund = refund } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2707,6 +2738,7 @@ private constructor( fun build(): ProcessingCategory = ProcessingCategory( checkRequired("category", category), + refund, additionalProperties.toMutableMap(), ) } @@ -2719,6 +2751,7 @@ private constructor( } category().validate() + refund().ifPresent { it.validate() } validated = true } @@ -2737,7 +2770,9 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + internal fun validity(): Int = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (refund.asKnown().getOrNull()?.validity() ?: 0) /** * The processing category describes the intent behind the authorization, such as whether it @@ -2981,6 +3016,164 @@ private constructor( override fun toString() = value.toString() } + /** Details related to refund authorizations. */ + class Refund + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val originalCardPaymentId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("original_card_payment_id") + @ExcludeMissing + originalCardPaymentId: JsonField = JsonMissing.of() + ) : this(originalCardPaymentId, mutableMapOf()) + + /** + * The card payment to link this refund to. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun originalCardPaymentId(): Optional = + originalCardPaymentId.getOptional("original_card_payment_id") + + /** + * Returns the raw JSON value of [originalCardPaymentId]. + * + * Unlike [originalCardPaymentId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("original_card_payment_id") + @ExcludeMissing + fun _originalCardPaymentId(): JsonField = originalCardPaymentId + + @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 [Refund]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Refund]. */ + class Builder internal constructor() { + + private var originalCardPaymentId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(refund: Refund) = apply { + originalCardPaymentId = refund.originalCardPaymentId + additionalProperties = refund.additionalProperties.toMutableMap() + } + + /** The card payment to link this refund to. */ + fun originalCardPaymentId(originalCardPaymentId: String) = + originalCardPaymentId(JsonField.of(originalCardPaymentId)) + + /** + * Sets [Builder.originalCardPaymentId] to an arbitrary JSON value. + * + * You should usually call [Builder.originalCardPaymentId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun originalCardPaymentId(originalCardPaymentId: JsonField) = apply { + this.originalCardPaymentId = originalCardPaymentId + } + + 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 [Refund]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Refund = + Refund(originalCardPaymentId, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Refund = apply { + if (validated) { + return@apply + } + + originalCardPaymentId() + 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 (originalCardPaymentId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Refund && + originalCardPaymentId == other.originalCardPaymentId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(originalCardPaymentId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Refund{originalCardPaymentId=$originalCardPaymentId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -2988,15 +3181,16 @@ private constructor( return other is ProcessingCategory && category == other.category && + refund == other.refund && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(category, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(category, refund, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ProcessingCategory{category=$category, additionalProperties=$additionalProperties}" + "ProcessingCategory{category=$category, refund=$refund, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt index e603dd75d..fa5172a66 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt @@ -639,16 +639,16 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val action: JsonField, - private val acceptChargeback: JsonValue, - private val acceptUserSubmission: JsonValue, - private val declineUserPrearbitration: JsonValue, - private val receiveMerchantPrearbitration: JsonValue, - private val represent: JsonValue, + private val acceptChargeback: JsonField, + private val acceptUserSubmission: JsonField, + private val declineUserPrearbitration: JsonField, + private val receiveMerchantPrearbitration: JsonField, + private val represent: JsonField, private val requestFurtherInformation: JsonField, - private val timeOutChargeback: JsonValue, - private val timeOutMerchantPrearbitration: JsonValue, - private val timeOutRepresentment: JsonValue, - private val timeOutUserPrearbitration: JsonValue, + private val timeOutChargeback: JsonField, + private val timeOutMerchantPrearbitration: JsonField, + private val timeOutRepresentment: JsonField, + private val timeOutUserPrearbitration: JsonField, private val additionalProperties: MutableMap, ) { @@ -657,32 +657,36 @@ private constructor( @JsonProperty("action") @ExcludeMissing action: JsonField = JsonMissing.of(), @JsonProperty("accept_chargeback") @ExcludeMissing - acceptChargeback: JsonValue = JsonMissing.of(), + acceptChargeback: JsonField = JsonMissing.of(), @JsonProperty("accept_user_submission") @ExcludeMissing - acceptUserSubmission: JsonValue = JsonMissing.of(), + acceptUserSubmission: JsonField = JsonMissing.of(), @JsonProperty("decline_user_prearbitration") @ExcludeMissing - declineUserPrearbitration: JsonValue = JsonMissing.of(), + declineUserPrearbitration: JsonField = JsonMissing.of(), @JsonProperty("receive_merchant_prearbitration") @ExcludeMissing - receiveMerchantPrearbitration: JsonValue = JsonMissing.of(), - @JsonProperty("represent") @ExcludeMissing represent: JsonValue = JsonMissing.of(), + receiveMerchantPrearbitration: JsonField = + JsonMissing.of(), + @JsonProperty("represent") + @ExcludeMissing + represent: JsonField = JsonMissing.of(), @JsonProperty("request_further_information") @ExcludeMissing requestFurtherInformation: JsonField = JsonMissing.of(), @JsonProperty("time_out_chargeback") @ExcludeMissing - timeOutChargeback: JsonValue = JsonMissing.of(), + timeOutChargeback: JsonField = JsonMissing.of(), @JsonProperty("time_out_merchant_prearbitration") @ExcludeMissing - timeOutMerchantPrearbitration: JsonValue = JsonMissing.of(), + timeOutMerchantPrearbitration: JsonField = + JsonMissing.of(), @JsonProperty("time_out_representment") @ExcludeMissing - timeOutRepresentment: JsonValue = JsonMissing.of(), + timeOutRepresentment: JsonField = JsonMissing.of(), @JsonProperty("time_out_user_prearbitration") @ExcludeMissing - timeOutUserPrearbitration: JsonValue = JsonMissing.of(), + timeOutUserPrearbitration: JsonField = JsonMissing.of(), ) : this( action, acceptChargeback, @@ -710,40 +714,51 @@ private constructor( /** * The parameters for accepting the chargeback. Required if and only if `action` is * `accept_chargeback`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("accept_chargeback") - @ExcludeMissing - fun _acceptChargeback(): JsonValue = acceptChargeback + fun acceptChargeback(): Optional = + acceptChargeback.getOptional("accept_chargeback") /** * The parameters for accepting the user submission. Required if and only if `action` is * `accept_user_submission`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("accept_user_submission") - @ExcludeMissing - fun _acceptUserSubmission(): JsonValue = acceptUserSubmission + fun acceptUserSubmission(): Optional = + acceptUserSubmission.getOptional("accept_user_submission") /** * The parameters for declining the prearbitration. Required if and only if `action` is * `decline_user_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("decline_user_prearbitration") - @ExcludeMissing - fun _declineUserPrearbitration(): JsonValue = declineUserPrearbitration + fun declineUserPrearbitration(): Optional = + declineUserPrearbitration.getOptional("decline_user_prearbitration") /** * The parameters for receiving the prearbitration. Required if and only if `action` is * `receive_merchant_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("receive_merchant_prearbitration") - @ExcludeMissing - fun _receiveMerchantPrearbitration(): JsonValue = receiveMerchantPrearbitration + fun receiveMerchantPrearbitration(): Optional = + receiveMerchantPrearbitration.getOptional("receive_merchant_prearbitration") /** * The parameters for re-presenting the dispute. Required if and only if `action` is * `represent`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("represent") @ExcludeMissing fun _represent(): JsonValue = represent + fun represent(): Optional = represent.getOptional("represent") /** * The parameters for requesting further information from the user. Required if and only if @@ -758,34 +773,42 @@ private constructor( /** * The parameters for timing out the chargeback. Required if and only if `action` is * `time_out_chargeback`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_chargeback") - @ExcludeMissing - fun _timeOutChargeback(): JsonValue = timeOutChargeback + fun timeOutChargeback(): Optional = + timeOutChargeback.getOptional("time_out_chargeback") /** * The parameters for timing out the merchant prearbitration. Required if and only if * `action` is `time_out_merchant_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_merchant_prearbitration") - @ExcludeMissing - fun _timeOutMerchantPrearbitration(): JsonValue = timeOutMerchantPrearbitration + fun timeOutMerchantPrearbitration(): Optional = + timeOutMerchantPrearbitration.getOptional("time_out_merchant_prearbitration") /** * The parameters for timing out the re-presentment. Required if and only if `action` is * `time_out_representment`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_representment") - @ExcludeMissing - fun _timeOutRepresentment(): JsonValue = timeOutRepresentment + fun timeOutRepresentment(): Optional = + timeOutRepresentment.getOptional("time_out_representment") /** * The parameters for timing out the user prearbitration. Required if and only if `action` * is `time_out_user_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_user_prearbitration") - @ExcludeMissing - fun _timeOutUserPrearbitration(): JsonValue = timeOutUserPrearbitration + fun timeOutUserPrearbitration(): Optional = + timeOutUserPrearbitration.getOptional("time_out_user_prearbitration") /** * Returns the raw JSON value of [action]. @@ -794,6 +817,57 @@ private constructor( */ @JsonProperty("action") @ExcludeMissing fun _action(): JsonField = action + /** + * Returns the raw JSON value of [acceptChargeback]. + * + * Unlike [acceptChargeback], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("accept_chargeback") + @ExcludeMissing + fun _acceptChargeback(): JsonField = acceptChargeback + + /** + * Returns the raw JSON value of [acceptUserSubmission]. + * + * Unlike [acceptUserSubmission], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("accept_user_submission") + @ExcludeMissing + fun _acceptUserSubmission(): JsonField = acceptUserSubmission + + /** + * Returns the raw JSON value of [declineUserPrearbitration]. + * + * Unlike [declineUserPrearbitration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("decline_user_prearbitration") + @ExcludeMissing + fun _declineUserPrearbitration(): JsonField = + declineUserPrearbitration + + /** + * Returns the raw JSON value of [receiveMerchantPrearbitration]. + * + * Unlike [receiveMerchantPrearbitration], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("receive_merchant_prearbitration") + @ExcludeMissing + fun _receiveMerchantPrearbitration(): JsonField = + receiveMerchantPrearbitration + + /** + * Returns the raw JSON value of [represent]. + * + * Unlike [represent], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("represent") + @ExcludeMissing + fun _represent(): JsonField = represent + /** * Returns the raw JSON value of [requestFurtherInformation]. * @@ -805,6 +879,48 @@ private constructor( fun _requestFurtherInformation(): JsonField = requestFurtherInformation + /** + * Returns the raw JSON value of [timeOutChargeback]. + * + * Unlike [timeOutChargeback], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_out_chargeback") + @ExcludeMissing + fun _timeOutChargeback(): JsonField = timeOutChargeback + + /** + * Returns the raw JSON value of [timeOutMerchantPrearbitration]. + * + * Unlike [timeOutMerchantPrearbitration], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("time_out_merchant_prearbitration") + @ExcludeMissing + fun _timeOutMerchantPrearbitration(): JsonField = + timeOutMerchantPrearbitration + + /** + * Returns the raw JSON value of [timeOutRepresentment]. + * + * Unlike [timeOutRepresentment], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("time_out_representment") + @ExcludeMissing + fun _timeOutRepresentment(): JsonField = timeOutRepresentment + + /** + * Returns the raw JSON value of [timeOutUserPrearbitration]. + * + * Unlike [timeOutUserPrearbitration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("time_out_user_prearbitration") + @ExcludeMissing + fun _timeOutUserPrearbitration(): JsonField = + timeOutUserPrearbitration + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -834,17 +950,21 @@ private constructor( class Builder internal constructor() { private var action: JsonField? = null - private var acceptChargeback: JsonValue = JsonMissing.of() - private var acceptUserSubmission: JsonValue = JsonMissing.of() - private var declineUserPrearbitration: JsonValue = JsonMissing.of() - private var receiveMerchantPrearbitration: JsonValue = JsonMissing.of() - private var represent: JsonValue = JsonMissing.of() + private var acceptChargeback: JsonField = JsonMissing.of() + private var acceptUserSubmission: JsonField = JsonMissing.of() + private var declineUserPrearbitration: JsonField = + JsonMissing.of() + private var receiveMerchantPrearbitration: JsonField = + JsonMissing.of() + private var represent: JsonField = JsonMissing.of() private var requestFurtherInformation: JsonField = JsonMissing.of() - private var timeOutChargeback: JsonValue = JsonMissing.of() - private var timeOutMerchantPrearbitration: JsonValue = JsonMissing.of() - private var timeOutRepresentment: JsonValue = JsonMissing.of() - private var timeOutUserPrearbitration: JsonValue = JsonMissing.of() + private var timeOutChargeback: JsonField = JsonMissing.of() + private var timeOutMerchantPrearbitration: JsonField = + JsonMissing.of() + private var timeOutRepresentment: JsonField = JsonMissing.of() + private var timeOutUserPrearbitration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -882,7 +1002,17 @@ private constructor( * The parameters for accepting the chargeback. Required if and only if `action` is * `accept_chargeback`. */ - fun acceptChargeback(acceptChargeback: JsonValue) = apply { + fun acceptChargeback(acceptChargeback: AcceptChargeback) = + acceptChargeback(JsonField.of(acceptChargeback)) + + /** + * Sets [Builder.acceptChargeback] to an arbitrary JSON value. + * + * You should usually call [Builder.acceptChargeback] with a well-typed + * [AcceptChargeback] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun acceptChargeback(acceptChargeback: JsonField) = apply { this.acceptChargeback = acceptChargeback } @@ -890,31 +1020,72 @@ private constructor( * The parameters for accepting the user submission. Required if and only if `action` is * `accept_user_submission`. */ - fun acceptUserSubmission(acceptUserSubmission: JsonValue) = apply { - this.acceptUserSubmission = acceptUserSubmission - } + fun acceptUserSubmission(acceptUserSubmission: AcceptUserSubmission) = + acceptUserSubmission(JsonField.of(acceptUserSubmission)) + + /** + * Sets [Builder.acceptUserSubmission] to an arbitrary JSON value. + * + * You should usually call [Builder.acceptUserSubmission] with a well-typed + * [AcceptUserSubmission] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun acceptUserSubmission(acceptUserSubmission: JsonField) = + apply { + this.acceptUserSubmission = acceptUserSubmission + } /** * The parameters for declining the prearbitration. Required if and only if `action` is * `decline_user_prearbitration`. */ - fun declineUserPrearbitration(declineUserPrearbitration: JsonValue) = apply { - this.declineUserPrearbitration = declineUserPrearbitration - } + fun declineUserPrearbitration(declineUserPrearbitration: DeclineUserPrearbitration) = + declineUserPrearbitration(JsonField.of(declineUserPrearbitration)) + + /** + * Sets [Builder.declineUserPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.declineUserPrearbitration] with a well-typed + * [DeclineUserPrearbitration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun declineUserPrearbitration( + declineUserPrearbitration: JsonField + ) = apply { this.declineUserPrearbitration = declineUserPrearbitration } /** * The parameters for receiving the prearbitration. Required if and only if `action` is * `receive_merchant_prearbitration`. */ - fun receiveMerchantPrearbitration(receiveMerchantPrearbitration: JsonValue) = apply { - this.receiveMerchantPrearbitration = receiveMerchantPrearbitration - } + fun receiveMerchantPrearbitration( + receiveMerchantPrearbitration: ReceiveMerchantPrearbitration + ) = receiveMerchantPrearbitration(JsonField.of(receiveMerchantPrearbitration)) + + /** + * Sets [Builder.receiveMerchantPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.receiveMerchantPrearbitration] with a well-typed + * [ReceiveMerchantPrearbitration] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun receiveMerchantPrearbitration( + receiveMerchantPrearbitration: JsonField + ) = apply { this.receiveMerchantPrearbitration = receiveMerchantPrearbitration } /** * The parameters for re-presenting the dispute. Required if and only if `action` is * `represent`. */ - fun represent(represent: JsonValue) = apply { this.represent = represent } + fun represent(represent: Represent) = represent(JsonField.of(represent)) + + /** + * Sets [Builder.represent] to an arbitrary JSON value. + * + * You should usually call [Builder.represent] with a well-typed [Represent] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun represent(represent: JsonField) = apply { this.represent = represent } /** * The parameters for requesting further information from the user. Required if and only @@ -938,7 +1109,17 @@ private constructor( * The parameters for timing out the chargeback. Required if and only if `action` is * `time_out_chargeback`. */ - fun timeOutChargeback(timeOutChargeback: JsonValue) = apply { + fun timeOutChargeback(timeOutChargeback: TimeOutChargeback) = + timeOutChargeback(JsonField.of(timeOutChargeback)) + + /** + * Sets [Builder.timeOutChargeback] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutChargeback] with a well-typed + * [TimeOutChargeback] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun timeOutChargeback(timeOutChargeback: JsonField) = apply { this.timeOutChargeback = timeOutChargeback } @@ -946,25 +1127,57 @@ private constructor( * The parameters for timing out the merchant prearbitration. Required if and only if * `action` is `time_out_merchant_prearbitration`. */ - fun timeOutMerchantPrearbitration(timeOutMerchantPrearbitration: JsonValue) = apply { - this.timeOutMerchantPrearbitration = timeOutMerchantPrearbitration - } + fun timeOutMerchantPrearbitration( + timeOutMerchantPrearbitration: TimeOutMerchantPrearbitration + ) = timeOutMerchantPrearbitration(JsonField.of(timeOutMerchantPrearbitration)) + + /** + * Sets [Builder.timeOutMerchantPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutMerchantPrearbitration] with a well-typed + * [TimeOutMerchantPrearbitration] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun timeOutMerchantPrearbitration( + timeOutMerchantPrearbitration: JsonField + ) = apply { this.timeOutMerchantPrearbitration = timeOutMerchantPrearbitration } /** * The parameters for timing out the re-presentment. Required if and only if `action` is * `time_out_representment`. */ - fun timeOutRepresentment(timeOutRepresentment: JsonValue) = apply { - this.timeOutRepresentment = timeOutRepresentment - } + fun timeOutRepresentment(timeOutRepresentment: TimeOutRepresentment) = + timeOutRepresentment(JsonField.of(timeOutRepresentment)) + + /** + * Sets [Builder.timeOutRepresentment] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutRepresentment] with a well-typed + * [TimeOutRepresentment] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun timeOutRepresentment(timeOutRepresentment: JsonField) = + apply { + this.timeOutRepresentment = timeOutRepresentment + } /** * The parameters for timing out the user prearbitration. Required if and only if * `action` is `time_out_user_prearbitration`. */ - fun timeOutUserPrearbitration(timeOutUserPrearbitration: JsonValue) = apply { - this.timeOutUserPrearbitration = timeOutUserPrearbitration - } + fun timeOutUserPrearbitration(timeOutUserPrearbitration: TimeOutUserPrearbitration) = + timeOutUserPrearbitration(JsonField.of(timeOutUserPrearbitration)) + + /** + * Sets [Builder.timeOutUserPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutUserPrearbitration] with a well-typed + * [TimeOutUserPrearbitration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun timeOutUserPrearbitration( + timeOutUserPrearbitration: JsonField + ) = apply { this.timeOutUserPrearbitration = timeOutUserPrearbitration } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1022,7 +1235,16 @@ private constructor( } action().validate() + acceptChargeback().ifPresent { it.validate() } + acceptUserSubmission().ifPresent { it.validate() } + declineUserPrearbitration().ifPresent { it.validate() } + receiveMerchantPrearbitration().ifPresent { it.validate() } + represent().ifPresent { it.validate() } requestFurtherInformation().ifPresent { it.validate() } + timeOutChargeback().ifPresent { it.validate() } + timeOutMerchantPrearbitration().ifPresent { it.validate() } + timeOutRepresentment().ifPresent { it.validate() } + timeOutUserPrearbitration().ifPresent { it.validate() } validated = true } @@ -1043,7 +1265,16 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (action.asKnown().getOrNull()?.validity() ?: 0) + - (requestFurtherInformation.asKnown().getOrNull()?.validity() ?: 0) + (acceptChargeback.asKnown().getOrNull()?.validity() ?: 0) + + (acceptUserSubmission.asKnown().getOrNull()?.validity() ?: 0) + + (declineUserPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (receiveMerchantPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (represent.asKnown().getOrNull()?.validity() ?: 0) + + (requestFurtherInformation.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutChargeback.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutMerchantPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutRepresentment.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutUserPrearbitration.asKnown().getOrNull()?.validity() ?: 0) /** * The action to take. Details specific to the action are required under the sub-object with @@ -1349,36 +1580,14 @@ private constructor( } /** - * The parameters for requesting further information from the user. Required if and only if - * `action` is `request_further_information`. + * The parameters for accepting the chargeback. Required if and only if `action` is + * `accept_chargeback`. */ - class RequestFurtherInformation + class AcceptChargeback @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() - ) : this(reason, mutableMapOf()) - - /** - * The reason for requesting further information from the user. - * - * @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 reason(): String = reason.getRequired("reason") + private constructor(private val additionalProperties: MutableMap) { - /** - * Returns the raw JSON value of [reason]. - * - * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + @JsonCreator private constructor() : this(mutableMapOf()) @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -1394,43 +1603,20 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of - * [RequestFurtherInformation]. - * - * The following fields are required: - * ```java - * .reason() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [AcceptChargeback]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [RequestFurtherInformation]. */ + /** A builder for [AcceptChargeback]. */ class Builder internal constructor() { - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(requestFurtherInformation: RequestFurtherInformation) = apply { - reason = requestFurtherInformation.reason - additionalProperties = - requestFurtherInformation.additionalProperties.toMutableMap() + internal fun from(acceptChargeback: AcceptChargeback) = apply { + additionalProperties = acceptChargeback.additionalProperties.toMutableMap() } - /** The reason for requesting further information from the user. */ - fun reason(reason: String) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun reason(reason: JsonField) = apply { this.reason = reason } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1454,32 +1640,21 @@ private constructor( } /** - * Returns an immutable instance of [RequestFurtherInformation]. + * Returns an immutable instance of [AcceptChargeback]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .reason() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): RequestFurtherInformation = - RequestFurtherInformation( - checkRequired("reason", reason), - additionalProperties.toMutableMap(), - ) + fun build(): AcceptChargeback = + AcceptChargeback(additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): RequestFurtherInformation = apply { + fun validate(): AcceptChargeback = apply { if (validated) { return@apply } - reason() validated = true } @@ -1497,24 +1672,1108 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (if (reason.asKnown().isPresent) 1 else 0) + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is RequestFurtherInformation && - reason == other.reason && + return other is AcceptChargeback && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode - override fun toString() = - "RequestFurtherInformation{reason=$reason, additionalProperties=$additionalProperties}" + override fun toString() = "AcceptChargeback{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for accepting the user submission. Required if and only if `action` is + * `accept_user_submission`. + */ + class AcceptUserSubmission + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [AcceptUserSubmission]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AcceptUserSubmission]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(acceptUserSubmission: AcceptUserSubmission) = apply { + additionalProperties = acceptUserSubmission.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [AcceptUserSubmission]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AcceptUserSubmission = + AcceptUserSubmission(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): AcceptUserSubmission = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AcceptUserSubmission && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AcceptUserSubmission{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for declining the prearbitration. Required if and only if `action` is + * `decline_user_prearbitration`. + */ + class DeclineUserPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [DeclineUserPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DeclineUserPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(declineUserPrearbitration: DeclineUserPrearbitration) = apply { + additionalProperties = + declineUserPrearbitration.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [DeclineUserPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): DeclineUserPrearbitration = + DeclineUserPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): DeclineUserPrearbitration = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DeclineUserPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DeclineUserPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for receiving the prearbitration. Required if and only if `action` is + * `receive_merchant_prearbitration`. + */ + class ReceiveMerchantPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ReceiveMerchantPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ReceiveMerchantPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(receiveMerchantPrearbitration: ReceiveMerchantPrearbitration) = + apply { + additionalProperties = + receiveMerchantPrearbitration.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ReceiveMerchantPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ReceiveMerchantPrearbitration = + ReceiveMerchantPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ReceiveMerchantPrearbitration = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ReceiveMerchantPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ReceiveMerchantPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for re-presenting the dispute. Required if and only if `action` is + * `represent`. + */ + class Represent + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Represent]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Represent]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(represent: Represent) = apply { + additionalProperties = represent.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Represent]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Represent = Represent(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Represent = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Represent && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Represent{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for requesting further information from the user. Required if and only if + * `action` is `request_further_information`. + */ + class RequestFurtherInformation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() + ) : this(reason, mutableMapOf()) + + /** + * The reason for requesting further information from the user. + * + * @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 reason(): String = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @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 + * [RequestFurtherInformation]. + * + * The following fields are required: + * ```java + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RequestFurtherInformation]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(requestFurtherInformation: RequestFurtherInformation) = apply { + reason = requestFurtherInformation.reason + additionalProperties = + requestFurtherInformation.additionalProperties.toMutableMap() + } + + /** The reason for requesting further information from the user. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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 [RequestFurtherInformation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RequestFurtherInformation = + RequestFurtherInformation( + checkRequired("reason", reason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): RequestFurtherInformation = apply { + if (validated) { + return@apply + } + + reason() + 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 (reason.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RequestFurtherInformation && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RequestFurtherInformation{reason=$reason, additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the chargeback. Required if and only if `action` is + * `time_out_chargeback`. + */ + class TimeOutChargeback + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [TimeOutChargeback]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutChargeback]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutChargeback: TimeOutChargeback) = apply { + additionalProperties = timeOutChargeback.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TimeOutChargeback]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutChargeback = + TimeOutChargeback(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutChargeback = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutChargeback && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutChargeback{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the merchant prearbitration. Required if and only if + * `action` is `time_out_merchant_prearbitration`. + */ + class TimeOutMerchantPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [TimeOutMerchantPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutMerchantPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutMerchantPrearbitration: TimeOutMerchantPrearbitration) = + apply { + additionalProperties = + timeOutMerchantPrearbitration.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TimeOutMerchantPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutMerchantPrearbitration = + TimeOutMerchantPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutMerchantPrearbitration = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutMerchantPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutMerchantPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the re-presentment. Required if and only if `action` is + * `time_out_representment`. + */ + class TimeOutRepresentment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [TimeOutRepresentment]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutRepresentment]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutRepresentment: TimeOutRepresentment) = apply { + additionalProperties = timeOutRepresentment.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TimeOutRepresentment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutRepresentment = + TimeOutRepresentment(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutRepresentment = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutRepresentment && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutRepresentment{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the user prearbitration. Required if and only if `action` + * is `time_out_user_prearbitration`. + */ + class TimeOutUserPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [TimeOutUserPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutUserPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutUserPrearbitration: TimeOutUserPrearbitration) = apply { + additionalProperties = + timeOutUserPrearbitration.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [TimeOutUserPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutUserPrearbitration = + TimeOutUserPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutUserPrearbitration = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutUserPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutUserPrearbitration{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt index 42b6ac667..23318d0ca 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt @@ -29,6 +29,15 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if not + * provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun amount(): Optional = body.amount() + /** * The identifier of the Pending Transaction for the refund authorization. If this is provided, * `transaction` must not be provided as a refund with a refund authorized can not be linked to @@ -48,6 +57,13 @@ private constructor( */ fun transactionId(): Optional = body.transactionId() + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -100,11 +116,26 @@ private constructor( * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: + * - [amount] * - [pendingTransactionId] * - [transactionId] */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if + * not provided. + */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + /** * The identifier of the Pending Transaction for the refund authorization. If this is * provided, `transaction` must not be provided as a refund with a refund authorized can not @@ -281,6 +312,7 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val amount: JsonField, private val pendingTransactionId: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, @@ -288,13 +320,23 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), @JsonProperty("pending_transaction_id") @ExcludeMissing pendingTransactionId: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(pendingTransactionId, transactionId, mutableMapOf()) + ) : this(amount, pendingTransactionId, transactionId, mutableMapOf()) + + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if + * not provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun amount(): Optional = amount.getOptional("amount") /** * The identifier of the Pending Transaction for the refund authorization. If this is @@ -316,6 +358,13 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -357,17 +406,34 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { + private var amount: JsonField = JsonMissing.of() private var pendingTransactionId: JsonField = JsonMissing.of() private var transactionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { + amount = body.amount pendingTransactionId = body.pendingTransactionId transactionId = body.transactionId additionalProperties = body.additionalProperties.toMutableMap() } + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` + * if not provided. + */ + 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 } + /** * The identifier of the Pending Transaction for the refund authorization. If this is * provided, `transaction` must not be provided as a refund with a refund authorized can @@ -429,7 +495,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): Body = - Body(pendingTransactionId, transactionId, additionalProperties.toMutableMap()) + Body( + amount, + pendingTransactionId, + transactionId, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -439,6 +510,7 @@ private constructor( return@apply } + amount() pendingTransactionId() transactionId() validated = true @@ -460,7 +532,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -469,19 +542,20 @@ private constructor( } return other is Body && + amount == other.amount && pendingTransactionId == other.pendingTransactionId && transactionId == other.transactionId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(pendingTransactionId, transactionId, additionalProperties) + Objects.hash(amount, pendingTransactionId, transactionId, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{pendingTransactionId=$pendingTransactionId, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "Body{amount=$amount, pendingTransactionId=$pendingTransactionId, transactionId=$transactionId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt new file mode 100644 index 000000000..1dfcd1dc0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt @@ -0,0 +1,822 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.simulations.inboundfednowtransfers + +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.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.checkRequired +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional + +/** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ +class InboundFednowTransferCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The identifier of the Account Number the inbound FedNow Transfer is for. + * + * @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 accountNumberId(): String = body.accountNumberId() + + /** + * The transfer amount in USD cents. Must be positive. + * + * @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 = body.amount() + + /** + * The account number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorAccountNumber(): Optional = body.debtorAccountNumber() + + /** + * The name provided by the sender of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorName(): Optional = body.debtorName() + + /** + * The routing number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorRoutingNumber(): Optional = body.debtorRoutingNumber() + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + body.unstructuredRemittanceInformation() + + /** + * Returns the raw JSON value of [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountNumberId(): JsonField = body._accountNumberId() + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + + /** + * Returns the raw JSON value of [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _debtorAccountNumber(): JsonField = body._debtorAccountNumber() + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorName(): JsonField = body._debtorName() + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _debtorRoutingNumber(): JsonField = body._debtorRoutingNumber() + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + fun _unstructuredRemittanceInformation(): JsonField = + body._unstructuredRemittanceInformation() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferCreateParams]. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(inboundFednowTransferCreateParams: InboundFednowTransferCreateParams) = + apply { + body = inboundFednowTransferCreateParams.body.toBuilder() + additionalHeaders = inboundFednowTransferCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [accountNumberId] + * - [amount] + * - [debtorAccountNumber] + * - [debtorName] + * - [debtorRoutingNumber] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The identifier of the Account Number the inbound FedNow Transfer is for. */ + fun accountNumberId(accountNumberId: String) = apply { + body.accountNumberId(accountNumberId) + } + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + body.accountNumberId(accountNumberId) + } + + /** The transfer amount in USD cents. Must be positive. */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = apply { + body.debtorAccountNumber(debtorAccountNumber) + } + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + body.debtorAccountNumber(debtorAccountNumber) + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = apply { body.debtorName(debtorName) } + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { body.debtorName(debtorName) } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = apply { + body.debtorRoutingNumber(debtorRoutingNumber) + } + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + body.debtorRoutingNumber(debtorRoutingNumber) + } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = apply { + body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) + } + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferCreateParams = + InboundFednowTransferCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val accountNumberId: JsonField, + private val amount: JsonField, + private val debtorAccountNumber: JsonField, + private val debtorName: JsonField, + private val debtorRoutingNumber: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("account_number_id") + @ExcludeMissing + accountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("debtor_account_number") + @ExcludeMissing + debtorAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_routing_number") + @ExcludeMissing + debtorRoutingNumber: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + accountNumberId, + amount, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The identifier of the Account Number the inbound FedNow Transfer is for. + * + * @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 accountNumberId(): String = accountNumberId.getRequired("account_number_id") + + /** + * The transfer amount in USD cents. Must be positive. + * + * @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") + + /** + * The account number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorAccountNumber(): Optional = + debtorAccountNumber.getOptional("debtor_account_number") + + /** + * The name provided by the sender of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorName(): Optional = debtorName.getOptional("debtor_name") + + /** + * The routing number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorRoutingNumber(): Optional = + debtorRoutingNumber.getOptional("debtor_routing_number") + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + unstructuredRemittanceInformation.getOptional("unstructured_remittance_information") + + /** + * Returns the raw JSON value of [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("account_number_id") + @ExcludeMissing + fun _accountNumberId(): JsonField = accountNumberId + + /** + * 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 [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("debtor_account_number") + @ExcludeMissing + fun _debtorAccountNumber(): JsonField = debtorAccountNumber + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") + @ExcludeMissing + fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("debtor_routing_number") + @ExcludeMissing + fun _debtorRoutingNumber(): JsonField = debtorRoutingNumber + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = + unstructuredRemittanceInformation + + @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 [Body]. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var accountNumberId: JsonField? = null + private var amount: JsonField? = null + private var debtorAccountNumber: JsonField = JsonMissing.of() + private var debtorName: JsonField = JsonMissing.of() + private var debtorRoutingNumber: JsonField = JsonMissing.of() + private var unstructuredRemittanceInformation: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + accountNumberId = body.accountNumberId + amount = body.amount + debtorAccountNumber = body.debtorAccountNumber + debtorName = body.debtorName + debtorRoutingNumber = body.debtorRoutingNumber + unstructuredRemittanceInformation = body.unstructuredRemittanceInformation + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The identifier of the Account Number the inbound FedNow Transfer is for. */ + fun accountNumberId(accountNumberId: String) = + accountNumberId(JsonField.of(accountNumberId)) + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + this.accountNumberId = accountNumberId + } + + /** The transfer amount in USD cents. Must be positive. */ + 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 } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = + debtorAccountNumber(JsonField.of(debtorAccountNumber)) + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + this.debtorAccountNumber = debtorAccountNumber + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = + debtorRoutingNumber(JsonField.of(debtorRoutingNumber)) + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + this.debtorRoutingNumber = debtorRoutingNumber + } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("accountNumberId", accountNumberId), + checkRequired("amount", amount), + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + accountNumberId() + amount() + debtorAccountNumber() + debtorName() + debtorRoutingNumber() + unstructuredRemittanceInformation() + 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 (accountNumberId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (debtorAccountNumber.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (debtorRoutingNumber.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + accountNumberId == other.accountNumberId && + amount == other.amount && + debtorAccountNumber == other.debtorAccountNumber && + debtorName == other.debtorName && + debtorRoutingNumber == other.debtorRoutingNumber && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountNumberId, + amount, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{accountNumberId=$accountNumberId, amount=$amount, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "InboundFednowTransferCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt index 2103c1de6..9d7cbc51f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt @@ -580,6 +580,9 @@ private constructor( /** Grasshopper Bank */ @JvmField val GRASSHOPPER_BANK = of("grasshopper_bank") + /** Twin City Bank */ + @JvmField val TWIN_CITY_BANK = of("twin_city_bank") + @JvmStatic fun of(value: String) = Bank(JsonField.of(value)) } @@ -595,6 +598,8 @@ private constructor( GLOBAL_INNOVATIONS_BANK, /** Grasshopper Bank */ GRASSHOPPER_BANK, + /** Twin City Bank */ + TWIN_CITY_BANK, } /** @@ -617,6 +622,8 @@ private constructor( GLOBAL_INNOVATIONS_BANK, /** Grasshopper Bank */ GRASSHOPPER_BANK, + /** Twin City Bank */ + TWIN_CITY_BANK, /** An enum member indicating that [Bank] was instantiated with an unknown value. */ _UNKNOWN, } @@ -635,6 +642,7 @@ private constructor( FIRST_INTERNET_BANK -> Value.FIRST_INTERNET_BANK GLOBAL_INNOVATIONS_BANK -> Value.GLOBAL_INNOVATIONS_BANK GRASSHOPPER_BANK -> Value.GRASSHOPPER_BANK + TWIN_CITY_BANK -> Value.TWIN_CITY_BANK else -> Value._UNKNOWN } @@ -654,6 +662,7 @@ private constructor( FIRST_INTERNET_BANK -> Known.FIRST_INTERNET_BANK GLOBAL_INNOVATIONS_BANK -> Known.GLOBAL_INNOVATIONS_BANK GRASSHOPPER_BANK -> Known.GRASSHOPPER_BANK + TWIN_CITY_BANK -> Known.TWIN_CITY_BANK else -> throw IncreaseInvalidDataException("Unknown Bank: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 1145d8251..2fa22e28a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -903,7 +903,7 @@ private constructor( private val inboundWireTransferReversal: JsonField, private val interestPayment: JsonField, private val internalSource: JsonField, - private val other: JsonValue, + private val other: JsonField, private val realTimePaymentsTransferAcknowledgement: JsonField, private val sampleFunds: JsonField, @@ -1014,7 +1014,7 @@ private constructor( @JsonProperty("internal_source") @ExcludeMissing internalSource: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("real_time_payments_transfer_acknowledgement") @ExcludeMissing realTimePaymentsTransferAcknowledgement: @@ -1442,8 +1442,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in the @@ -1817,6 +1820,13 @@ private constructor( @ExcludeMissing fun _internalSource(): JsonField = internalSource + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [realTimePaymentsTransferAcknowledgement]. * @@ -1972,7 +1982,7 @@ private constructor( private var inboundWireTransferReversal: JsonField? = null private var interestPayment: JsonField? = null private var internalSource: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var realTimePaymentsTransferAcknowledgement: JsonField? = null @@ -2873,7 +2883,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in @@ -3181,6 +3203,7 @@ private constructor( inboundWireTransferReversal().ifPresent { it.validate() } interestPayment().ifPresent { it.validate() } internalSource().ifPresent { it.validate() } + other().ifPresent { it.validate() } realTimePaymentsTransferAcknowledgement().ifPresent { it.validate() } sampleFunds().ifPresent { it.validate() } swiftTransferIntention().ifPresent { it.validate() } @@ -3237,6 +3260,7 @@ private constructor( (inboundWireTransferReversal.asKnown().getOrNull()?.validity() ?: 0) + (interestPayment.asKnown().getOrNull()?.validity() ?: 0) + (internalSource.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (realTimePaymentsTransferAcknowledgement.asKnown().getOrNull()?.validity() ?: 0) + (sampleFunds.asKnown().getOrNull()?.validity() ?: 0) + (swiftTransferIntention.asKnown().getOrNull()?.validity() ?: 0) + @@ -6953,13 +6977,18 @@ private constructor( /** Visa: details will be under the `visa` object. */ @JvmField val VISA = of("visa") + /** Pulse: details will be under the `pulse` object. */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa: details will be under the `visa` object. */ - VISA + VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, } /** @@ -6974,6 +7003,8 @@ private constructor( enum class Value { /** Visa: details will be under the `visa` object. */ VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -6991,6 +7022,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7006,6 +7038,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -8050,7 +8083,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -8814,7 +8848,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -9346,6 +9381,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -9364,6 +9400,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -9388,6 +9427,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -9414,6 +9454,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -9489,6 +9537,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -9579,6 +9637,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -9596,6 +9655,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -9609,6 +9669,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -9649,6 +9710,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -9815,6 +9891,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -9830,6 +9907,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -9850,6 +9928,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -9878,6 +9957,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -10340,6 +10420,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount'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(): String = currency.getRequired("currency") + + /** + * 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 [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + 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 } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -11943,6 +12250,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -11957,6 +12265,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -11971,7 +12280,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -12306,6 +12615,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -12315,8 +12625,11 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -12327,6 +12640,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + /** * Fields specific to the `visa` network. * @@ -12345,6 +12666,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -12373,6 +12702,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -12383,12 +12713,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -12405,6 +12737,21 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -12450,6 +12797,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -12458,6 +12806,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -12471,6 +12820,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -12492,6 +12842,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -12515,13 +12866,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -12537,6 +12893,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -12554,6 +12912,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -12569,6 +12928,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -12627,6 +12987,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -13788,24 +14257,26 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -13814,6 +14285,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -13823,7 +14297,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -13854,6 +14346,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * 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 [retrievalReferenceNumber]. * @@ -13904,6 +14407,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -13915,6 +14419,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -13922,6 +14427,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -13929,6 +14436,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -14031,6 +14575,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -14040,6 +14585,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -14054,6 +14603,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -14076,7 +14626,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -14086,6 +14637,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -14094,6 +14647,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -14104,7 +14658,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -18029,6 +18583,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -18041,10 +18596,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -18067,6 +18631,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -18096,6 +18672,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * 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 [transactionId]. * @@ -18128,6 +18715,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -18139,6 +18727,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -18146,6 +18735,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -18185,6 +18776,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -18240,6 +18868,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -18249,6 +18878,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -18263,6 +18896,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -18285,6 +18919,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -18295,6 +18930,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -18303,6 +18940,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -18311,7 +18949,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -28324,13 +28962,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -28345,6 +28988,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -28362,6 +29007,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -28377,6 +29023,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -28440,6 +29087,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -28452,10 +29100,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -28478,6 +29135,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -28507,6 +29176,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * 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 [transactionId]. * @@ -28539,6 +29219,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -28550,6 +29231,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -28557,6 +29239,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -28596,6 +29280,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * 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 + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -28651,6 +29372,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -28660,6 +29382,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -28674,6 +29400,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -28696,6 +29423,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -28706,6 +29434,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -28714,6 +29444,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -28722,7 +29453,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -37436,7 +38167,8 @@ private constructor( ) /** - * The account number printed on the check. + * The account number printed on the check. This is an account at the bank that issued + * the check. * * @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 @@ -37483,7 +38215,8 @@ private constructor( fun currency(): Currency = currency.getRequired("currency") /** - * The routing number printed on the check. + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. * * @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 @@ -37624,7 +38357,10 @@ private constructor( checkDepositAcceptance.additionalProperties.toMutableMap() } - /** The account number printed on the check. */ + /** + * The account number printed on the check. This is an account at the bank that + * issued the check. + */ fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) @@ -37706,7 +38442,10 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The routing number printed on the check. */ + /** + * The routing number printed on the check. This is a routing number for the bank + * that issued the check. + */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -46857,6 +47596,11 @@ private constructor( /** Account closure */ @JvmField val ACCOUNT_CLOSURE = of("account_closure") + /** Account revenue payment distribution */ + @JvmField + val ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION = + of("account_revenue_payment_distribution") + /** Bank-drawn check */ @JvmField val BANK_DRAWN_CHECK = of("bank_drawn_check") @@ -46875,6 +47619,9 @@ private constructor( /** Collection receivable */ @JvmField val COLLECTION_RECEIVABLE = of("collection_receivable") + /** Dishonored ACH return */ + @JvmField val DISHONORED_ACH_RETURN = of("dishonored_ach_return") + /** Empyreal adjustment */ @JvmField val EMPYREAL_ADJUSTMENT = of("empyreal_adjustment") @@ -46899,11 +47646,6 @@ private constructor( /** Sample funds return */ @JvmField val SAMPLE_FUNDS_RETURN = of("sample_funds_return") - /** Account revenue payment distribution */ - @JvmField - val ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION = - of("account_revenue_payment_distribution") - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } @@ -46911,6 +47653,8 @@ private constructor( enum class Known { /** Account closure */ ACCOUNT_CLOSURE, + /** Account revenue payment distribution */ + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** Bank-drawn check */ BANK_DRAWN_CHECK, /** Bank-drawn check credit */ @@ -46923,6 +47667,8 @@ private constructor( COLLECTION_PAYMENT, /** Collection receivable */ COLLECTION_RECEIVABLE, + /** Dishonored ACH return */ + DISHONORED_ACH_RETURN, /** Empyreal adjustment */ EMPYREAL_ADJUSTMENT, /** Error */ @@ -46939,8 +47685,6 @@ private constructor( SAMPLE_FUNDS, /** Sample funds return */ SAMPLE_FUNDS_RETURN, - /** Account revenue payment distribution */ - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, } /** @@ -46955,6 +47699,8 @@ private constructor( enum class Value { /** Account closure */ ACCOUNT_CLOSURE, + /** Account revenue payment distribution */ + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** Bank-drawn check */ BANK_DRAWN_CHECK, /** Bank-drawn check credit */ @@ -46967,6 +47713,8 @@ private constructor( COLLECTION_PAYMENT, /** Collection receivable */ COLLECTION_RECEIVABLE, + /** Dishonored ACH return */ + DISHONORED_ACH_RETURN, /** Empyreal adjustment */ EMPYREAL_ADJUSTMENT, /** Error */ @@ -46983,8 +47731,6 @@ private constructor( SAMPLE_FUNDS, /** Sample funds return */ SAMPLE_FUNDS_RETURN, - /** Account revenue payment distribution */ - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** * An enum member indicating that [Reason] was instantiated with an unknown * value. @@ -47002,12 +47748,15 @@ private constructor( fun value(): Value = when (this) { ACCOUNT_CLOSURE -> Value.ACCOUNT_CLOSURE + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> + Value.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION BANK_DRAWN_CHECK -> Value.BANK_DRAWN_CHECK BANK_DRAWN_CHECK_CREDIT -> Value.BANK_DRAWN_CHECK_CREDIT BANK_MIGRATION -> Value.BANK_MIGRATION CHECK_ADJUSTMENT -> Value.CHECK_ADJUSTMENT COLLECTION_PAYMENT -> Value.COLLECTION_PAYMENT COLLECTION_RECEIVABLE -> Value.COLLECTION_RECEIVABLE + DISHONORED_ACH_RETURN -> Value.DISHONORED_ACH_RETURN EMPYREAL_ADJUSTMENT -> Value.EMPYREAL_ADJUSTMENT ERROR -> Value.ERROR ERROR_CORRECTION -> Value.ERROR_CORRECTION @@ -47016,8 +47765,6 @@ private constructor( NEGATIVE_BALANCE_FORGIVENESS -> Value.NEGATIVE_BALANCE_FORGIVENESS SAMPLE_FUNDS -> Value.SAMPLE_FUNDS SAMPLE_FUNDS_RETURN -> Value.SAMPLE_FUNDS_RETURN - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> - Value.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION else -> Value._UNKNOWN } @@ -47033,12 +47780,15 @@ private constructor( fun known(): Known = when (this) { ACCOUNT_CLOSURE -> Known.ACCOUNT_CLOSURE + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> + Known.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION BANK_DRAWN_CHECK -> Known.BANK_DRAWN_CHECK BANK_DRAWN_CHECK_CREDIT -> Known.BANK_DRAWN_CHECK_CREDIT BANK_MIGRATION -> Known.BANK_MIGRATION CHECK_ADJUSTMENT -> Known.CHECK_ADJUSTMENT COLLECTION_PAYMENT -> Known.COLLECTION_PAYMENT COLLECTION_RECEIVABLE -> Known.COLLECTION_RECEIVABLE + DISHONORED_ACH_RETURN -> Known.DISHONORED_ACH_RETURN EMPYREAL_ADJUSTMENT -> Known.EMPYREAL_ADJUSTMENT ERROR -> Known.ERROR ERROR_CORRECTION -> Known.ERROR_CORRECTION @@ -47047,8 +47797,6 @@ private constructor( NEGATIVE_BALANCE_FORGIVENESS -> Known.NEGATIVE_BALANCE_FORGIVENESS SAMPLE_FUNDS -> Known.SAMPLE_FUNDS SAMPLE_FUNDS_RETURN -> Known.SAMPLE_FUNDS_RETURN - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> - Known.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION else -> throw IncreaseInvalidDataException("Unknown Reason: $value") } @@ -47128,6 +47876,115 @@ private constructor( "InternalSource{amount=$amount, currency=$currency, reason=$reason, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in the * JSON response if and only if `category` is equal to diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt index 3a79799bd..350d15532 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt @@ -32,23 +32,16 @@ private constructor( private val accountNumber: JsonField, private val amount: JsonField, private val approval: JsonField, - private val beneficiaryAddressLine1: JsonField, - private val beneficiaryAddressLine2: JsonField, - private val beneficiaryAddressLine3: JsonField, - private val beneficiaryName: JsonField, private val cancellation: JsonField, private val createdAt: JsonField, private val createdBy: JsonField, + private val creditor: JsonField, private val currency: JsonField, + private val debtor: JsonField, private val externalAccountId: JsonField, private val idempotencyKey: JsonField, private val inboundWireDrawdownRequestId: JsonField, - private val messageToRecipient: JsonField, private val network: JsonField, - private val originatorAddressLine1: JsonField, - private val originatorAddressLine2: JsonField, - private val originatorAddressLine3: JsonField, - private val originatorName: JsonField, private val pendingTransactionId: JsonField, private val remittance: JsonField, private val reversal: JsonField, @@ -70,18 +63,6 @@ private constructor( accountNumber: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), @JsonProperty("approval") @ExcludeMissing approval: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - beneficiaryAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - beneficiaryAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - beneficiaryAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_name") - @ExcludeMissing - beneficiaryName: JsonField = JsonMissing.of(), @JsonProperty("cancellation") @ExcludeMissing cancellation: JsonField = JsonMissing.of(), @@ -91,7 +72,9 @@ private constructor( @JsonProperty("created_by") @ExcludeMissing createdBy: JsonField = JsonMissing.of(), + @JsonProperty("creditor") @ExcludeMissing creditor: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing debtor: JsonField = JsonMissing.of(), @JsonProperty("external_account_id") @ExcludeMissing externalAccountId: JsonField = JsonMissing.of(), @@ -101,22 +84,7 @@ private constructor( @JsonProperty("inbound_wire_drawdown_request_id") @ExcludeMissing inboundWireDrawdownRequestId: JsonField = JsonMissing.of(), - @JsonProperty("message_to_recipient") - @ExcludeMissing - messageToRecipient: JsonField = JsonMissing.of(), @JsonProperty("network") @ExcludeMissing network: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line1") - @ExcludeMissing - originatorAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line2") - @ExcludeMissing - originatorAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line3") - @ExcludeMissing - originatorAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("originator_name") - @ExcludeMissing - originatorName: JsonField = JsonMissing.of(), @JsonProperty("pending_transaction_id") @ExcludeMissing pendingTransactionId: JsonField = JsonMissing.of(), @@ -144,23 +112,16 @@ private constructor( accountNumber, amount, approval, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, - beneficiaryName, cancellation, createdAt, createdBy, + creditor, currency, + debtor, externalAccountId, idempotencyKey, inboundWireDrawdownRequestId, - messageToRecipient, network, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, pendingTransactionId, remittance, reversal, @@ -214,41 +175,6 @@ private constructor( */ fun approval(): Optional = approval.getOptional("approval") - /** - * The beneficiary's address line 1. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine1(): Optional = - beneficiaryAddressLine1.getOptional("beneficiary_address_line1") - - /** - * The beneficiary's address line 2. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine2(): Optional = - beneficiaryAddressLine2.getOptional("beneficiary_address_line2") - - /** - * The beneficiary's address line 3. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine3(): Optional = - beneficiaryAddressLine3.getOptional("beneficiary_address_line3") - - /** - * The beneficiary's name. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryName(): Optional = beneficiaryName.getOptional("beneficiary_name") - /** * If your account requires approvals for transfers and the transfer was not approved, this will * contain details of the cancellation. @@ -275,6 +201,14 @@ private constructor( */ fun createdBy(): Optional = createdBy.getOptional("created_by") + /** + * The person or business that is receiving the funds from the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditor(): Optional = creditor.getOptional("creditor") + /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For * wire transfers this is always equal to `usd`. @@ -284,6 +218,14 @@ private constructor( */ fun currency(): Currency = currency.getRequired("currency") + /** + * The person or business whose funds are being transferred. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtor(): Optional = debtor.getOptional("debtor") + /** * The identifier of the External Account the transfer was made to, if any. * @@ -311,14 +253,6 @@ private constructor( fun inboundWireDrawdownRequestId(): Optional = inboundWireDrawdownRequestId.getOptional("inbound_wire_drawdown_request_id") - /** - * The message that will show on the recipient's bank statement. - * - * @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 messageToRecipient(): String = messageToRecipient.getRequired("message_to_recipient") - /** * The transfer's network. * @@ -327,41 +261,6 @@ private constructor( */ fun network(): Network = network.getRequired("network") - /** - * The originator's address line 1. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = - originatorAddressLine1.getOptional("originator_address_line1") - - /** - * The originator's address line 2. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = - originatorAddressLine2.getOptional("originator_address_line2") - - /** - * The originator's address line 3. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = - originatorAddressLine3.getOptional("originator_address_line3") - - /** - * The originator's name. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorName(): Optional = originatorName.getOptional("originator_name") - /** * The ID for the pending transaction representing the transfer. A pending transaction is * created when the transfer @@ -477,45 +376,6 @@ private constructor( */ @JsonProperty("approval") @ExcludeMissing fun _approval(): JsonField = approval - /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. - * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - fun _beneficiaryAddressLine1(): JsonField = beneficiaryAddressLine1 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. - * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - fun _beneficiaryAddressLine2(): JsonField = beneficiaryAddressLine2 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. - * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - fun _beneficiaryAddressLine3(): JsonField = beneficiaryAddressLine3 - - /** - * Returns the raw JSON value of [beneficiaryName]. - * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("beneficiary_name") - @ExcludeMissing - fun _beneficiaryName(): JsonField = beneficiaryName - /** * Returns the raw JSON value of [cancellation]. * @@ -541,6 +401,13 @@ private constructor( */ @JsonProperty("created_by") @ExcludeMissing fun _createdBy(): JsonField = createdBy + /** + * Returns the raw JSON value of [creditor]. + * + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor") @ExcludeMissing fun _creditor(): JsonField = creditor + /** * Returns the raw JSON value of [currency]. * @@ -548,6 +415,13 @@ private constructor( */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + /** + * Returns the raw JSON value of [debtor]. + * + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor") @ExcludeMissing fun _debtor(): JsonField = debtor + /** * Returns the raw JSON value of [externalAccountId]. * @@ -577,16 +451,6 @@ private constructor( @ExcludeMissing fun _inboundWireDrawdownRequestId(): JsonField = inboundWireDrawdownRequestId - /** - * Returns the raw JSON value of [messageToRecipient]. - * - * Unlike [messageToRecipient], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("message_to_recipient") - @ExcludeMissing - fun _messageToRecipient(): JsonField = messageToRecipient - /** * Returns the raw JSON value of [network]. * @@ -594,45 +458,6 @@ private constructor( */ @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line1") - @ExcludeMissing - fun _originatorAddressLine1(): JsonField = originatorAddressLine1 - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line2") - @ExcludeMissing - fun _originatorAddressLine2(): JsonField = originatorAddressLine2 - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line3") - @ExcludeMissing - fun _originatorAddressLine3(): JsonField = originatorAddressLine3 - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("originator_name") - @ExcludeMissing - fun _originatorName(): JsonField = originatorName - /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -734,23 +559,16 @@ private constructor( * .accountNumber() * .amount() * .approval() - * .beneficiaryAddressLine1() - * .beneficiaryAddressLine2() - * .beneficiaryAddressLine3() - * .beneficiaryName() * .cancellation() * .createdAt() * .createdBy() + * .creditor() * .currency() + * .debtor() * .externalAccountId() * .idempotencyKey() * .inboundWireDrawdownRequestId() - * .messageToRecipient() * .network() - * .originatorAddressLine1() - * .originatorAddressLine2() - * .originatorAddressLine3() - * .originatorName() * .pendingTransactionId() * .remittance() * .reversal() @@ -773,23 +591,16 @@ private constructor( private var accountNumber: JsonField? = null private var amount: JsonField? = null private var approval: JsonField? = null - private var beneficiaryAddressLine1: JsonField? = null - private var beneficiaryAddressLine2: JsonField? = null - private var beneficiaryAddressLine3: JsonField? = null - private var beneficiaryName: JsonField? = null private var cancellation: JsonField? = null private var createdAt: JsonField? = null private var createdBy: JsonField? = null + private var creditor: JsonField? = null private var currency: JsonField? = null + private var debtor: JsonField? = null private var externalAccountId: JsonField? = null private var idempotencyKey: JsonField? = null private var inboundWireDrawdownRequestId: JsonField? = null - private var messageToRecipient: JsonField? = null private var network: JsonField? = null - private var originatorAddressLine1: JsonField? = null - private var originatorAddressLine2: JsonField? = null - private var originatorAddressLine3: JsonField? = null - private var originatorName: JsonField? = null private var pendingTransactionId: JsonField? = null private var remittance: JsonField? = null private var reversal: JsonField? = null @@ -808,23 +619,16 @@ private constructor( accountNumber = wireTransfer.accountNumber amount = wireTransfer.amount approval = wireTransfer.approval - beneficiaryAddressLine1 = wireTransfer.beneficiaryAddressLine1 - beneficiaryAddressLine2 = wireTransfer.beneficiaryAddressLine2 - beneficiaryAddressLine3 = wireTransfer.beneficiaryAddressLine3 - beneficiaryName = wireTransfer.beneficiaryName cancellation = wireTransfer.cancellation createdAt = wireTransfer.createdAt createdBy = wireTransfer.createdBy + creditor = wireTransfer.creditor currency = wireTransfer.currency + debtor = wireTransfer.debtor externalAccountId = wireTransfer.externalAccountId idempotencyKey = wireTransfer.idempotencyKey inboundWireDrawdownRequestId = wireTransfer.inboundWireDrawdownRequestId - messageToRecipient = wireTransfer.messageToRecipient network = wireTransfer.network - originatorAddressLine1 = wireTransfer.originatorAddressLine1 - originatorAddressLine2 = wireTransfer.originatorAddressLine2 - originatorAddressLine3 = wireTransfer.originatorAddressLine3 - originatorName = wireTransfer.originatorName pendingTransactionId = wireTransfer.pendingTransactionId remittance = wireTransfer.remittance reversal = wireTransfer.reversal @@ -903,91 +707,6 @@ private constructor( */ fun approval(approval: JsonField) = apply { this.approval = approval } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String?) = - beneficiaryAddressLine1(JsonField.ofNullable(beneficiaryAddressLine1)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine1] with - * `beneficiaryAddressLine1.orElse(null)`. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: Optional) = - beneficiaryAddressLine1(beneficiaryAddressLine1.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - this.beneficiaryAddressLine1 = beneficiaryAddressLine1 - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String?) = - beneficiaryAddressLine2(JsonField.ofNullable(beneficiaryAddressLine2)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine2] with - * `beneficiaryAddressLine2.orElse(null)`. - */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: Optional) = - beneficiaryAddressLine2(beneficiaryAddressLine2.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - this.beneficiaryAddressLine2 = beneficiaryAddressLine2 - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String?) = - beneficiaryAddressLine3(JsonField.ofNullable(beneficiaryAddressLine3)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine3] with - * `beneficiaryAddressLine3.orElse(null)`. - */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: Optional) = - beneficiaryAddressLine3(beneficiaryAddressLine3.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - this.beneficiaryAddressLine3 = beneficiaryAddressLine3 - } - - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String?) = - beneficiaryName(JsonField.ofNullable(beneficiaryName)) - - /** Alias for calling [Builder.beneficiaryName] with `beneficiaryName.orElse(null)`. */ - fun beneficiaryName(beneficiaryName: Optional) = - beneficiaryName(beneficiaryName.getOrNull()) - - /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - this.beneficiaryName = beneficiaryName - } - /** * If your account requires approvals for transfers and the transfer was not approved, this * will contain details of the cancellation. @@ -1040,6 +759,21 @@ private constructor( */ fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy } + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor?) = creditor(JsonField.ofNullable(creditor)) + + /** Alias for calling [Builder.creditor] with `creditor.orElse(null)`. */ + fun creditor(creditor: Optional) = creditor(creditor.getOrNull()) + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditor(creditor: JsonField) = apply { this.creditor = creditor } + /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. * For wire transfers this is always equal to `usd`. @@ -1055,6 +789,20 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } + /** The person or business whose funds are being transferred. */ + fun debtor(debtor: Debtor?) = debtor(JsonField.ofNullable(debtor)) + + /** Alias for calling [Builder.debtor] with `debtor.orElse(null)`. */ + fun debtor(debtor: Optional) = debtor(debtor.getOrNull()) + + /** + * Sets [Builder.debtor] to an arbitrary JSON value. + * + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } + /** The identifier of the External Account the transfer was made to, if any. */ fun externalAccountId(externalAccountId: String?) = externalAccountId(JsonField.ofNullable(externalAccountId)) @@ -1121,21 +869,6 @@ private constructor( this.inboundWireDrawdownRequestId = inboundWireDrawdownRequestId } - /** The message that will show on the recipient's bank statement. */ - fun messageToRecipient(messageToRecipient: String) = - messageToRecipient(JsonField.of(messageToRecipient)) - - /** - * Sets [Builder.messageToRecipient] to an arbitrary JSON value. - * - * You should usually call [Builder.messageToRecipient] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun messageToRecipient(messageToRecipient: JsonField) = apply { - this.messageToRecipient = messageToRecipient - } - /** The transfer's network. */ fun network(network: Network) = network(JsonField.of(network)) @@ -1147,91 +880,6 @@ private constructor( */ fun network(network: JsonField) = apply { this.network = network } - /** The originator's address line 1. */ - fun originatorAddressLine1(originatorAddressLine1: String?) = - originatorAddressLine1(JsonField.ofNullable(originatorAddressLine1)) - - /** - * Alias for calling [Builder.originatorAddressLine1] with - * `originatorAddressLine1.orElse(null)`. - */ - fun originatorAddressLine1(originatorAddressLine1: Optional) = - originatorAddressLine1(originatorAddressLine1.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - this.originatorAddressLine1 = originatorAddressLine1 - } - - /** The originator's address line 2. */ - fun originatorAddressLine2(originatorAddressLine2: String?) = - originatorAddressLine2(JsonField.ofNullable(originatorAddressLine2)) - - /** - * Alias for calling [Builder.originatorAddressLine2] with - * `originatorAddressLine2.orElse(null)`. - */ - fun originatorAddressLine2(originatorAddressLine2: Optional) = - originatorAddressLine2(originatorAddressLine2.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - this.originatorAddressLine2 = originatorAddressLine2 - } - - /** The originator's address line 3. */ - fun originatorAddressLine3(originatorAddressLine3: String?) = - originatorAddressLine3(JsonField.ofNullable(originatorAddressLine3)) - - /** - * Alias for calling [Builder.originatorAddressLine3] with - * `originatorAddressLine3.orElse(null)`. - */ - fun originatorAddressLine3(originatorAddressLine3: Optional) = - originatorAddressLine3(originatorAddressLine3.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - this.originatorAddressLine3 = originatorAddressLine3 - } - - /** The originator's name. */ - fun originatorName(originatorName: String?) = - originatorName(JsonField.ofNullable(originatorName)) - - /** Alias for calling [Builder.originatorName] with `originatorName.orElse(null)`. */ - fun originatorName(originatorName: Optional) = - originatorName(originatorName.getOrNull()) - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - this.originatorName = originatorName - } - /** * The ID for the pending transaction representing the transfer. A pending transaction is * created when the transfer @@ -1415,23 +1063,16 @@ private constructor( * .accountNumber() * .amount() * .approval() - * .beneficiaryAddressLine1() - * .beneficiaryAddressLine2() - * .beneficiaryAddressLine3() - * .beneficiaryName() * .cancellation() * .createdAt() * .createdBy() + * .creditor() * .currency() + * .debtor() * .externalAccountId() * .idempotencyKey() * .inboundWireDrawdownRequestId() - * .messageToRecipient() * .network() - * .originatorAddressLine1() - * .originatorAddressLine2() - * .originatorAddressLine3() - * .originatorName() * .pendingTransactionId() * .remittance() * .reversal() @@ -1452,23 +1093,16 @@ private constructor( checkRequired("accountNumber", accountNumber), checkRequired("amount", amount), checkRequired("approval", approval), - checkRequired("beneficiaryAddressLine1", beneficiaryAddressLine1), - checkRequired("beneficiaryAddressLine2", beneficiaryAddressLine2), - checkRequired("beneficiaryAddressLine3", beneficiaryAddressLine3), - checkRequired("beneficiaryName", beneficiaryName), checkRequired("cancellation", cancellation), checkRequired("createdAt", createdAt), checkRequired("createdBy", createdBy), + checkRequired("creditor", creditor), checkRequired("currency", currency), + checkRequired("debtor", debtor), checkRequired("externalAccountId", externalAccountId), checkRequired("idempotencyKey", idempotencyKey), checkRequired("inboundWireDrawdownRequestId", inboundWireDrawdownRequestId), - checkRequired("messageToRecipient", messageToRecipient), checkRequired("network", network), - checkRequired("originatorAddressLine1", originatorAddressLine1), - checkRequired("originatorAddressLine2", originatorAddressLine2), - checkRequired("originatorAddressLine3", originatorAddressLine3), - checkRequired("originatorName", originatorName), checkRequired("pendingTransactionId", pendingTransactionId), checkRequired("remittance", remittance), checkRequired("reversal", reversal), @@ -1494,23 +1128,16 @@ private constructor( accountNumber() amount() approval().ifPresent { it.validate() } - beneficiaryAddressLine1() - beneficiaryAddressLine2() - beneficiaryAddressLine3() - beneficiaryName() cancellation().ifPresent { it.validate() } createdAt() createdBy().ifPresent { it.validate() } + creditor().ifPresent { it.validate() } currency().validate() + debtor().ifPresent { it.validate() } externalAccountId() idempotencyKey() inboundWireDrawdownRequestId() - messageToRecipient() network().validate() - originatorAddressLine1() - originatorAddressLine2() - originatorAddressLine3() - originatorName() pendingTransactionId() remittance().ifPresent { it.validate() } reversal().ifPresent { it.validate() } @@ -1543,23 +1170,16 @@ private constructor( (if (accountNumber.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + (approval.asKnown().getOrNull()?.validity() ?: 0) + - (if (beneficiaryAddressLine1.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine2.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine3.asKnown().isPresent) 1 else 0) + - (if (beneficiaryName.asKnown().isPresent) 1 else 0) + (cancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (createdBy.asKnown().getOrNull()?.validity() ?: 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + (if (externalAccountId.asKnown().isPresent) 1 else 0) + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + (if (inboundWireDrawdownRequestId.asKnown().isPresent) 1 else 0) + - (if (messageToRecipient.asKnown().isPresent) 1 else 0) + (network.asKnown().getOrNull()?.validity() ?: 0) + - (if (originatorAddressLine1.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine2.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine3.asKnown().isPresent) 1 else 0) + - (if (originatorName.asKnown().isPresent) 1 else 0) + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + (remittance.asKnown().getOrNull()?.validity() ?: 0) + (reversal.asKnown().getOrNull()?.validity() ?: 0) + @@ -2972,147 +2592,170 @@ private constructor( "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For - * wire transfers this is always equal to `usd`. - */ - class Currency @JsonCreator private constructor(private val value: JsonField) : Enum { + /** The person or business that is receiving the funds from the transfer. */ + class Creditor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val address: JsonField
, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(address, name, mutableMapOf()) /** - * Returns this class instance's raw value. + * The person or business's address. * - * 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. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun address(): Optional
= address.getOptional("address") - companion object { + /** + * The person or business's name. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") - /** Canadian Dollar (CAD) */ - @JvmField val CAD = of("CAD") + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address - /** Swiss Franc (CHF) */ - @JvmField val CHF = of("CHF") + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - /** Euro (EUR) */ - @JvmField val EUR = of("EUR") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** British Pound (GBP) */ - @JvmField val GBP = of("GBP") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** Japanese Yen (JPY) */ - @JvmField val JPY = of("JPY") + fun toBuilder() = Builder().from(this) - /** US Dollar (USD) */ - @JvmField val USD = of("USD") + companion object { - @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + /** + * Returns a mutable builder for constructing an instance of [Creditor]. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() } - /** An enum containing [Currency]'s known values. */ - enum class Known { - /** Canadian Dollar (CAD) */ - CAD, - /** Swiss Franc (CHF) */ - CHF, - /** Euro (EUR) */ - EUR, - /** British Pound (GBP) */ - GBP, - /** Japanese Yen (JPY) */ - JPY, - /** US Dollar (USD) */ - USD, - } + /** A builder for [Creditor]. */ + class Builder internal constructor() { - /** - * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Currency] 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 { - /** Canadian Dollar (CAD) */ - CAD, - /** Swiss Franc (CHF) */ - CHF, - /** Euro (EUR) */ - EUR, - /** British Pound (GBP) */ - GBP, - /** Japanese Yen (JPY) */ - JPY, - /** US Dollar (USD) */ - USD, - /** An enum member indicating that [Currency] was instantiated with an unknown value. */ - _UNKNOWN, - } + private var address: JsonField
? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - /** - * 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) { - CAD -> Value.CAD - CHF -> Value.CHF - EUR -> Value.EUR - GBP -> Value.GBP - JPY -> Value.JPY - USD -> Value.USD - else -> Value._UNKNOWN + @JvmSynthetic + internal fun from(creditor: Creditor) = apply { + address = creditor.address + name = creditor.name + additionalProperties = creditor.additionalProperties.toMutableMap() } - /** - * 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) { - CAD -> Known.CAD - CHF -> Known.CHF - EUR -> Known.EUR - GBP -> Known.GBP - JPY -> Known.JPY - USD -> Known.USD - else -> throw IncreaseInvalidDataException("Unknown Currency: $value") + /** The person or business's address. */ + fun address(address: Address?) = address(JsonField.ofNullable(address)) + + /** Alias for calling [Builder.address] with `address.orElse(null)`. */ + fun address(address: Optional
) = address(address.getOrNull()) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** The person or business's name. */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * 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") + 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 [Creditor]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Creditor = + Creditor( + checkRequired("address", address), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Currency = apply { + fun validate(): Creditor = apply { if (validated) { return@apply } - known() + address().ifPresent { it.validate() } + name() validated = true } @@ -3130,19 +2773,1276 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic + internal fun validity(): Int = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) + + /** + * Unstructured address lines. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is Currency && value == other.value - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - override fun hashCode() = value.hashCode() + fun toBuilder() = Builder().from(this) - override fun toString() = value.toString() + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured?) = + unstructured(JsonField.ofNullable(unstructured)) + + /** Alias for calling [Builder.unstructured] with `unstructured.orElse(null)`. */ + fun unstructured(unstructured: Optional) = + unstructured(unstructured.getOrNull()) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().ifPresent { it.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 = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + + /** + * The first line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * The second line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") + + /** + * The third line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField? = null + private var line3: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The first line. */ + fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) + + /** Alias for calling [Builder.line1] with `line1.orElse(null)`. */ + fun line1(line1: Optional) = line1(line1.getOrNull()) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The second line. */ + fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) + + /** Alias for calling [Builder.line2] with `line2.orElse(null)`. */ + fun line2(line2: Optional) = line2(line2.getOrNull()) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The third line. */ + fun line3(line3: String?) = line3(JsonField.ofNullable(line3)) + + /** Alias for calling [Builder.line3] with `line3.orElse(null)`. */ + fun line3(line3: Optional) = line3(line3.getOrNull()) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + checkRequired("line2", line2), + checkRequired("line3", line3), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Creditor && + address == other.address && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(address, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Creditor{address=$address, name=$name, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * wire transfers this is always equal to `usd`. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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(): Currency = 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** The person or business whose funds are being transferred. */ + class Debtor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val address: JsonField
, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(address, name, mutableMapOf()) + + /** + * The person or business's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun address(): Optional
= address.getOptional("address") + + /** + * The person or business's name. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Debtor]. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Debtor]. */ + class Builder internal constructor() { + + private var address: JsonField
? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtor: Debtor) = apply { + address = debtor.address + name = debtor.name + additionalProperties = debtor.additionalProperties.toMutableMap() + } + + /** The person or business's address. */ + fun address(address: Address?) = address(JsonField.ofNullable(address)) + + /** Alias for calling [Builder.address] with `address.orElse(null)`. */ + fun address(address: Optional
) = address(address.getOrNull()) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** The person or business's name. */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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 [Debtor]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Debtor = + Debtor( + checkRequired("address", address), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Debtor = apply { + if (validated) { + return@apply + } + + address().ifPresent { it.validate() } + name() + 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 = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) + + /** + * Unstructured address lines. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured?) = + unstructured(JsonField.ofNullable(unstructured)) + + /** Alias for calling [Builder.unstructured] with `unstructured.orElse(null)`. */ + fun unstructured(unstructured: Optional) = + unstructured(unstructured.getOrNull()) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().ifPresent { it.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 = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + + /** + * The first line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * The second line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") + + /** + * The third line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField? = null + private var line3: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The first line. */ + fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) + + /** Alias for calling [Builder.line1] with `line1.orElse(null)`. */ + fun line1(line1: Optional) = line1(line1.getOrNull()) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The second line. */ + fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) + + /** Alias for calling [Builder.line2] with `line2.orElse(null)`. */ + fun line2(line2: Optional) = line2(line2.getOrNull()) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The third line. */ + fun line3(line3: String?) = line3(JsonField.ofNullable(line3)) + + /** Alias for calling [Builder.line3] with `line3.orElse(null)`. */ + fun line3(line3: Optional) = line3(line3.getOrNull()) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + checkRequired("line2", line2), + checkRequired("line3", line3), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Debtor && + address == other.address && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(address, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Debtor{address=$address, name=$name, additionalProperties=$additionalProperties}" } /** The transfer's network. */ @@ -5495,23 +6395,16 @@ private constructor( accountNumber == other.accountNumber && amount == other.amount && approval == other.approval && - beneficiaryAddressLine1 == other.beneficiaryAddressLine1 && - beneficiaryAddressLine2 == other.beneficiaryAddressLine2 && - beneficiaryAddressLine3 == other.beneficiaryAddressLine3 && - beneficiaryName == other.beneficiaryName && cancellation == other.cancellation && createdAt == other.createdAt && createdBy == other.createdBy && + creditor == other.creditor && currency == other.currency && + debtor == other.debtor && externalAccountId == other.externalAccountId && idempotencyKey == other.idempotencyKey && inboundWireDrawdownRequestId == other.inboundWireDrawdownRequestId && - messageToRecipient == other.messageToRecipient && network == other.network && - originatorAddressLine1 == other.originatorAddressLine1 && - originatorAddressLine2 == other.originatorAddressLine2 && - originatorAddressLine3 == other.originatorAddressLine3 && - originatorName == other.originatorName && pendingTransactionId == other.pendingTransactionId && remittance == other.remittance && reversal == other.reversal && @@ -5531,23 +6424,16 @@ private constructor( accountNumber, amount, approval, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, - beneficiaryName, cancellation, createdAt, createdBy, + creditor, currency, + debtor, externalAccountId, idempotencyKey, inboundWireDrawdownRequestId, - messageToRecipient, network, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, pendingTransactionId, remittance, reversal, @@ -5564,5 +6450,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, amount=$amount, approval=$approval, beneficiaryAddressLine1=$beneficiaryAddressLine1, beneficiaryAddressLine2=$beneficiaryAddressLine2, beneficiaryAddressLine3=$beneficiaryAddressLine3, beneficiaryName=$beneficiaryName, cancellation=$cancellation, createdAt=$createdAt, createdBy=$createdBy, currency=$currency, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, messageToRecipient=$messageToRecipient, network=$network, originatorAddressLine1=$originatorAddressLine1, originatorAddressLine2=$originatorAddressLine2, originatorAddressLine3=$originatorAddressLine3, originatorName=$originatorName, pendingTransactionId=$pendingTransactionId, remittance=$remittance, reversal=$reversal, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" + "WireTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, amount=$amount, approval=$approval, cancellation=$cancellation, createdAt=$createdAt, createdBy=$createdBy, creditor=$creditor, currency=$currency, debtor=$debtor, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, network=$network, pendingTransactionId=$pendingTransactionId, remittance=$remittance, reversal=$reversal, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt index fd2679ef8..747ff7d0f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt @@ -47,44 +47,37 @@ private constructor( fun amount(): Long = body.amount() /** - * The beneficiary's name. + * The person or business that is receiving the funds from 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 beneficiaryName(): String = body.beneficiaryName() + fun creditor(): Creditor = body.creditor() /** - * The account number for the destination account. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun accountNumber(): Optional = body.accountNumber() - - /** - * The beneficiary's address line 1. + * Additional remittance information related to the wire transfer. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). + * @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 beneficiaryAddressLine1(): Optional = body.beneficiaryAddressLine1() + fun remittance(): Remittance = body.remittance() /** - * The beneficiary's address line 2. + * The account number for the destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun beneficiaryAddressLine2(): Optional = body.beneficiaryAddressLine2() + fun accountNumber(): Optional = body.accountNumber() /** - * The beneficiary's address line 3. + * The person or business whose funds are being transferred. This is only necessary if you're + * transferring from a commingled account. Otherwise, we'll use the associated entity's details. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun beneficiaryAddressLine3(): Optional = body.beneficiaryAddressLine3() + fun debtor(): Optional = body.debtor() /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -103,50 +96,6 @@ private constructor( */ fun inboundWireDrawdownRequestId(): Optional = body.inboundWireDrawdownRequestId() - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = body.originatorAddressLine1() - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = body.originatorAddressLine2() - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = body.originatorAddressLine3() - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorName(): Optional = body.originatorName() - - /** - * Additional remittance information related to the wire transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun remittance(): Optional = body.remittance() - /** * Whether the transfer requires explicit approval via the dashboard or API. * @@ -187,42 +136,32 @@ private constructor( fun _amount(): JsonField = body._amount() /** - * Returns the raw JSON value of [beneficiaryName]. - * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _beneficiaryName(): JsonField = body._beneficiaryName() - - /** - * Returns the raw JSON value of [accountNumber]. + * Returns the raw JSON value of [creditor]. * - * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. */ - fun _accountNumber(): JsonField = body._accountNumber() + fun _creditor(): JsonField = body._creditor() /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. + * Returns the raw JSON value of [remittance]. * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine1(): JsonField = body._beneficiaryAddressLine1() + fun _remittance(): JsonField = body._remittance() /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. + * Returns the raw JSON value of [accountNumber]. * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine2(): JsonField = body._beneficiaryAddressLine2() + fun _accountNumber(): JsonField = body._accountNumber() /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. + * Returns the raw JSON value of [debtor]. * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine3(): JsonField = body._beneficiaryAddressLine3() + fun _debtor(): JsonField = body._debtor() /** * Returns the raw JSON value of [externalAccountId]. @@ -240,44 +179,6 @@ private constructor( */ fun _inboundWireDrawdownRequestId(): JsonField = body._inboundWireDrawdownRequestId() - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine1(): JsonField = body._originatorAddressLine1() - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine2(): JsonField = body._originatorAddressLine2() - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine3(): JsonField = body._originatorAddressLine3() - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _originatorName(): JsonField = body._originatorName() - - /** - * Returns the raw JSON value of [remittance]. - * - * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _remittance(): JsonField = body._remittance() - /** * Returns the raw JSON value of [requireApproval]. * @@ -319,7 +220,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` */ @JvmStatic fun builder() = Builder() @@ -346,9 +248,9 @@ private constructor( * Otherwise, it's more convenient to use the top-level setters instead: * - [accountId] * - [amount] - * - [beneficiaryName] + * - [creditor] + * - [remittance] * - [accountNumber] - * - [beneficiaryAddressLine1] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -376,21 +278,29 @@ private constructor( */ fun amount(amount: JsonField) = apply { body.amount(amount) } - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String) = apply { - body.beneficiaryName(beneficiaryName) - } + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor) = apply { body.creditor(creditor) } + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditor(creditor: JsonField) = apply { body.creditor(creditor) } + + /** Additional remittance information related to the wire transfer. */ + fun remittance(remittance: Remittance) = apply { body.remittance(remittance) } /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. + * Sets [Builder.remittance] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value + * You should usually call [Builder.remittance] with a well-typed [Remittance] value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - body.beneficiaryName(beneficiaryName) - } + fun remittance(remittance: JsonField) = apply { body.remittance(remittance) } /** The account number for the destination account. */ fun accountNumber(accountNumber: String) = apply { body.accountNumber(accountNumber) } @@ -406,53 +316,20 @@ private constructor( body.accountNumber(accountNumber) } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String) = apply { - body.beneficiaryAddressLine1(beneficiaryAddressLine1) - } - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - body.beneficiaryAddressLine1(beneficiaryAddressLine1) - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String) = apply { - body.beneficiaryAddressLine2(beneficiaryAddressLine2) - } - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - body.beneficiaryAddressLine2(beneficiaryAddressLine2) - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String) = apply { - body.beneficiaryAddressLine3(beneficiaryAddressLine3) - } + fun debtor(debtor: Debtor) = apply { body.debtor(debtor) } /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - body.beneficiaryAddressLine3(beneficiaryAddressLine3) - } + fun debtor(debtor: JsonField) = apply { body.debtor(debtor) } /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -492,92 +369,6 @@ private constructor( body.inboundWireDrawdownRequestId(inboundWireDrawdownRequestId) } - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine1(originatorAddressLine1: String) = apply { - body.originatorAddressLine1(originatorAddressLine1) - } - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - body.originatorAddressLine1(originatorAddressLine1) - } - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine2(originatorAddressLine2: String) = apply { - body.originatorAddressLine2(originatorAddressLine2) - } - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - body.originatorAddressLine2(originatorAddressLine2) - } - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine3(originatorAddressLine3: String) = apply { - body.originatorAddressLine3(originatorAddressLine3) - } - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - body.originatorAddressLine3(originatorAddressLine3) - } - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - */ - fun originatorName(originatorName: String) = apply { body.originatorName(originatorName) } - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - body.originatorName(originatorName) - } - - /** Additional remittance information related to the wire transfer. */ - fun remittance(remittance: Remittance) = apply { body.remittance(remittance) } - - /** - * Sets [Builder.remittance] to an arbitrary JSON value. - * - * You should usually call [Builder.remittance] with a well-typed [Remittance] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun remittance(remittance: JsonField) = apply { body.remittance(remittance) } - /** Whether the transfer requires explicit approval via the dashboard or API. */ fun requireApproval(requireApproval: Boolean) = apply { body.requireApproval(requireApproval) @@ -753,7 +544,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` * * @throws IllegalStateException if any required field is unset. @@ -777,18 +569,12 @@ private constructor( private constructor( private val accountId: JsonField, private val amount: JsonField, - private val beneficiaryName: JsonField, + private val creditor: JsonField, + private val remittance: JsonField, private val accountNumber: JsonField, - private val beneficiaryAddressLine1: JsonField, - private val beneficiaryAddressLine2: JsonField, - private val beneficiaryAddressLine3: JsonField, + private val debtor: JsonField, private val externalAccountId: JsonField, private val inboundWireDrawdownRequestId: JsonField, - private val originatorAddressLine1: JsonField, - private val originatorAddressLine2: JsonField, - private val originatorAddressLine3: JsonField, - private val originatorName: JsonField, - private val remittance: JsonField, private val requireApproval: JsonField, private val routingNumber: JsonField, private val sourceAccountNumberId: JsonField, @@ -801,42 +587,22 @@ private constructor( @ExcludeMissing accountId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_name") + @JsonProperty("creditor") @ExcludeMissing - beneficiaryName: JsonField = JsonMissing.of(), + creditor: JsonField = JsonMissing.of(), + @JsonProperty("remittance") + @ExcludeMissing + remittance: JsonField = JsonMissing.of(), @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - beneficiaryAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - beneficiaryAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - beneficiaryAddressLine3: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing debtor: JsonField = JsonMissing.of(), @JsonProperty("external_account_id") @ExcludeMissing externalAccountId: JsonField = JsonMissing.of(), @JsonProperty("inbound_wire_drawdown_request_id") @ExcludeMissing inboundWireDrawdownRequestId: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line1") - @ExcludeMissing - originatorAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line2") - @ExcludeMissing - originatorAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line3") - @ExcludeMissing - originatorAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("originator_name") - @ExcludeMissing - originatorName: JsonField = JsonMissing.of(), - @JsonProperty("remittance") - @ExcludeMissing - remittance: JsonField = JsonMissing.of(), @JsonProperty("require_approval") @ExcludeMissing requireApproval: JsonField = JsonMissing.of(), @@ -849,18 +615,12 @@ private constructor( ) : this( accountId, amount, - beneficiaryName, + creditor, + remittance, accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -884,47 +644,38 @@ private constructor( fun amount(): Long = amount.getRequired("amount") /** - * The beneficiary's name. + * The person or business that is receiving the funds from 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 beneficiaryName(): String = beneficiaryName.getRequired("beneficiary_name") - - /** - * The account number for the destination account. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun accountNumber(): Optional = accountNumber.getOptional("account_number") + fun creditor(): Creditor = creditor.getRequired("creditor") /** - * The beneficiary's address line 1. + * Additional remittance information related to the wire transfer. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * @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 beneficiaryAddressLine1(): Optional = - beneficiaryAddressLine1.getOptional("beneficiary_address_line1") + fun remittance(): Remittance = remittance.getRequired("remittance") /** - * The beneficiary's address line 2. + * The account number for the destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun beneficiaryAddressLine2(): Optional = - beneficiaryAddressLine2.getOptional("beneficiary_address_line2") + fun accountNumber(): Optional = accountNumber.getOptional("account_number") /** - * The beneficiary's address line 3. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun beneficiaryAddressLine3(): Optional = - beneficiaryAddressLine3.getOptional("beneficiary_address_line3") + fun debtor(): Optional = debtor.getOptional("debtor") /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -946,53 +697,6 @@ private constructor( fun inboundWireDrawdownRequestId(): Optional = inboundWireDrawdownRequestId.getOptional("inbound_wire_drawdown_request_id") - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = - originatorAddressLine1.getOptional("originator_address_line1") - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = - originatorAddressLine2.getOptional("originator_address_line2") - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = - originatorAddressLine3.getOptional("originator_address_line3") - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorName(): Optional = originatorName.getOptional("originator_name") - - /** - * Additional remittance information related to the wire transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun remittance(): Optional = remittance.getOptional("remittance") - /** * Whether the transfer requires explicit approval via the dashboard or API. * @@ -1034,14 +738,20 @@ private constructor( @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** - * Returns the raw JSON value of [beneficiaryName]. + * Returns the raw JSON value of [creditor]. * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor") @ExcludeMissing fun _creditor(): JsonField = creditor + + /** + * Returns the raw JSON value of [remittance]. + * + * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("beneficiary_name") + @JsonProperty("remittance") @ExcludeMissing - fun _beneficiaryName(): JsonField = beneficiaryName + fun _remittance(): JsonField = remittance /** * Returns the raw JSON value of [accountNumber]. @@ -1054,40 +764,17 @@ private constructor( fun _accountNumber(): JsonField = accountNumber /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. + * Returns the raw JSON value of [debtor]. * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - fun _beneficiaryAddressLine1(): JsonField = beneficiaryAddressLine1 + @JsonProperty("debtor") @ExcludeMissing fun _debtor(): JsonField = debtor /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. + * Returns the raw JSON value of [externalAccountId]. * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - fun _beneficiaryAddressLine2(): JsonField = beneficiaryAddressLine2 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. - * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - fun _beneficiaryAddressLine3(): JsonField = beneficiaryAddressLine3 - - /** - * Returns the raw JSON value of [externalAccountId]. - * - * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. */ @JsonProperty("external_account_id") @ExcludeMissing @@ -1103,55 +790,6 @@ private constructor( @ExcludeMissing fun _inboundWireDrawdownRequestId(): JsonField = inboundWireDrawdownRequestId - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line1") - @ExcludeMissing - fun _originatorAddressLine1(): JsonField = originatorAddressLine1 - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line2") - @ExcludeMissing - fun _originatorAddressLine2(): JsonField = originatorAddressLine2 - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line3") - @ExcludeMissing - fun _originatorAddressLine3(): JsonField = originatorAddressLine3 - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("originator_name") - @ExcludeMissing - fun _originatorName(): JsonField = originatorName - - /** - * Returns the raw JSON value of [remittance]. - * - * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("remittance") - @ExcludeMissing - fun _remittance(): JsonField = remittance - /** * Returns the raw JSON value of [requireApproval]. * @@ -1203,7 +841,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` */ @JvmStatic fun builder() = Builder() @@ -1214,18 +853,12 @@ private constructor( private var accountId: JsonField? = null private var amount: JsonField? = null - private var beneficiaryName: JsonField? = null + private var creditor: JsonField? = null + private var remittance: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() - private var beneficiaryAddressLine1: JsonField = JsonMissing.of() - private var beneficiaryAddressLine2: JsonField = JsonMissing.of() - private var beneficiaryAddressLine3: JsonField = JsonMissing.of() + private var debtor: JsonField = JsonMissing.of() private var externalAccountId: JsonField = JsonMissing.of() private var inboundWireDrawdownRequestId: JsonField = JsonMissing.of() - private var originatorAddressLine1: JsonField = JsonMissing.of() - private var originatorAddressLine2: JsonField = JsonMissing.of() - private var originatorAddressLine3: JsonField = JsonMissing.of() - private var originatorName: JsonField = JsonMissing.of() - private var remittance: JsonField = JsonMissing.of() private var requireApproval: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() private var sourceAccountNumberId: JsonField = JsonMissing.of() @@ -1235,18 +868,12 @@ private constructor( internal fun from(body: Body) = apply { accountId = body.accountId amount = body.amount - beneficiaryName = body.beneficiaryName + creditor = body.creditor + remittance = body.remittance accountNumber = body.accountNumber - beneficiaryAddressLine1 = body.beneficiaryAddressLine1 - beneficiaryAddressLine2 = body.beneficiaryAddressLine2 - beneficiaryAddressLine3 = body.beneficiaryAddressLine3 + debtor = body.debtor externalAccountId = body.externalAccountId inboundWireDrawdownRequestId = body.inboundWireDrawdownRequestId - originatorAddressLine1 = body.originatorAddressLine1 - originatorAddressLine2 = body.originatorAddressLine2 - originatorAddressLine3 = body.originatorAddressLine3 - originatorName = body.originatorName - remittance = body.remittance requireApproval = body.requireApproval routingNumber = body.routingNumber sourceAccountNumberId = body.sourceAccountNumberId @@ -1277,19 +904,30 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String) = - beneficiaryName(JsonField.of(beneficiaryName)) + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor) = creditor(JsonField.of(creditor)) + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditor(creditor: JsonField) = apply { this.creditor = creditor } + + /** Additional remittance information related to the wire transfer. */ + fun remittance(remittance: Remittance) = remittance(JsonField.of(remittance)) /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. + * Sets [Builder.remittance] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value + * You should usually call [Builder.remittance] with a well-typed [Remittance] value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - this.beneficiaryName = beneficiaryName + fun remittance(remittance: JsonField) = apply { + this.remittance = remittance } /** The account number for the destination account. */ @@ -1306,50 +944,21 @@ private constructor( this.accountNumber = accountNumber } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String) = - beneficiaryAddressLine1(JsonField.of(beneficiaryAddressLine1)) - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - this.beneficiaryAddressLine1 = beneficiaryAddressLine1 - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String) = - beneficiaryAddressLine2(JsonField.of(beneficiaryAddressLine2)) - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - this.beneficiaryAddressLine2 = beneficiaryAddressLine2 - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String) = - beneficiaryAddressLine3(JsonField.of(beneficiaryAddressLine3)) + fun debtor(debtor: Debtor) = debtor(JsonField.of(debtor)) /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - this.beneficiaryAddressLine3 = beneficiaryAddressLine3 - } + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } /** * The ID of an External Account to initiate a transfer to. If this parameter is @@ -1388,92 +997,6 @@ private constructor( this.inboundWireDrawdownRequestId = inboundWireDrawdownRequestId } - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine1(originatorAddressLine1: String) = - originatorAddressLine1(JsonField.of(originatorAddressLine1)) - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - this.originatorAddressLine1 = originatorAddressLine1 - } - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine2(originatorAddressLine2: String) = - originatorAddressLine2(JsonField.of(originatorAddressLine2)) - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - this.originatorAddressLine2 = originatorAddressLine2 - } - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine3(originatorAddressLine3: String) = - originatorAddressLine3(JsonField.of(originatorAddressLine3)) - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - this.originatorAddressLine3 = originatorAddressLine3 - } - - /** - * The originator's name. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorName(originatorName: String) = - originatorName(JsonField.of(originatorName)) - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - this.originatorName = originatorName - } - - /** Additional remittance information related to the wire transfer. */ - fun remittance(remittance: Remittance) = remittance(JsonField.of(remittance)) - - /** - * Sets [Builder.remittance] to an arbitrary JSON value. - * - * You should usually call [Builder.remittance] with a well-typed [Remittance] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun remittance(remittance: JsonField) = apply { - this.remittance = remittance - } - /** Whether the transfer requires explicit approval via the dashboard or API. */ fun requireApproval(requireApproval: Boolean) = requireApproval(JsonField.of(requireApproval)) @@ -1549,7 +1072,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` * * @throws IllegalStateException if any required field is unset. @@ -1558,18 +1082,12 @@ private constructor( Body( checkRequired("accountId", accountId), checkRequired("amount", amount), - checkRequired("beneficiaryName", beneficiaryName), + checkRequired("creditor", creditor), + checkRequired("remittance", remittance), accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -1586,18 +1104,12 @@ private constructor( accountId() amount() - beneficiaryName() + creditor().validate() + remittance().validate() accountNumber() - beneficiaryAddressLine1() - beneficiaryAddressLine2() - beneficiaryAddressLine3() + debtor().ifPresent { it.validate() } externalAccountId() inboundWireDrawdownRequestId() - originatorAddressLine1() - originatorAddressLine2() - originatorAddressLine3() - originatorName() - remittance().ifPresent { it.validate() } requireApproval() routingNumber() sourceAccountNumberId() @@ -1622,18 +1134,12 @@ private constructor( internal fun validity(): Int = (if (accountId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + - (if (beneficiaryName.asKnown().isPresent) 1 else 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + + (remittance.asKnown().getOrNull()?.validity() ?: 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine1.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine2.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine3.asKnown().isPresent) 1 else 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + (if (externalAccountId.asKnown().isPresent) 1 else 0) + (if (inboundWireDrawdownRequestId.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine1.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine2.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine3.asKnown().isPresent) 1 else 0) + - (if (originatorName.asKnown().isPresent) 1 else 0) + - (remittance.asKnown().getOrNull()?.validity() ?: 0) + (if (requireApproval.asKnown().isPresent) 1 else 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) @@ -1646,18 +1152,12 @@ private constructor( return other is Body && accountId == other.accountId && amount == other.amount && - beneficiaryName == other.beneficiaryName && + creditor == other.creditor && + remittance == other.remittance && accountNumber == other.accountNumber && - beneficiaryAddressLine1 == other.beneficiaryAddressLine1 && - beneficiaryAddressLine2 == other.beneficiaryAddressLine2 && - beneficiaryAddressLine3 == other.beneficiaryAddressLine3 && + debtor == other.debtor && externalAccountId == other.externalAccountId && inboundWireDrawdownRequestId == other.inboundWireDrawdownRequestId && - originatorAddressLine1 == other.originatorAddressLine1 && - originatorAddressLine2 == other.originatorAddressLine2 && - originatorAddressLine3 == other.originatorAddressLine3 && - originatorName == other.originatorName && - remittance == other.remittance && requireApproval == other.requireApproval && routingNumber == other.routingNumber && sourceAccountNumberId == other.sourceAccountNumberId && @@ -1668,18 +1168,12 @@ private constructor( Objects.hash( accountId, amount, - beneficiaryName, + creditor, + remittance, accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -1690,78 +1184,53 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{accountId=$accountId, amount=$amount, beneficiaryName=$beneficiaryName, accountNumber=$accountNumber, beneficiaryAddressLine1=$beneficiaryAddressLine1, beneficiaryAddressLine2=$beneficiaryAddressLine2, beneficiaryAddressLine3=$beneficiaryAddressLine3, externalAccountId=$externalAccountId, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, originatorAddressLine1=$originatorAddressLine1, originatorAddressLine2=$originatorAddressLine2, originatorAddressLine3=$originatorAddressLine3, originatorName=$originatorName, remittance=$remittance, requireApproval=$requireApproval, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, additionalProperties=$additionalProperties}" + "Body{accountId=$accountId, amount=$amount, creditor=$creditor, remittance=$remittance, accountNumber=$accountNumber, debtor=$debtor, externalAccountId=$externalAccountId, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, requireApproval=$requireApproval, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, additionalProperties=$additionalProperties}" } - /** Additional remittance information related to the wire transfer. */ - class Remittance + /** The person or business that is receiving the funds from the transfer. */ + class Creditor @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val category: JsonField, - private val tax: JsonField, - private val unstructured: JsonField, + private val name: JsonField, + private val address: JsonField
, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), - @JsonProperty("tax") @ExcludeMissing tax: JsonField = JsonMissing.of(), - @JsonProperty("unstructured") - @ExcludeMissing - unstructured: JsonField = JsonMissing.of(), - ) : this(category, tax, unstructured, mutableMapOf()) + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + ) : this(name, address, mutableMapOf()) /** - * The type of remittance information being passed. + * The person or business's name. * * @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") - - /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal - * to `tax`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tax(): Optional = tax.getOptional("tax") + fun name(): String = name.getRequired("name") /** - * Unstructured remittance information. Required if `category` is equal to `unstructured`. + * The person or business's address. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun unstructured(): Optional = unstructured.getOptional("unstructured") - - /** - * 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 + fun address(): Optional
= address.getOptional("address") /** - * Returns the raw JSON value of [tax]. + * Returns the raw JSON value of [name]. * - * Unlike [tax], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("tax") @ExcludeMissing fun _tax(): JsonField = tax + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name /** - * Returns the raw JSON value of [unstructured]. + * Returns the raw JSON value of [address]. * - * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("unstructured") - @ExcludeMissing - fun _unstructured(): JsonField = unstructured + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -1778,75 +1247,53 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Remittance]. + * Returns a mutable builder for constructing an instance of [Creditor]. * * The following fields are required: * ```java - * .category() + * .name() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Remittance]. */ + /** A builder for [Creditor]. */ class Builder internal constructor() { - private var category: JsonField? = null - private var tax: JsonField = JsonMissing.of() - private var unstructured: JsonField = JsonMissing.of() + private var name: JsonField? = null + private var address: JsonField
= JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(remittance: Remittance) = apply { - category = remittance.category - tax = remittance.tax - unstructured = remittance.unstructured - additionalProperties = remittance.additionalProperties.toMutableMap() + internal fun from(creditor: Creditor) = apply { + name = creditor.name + address = creditor.address + additionalProperties = creditor.additionalProperties.toMutableMap() } - /** The type of remittance information being passed. */ - 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) = apply { this.category = category } - - /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is - * equal to `tax`. - */ - fun tax(tax: Tax) = tax(JsonField.of(tax)) + /** The person or business's name. */ + fun name(name: String) = name(JsonField.of(name)) /** - * Sets [Builder.tax] to an arbitrary JSON value. + * Sets [Builder.name] to an arbitrary JSON value. * - * You should usually call [Builder.tax] with a well-typed [Tax] value instead. This + * You should usually call [Builder.name] with a well-typed [String] value instead. This * method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun tax(tax: JsonField) = apply { this.tax = tax } + fun name(name: JsonField) = apply { this.name = name } - /** - * Unstructured remittance information. Required if `category` is equal to - * `unstructured`. - */ - fun unstructured(unstructured: Unstructured) = unstructured(JsonField.of(unstructured)) + /** The person or business's address. */ + fun address(address: Address) = address(JsonField.of(address)) /** - * Sets [Builder.unstructured] to an arbitrary JSON value. + * Sets [Builder.address] to an arbitrary JSON value. * - * You should usually call [Builder.unstructured] with a well-typed [Unstructured] value - * instead. This method is primarily for setting the field to an undocumented or not yet + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun unstructured(unstructured: JsonField) = apply { - this.unstructured = unstructured - } + fun address(address: JsonField
) = apply { this.address = address } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1868,36 +1315,30 @@ private constructor( } /** - * Returns an immutable instance of [Remittance]. + * Returns an immutable instance of [Creditor]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .category() + * .name() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Remittance = - Remittance( - checkRequired("category", category), - tax, - unstructured, - additionalProperties.toMutableMap(), - ) + fun build(): Creditor = + Creditor(checkRequired("name", name), address, additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): Remittance = apply { + fun validate(): Creditor = apply { if (validated) { return@apply } - category().validate() - tax().ifPresent { it.validate() } - unstructured().ifPresent { it.validate() } + name() + address().ifPresent { it.validate() } validated = true } @@ -1917,124 +1358,1218 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (category.asKnown().getOrNull()?.validity() ?: 0) + - (tax.asKnown().getOrNull()?.validity() ?: 0) + - (unstructured.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + + (address.asKnown().getOrNull()?.validity() ?: 0) - /** The type of remittance information being passed. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) /** - * Returns this class instance's raw value. + * Unstructured address lines. * - * 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. + * @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). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun unstructured(): Unstructured = unstructured.getRequired("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 { - /** The wire transfer contains unstructured remittance information. */ - @JvmField val UNSTRUCTURED = of("unstructured") + /** + * Returns a mutable builder for constructing an instance of [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured) = + unstructured(JsonField.of(unstructured)) /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - @JvmField val TAX = of("tax") + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } + 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) + } - /** An enum containing [Category]'s known values. */ - enum class Known { - /** The wire transfer contains unstructured remittance information. */ - UNSTRUCTURED, /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * Returns an immutable instance of [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - TAX, + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().validate() + validated = true } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * Returns a score indicating how many valid values are contained in this object + * recursively. * - * An instance of [Category] 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. + * Used for best match union deserialization. */ - enum class Value { - /** The wire transfer contains unstructured remittance information. */ - UNSTRUCTURED, + @JvmSynthetic + internal fun validity(): Int = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * The address line 1. + * + * @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). */ - TAX, + fun line1(): String = line1.getRequired("line1") + /** - * An enum member indicating that [Category] was instantiated with an unknown value. + * The address line 2. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - _UNKNOWN, + fun line2(): Optional = line2.getOptional("line2") + + /** + * The address line 3. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField = JsonMissing.of() + private var line3: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The address line 1. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The address line 2. */ + fun line2(line2: String) = line2(JsonField.of(line2)) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The address line 3. */ + fun line3(line3: String) = line3(JsonField.of(line3)) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + line2, + line3, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" } - /** - * 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) { - UNSTRUCTURED -> Value.UNSTRUCTURED - TAX -> Value.TAX - else -> Value._UNKNOWN + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * 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) { - UNSTRUCTURED -> Known.UNSTRUCTURED - TAX -> Known.TAX - else -> throw IncreaseInvalidDataException("Unknown Category: $value") + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Creditor && + name == other.name && + address == other.address && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, address, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Creditor{name=$name, address=$address, additionalProperties=$additionalProperties}" + } + + /** Additional remittance information related to the wire transfer. */ + class Remittance + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val tax: JsonField, + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("tax") @ExcludeMissing tax: JsonField = JsonMissing.of(), + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of(), + ) : this(category, tax, unstructured, mutableMapOf()) + + /** + * The type of remittance information being passed. + * + * @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") + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal + * to `tax`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tax(): Optional = tax.getOptional("tax") + + /** + * Unstructured remittance information. Required if `category` is equal to `unstructured`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * 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 [tax]. + * + * Unlike [tax], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("tax") @ExcludeMissing fun _tax(): JsonField = tax + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 [Remittance]. + * + * The following fields are required: + * ```java + * .category() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Remittance]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var tax: JsonField = JsonMissing.of() + private var unstructured: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(remittance: Remittance) = apply { + category = remittance.category + tax = remittance.tax + unstructured = remittance.unstructured + additionalProperties = remittance.additionalProperties.toMutableMap() + } + + /** The type of remittance information being passed. */ + 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) = apply { this.category = category } + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is + * equal to `tax`. + */ + fun tax(tax: Tax) = tax(JsonField.of(tax)) + + /** + * Sets [Builder.tax] to an arbitrary JSON value. + * + * You should usually call [Builder.tax] with a well-typed [Tax] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tax(tax: JsonField) = apply { this.tax = tax } + + /** + * Unstructured remittance information. Required if `category` is equal to + * `unstructured`. + */ + fun unstructured(unstructured: Unstructured) = unstructured(JsonField.of(unstructured)) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Remittance]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Remittance = + Remittance( + checkRequired("category", category), + tax, + unstructured, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Remittance = apply { + if (validated) { + return@apply + } + + category().validate() + tax().ifPresent { it.validate() } + unstructured().ifPresent { it.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 = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (tax.asKnown().getOrNull()?.validity() ?: 0) + + (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of remittance information being passed. */ + class Category @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 wire transfer contains unstructured remittance information. */ + @JvmField val UNSTRUCTURED = of("unstructured") + + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + @JvmField val TAX = of("tax") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** The wire transfer contains unstructured remittance information. */ + UNSTRUCTURED, + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + TAX, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] 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 wire transfer contains unstructured remittance information. */ + UNSTRUCTURED, + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + TAX, + /** + * An enum member indicating that [Category] 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) { + UNSTRUCTURED -> Value.UNSTRUCTURED + TAX -> Value.TAX + 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) { + UNSTRUCTURED -> Known.UNSTRUCTURED + TAX -> Known.TAX + else -> throw IncreaseInvalidDataException("Unknown Category: $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(): Category = 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal + * to `tax`. + */ + class Tax + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val date: JsonField, + private val identificationNumber: JsonField, + private val typeCode: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), + @JsonProperty("identification_number") + @ExcludeMissing + identificationNumber: JsonField = JsonMissing.of(), + @JsonProperty("type_code") + @ExcludeMissing + typeCode: JsonField = JsonMissing.of(), + ) : this(date, identificationNumber, typeCode, mutableMapOf()) + + /** + * The month and year the tax payment is for, in YYYY-MM-DD format. The day is ignored. + * + * @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 date(): LocalDate = date.getRequired("date") + + /** + * The 9-digit Tax Identification Number (TIN) or Employer Identification Number (EIN). + * + * @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 identificationNumber(): String = + identificationNumber.getRequired("identification_number") + + /** + * The 5-character tax type code. + * + * @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 typeCode(): String = typeCode.getRequired("type_code") + + /** + * Returns the raw JSON value of [date]. + * + * Unlike [date], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date + + /** + * Returns the raw JSON value of [identificationNumber]. + * + * Unlike [identificationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("identification_number") + @ExcludeMissing + fun _identificationNumber(): JsonField = identificationNumber + + /** + * Returns the raw JSON value of [typeCode]. + * + * Unlike [typeCode], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("type_code") @ExcludeMissing fun _typeCode(): JsonField = typeCode + + @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 [Tax]. + * + * The following fields are required: + * ```java + * .date() + * .identificationNumber() + * .typeCode() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Tax]. */ + class Builder internal constructor() { + + private var date: JsonField? = null + private var identificationNumber: JsonField? = null + private var typeCode: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(tax: Tax) = apply { + date = tax.date + identificationNumber = tax.identificationNumber + typeCode = tax.typeCode + additionalProperties = tax.additionalProperties.toMutableMap() + } + + /** + * The month and year the tax payment is for, in YYYY-MM-DD format. The day is + * ignored. + */ + fun date(date: LocalDate) = date(JsonField.of(date)) + + /** + * Sets [Builder.date] to an arbitrary JSON value. + * + * You should usually call [Builder.date] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun date(date: JsonField) = apply { this.date = date } + + /** + * The 9-digit Tax Identification Number (TIN) or Employer Identification Number + * (EIN). + */ + fun identificationNumber(identificationNumber: String) = + identificationNumber(JsonField.of(identificationNumber)) + + /** + * Sets [Builder.identificationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.identificationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun identificationNumber(identificationNumber: JsonField) = apply { + this.identificationNumber = identificationNumber + } + + /** The 5-character tax type code. */ + fun typeCode(typeCode: String) = typeCode(JsonField.of(typeCode)) + + /** + * Sets [Builder.typeCode] to an arbitrary JSON value. + * + * You should usually call [Builder.typeCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun typeCode(typeCode: JsonField) = apply { this.typeCode = typeCode } + + 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 [Tax]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .date() + * .identificationNumber() + * .typeCode() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Tax = + Tax( + checkRequired("date", date), + checkRequired("identificationNumber", identificationNumber), + checkRequired("typeCode", typeCode), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Tax = apply { + if (validated) { + return@apply + } + + date() + identificationNumber() + typeCode() + 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 (date.asKnown().isPresent) 1 else 0) + + (if (identificationNumber.asKnown().isPresent) 1 else 0) + + (if (typeCode.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Tax && + date == other.date && + identificationNumber == other.identificationNumber && + typeCode == other.typeCode && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(date, identificationNumber, typeCode, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Tax{date=$date, identificationNumber=$identificationNumber, typeCode=$typeCode, additionalProperties=$additionalProperties}" + } + + /** + * Unstructured remittance information. Required if `category` is equal to `unstructured`. + */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val message: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("message") + @ExcludeMissing + message: JsonField = JsonMissing.of() + ) : this(message, mutableMapOf()) + + /** + * The information. + * + * @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 message(): String = message.getRequired("message") + + /** + * Returns the raw JSON value of [message]. + * + * Unlike [message], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("message") @ExcludeMissing fun _message(): JsonField = message + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .message() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var message: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + message = unstructured.message + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The information. */ + fun message(message: String) = message(JsonField.of(message)) + + /** + * Sets [Builder.message] to an arbitrary JSON value. + * + * You should usually call [Builder.message] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun message(message: JsonField) = apply { this.message = message } + + 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) } - /** - * 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") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .message() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("message", message), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): Unstructured = apply { if (validated) { return@apply } - known() + message() validated = true } @@ -2052,97 +2587,258 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = (if (message.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is Unstructured && + message == other.message && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(message, additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{message=$message, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Remittance && + category == other.category && + tax == other.tax && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, tax, unstructured, additionalProperties) } + override fun hashCode(): Int = hashCode + + override fun toString() = + "Remittance{category=$category, tax=$tax, unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + /** + * The person or business whose funds are being transferred. This is only necessary if you're + * transferring from a commingled account. Otherwise, we'll use the associated entity's details. + */ + class Debtor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val name: JsonField, + private val address: JsonField
, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + ) : this(name, address, mutableMapOf()) + /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal - * to `tax`. + * The person or business's name. + * + * @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). */ - class Tax - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val date: JsonField, - private val identificationNumber: JsonField, - private val typeCode: JsonField, - private val additionalProperties: MutableMap, - ) { + fun name(): String = name.getRequired("name") - @JsonCreator - private constructor( - @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), - @JsonProperty("identification_number") - @ExcludeMissing - identificationNumber: JsonField = JsonMissing.of(), - @JsonProperty("type_code") - @ExcludeMissing - typeCode: JsonField = JsonMissing.of(), - ) : this(date, identificationNumber, typeCode, mutableMapOf()) + /** + * The person or business's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun address(): Optional
= address.getOptional("address") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + + @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 { /** - * The month and year the tax payment is for, in YYYY-MM-DD format. The day is ignored. + * Returns a mutable builder for constructing an instance of [Debtor]. * - * @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). + * The following fields are required: + * ```java + * .name() + * ``` */ - fun date(): LocalDate = date.getRequired("date") + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Debtor]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var address: JsonField
= JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtor: Debtor) = apply { + name = debtor.name + address = debtor.address + additionalProperties = debtor.additionalProperties.toMutableMap() + } + + /** The person or business's name. */ + fun name(name: String) = name(JsonField.of(name)) /** - * The 9-digit Tax Identification Number (TIN) or Employer Identification Number (EIN). + * Sets [Builder.name] to an arbitrary JSON value. * - * @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). + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun identificationNumber(): String = - identificationNumber.getRequired("identification_number") + fun name(name: JsonField) = apply { this.name = name } + + /** The person or business's address. */ + fun address(address: Address) = address(JsonField.of(address)) /** - * The 5-character tax type code. + * Sets [Builder.address] to an arbitrary JSON value. * - * @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). + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun typeCode(): String = typeCode.getRequired("type_code") + fun address(address: JsonField
) = apply { this.address = address } + + 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 the raw JSON value of [date]. + * Returns an immutable instance of [Debtor]. * - * Unlike [date], this method doesn't throw if the JSON field has an unexpected type. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date + fun build(): Debtor = + Debtor(checkRequired("name", name), address, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Debtor = apply { + if (validated) { + return@apply + } + + name() + address().ifPresent { it.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 (name.asKnown().isPresent) 1 else 0) + + (address.asKnown().getOrNull()?.validity() ?: 0) + + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) /** - * Returns the raw JSON value of [identificationNumber]. + * Unstructured address lines. * - * Unlike [identificationNumber], this method doesn't throw if the JSON field has an - * unexpected type. + * @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). */ - @JsonProperty("identification_number") - @ExcludeMissing - fun _identificationNumber(): JsonField = identificationNumber + fun unstructured(): Unstructured = unstructured.getRequired("unstructured") /** - * Returns the raw JSON value of [typeCode]. + * Returns the raw JSON value of [unstructured]. * - * Unlike [typeCode], this method doesn't throw if the JSON field has an unexpected + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("type_code") @ExcludeMissing fun _typeCode(): JsonField = typeCode + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -2159,79 +2855,43 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Tax]. + * Returns a mutable builder for constructing an instance of [Address]. * * The following fields are required: * ```java - * .date() - * .identificationNumber() - * .typeCode() + * .unstructured() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Tax]. */ + /** A builder for [Address]. */ class Builder internal constructor() { - private var date: JsonField? = null - private var identificationNumber: JsonField? = null - private var typeCode: JsonField? = null + private var unstructured: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tax: Tax) = apply { - date = tax.date - identificationNumber = tax.identificationNumber - typeCode = tax.typeCode - additionalProperties = tax.additionalProperties.toMutableMap() + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() } - /** - * The month and year the tax payment is for, in YYYY-MM-DD format. The day is - * ignored. - */ - fun date(date: LocalDate) = date(JsonField.of(date)) - - /** - * Sets [Builder.date] to an arbitrary JSON value. - * - * You should usually call [Builder.date] with a well-typed [LocalDate] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun date(date: JsonField) = apply { this.date = date } - - /** - * The 9-digit Tax Identification Number (TIN) or Employer Identification Number - * (EIN). - */ - fun identificationNumber(identificationNumber: String) = - identificationNumber(JsonField.of(identificationNumber)) + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured) = + unstructured(JsonField.of(unstructured)) /** - * Sets [Builder.identificationNumber] to an arbitrary JSON value. + * Sets [Builder.unstructured] to an arbitrary JSON value. * - * You should usually call [Builder.identificationNumber] with a well-typed [String] + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] * value instead. This method is primarily for setting the field to an undocumented * or not yet supported value. */ - fun identificationNumber(identificationNumber: JsonField) = apply { - this.identificationNumber = identificationNumber + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured } - /** The 5-character tax type code. */ - fun typeCode(typeCode: String) = typeCode(JsonField.of(typeCode)) - - /** - * Sets [Builder.typeCode] to an arbitrary JSON value. - * - * You should usually call [Builder.typeCode] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun typeCode(typeCode: JsonField) = apply { this.typeCode = typeCode } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2255,38 +2915,32 @@ private constructor( } /** - * Returns an immutable instance of [Tax]. + * Returns an immutable instance of [Address]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .date() - * .identificationNumber() - * .typeCode() + * .unstructured() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Tax = - Tax( - checkRequired("date", date), - checkRequired("identificationNumber", identificationNumber), - checkRequired("typeCode", typeCode), + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): Tax = apply { + fun validate(): Address = apply { if (validated) { return@apply } - date() - identificationNumber() - typeCode() + unstructured().validate() validated = true } @@ -2305,199 +2959,271 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = - (if (date.asKnown().isPresent) 1 else 0) + - (if (identificationNumber.asKnown().isPresent) 1 else 0) + - (if (typeCode.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + internal fun validity(): Int = (unstructured.asKnown().getOrNull()?.validity() ?: 0) - return other is Tax && - date == other.date && - identificationNumber == other.identificationNumber && - typeCode == other.typeCode && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(date, identificationNumber, typeCode, additionalProperties) - } + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) - override fun hashCode(): Int = hashCode + /** + * The address line 1. + * + * @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 line1(): String = line1.getRequired("line1") - override fun toString() = - "Tax{date=$date, identificationNumber=$identificationNumber, typeCode=$typeCode, additionalProperties=$additionalProperties}" - } + /** + * The address line 2. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") - /** - * Unstructured remittance information. Required if `category` is equal to `unstructured`. - */ - class Unstructured - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val message: JsonField, - private val additionalProperties: MutableMap, - ) { + /** + * The address line 3. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") - @JsonCreator - private constructor( - @JsonProperty("message") - @ExcludeMissing - message: JsonField = JsonMissing.of() - ) : this(message, mutableMapOf()) + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 - /** - * The message to the beneficiary. - * - * @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 message(): String = message.getRequired("message") + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 - /** - * Returns the raw JSON value of [message]. - * - * Unlike [message], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("message") @ExcludeMissing fun _message(): JsonField = message + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * ``` + */ + @JvmStatic fun builder() = Builder() + } - fun toBuilder() = Builder().from(this) + /** A builder for [Unstructured]. */ + class Builder internal constructor() { - companion object { + private var line1: JsonField? = null + private var line2: JsonField = JsonMissing.of() + private var line3: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Returns a mutable builder for constructing an instance of [Unstructured]. - * - * The following fields are required: - * ```java - * .message() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } - /** A builder for [Unstructured]. */ - class Builder internal constructor() { + /** The address line 1. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The address line 2. */ + fun line2(line2: String) = line2(JsonField.of(line2)) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The address line 3. */ + fun line3(line3: String) = line3(JsonField.of(line3)) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - private var message: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - @JvmSynthetic - internal fun from(unstructured: Unstructured) = apply { - message = unstructured.message - additionalProperties = unstructured.additionalProperties.toMutableMap() - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** The message to the beneficiary. */ - fun message(message: String) = message(JsonField.of(message)) + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** - * Sets [Builder.message] to an arbitrary JSON value. - * - * You should usually call [Builder.message] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun message(message: JsonField) = apply { this.message = message } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) + /** + * Returns an immutable instance of [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + line2, + line3, + additionalProperties.toMutableMap(), + ) } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + private var validated: Boolean = false - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) + fun validate(): Unstructured = apply { + if (validated) { + return@apply } - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) + line1() + line2() + line3() + validated = true } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } /** - * Returns an immutable instance of [Unstructured]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .message() - * ``` + * Returns a score indicating how many valid values are contained in this object + * recursively. * - * @throws IllegalStateException if any required field is unset. + * Used for best match union deserialization. */ - fun build(): Unstructured = - Unstructured( - checkRequired("message", message), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false + @JvmSynthetic + internal fun validity(): Int = + (if (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - fun validate(): Unstructured = apply { - if (validated) { - return@apply + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties } - message() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) } - /** - * 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 (message.asKnown().isPresent) 1 else 0) + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Unstructured && - message == other.message && + return other is Address && + unstructured == other.unstructured && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Unstructured{message=$message, additionalProperties=$additionalProperties}" + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -2505,21 +3231,18 @@ private constructor( return true } - return other is Remittance && - category == other.category && - tax == other.tax && - unstructured == other.unstructured && + return other is Debtor && + name == other.name && + address == other.address && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash(category, tax, unstructured, additionalProperties) - } + private val hashCode: Int by lazy { Objects.hash(name, address, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Remittance{category=$category, tax=$tax, unstructured=$unstructured, additionalProperties=$additionalProperties}" + "Debtor{name=$name, address=$address, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt new file mode 100644 index 000000000..1debb37e7 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt @@ -0,0 +1,344 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface FednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): FednowTransferServiceAsync + + /** Create a FedNow Transfer */ + fun create(params: FednowTransferCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** Retrieve a FedNow Transfer */ + fun retrieve(fednowTransferId: String): CompletableFuture = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): CompletableFuture = retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve(params: FednowTransferRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** List FedNow Transfers */ + fun list(): CompletableFuture = + list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(FednowTransferListParams.none(), requestOptions) + + /** Approve a FedNow Transfer */ + fun approve(fednowTransferId: String): CompletableFuture = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): CompletableFuture = approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see approve */ + fun approve(params: FednowTransferApproveParams): CompletableFuture = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** Cancel a pending FedNow Transfer */ + fun cancel(fednowTransferId: String): CompletableFuture = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): CompletableFuture = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see cancel */ + fun cancel(params: FednowTransferCancelParams): CompletableFuture = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + + /** + * A view of [FednowTransferServiceAsync] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /fednow_transfers`, but is otherwise the same as + * [FednowTransferServiceAsync.create]. + */ + fun create( + params: FednowTransferCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /fednow_transfers/{fednow_transfer_id}`, but is + * otherwise the same as [FednowTransferServiceAsync.retrieve]. + */ + fun retrieve(fednowTransferId: String): CompletableFuture> = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): CompletableFuture> = + retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /fednow_transfers`, but is otherwise the same as + * [FednowTransferServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(FednowTransferListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/approve`, + * but is otherwise the same as [FednowTransferServiceAsync.approve]. + */ + fun approve(fednowTransferId: String): CompletableFuture> = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): CompletableFuture> = + approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams + ): CompletableFuture> = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/cancel`, but + * is otherwise the same as [FednowTransferServiceAsync.cancel]. + */ + fun cancel(fednowTransferId: String): CompletableFuture> = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): CompletableFuture> = + cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams + ): CompletableFuture> = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..ea4c3f72e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt @@ -0,0 +1,263 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class FednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : FednowTransferServiceAsync { + + private val withRawResponse: FednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): FednowTransferServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync = + FednowTransferServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /fednow_transfers/{fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /fednow_transfers + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers/{fednow_transfer_id}/approve + withRawResponse().approve(params, requestOptions).thenApply { it.parse() } + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers/{fednow_transfer_id}/cancel + withRawResponse().cancel(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync.WithRawResponse = + FednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + FednowTransferListPageAsync.builder() + .service(FednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + + private val approveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "approve") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { approveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val cancelHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "cancel") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { cancelHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt new file mode 100644 index 000000000..ca737e1bf --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt @@ -0,0 +1,186 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface InboundFednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferServiceAsync + + /** Retrieve an Inbound FedNow Transfer */ + fun retrieve(inboundFednowTransferId: String): CompletableFuture = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): CompletableFuture = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): CompletableFuture = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** List Inbound FedNow Transfers */ + fun list(): CompletableFuture = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture = + list(InboundFednowTransferListParams.none(), requestOptions) + + /** + * A view of [InboundFednowTransferServiceAsync] that provides access to raw HTTP responses for + * each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /inbound_fednow_transfers/{inbound_fednow_transfer_id}`, but is otherwise the same as + * [InboundFednowTransferServiceAsync.retrieve]. + */ + fun retrieve( + inboundFednowTransferId: String + ): CompletableFuture> = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): CompletableFuture> = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /inbound_fednow_transfers`, but is otherwise the + * same as [InboundFednowTransferServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(InboundFednowTransferListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..992a3cf7e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt @@ -0,0 +1,142 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class InboundFednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferServiceAsync { + + private val withRawResponse: InboundFednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferServiceAsync.WithRawResponse = + withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync = + InboundFednowTransferServiceAsyncImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /inbound_fednow_transfers/{inbound_fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /inbound_fednow_transfers + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse = + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inboundFednowTransferId", params.inboundFednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + InboundFednowTransferListPageAsync.builder() + .service(InboundFednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt index 1ea163761..ea0418bd8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt @@ -21,6 +21,7 @@ import com.increase.api.services.async.simulations.DigitalWalletTokenRequestServ import com.increase.api.services.async.simulations.DocumentServiceAsync import com.increase.api.services.async.simulations.InboundAchTransferServiceAsync import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsync +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsync import com.increase.api.services.async.simulations.InboundMailItemServiceAsync import com.increase.api.services.async.simulations.InboundRealTimePaymentsTransferServiceAsync import com.increase.api.services.async.simulations.InboundWireDrawdownRequestServiceAsync @@ -94,6 +95,8 @@ interface SimulationServiceAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync + fun checkDeposits(): CheckDepositServiceAsync fun inboundMailItems(): InboundMailItemServiceAsync @@ -168,6 +171,8 @@ interface SimulationServiceAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync.WithRawResponse + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse + fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse fun inboundMailItems(): InboundMailItemServiceAsync.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt index 8aa019ed2..1bb414948 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt @@ -39,6 +39,8 @@ import com.increase.api.services.async.simulations.InboundAchTransferServiceAsyn import com.increase.api.services.async.simulations.InboundAchTransferServiceAsyncImpl import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsync import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsyncImpl +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsync +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsyncImpl import com.increase.api.services.async.simulations.InboundMailItemServiceAsync import com.increase.api.services.async.simulations.InboundMailItemServiceAsyncImpl import com.increase.api.services.async.simulations.InboundRealTimePaymentsTransferServiceAsync @@ -163,6 +165,10 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsyncImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferServiceAsync by lazy { + InboundFednowTransferServiceAsyncImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync by lazy { CheckDepositServiceAsyncImpl(clientOptions) } @@ -239,6 +245,9 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync = checkDeposits override fun inboundMailItems(): InboundMailItemServiceAsync = inboundMailItems @@ -352,6 +361,11 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val inboundFednowTransfers: + InboundFednowTransferServiceAsync.WithRawResponse by lazy { + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync.WithRawResponse by lazy { CheckDepositServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -444,6 +458,9 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsync.WithRawResponse = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse = checkDeposits override fun inboundMailItems(): InboundMailItemServiceAsync.WithRawResponse = diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt new file mode 100644 index 000000000..0a0b3fc68 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface InboundFednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferServiceAsync + + /** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ + fun create( + params: InboundFednowTransferCreateParams + ): CompletableFuture = create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [InboundFednowTransferServiceAsync] that provides access to raw HTTP responses for + * each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /simulations/inbound_fednow_transfers`, but is + * otherwise the same as [InboundFednowTransferServiceAsync.create]. + */ + fun create( + params: InboundFednowTransferCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..3282a705a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +class InboundFednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferServiceAsync { + + private val withRawResponse: InboundFednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferServiceAsync.WithRawResponse = + withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync = + InboundFednowTransferServiceAsyncImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /simulations/inbound_fednow_transfers + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse = + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("simulations", "inbound_fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt new file mode 100644 index 000000000..f0447c0dd --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt @@ -0,0 +1,344 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.function.Consumer + +interface FednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): FednowTransferService + + /** Create a FedNow Transfer */ + fun create(params: FednowTransferCreateParams): FednowTransfer = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** Retrieve a FedNow Transfer */ + fun retrieve(fednowTransferId: String): FednowTransfer = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): FednowTransfer = retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see retrieve */ + fun retrieve(params: FednowTransferRetrieveParams): FednowTransfer = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** List FedNow Transfers */ + fun list(): FednowTransferListPage = list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransferListPage + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): FednowTransferListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): FednowTransferListPage = + list(FednowTransferListParams.none(), requestOptions) + + /** Approve a FedNow Transfer */ + fun approve(fednowTransferId: String): FednowTransfer = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): FednowTransfer = approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see approve */ + fun approve(params: FednowTransferApproveParams): FednowTransfer = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** Cancel a pending FedNow Transfer */ + fun cancel(fednowTransferId: String): FednowTransfer = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): FednowTransfer = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see cancel */ + fun cancel(params: FednowTransferCancelParams): FednowTransfer = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + + /** + * A view of [FednowTransferService] that provides access to raw HTTP responses for each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): FednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /fednow_transfers`, but is otherwise the same as + * [FednowTransferService.create]. + */ + @MustBeClosed + fun create(params: FednowTransferCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /fednow_transfers/{fednow_transfer_id}`, but is + * otherwise the same as [FednowTransferService.retrieve]. + */ + @MustBeClosed + fun retrieve(fednowTransferId: String): HttpResponseFor = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): HttpResponseFor = + retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: FednowTransferRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /fednow_transfers`, but is otherwise the same as + * [FednowTransferService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = list(FednowTransferListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(FednowTransferListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/approve`, + * but is otherwise the same as [FednowTransferService.approve]. + */ + @MustBeClosed + fun approve(fednowTransferId: String): HttpResponseFor = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): HttpResponseFor = + approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see approve */ + @MustBeClosed + fun approve(params: FednowTransferApproveParams): HttpResponseFor = + approve(params, RequestOptions.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/cancel`, but + * is otherwise the same as [FednowTransferService.cancel]. + */ + @MustBeClosed + fun cancel(fednowTransferId: String): HttpResponseFor = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): HttpResponseFor = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see cancel */ + @MustBeClosed + fun cancel(params: FednowTransferCancelParams): HttpResponseFor = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt new file mode 100644 index 000000000..4f4632985 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt @@ -0,0 +1,244 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class FednowTransferServiceImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferService { + + private val withRawResponse: FednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): FednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): FednowTransferService = + FednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers + withRawResponse().create(params, requestOptions).parse() + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // get /fednow_transfers/{fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): FednowTransferListPage = + // get /fednow_transfers + withRawResponse().list(params, requestOptions).parse() + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers/{fednow_transfer_id}/approve + withRawResponse().approve(params, requestOptions).parse() + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers/{fednow_transfer_id}/cancel + withRawResponse().cancel(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): FednowTransferService.WithRawResponse = + FednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + FednowTransferListPage.builder() + .service(FednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + + private val approveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "approve") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { approveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val cancelHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "cancel") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { cancelHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt new file mode 100644 index 000000000..c62b7542f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.function.Consumer + +interface InboundFednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferService + + /** Retrieve an Inbound FedNow Transfer */ + fun retrieve(inboundFednowTransferId: String): InboundFednowTransfer = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): InboundFednowTransfer = retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer + + /** @see retrieve */ + fun retrieve(params: InboundFednowTransferRetrieveParams): InboundFednowTransfer = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** List Inbound FedNow Transfers */ + fun list(): InboundFednowTransferListPage = list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransferListPage + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): InboundFednowTransferListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): InboundFednowTransferListPage = + list(InboundFednowTransferListParams.none(), requestOptions) + + /** + * A view of [InboundFednowTransferService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /inbound_fednow_transfers/{inbound_fednow_transfer_id}`, but is otherwise the same as + * [InboundFednowTransferService.retrieve]. + */ + @MustBeClosed + fun retrieve(inboundFednowTransferId: String): HttpResponseFor = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): HttpResponseFor = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): HttpResponseFor = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /inbound_fednow_transfers`, but is otherwise the + * same as [InboundFednowTransferService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(InboundFednowTransferListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt new file mode 100644 index 000000000..6df0ed717 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class InboundFednowTransferServiceImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferService { + + private val withRawResponse: InboundFednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService = + InboundFednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + // get /inbound_fednow_transfers/{inbound_fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): InboundFednowTransferListPage = + // get /inbound_fednow_transfers + withRawResponse().list(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse = + InboundFednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inboundFednowTransferId", params.inboundFednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + InboundFednowTransferListPage.builder() + .service(InboundFednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt index f124c5978..69da7fc59 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt @@ -21,6 +21,7 @@ import com.increase.api.services.blocking.simulations.DigitalWalletTokenRequestS import com.increase.api.services.blocking.simulations.DocumentService import com.increase.api.services.blocking.simulations.InboundAchTransferService import com.increase.api.services.blocking.simulations.InboundCheckDepositService +import com.increase.api.services.blocking.simulations.InboundFednowTransferService import com.increase.api.services.blocking.simulations.InboundMailItemService import com.increase.api.services.blocking.simulations.InboundRealTimePaymentsTransferService import com.increase.api.services.blocking.simulations.InboundWireDrawdownRequestService @@ -94,6 +95,8 @@ interface SimulationService { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService + fun inboundFednowTransfers(): InboundFednowTransferService + fun checkDeposits(): CheckDepositService fun inboundMailItems(): InboundMailItemService @@ -165,6 +168,8 @@ interface SimulationService { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService.WithRawResponse + fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse + fun checkDeposits(): CheckDepositService.WithRawResponse fun inboundMailItems(): InboundMailItemService.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt index e0b712f98..c49b8a384 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt @@ -39,6 +39,8 @@ import com.increase.api.services.blocking.simulations.InboundAchTransferService import com.increase.api.services.blocking.simulations.InboundAchTransferServiceImpl import com.increase.api.services.blocking.simulations.InboundCheckDepositService import com.increase.api.services.blocking.simulations.InboundCheckDepositServiceImpl +import com.increase.api.services.blocking.simulations.InboundFednowTransferService +import com.increase.api.services.blocking.simulations.InboundFednowTransferServiceImpl import com.increase.api.services.blocking.simulations.InboundMailItemService import com.increase.api.services.blocking.simulations.InboundMailItemServiceImpl import com.increase.api.services.blocking.simulations.InboundRealTimePaymentsTransferService @@ -156,6 +158,10 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferServiceImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferService by lazy { + InboundFednowTransferServiceImpl(clientOptions) + } + private val checkDeposits: CheckDepositService by lazy { CheckDepositServiceImpl(clientOptions) } @@ -230,6 +236,8 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferService = inboundFednowTransfers + override fun checkDeposits(): CheckDepositService = checkDeposits override fun inboundMailItems(): InboundMailItemService = inboundMailItems @@ -342,6 +350,10 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferServiceImpl.WithRawResponseImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferService.WithRawResponse by lazy { + InboundFednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositService.WithRawResponse by lazy { CheckDepositServiceImpl.WithRawResponseImpl(clientOptions) } @@ -432,6 +444,9 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferService.WithRawResponse = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositService.WithRawResponse = checkDeposits override fun inboundMailItems(): InboundMailItemService.WithRawResponse = inboundMailItems diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt new file mode 100644 index 000000000..bdda1f5ad --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.function.Consumer + +interface InboundFednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferService + + /** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ + fun create(params: InboundFednowTransferCreateParams): InboundFednowTransfer = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer + + /** + * A view of [InboundFednowTransferService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /simulations/inbound_fednow_transfers`, but is + * otherwise the same as [InboundFednowTransferService.create]. + */ + @MustBeClosed + fun create( + params: InboundFednowTransferCreateParams + ): HttpResponseFor = create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt new file mode 100644 index 000000000..e15d91289 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt @@ -0,0 +1,84 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.function.Consumer + +class InboundFednowTransferServiceImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferService { + + private val withRawResponse: InboundFednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService = + InboundFednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + // post /simulations/inbound_fednow_transfers + withRawResponse().create(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse = + InboundFednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("simulations", "inbound_fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt index 038621031..e755df7b5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt @@ -156,6 +156,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") @@ -312,6 +315,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -474,6 +480,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt index 4916a6b36..ab1d04600 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt @@ -145,6 +145,9 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -293,6 +296,7 @@ internal class AchTransferTest { assertThat(achTransfer.submission()) .contains( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(OffsetDateTime.parse("2020-02-05T11:00:00Z")) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -441,6 +445,9 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt index ede600b58..8dead8032 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.carddisputes -import com.increase.api.core.JsonValue import java.time.LocalDate import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -64,7 +63,11 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise.NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -159,8 +162,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -191,7 +202,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise .ReturnAttempted @@ -242,7 +258,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation .ReturnAttempted @@ -363,7 +384,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived .Delayed @@ -397,10 +424,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa.ConsumerOriginalCreditTransactionNotAccepted .builder() @@ -428,7 +462,11 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise.NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -594,7 +632,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -702,7 +745,12 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -802,8 +850,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -837,7 +893,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -893,7 +955,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -1018,7 +1086,14 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -1056,10 +1131,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -1088,7 +1170,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -1255,7 +1342,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -1363,7 +1455,11 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise.NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -1458,8 +1554,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1490,7 +1594,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise .ReturnAttempted @@ -1541,7 +1650,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation .ReturnAttempted @@ -1662,7 +1776,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived .Delayed @@ -1696,10 +1816,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa.ConsumerOriginalCreditTransactionNotAccepted .builder() @@ -1727,7 +1854,11 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise.NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -1893,7 +2024,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index 72ac6295e..9b87a2a8c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.carddisputes import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -47,15 +46,30 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted + .builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted + .builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut + .builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent @@ -165,7 +179,10 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -249,21 +266,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() ) .userWithdrawalSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) .build() ) @@ -340,7 +372,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -493,7 +530,14 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission @@ -503,7 +547,12 @@ internal class CardDisputeListPageResponseTest { .GUARANTEED_RESERVATION ) .timeshare( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() ) .build() ) @@ -545,7 +594,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -626,7 +680,12 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -793,9 +852,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from( - mapOf() - ) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -878,7 +941,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -918,7 +986,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission @@ -1184,7 +1257,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -1350,15 +1428,27 @@ internal class CardDisputeListPageResponseTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -1467,7 +1557,9 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -1550,20 +1642,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) .build() ) .requiredUserSubmissionCategory(null) @@ -1633,7 +1741,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -1772,7 +1884,13 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -1780,7 +1898,13 @@ internal class CardDisputeListPageResponseTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1818,7 +1942,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -1893,7 +2021,11 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -2046,7 +2178,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -2125,7 +2263,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -2163,7 +2305,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback @@ -2410,7 +2556,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -2573,15 +2723,30 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted + .builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted + .builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut + .builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent @@ -2691,7 +2856,10 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -2775,21 +2943,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() ) .userWithdrawalSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) .build() ) @@ -2866,7 +3049,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -3019,7 +3207,14 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission @@ -3029,7 +3224,12 @@ internal class CardDisputeListPageResponseTest { .GUARANTEED_RESERVATION ) .timeshare( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() ) .build() ) @@ -3071,7 +3271,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -3152,7 +3357,12 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -3319,9 +3529,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from( - mapOf() - ) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -3404,7 +3618,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -3444,7 +3663,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission @@ -3710,7 +3934,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt index 168e4d71b..1e6673c95 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.carddisputes -import com.increase.api.core.JsonValue import java.time.LocalDate import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -87,7 +86,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -204,8 +209,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -244,7 +261,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -303,7 +326,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -446,7 +475,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -488,10 +525,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -524,7 +572,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -724,7 +778,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -913,7 +973,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -1034,8 +1100,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1074,7 +1152,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -1135,7 +1219,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -1282,7 +1372,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1324,10 +1422,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1360,7 +1469,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -1566,7 +1681,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -1740,7 +1861,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -1857,8 +1984,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1897,7 +2036,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -1956,7 +2101,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -2099,7 +2250,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -2141,10 +2300,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2177,7 +2347,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -2377,7 +2553,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index 560738723..35a842b36 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.carddisputes import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -44,13 +43,25 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -159,7 +170,9 @@ internal class CardDisputeTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -240,12 +253,34 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -311,7 +346,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -439,7 +480,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -447,7 +494,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -478,7 +531,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation( "order_and_issue_explanation" ) @@ -545,7 +604,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -683,7 +748,13 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -754,7 +825,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -791,7 +866,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -1015,7 +1096,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -1157,13 +1242,21 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder().build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder().build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder().build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -1262,7 +1355,11 @@ internal class CardDisputeTest { ) .build() ) - .merchantPrearbitrationTimedOut(JsonValue.from(mapOf())) + .merchantPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() + ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() .cardholderNoLongerDisputes( @@ -1342,12 +1439,30 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted.builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined.builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted.builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut.builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -1410,7 +1525,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1534,7 +1655,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -1542,7 +1669,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1573,7 +1706,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation("order_and_issue_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1636,7 +1775,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1770,7 +1915,12 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission.Chargeback @@ -1835,7 +1985,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) @@ -1871,7 +2027,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -2087,7 +2249,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) @@ -2230,13 +2398,25 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -2345,7 +2525,9 @@ internal class CardDisputeTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -2426,12 +2608,34 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -2497,7 +2701,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -2625,7 +2835,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -2633,7 +2849,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -2664,7 +2886,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation( "order_and_issue_explanation" ) @@ -2731,7 +2959,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -2869,7 +3103,13 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -2940,7 +3180,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -2977,7 +3221,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -3201,7 +3451,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 87e857cc4..669bb9398 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.cardpayments import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -123,6 +122,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -215,6 +223,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -245,6 +260,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -359,6 +375,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -451,6 +476,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -478,6 +510,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -535,6 +568,227 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -553,6 +807,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -595,6 +850,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -671,6 +935,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -731,6 +996,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -975,6 +1241,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1049,6 +1316,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1313,6 +1581,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -1399,6 +1676,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -1427,6 +1711,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1481,7 +1766,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -1581,6 +1866,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -1673,6 +1967,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -1703,6 +2004,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1817,6 +2119,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -1909,6 +2220,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -1936,6 +2254,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1993,11 +2312,232 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" ) .currency( CardPayment.Element.CardFuelConfirmation.Currency @@ -2011,6 +2551,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2053,6 +2594,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -2129,6 +2679,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2189,6 +2740,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2433,6 +2985,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2507,6 +3060,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2771,6 +3325,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -2857,6 +3420,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -2885,6 +3455,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2939,7 +3510,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -3039,6 +3610,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -3131,6 +3711,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -3161,6 +3748,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3275,6 +3863,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -3367,6 +3964,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -3394,6 +3998,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3451,30 +4056,252 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) - .currency( - CardPayment.Element.CardFuelConfirmation.Currency - .USD - ) - .network( - CardPayment.Element.CardFuelConfirmation.Network - .VISA + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE ) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation - .NetworkIdentifiers + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardFuelConfirmation.Currency + .USD + ) + .network( + CardPayment.Element.CardFuelConfirmation.Network + .VISA + ) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( "pending_transaction_k1sfetcau2qbvjbzgju4" ) .type( @@ -3511,6 +4338,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -3587,6 +4423,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3647,6 +4484,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3891,6 +4729,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3965,6 +4804,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -4229,6 +5069,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -4315,6 +5164,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -4343,6 +5199,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4397,7 +5254,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -4497,6 +5354,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -4589,6 +5455,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -4619,6 +5492,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4733,6 +5607,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -4825,6 +5708,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -4852,6 +5742,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4909,15 +5800,236 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE ) - .currency( - CardPayment.Element.CardFuelConfirmation.Currency - .USD + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardFuelConfirmation.Currency + .USD ) .network( CardPayment.Element.CardFuelConfirmation.Network @@ -4927,6 +6039,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4969,6 +6082,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -5045,6 +6167,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5105,6 +6228,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5349,6 +6473,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5423,6 +6548,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5687,6 +6813,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -5773,6 +6908,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -5801,6 +6943,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5855,7 +6998,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -5865,6 +7008,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -5979,6 +7123,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -6071,6 +7224,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -6098,6 +7258,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6203,6 +7364,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -6293,6 +7463,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -6319,6 +7495,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6375,29 +7552,239 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) - .currency( - CardPayment.Element.CardFuelConfirmation.Currency.USD - ) - .network( - CardPayment.Element.CardFuelConfirmation.Network.VISA + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE ) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation - .NetworkIdentifiers + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardFuelConfirmation.Currency.USD + ) + .network( + CardPayment.Element.CardFuelConfirmation.Network.VISA + ) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" ) .type( CardPayment.Element.CardFuelConfirmation.Type @@ -6433,6 +7820,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -6507,6 +7903,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6561,6 +7958,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -6789,6 +8187,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6851,6 +8250,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7105,6 +8505,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -7189,6 +8598,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -7216,6 +8632,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7268,7 +8685,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -7363,6 +8780,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -7455,6 +8881,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -7482,6 +8915,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7587,6 +9021,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -7677,6 +9120,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -7703,6 +9152,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7759,28 +9209,238 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) - .currency( - CardPayment.Element.CardFuelConfirmation.Currency.USD - ) - .network( - CardPayment.Element.CardFuelConfirmation.Network.VISA + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE ) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation - .NetworkIdentifiers + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardFuelConfirmation.Currency.USD + ) + .network( + CardPayment.Element.CardFuelConfirmation.Network.VISA + ) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( "pending_transaction_k1sfetcau2qbvjbzgju4" ) .type( @@ -7817,6 +9477,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -7891,6 +9560,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7945,6 +9615,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8173,6 +9844,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8235,6 +9907,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8489,6 +10162,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -8573,6 +10255,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -8600,6 +10289,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8652,7 +10342,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -8747,6 +10437,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -8839,6 +10538,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -8866,6 +10572,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8971,6 +10678,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -9044,36 +10760,254 @@ internal class CardPaymentListPageResponseTest { ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -9085,8 +11019,9 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9094,27 +11029,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -9123,7 +11055,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -9131,7 +11063,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -9159,6 +11091,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9201,6 +11134,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -9275,6 +11217,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9329,6 +11272,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9557,6 +11501,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9619,6 +11564,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9873,6 +11819,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -9957,6 +11912,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -9984,6 +11946,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10036,7 +11999,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -10131,6 +12094,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -10223,6 +12195,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -10250,6 +12229,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10355,6 +12335,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -10445,19 +12434,237 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -10469,8 +12676,9 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10478,27 +12686,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -10507,7 +12712,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -10515,7 +12720,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -10543,6 +12748,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10585,6 +12791,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -10659,6 +12874,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10713,6 +12929,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10941,6 +13158,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11003,6 +13221,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -11257,6 +13476,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -11341,6 +13569,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -11368,6 +13603,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11420,7 +13656,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -11430,6 +13666,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -11553,6 +13790,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -11645,6 +13891,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -11675,6 +13928,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11789,6 +14043,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -11881,20 +14144,246 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -11906,8 +14395,9 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11915,28 +14405,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -11945,7 +14436,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -11953,7 +14445,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -11983,6 +14475,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12025,6 +14518,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -12101,6 +14603,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12161,6 +14664,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12405,6 +14909,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12479,6 +14984,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12743,6 +15249,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -12829,6 +15344,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -12857,6 +15379,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12911,7 +15434,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -13011,6 +15534,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -13103,6 +15635,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -13133,6 +15672,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13247,6 +15787,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -13331,28 +15880,254 @@ internal class CardPaymentListPageResponseTest { .merchantPostalCode("10045") .merchantState(null) .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -13364,8 +16139,9 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13373,28 +16149,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -13403,7 +16180,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -13411,7 +16189,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -13441,6 +16219,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13483,6 +16262,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -13559,6 +16347,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13619,6 +16408,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13863,6 +16653,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13937,6 +16728,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14201,6 +16993,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -14287,6 +17088,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -14315,6 +17123,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14369,7 +17178,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -14469,6 +17278,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -14561,6 +17379,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -14591,6 +17416,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14705,6 +17531,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -14797,6 +17632,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -14824,6 +17666,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14845,14 +17688,234 @@ internal class CardPaymentListPageResponseTest { ) .terminalId("RCN5VNXS") .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -14861,7 +17924,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -14869,7 +17933,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -14899,6 +17963,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14941,6 +18006,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -15017,6 +18091,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15077,6 +18152,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -15321,6 +18397,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15395,6 +18472,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -15659,6 +18737,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -15745,6 +18832,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -15773,6 +18867,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15827,7 +18922,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -15927,6 +19022,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -16019,6 +19123,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -16049,6 +19160,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16163,6 +19275,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -16255,6 +19376,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -16282,6 +19410,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16339,6 +19468,227 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -16357,6 +19707,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16399,6 +19750,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -16475,6 +19835,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16535,6 +19896,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -16779,6 +20141,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16853,6 +20216,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -17117,6 +20481,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -17203,6 +20576,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -17231,6 +20611,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -17285,7 +20666,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -17295,6 +20676,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index e2bf426bb..6121a0077 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.cardpayments import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -110,6 +109,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -198,6 +206,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -224,6 +238,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -319,6 +334,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -400,6 +423,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -424,6 +452,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -476,6 +505,202 @@ internal class CardPaymentTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -485,6 +710,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -523,6 +749,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -588,6 +822,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -639,6 +874,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -861,6 +1097,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -922,6 +1159,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1158,6 +1396,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -1233,6 +1479,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -1259,6 +1511,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1310,7 +1563,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -1399,6 +1652,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -1487,6 +1749,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -1513,6 +1781,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1608,6 +1877,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -1689,6 +1966,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -1713,6 +1995,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1765,39 +2048,15 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -1805,30 +2064,259 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) .currency("currency") .build() ) - .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts - .Prescription + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original .builder() .amount(0L) .currency("currency") .build() ) - .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts - .Surcharge + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription .builder() .amount(0L) .currency("currency") .build() ) - .totalCumulative( + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( CardPayment.Element.CardIncrement.AdditionalAmounts .TotalCumulative .builder() @@ -1877,6 +2365,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1928,6 +2417,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2150,6 +2640,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2211,6 +2702,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2447,6 +2939,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -2522,6 +3022,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -2548,6 +3054,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2599,7 +3106,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -2688,6 +3195,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -2776,6 +3292,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -2802,6 +3324,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2897,6 +3420,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -2978,6 +3509,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -3002,6 +3538,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3054,30 +3591,227 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) .cardIncrement( CardPayment.Element.CardIncrement.builder() .id("card_increment_6ztayc58j1od0rpebp3e") @@ -3101,6 +3835,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -3166,6 +3908,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3217,6 +3960,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3439,6 +4183,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3500,6 +4245,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3736,6 +4482,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -3811,6 +4565,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -3837,6 +4597,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3888,7 +4649,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -3977,6 +4738,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -4065,6 +4835,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -4091,6 +4867,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4186,6 +4963,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -4267,6 +5052,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -4291,6 +5081,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4343,39 +5134,15 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -4383,15 +5150,23 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) .currency("currency") .build() ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -4399,7 +5174,228 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts .Surcharge .builder() .amount(0L) @@ -4455,6 +5451,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4506,6 +5503,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -4728,6 +5726,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4789,6 +5788,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5025,6 +6025,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -5100,6 +6108,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -5126,6 +6140,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5177,7 +6192,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -5187,6 +6202,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -5276,6 +6292,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -5354,6 +6378,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -5376,6 +6405,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5459,6 +6489,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -5532,6 +6569,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -5552,6 +6594,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5602,49 +6645,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") - .type( - CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -5652,7 +6681,207 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .type( + CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts .Surcharge .builder() .amount(0L) @@ -5704,6 +6933,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5750,6 +6980,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5950,6 +7181,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6004,6 +7236,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -6216,6 +7449,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -6287,6 +7528,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -6309,6 +7555,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6355,7 +7602,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -6431,6 +7678,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -6509,6 +7764,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -6531,6 +7791,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6614,6 +7875,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -6687,6 +7955,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -6707,6 +7980,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6757,49 +8031,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") - .type( - CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -6807,15 +8067,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() - .amount(0L) - .currency("currency") + .amount(10L) + .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -6823,7 +8083,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -6831,21 +8091,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardIncrement.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardIncrement.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardIncrement.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -6853,18 +8113,219 @@ internal class CardPaymentTest { ) .build() ) - .amount(20L) - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardIncrement.Currency.USD) - .network(CardPayment.Element.CardIncrement.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .networkRiskScore(10L) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .type( + CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardIncrement.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardIncrement.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardIncrement.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(20L) + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardIncrement.Currency.USD) + .network(CardPayment.Element.CardIncrement.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") .presentmentAmount(20L) .presentmentCurrency("USD") @@ -6905,6 +8366,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7105,6 +8567,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7159,6 +8622,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7371,6 +8835,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -7442,6 +8914,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -7464,6 +8941,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7510,7 +8988,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -7586,6 +9064,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -7664,6 +9150,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -7686,6 +9177,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7725,7 +9217,196 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardAuthorizationExpiration.Currency.USD) + .expiredAmount(20L) + .network(CardPayment.Element.CardAuthorizationExpiration.Network.VISA) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -7736,41 +9417,35 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardAuthorizationExpiration.Currency.USD) - .expiredAmount(20L) - .network(CardPayment.Element.CardAuthorizationExpiration.Network.VISA) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -7778,14 +9453,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -7793,7 +9469,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -7801,21 +9477,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -7823,35 +9499,41 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -7861,7 +9543,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7869,23 +9552,23 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .Result .MATCH @@ -7893,7 +9576,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -7901,7 +9584,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -7921,6 +9604,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7953,6 +9637,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -8014,6 +9705,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8060,6 +9752,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8260,6 +9953,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8314,6 +10008,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8526,6 +10221,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -8597,6 +10300,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -8619,6 +10327,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8665,7 +10374,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -8741,6 +10450,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -8819,6 +10536,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -8841,6 +10563,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8911,21 +10634,204 @@ internal class CardPaymentTest { .additionalAmounts( CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -8933,14 +10839,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -8948,7 +10855,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -8956,21 +10863,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -8978,35 +10885,41 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -9016,7 +10929,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9024,23 +10938,23 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .Result .MATCH @@ -9048,7 +10962,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -9056,7 +10970,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -9076,6 +10990,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9108,6 +11023,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -9169,6 +11091,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9215,6 +11138,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9415,6 +11339,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9469,6 +11394,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9681,6 +11607,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -9752,6 +11686,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -9774,6 +11713,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9820,7 +11760,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) assertThat(cardPayment.physicalCardId()).isEmpty @@ -9830,6 +11770,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -9937,6 +11878,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -10025,6 +11975,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -10051,6 +12007,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10146,6 +12103,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -10163,7 +12128,201 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -10171,7 +12330,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -10179,7 +12338,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -10187,7 +12346,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -10195,7 +12354,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -10204,41 +12363,46 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -10250,7 +12414,9 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10258,25 +12424,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -10284,7 +12450,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -10292,7 +12458,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -10312,6 +12479,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10350,6 +12518,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -10415,6 +12591,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10466,6 +12643,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10688,6 +12866,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10749,6 +12928,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10985,6 +13165,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -11060,6 +13248,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -11086,6 +13280,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11137,7 +13332,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -11226,6 +13421,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -11314,6 +13518,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -11340,6 +13550,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11435,6 +13646,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -11452,7 +13671,201 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -11460,7 +13873,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -11468,7 +13881,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -11476,7 +13889,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -11484,7 +13897,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -11493,41 +13906,46 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -11539,7 +13957,9 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11547,25 +13967,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -11573,7 +13993,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -11581,7 +14001,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -11601,6 +14022,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11639,6 +14061,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -11704,6 +14134,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11755,6 +14186,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -11977,6 +14409,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12038,6 +14471,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12274,6 +14708,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -12349,6 +14791,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -12375,6 +14823,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12426,7 +14875,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -12515,6 +14964,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -12603,6 +15061,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -12629,6 +15093,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12724,6 +15189,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -12741,7 +15214,201 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -12749,7 +15416,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -12757,7 +15424,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -12765,7 +15432,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -12773,7 +15440,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -12782,41 +15449,46 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -12828,7 +15500,9 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12836,25 +15510,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -12862,7 +15536,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -12870,7 +15544,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -12890,6 +15565,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12928,6 +15604,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -12993,6 +15677,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13044,6 +15729,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13266,6 +15952,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13327,6 +16014,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13563,6 +16251,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -13638,6 +16334,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -13664,6 +16366,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13715,7 +16418,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -13804,6 +16507,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -13892,6 +16604,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -13918,6 +16636,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14013,6 +16732,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -14094,6 +16821,11 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -14118,6 +16850,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14170,6 +16903,202 @@ internal class CardPaymentTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -14179,6 +17108,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14217,6 +17147,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -14282,6 +17220,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14333,6 +17272,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14555,6 +17495,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14616,6 +17557,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14852,6 +17794,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -14927,6 +17877,12 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -14953,6 +17909,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15004,7 +17961,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -15014,6 +17971,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt index 4766b7c02..ff594e04b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt @@ -24,7 +24,7 @@ internal class CardCreateParamsTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -50,7 +50,7 @@ internal class CardCreateParamsTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -75,7 +75,7 @@ internal class CardCreateParamsTest { .contains( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt index 8c85822f4..37d1feb05 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt @@ -24,7 +24,7 @@ internal class CardUpdateParamsTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -60,7 +60,7 @@ internal class CardUpdateParamsTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -85,7 +85,7 @@ internal class CardUpdateParamsTest { .contains( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt index f523fc6de..18a5ec6e4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt @@ -14,6 +14,7 @@ internal class CheckTransferCreateParamsTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() @@ -64,6 +65,7 @@ internal class CheckTransferCreateParamsTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() @@ -114,6 +116,7 @@ internal class CheckTransferCreateParamsTest { assertThat(body.fulfillmentMethod()) .isEqualTo(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.balanceCheck()).contains(CheckTransferCreateParams.BalanceCheck.FULL) assertThat(body.checkNumber()).contains("x") assertThat(body.physicalCheck()) .contains( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index 30e256d1d..e2eaccef2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.declinedtransactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -77,6 +76,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -172,6 +180,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -200,6 +215,7 @@ internal class DeclinedTransactionListPageResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -337,7 +353,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -418,6 +434,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -510,6 +535,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -537,6 +569,7 @@ internal class DeclinedTransactionListPageResponseTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -668,7 +701,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -755,6 +788,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -850,6 +892,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -878,6 +927,7 @@ internal class DeclinedTransactionListPageResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1015,7 +1065,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index b146dba6a..d1a90ffac 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.declinedtransactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -66,6 +65,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription @@ -147,6 +154,12 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa @@ -173,6 +186,7 @@ internal class DeclinedTransactionTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -294,7 +308,7 @@ internal class DeclinedTransactionTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -360,6 +374,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription @@ -439,6 +461,11 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails.Visa .builder() @@ -463,6 +490,7 @@ internal class DeclinedTransactionTest { ) .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -573,7 +601,7 @@ internal class DeclinedTransactionTest { .transferId("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr") .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -645,6 +673,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription @@ -726,6 +762,12 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa @@ -752,6 +794,7 @@ internal class DeclinedTransactionTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -873,7 +916,7 @@ internal class DeclinedTransactionTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt index 5b609eaeb..84c2eeaf1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt @@ -14,7 +14,7 @@ internal class DigitalCardProfileCloneParamsTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") @@ -45,7 +45,7 @@ internal class DigitalCardProfileCloneParamsTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") @@ -64,7 +64,7 @@ internal class DigitalCardProfileCloneParamsTest { assertThat(body.appIconFileId()).contains("app_icon_file_id") assertThat(body.backgroundImageFileId()).contains("file_1ai913suu1zfn1pdetru") assertThat(body.cardDescription()).contains("x") - assertThat(body.contactEmail()).contains("x") + assertThat(body.contactEmail()).contains("dev@stainless.com") assertThat(body.contactPhone()).contains("x") assertThat(body.contactWebsite()).contains("contact_website") assertThat(body.description()).contains("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt index 5eabcccec..363777e84 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.exports -import com.increase.api.core.JsonValue import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -18,6 +17,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -83,7 +83,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() } @@ -96,6 +96,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -161,7 +162,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() val body = params._body() @@ -172,6 +173,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) assertThat(body.accountStatementOfx()) @@ -242,7 +244,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - assertThat(body._vendorCsv()).isEqualTo(JsonValue.from(mapOf())) + assertThat(body.vendorCsv()).contains(ExportCreateParams.VendorCsv.builder().build()) } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt new file mode 100644 index 000000000..d9904bdf1 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferApproveParamsTest { + + @Test + fun create() { + FednowTransferApproveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferApproveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt new file mode 100644 index 000000000..a6cd3d84a --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferCancelParamsTest { + + @Test + fun create() { + FednowTransferCancelParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferCancelParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt new file mode 100644 index 000000000..543bf2c30 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt @@ -0,0 +1,127 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferCreateParamsTest { + + @Test + fun create() { + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + } + + @Test + fun body() { + val params = + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.amount()).isEqualTo(100L) + assertThat(body.creditorName()).isEqualTo("Ian Crease") + assertThat(body.debtorName()).isEqualTo("National Phonograph Company") + assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + assertThat(body.accountNumber()).contains("987654321") + assertThat(body.creditorAddress()) + .contains( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + assertThat(body.debtorAddress()) + .contains( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + assertThat(body.externalAccountId()).contains("external_account_id") + assertThat(body.requireApproval()).contains(true) + assertThat(body.routingNumber()).contains("101050001") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.amount()).isEqualTo(100L) + assertThat(body.creditorName()).isEqualTo("Ian Crease") + assertThat(body.debtorName()).isEqualTo("National Phonograph Company") + assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt new file mode 100644 index 000000000..555be5ebb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt @@ -0,0 +1,221 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferListPageResponseTest { + + @Test + fun create() { + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() + .addData( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(fednowTransferListPageResponse.data()) + .containsExactly( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + assertThat(fednowTransferListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() + .addData( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedFednowTransferListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fednowTransferListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFednowTransferListPageResponse) + .isEqualTo(fednowTransferListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt new file mode 100644 index 000000000..3f0ce6b0e --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferListParamsTest { + + @Test + fun create() { + FednowTransferListParams.builder() + .accountId("account_id") + .createdAt( + FednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .externalAccountId("external_account_id") + .idempotencyKey("x") + .limit(1L) + .status( + FednowTransferListParams.Status.builder() + .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) + .build() + ) + .build() + } + + @Test + fun queryParams() { + val params = + FednowTransferListParams.builder() + .accountId("account_id") + .createdAt( + FednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .externalAccountId("external_account_id") + .idempotencyKey("x") + .limit(1L) + .status( + FednowTransferListParams.Status.builder() + .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("account_id", "account_id") + .put("created_at.after", "2019-12-27T18:11:19.117Z") + .put("created_at.before", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_after", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_before", "2019-12-27T18:11:19.117Z") + .put("cursor", "cursor") + .put("external_account_id", "external_account_id") + .put("idempotency_key", "x") + .put("limit", "1") + .put("status.in", listOf("pending_reviewing").joinToString(",")) + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = FednowTransferListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt new file mode 100644 index 000000000..d7fb418cb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferRetrieveParamsTest { + + @Test + fun create() { + FednowTransferRetrieveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferRetrieveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt new file mode 100644 index 000000000..25cb67962 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt @@ -0,0 +1,200 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferTest { + + @Test + fun create() { + val fednowTransfer = + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + assertThat(fednowTransfer.id()).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + assertThat(fednowTransfer.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(fednowTransfer.accountNumber()).isEqualTo("987654321") + assertThat(fednowTransfer.acknowledgement()) + .contains( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.amount()).isEqualTo(100L) + assertThat(fednowTransfer.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(fednowTransfer.createdBy()) + .contains( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder().description("description").build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user(FednowTransfer.CreatedBy.User.builder().email("user@example.com").build()) + .build() + ) + assertThat(fednowTransfer.creditorName()).isEqualTo("Ian Crease") + assertThat(fednowTransfer.currency()).isEqualTo(FednowTransfer.Currency.USD) + assertThat(fednowTransfer.debtorName()).isEqualTo("National Phonograph Company") + assertThat(fednowTransfer.externalAccountId()).isEmpty + assertThat(fednowTransfer.idempotencyKey()).isEmpty + assertThat(fednowTransfer.pendingTransactionId()) + .contains("pending_transaction_k1sfetcau2qbvjbzgju4") + assertThat(fednowTransfer.rejection()) + .contains( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.routingNumber()).isEqualTo("101050001") + assertThat(fednowTransfer.sourceAccountNumberId()) + .isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(fednowTransfer.status()).isEqualTo(FednowTransfer.Status.COMPLETE) + assertThat(fednowTransfer.submission()) + .contains( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.transactionId()).contains("transaction_uyrp7fld2ium70oa7oi") + assertThat(fednowTransfer.type()).isEqualTo(FednowTransfer.Type.FEDNOW_TRANSFER) + assertThat(fednowTransfer.uniqueEndToEndTransactionReference()) + .isEqualTo("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + assertThat(fednowTransfer.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fednowTransfer = + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val roundtrippedFednowTransfer = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fednowTransfer), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFednowTransfer).isEqualTo(fednowTransfer) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt new file mode 100644 index 000000000..9ad0c3f5d --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferListPageResponseTest { + + @Test + fun create() { + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() + .addData( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason( + InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED + ) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(inboundFednowTransferListPageResponse.data()) + .containsExactly( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + assertThat(inboundFednowTransferListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() + .addData( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason( + InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED + ) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedInboundFednowTransferListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(inboundFednowTransferListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedInboundFednowTransferListPageResponse) + .isEqualTo(inboundFednowTransferListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt new file mode 100644 index 000000000..4e51b0b73 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferListParamsTest { + + @Test + fun create() { + InboundFednowTransferListParams.builder() + .accountId("account_id") + .accountNumberId("account_number_id") + .createdAt( + InboundFednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .limit(1L) + .build() + } + + @Test + fun queryParams() { + val params = + InboundFednowTransferListParams.builder() + .accountId("account_id") + .accountNumberId("account_number_id") + .createdAt( + InboundFednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .limit(1L) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("account_id", "account_id") + .put("account_number_id", "account_number_id") + .put("created_at.after", "2019-12-27T18:11:19.117Z") + .put("created_at.before", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_after", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_before", "2019-12-27T18:11:19.117Z") + .put("cursor", "cursor") + .put("limit", "1") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = InboundFednowTransferListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt new file mode 100644 index 000000000..e5917296e --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferRetrieveParamsTest { + + @Test + fun create() { + InboundFednowTransferRetrieveParams.builder() + .inboundFednowTransferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + } + + @Test + fun pathParams() { + val params = + InboundFednowTransferRetrieveParams.builder() + .inboundFednowTransferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + + assertThat(params._pathParam(0)).isEqualTo("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt new file mode 100644 index 000000000..6bc042bc7 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt @@ -0,0 +1,119 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferTest { + + @Test + fun create() { + val inboundFednowTransfer = + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + assertThat(inboundFednowTransfer.id()) + .isEqualTo("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + assertThat(inboundFednowTransfer.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(inboundFednowTransfer.accountNumberId()) + .isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(inboundFednowTransfer.amount()).isEqualTo(100L) + assertThat(inboundFednowTransfer.confirmation()) + .contains( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + assertThat(inboundFednowTransfer.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(inboundFednowTransfer.creditorName()).isEqualTo("Ian Crease") + assertThat(inboundFednowTransfer.currency()).isEqualTo(InboundFednowTransfer.Currency.USD) + assertThat(inboundFednowTransfer.debtorAccountNumber()).isEqualTo("987654321") + assertThat(inboundFednowTransfer.debtorName()).isEqualTo("National Phonograph Company") + assertThat(inboundFednowTransfer.debtorRoutingNumber()).isEqualTo("101050001") + assertThat(inboundFednowTransfer.decline()) + .contains( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + assertThat(inboundFednowTransfer.status()).isEqualTo(InboundFednowTransfer.Status.CONFIRMED) + assertThat(inboundFednowTransfer.transactionId()) + .contains("transaction_uyrp7fld2ium70oa7oi") + assertThat(inboundFednowTransfer.type()) + .isEqualTo(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + assertThat(inboundFednowTransfer.unstructuredRemittanceInformation()) + .contains("Invoice 29582") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val inboundFednowTransfer = + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val roundtrippedInboundFednowTransfer = + jsonMapper.readValue( + jsonMapper.writeValueAsString(inboundFednowTransfer), + jacksonTypeRef(), + ) + + assertThat(roundtrippedInboundFednowTransfer).isEqualTo(inboundFednowTransfer) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt index e9c805322..ba15fe766 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt @@ -14,11 +14,13 @@ internal class OAuthTokenTest { val oauthToken = OAuthToken.builder() .accessToken("12345") + .groupId("group_1g4mhziu6kvrs3vz35um") .tokenType(OAuthToken.TokenType.BEARER) .type(OAuthToken.Type.OAUTH_TOKEN) .build() assertThat(oauthToken.accessToken()).isEqualTo("12345") + assertThat(oauthToken.groupId()).isEqualTo("group_1g4mhziu6kvrs3vz35um") assertThat(oauthToken.tokenType()).isEqualTo(OAuthToken.TokenType.BEARER) assertThat(oauthToken.type()).isEqualTo(OAuthToken.Type.OAUTH_TOKEN) } @@ -29,6 +31,7 @@ internal class OAuthTokenTest { val oauthToken = OAuthToken.builder() .accessToken("12345") + .groupId("group_1g4mhziu6kvrs3vz35um") .tokenType(OAuthToken.TokenType.BEARER) .type(OAuthToken.Type.OAUTH_TOKEN) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 9458071fe..3cdb94983 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -20,11 +20,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -75,6 +75,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -168,6 +177,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -198,6 +214,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -331,7 +348,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -346,7 +363,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -371,11 +392,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -426,6 +447,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -518,6 +548,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -546,6 +583,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -669,7 +707,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -682,7 +720,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -711,11 +753,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -766,6 +808,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -859,6 +910,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -889,6 +947,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1022,7 +1081,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -1037,7 +1096,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 57c2fed97..c97894eea 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -18,11 +18,11 @@ internal class PendingTransactionTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -70,6 +70,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -159,6 +168,13 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -186,6 +202,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -298,7 +315,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) @@ -310,7 +327,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -329,13 +350,12 @@ internal class PendingTransactionTest { assertThat(pendingTransaction.id()).isEqualTo("pending_transaction_k1sfetcau2qbvjbzgju4") assertThat(pendingTransaction.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(pendingTransaction.amount()).isEqualTo(100L) - assertThat(pendingTransaction.balanceImpact()) - .isEqualTo(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) assertThat(pendingTransaction.completedAt()).isEmpty assertThat(pendingTransaction.createdAt()) .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) assertThat(pendingTransaction.currency()).isEqualTo(PendingTransaction.Currency.USD) assertThat(pendingTransaction.description()).isEqualTo("INVOICE 2468") + assertThat(pendingTransaction.heldAmount()).isEqualTo(100L) assertThat(pendingTransaction.routeId()).contains("card_oubs0hwk5rn6knuecxg2") assertThat(pendingTransaction.routeType()).contains(PendingTransaction.RouteType.CARD) assertThat(pendingTransaction.source()) @@ -381,6 +401,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -468,6 +497,12 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization.NetworkDetails .Visa @@ -494,6 +529,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -601,7 +637,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) @@ -613,7 +649,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -637,11 +677,11 @@ internal class PendingTransactionTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -689,6 +729,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -778,6 +827,13 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -805,6 +861,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -917,7 +974,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) @@ -929,7 +986,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt index a2b8183a0..30dbe82e2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt @@ -61,7 +61,7 @@ internal class RealTimeDecisionActionParamsTest { .result(RealTimeDecisionActionParams.DigitalWalletAuthentication.Result.SUCCESS) .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -71,7 +71,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -157,7 +157,7 @@ internal class RealTimeDecisionActionParamsTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -167,7 +167,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -236,7 +236,7 @@ internal class RealTimeDecisionActionParamsTest { .result(RealTimeDecisionActionParams.DigitalWalletAuthentication.Result.SUCCESS) .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -247,7 +247,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 6d59aa739..8e4def789 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.realtimedecisions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -52,6 +51,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts .Prescription @@ -127,6 +133,11 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -146,6 +157,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -174,7 +186,12 @@ internal class RealTimeDecisionTest { ) .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) @@ -233,7 +250,6 @@ internal class RealTimeDecisionTest { .digitalWalletToken( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() @@ -288,6 +304,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts.Prescription .builder() @@ -360,6 +383,10 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse.builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -379,6 +406,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -405,7 +433,12 @@ internal class RealTimeDecisionTest { .originalCardAuthorizationId("original_card_authorization_id") .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) @@ -466,7 +499,6 @@ internal class RealTimeDecisionTest { .contains( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() @@ -524,6 +556,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts .Prescription @@ -599,6 +638,11 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -618,6 +662,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -646,7 +691,12 @@ internal class RealTimeDecisionTest { ) .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) @@ -705,7 +755,6 @@ internal class RealTimeDecisionTest { .digitalWalletToken( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt index 5eed574cc..649446ba2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt @@ -42,6 +42,11 @@ internal class CardAuthorizationCreateParamsTest { .category( CardAuthorizationCreateParams.ProcessingCategory.Category.ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") @@ -85,6 +90,11 @@ internal class CardAuthorizationCreateParamsTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") @@ -128,6 +138,11 @@ internal class CardAuthorizationCreateParamsTest { .category( CardAuthorizationCreateParams.ProcessingCategory.Category.ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) assertThat(body.terminalId()).contains("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index 895289406..a41cc865b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -79,6 +79,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -174,6 +183,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -202,6 +218,7 @@ internal class CardAuthorizationCreateResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -339,7 +356,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -361,11 +378,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -416,6 +433,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -509,6 +535,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -539,6 +572,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -670,7 +704,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -685,7 +719,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -768,6 +806,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -860,6 +907,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -887,6 +941,7 @@ internal class CardAuthorizationCreateResponseTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1018,7 +1073,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -1041,11 +1096,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -1096,6 +1151,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -1188,6 +1252,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -1216,6 +1287,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1339,7 +1411,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -1352,7 +1424,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -1441,6 +1517,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -1536,6 +1621,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1564,6 +1656,7 @@ internal class CardAuthorizationCreateResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1701,7 +1794,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -1723,11 +1816,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -1778,6 +1871,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -1871,6 +1973,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -1901,6 +2010,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2032,7 +2142,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -2047,7 +2157,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt index 736fbc976..57ddbcb56 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.simulations.carddisputes -import com.increase.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -16,20 +15,36 @@ internal class CardDisputeActionParamsTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder().build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder().build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) .build() @@ -57,20 +72,38 @@ internal class CardDisputeActionParamsTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) .build() @@ -82,20 +115,36 @@ internal class CardDisputeActionParamsTest { .contains( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder().build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder().build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt index baece6da6..caeb63f1f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt @@ -10,6 +10,7 @@ internal class CardRefundCreateParamsTest { @Test fun create() { CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() @@ -19,12 +20,14 @@ internal class CardRefundCreateParamsTest { fun body() { val params = CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() val body = params._body() + assertThat(body.amount()).contains(1L) assertThat(body.pendingTransactionId()).contains("pending_transaction_id") assertThat(body.transactionId()).contains("transaction_uyrp7fld2ium70oa7oi") } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt new file mode 100644 index 000000000..45a6784e0 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.simulations.inboundfednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferCreateParamsTest { + + @Test + fun create() { + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + } + + @Test + fun body() { + val params = + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + + val body = params._body() + + assertThat(body.accountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.amount()).isEqualTo(1000L) + assertThat(body.debtorAccountNumber()).contains("x") + assertThat(body.debtorName()).contains("x") + assertThat(body.debtorRoutingNumber()).contains("xxxxxxxxx") + assertThat(body.unstructuredRemittanceInformation()).contains("x") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .build() + + val body = params._body() + + assertThat(body.accountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.amount()).isEqualTo(1000L) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index 7a13e0014..722a057c6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.transactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -136,6 +135,15 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial .AdditionalAmounts @@ -223,6 +231,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa @@ -249,6 +263,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -348,6 +363,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -614,6 +630,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1074,7 +1091,7 @@ internal class TransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement .builder() @@ -1229,6 +1246,14 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -1308,6 +1333,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -1333,6 +1364,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1426,6 +1458,7 @@ internal class TransactionListPageResponseTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1680,6 +1713,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2113,7 +2147,7 @@ internal class TransactionListPageResponseTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -2280,6 +2314,15 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial .AdditionalAmounts @@ -2367,6 +2410,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa @@ -2393,6 +2442,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2492,6 +2542,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2758,6 +2809,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3218,7 +3270,7 @@ internal class TransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement .builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 12f7f8f7e..390d1623e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.transactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -120,6 +119,14 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -196,6 +203,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -218,6 +230,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -308,6 +321,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -547,6 +561,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -962,7 +977,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -1102,6 +1117,13 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -1174,6 +1196,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -1194,6 +1221,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1282,6 +1310,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1507,6 +1536,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1897,7 +1927,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -2043,6 +2073,14 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -2119,6 +2157,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -2141,6 +2184,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2231,6 +2275,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2470,6 +2515,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2885,7 +2931,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt index 6e16a8322..e87e60e83 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt @@ -13,17 +13,22 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -41,6 +46,25 @@ internal class WireTransferCreateParamsTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") @@ -53,17 +77,22 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -81,6 +110,25 @@ internal class WireTransferCreateParamsTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") @@ -90,19 +138,25 @@ internal class WireTransferCreateParamsTest { assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(body.amount()).isEqualTo(100L) - assertThat(body.beneficiaryName()).isEqualTo("Ian Crease") - assertThat(body.accountNumber()).contains("987654321") - assertThat(body.beneficiaryAddressLine1()).contains("33 Liberty Street") - assertThat(body.beneficiaryAddressLine2()).contains("New York") - assertThat(body.beneficiaryAddressLine3()).contains("NY 10045") - assertThat(body.externalAccountId()).contains("external_account_id") - assertThat(body.inboundWireDrawdownRequestId()).contains("inbound_wire_drawdown_request_id") - assertThat(body.originatorAddressLine1()).contains("x") - assertThat(body.originatorAddressLine2()).contains("x") - assertThat(body.originatorAddressLine3()).contains("x") - assertThat(body.originatorName()).contains("x") + assertThat(body.creditor()) + .isEqualTo( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) assertThat(body.remittance()) - .contains( + .isEqualTo( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) .tax( @@ -119,6 +173,26 @@ internal class WireTransferCreateParamsTest { ) .build() ) + assertThat(body.accountNumber()).contains("987654321") + assertThat(body.debtor()) + .contains( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + assertThat(body.externalAccountId()).contains("external_account_id") + assertThat(body.inboundWireDrawdownRequestId()).contains("inbound_wire_drawdown_request_id") assertThat(body.requireApproval()).contains(true) assertThat(body.routingNumber()).contains("101050001") assertThat(body.sourceAccountNumberId()).contains("source_account_number_id") @@ -130,13 +204,25 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") + .creditor(WireTransferCreateParams.Creditor.builder().name("Ian Crease").build()) + .remittance( + WireTransferCreateParams.Remittance.builder() + .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) + .build() + ) .build() val body = params._body() assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(body.amount()).isEqualTo(100L) - assertThat(body.beneficiaryName()).isEqualTo("Ian Crease") + assertThat(body.creditor()) + .isEqualTo(WireTransferCreateParams.Creditor.builder().name("Ian Crease").build()) + assertThat(body.remittance()) + .isEqualTo( + WireTransferCreateParams.Remittance.builder() + .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) + .build() + ) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt index 6cc652adf..25e92a0da 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt @@ -27,10 +27,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -58,16 +54,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -81,7 +104,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -133,10 +156,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -164,16 +183,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -187,7 +233,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -243,10 +289,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -274,16 +316,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -297,7 +366,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt index 22002a893..50f0f31bb 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt @@ -25,10 +25,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -52,16 +48,43 @@ internal class WireTransferTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -75,7 +98,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -122,10 +145,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - assertThat(wireTransfer.beneficiaryAddressLine1()).isEmpty - assertThat(wireTransfer.beneficiaryAddressLine2()).isEmpty - assertThat(wireTransfer.beneficiaryAddressLine3()).isEmpty - assertThat(wireTransfer.beneficiaryName()).isEmpty assertThat(wireTransfer.cancellation()) .contains( WireTransfer.Cancellation.builder() @@ -147,17 +166,46 @@ internal class WireTransferTest { .user(WireTransfer.CreatedBy.User.builder().email("user@example.com").build()) .build() ) + assertThat(wireTransfer.creditor()) + .contains( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) assertThat(wireTransfer.currency()).isEqualTo(WireTransfer.Currency.USD) + assertThat(wireTransfer.debtor()) + .contains( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) assertThat(wireTransfer.externalAccountId()) .contains("external_account_ukk55lr923a3ac0pp7iv") assertThat(wireTransfer.idempotencyKey()).isEmpty assertThat(wireTransfer.inboundWireDrawdownRequestId()).isEmpty - assertThat(wireTransfer.messageToRecipient()).isEqualTo("Message to recipient") assertThat(wireTransfer.network()).isEqualTo(WireTransfer.Network.WIRE) - assertThat(wireTransfer.originatorAddressLine1()).isEmpty - assertThat(wireTransfer.originatorAddressLine2()).isEmpty - assertThat(wireTransfer.originatorAddressLine3()).isEmpty - assertThat(wireTransfer.originatorName()).isEmpty assertThat(wireTransfer.pendingTransactionId()).isEmpty assertThat(wireTransfer.remittance()) .contains( @@ -172,7 +220,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -225,10 +273,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -252,16 +296,43 @@ internal class WireTransferTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -275,7 +346,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt index e1f0433b0..274501834 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.carddisputes.CardDisputeCreateParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate @@ -79,7 +78,12 @@ internal class CardDisputeServiceAsyncTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -183,8 +187,17 @@ internal class CardDisputeServiceAsyncTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -219,7 +232,13 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -275,7 +294,13 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -406,7 +431,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -444,10 +476,18 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -476,7 +516,12 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -650,7 +695,12 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -832,7 +882,14 @@ internal class CardDisputeServiceAsyncTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -961,8 +1018,22 @@ internal class CardDisputeServiceAsyncTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1003,7 +1074,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1068,7 +1146,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1227,7 +1312,13 @@ internal class CardDisputeServiceAsyncTest { .NOT_RETURNED ) .notReturned( - JsonValue.from(mapOf()) + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa @@ -1276,10 +1367,22 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1315,7 +1418,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1537,7 +1647,14 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt index b2de39ef1..e781b600b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt @@ -40,7 +40,7 @@ internal class CardServiceAsyncTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -93,7 +93,7 @@ internal class CardServiceAsyncTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt index ced340bea..6f02ccc1c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt @@ -28,6 +28,7 @@ internal class CheckTransferServiceAsyncTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt index 6c4a7363c..d3c0b122b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt @@ -109,7 +109,7 @@ internal class DigitalCardProfileServiceAsyncTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt index 3275f3c89..b044e39d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.exports.ExportCreateParams import java.time.LocalDate import java.time.OffsetDateTime @@ -31,6 +30,7 @@ internal class ExportServiceAsyncTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -96,7 +96,7 @@ internal class ExportServiceAsyncTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..129774f41 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt @@ -0,0 +1,121 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class FednowTransferServiceAsyncTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.create( + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + ) + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.retrieve("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val pageFuture = fednowTransferServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } + + @Test + fun approve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.approve("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun cancel() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.cancel("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..71b6d422b --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt @@ -0,0 +1,45 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceAsyncTest { + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.inboundFednowTransfers() + + val inboundFednowTransferFuture = + inboundFednowTransferServiceAsync.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20" + ) + + val inboundFednowTransfer = inboundFednowTransferFuture.get() + inboundFednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.inboundFednowTransfers() + + val pageFuture = inboundFednowTransferServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt index f4d577458..f3faeee2d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt @@ -104,7 +104,7 @@ internal class RealTimeDecisionServiceAsyncTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -114,7 +114,7 @@ internal class RealTimeDecisionServiceAsyncTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt index 62061e437..29516b117 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt @@ -26,17 +26,23 @@ internal class WireTransferServiceAsyncTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured + .builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -54,6 +60,26 @@ internal class WireTransferServiceAsyncTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured + .builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt index 3a53ebd69..75746804e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt @@ -56,6 +56,11 @@ internal class CardAuthorizationServiceAsyncTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt index b24041d51..b5f7f18db 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async.simulations import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.simulations.carddisputes.CardDisputeActionParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -29,20 +28,40 @@ internal class CardDisputeServiceAsyncTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder() + .build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder() + .build() + ) .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt index 7799c78f4..6bfa4f80e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt @@ -23,6 +23,7 @@ internal class CardRefundServiceAsyncTest { val transactionFuture = cardRefundServiceAsync.create( CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..a1e3ed3c5 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceAsyncTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.simulations().inboundFednowTransfers() + + val inboundFednowTransferFuture = + inboundFednowTransferServiceAsync.create( + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + ) + + val inboundFednowTransfer = inboundFednowTransferFuture.get() + inboundFednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt index fdb0b5fb7..e4296d8d5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.carddisputes.CardDisputeCreateParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate @@ -79,7 +78,12 @@ internal class CardDisputeServiceTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -183,8 +187,17 @@ internal class CardDisputeServiceTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -219,7 +232,13 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -275,7 +294,13 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -406,7 +431,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -444,10 +476,18 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -476,7 +516,12 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -650,7 +695,12 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -828,7 +878,14 @@ internal class CardDisputeServiceTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -957,8 +1014,22 @@ internal class CardDisputeServiceTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -999,7 +1070,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1064,7 +1142,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1223,7 +1308,13 @@ internal class CardDisputeServiceTest { .NOT_RETURNED ) .notReturned( - JsonValue.from(mapOf()) + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa @@ -1272,10 +1363,22 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1311,7 +1414,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1533,7 +1643,14 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt index 5a011ed22..ecab06e8f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt @@ -40,7 +40,7 @@ internal class CardServiceTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -91,7 +91,7 @@ internal class CardServiceTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt index 7532b7cbb..9842dafb7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt @@ -28,6 +28,7 @@ internal class CheckTransferServiceTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt index 7694911c7..ac93dd20c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt @@ -105,7 +105,7 @@ internal class DigitalCardProfileServiceTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt index b60876bca..c98cd80d1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.exports.ExportCreateParams import java.time.LocalDate import java.time.OffsetDateTime @@ -31,6 +30,7 @@ internal class ExportServiceTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -96,7 +96,7 @@ internal class ExportServiceTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt new file mode 100644 index 000000000..7dcad0dc8 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class FednowTransferServiceTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = + fednowTransferService.create( + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + ) + + fednowTransfer.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.retrieve("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val page = fednowTransferService.list() + + page.response().validate() + } + + @Test + fun approve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.approve("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } + + @Test + fun cancel() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.cancel("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt new file mode 100644 index 000000000..52147b35f --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceTest { + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.inboundFednowTransfers() + + val inboundFednowTransfer = + inboundFednowTransferService.retrieve("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + + inboundFednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.inboundFednowTransfers() + + val page = inboundFednowTransferService.list() + + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt index 5b841468e..ee03e2fe0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt @@ -103,7 +103,7 @@ internal class RealTimeDecisionServiceTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -113,7 +113,7 @@ internal class RealTimeDecisionServiceTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt index 5537e5dce..1b446956d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt @@ -26,17 +26,23 @@ internal class WireTransferServiceTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured + .builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -54,6 +60,26 @@ internal class WireTransferServiceTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured + .builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt index 1eeb96686..ecf86f1ce 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt @@ -56,6 +56,11 @@ internal class CardAuthorizationServiceTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt index bd0b3101d..fc3b5b8c1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking.simulations import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.simulations.carddisputes.CardDisputeActionParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -29,20 +28,40 @@ internal class CardDisputeServiceTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder() + .build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder() + .build() + ) .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt index cf3c0fbaf..9a53b8d23 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt @@ -23,6 +23,7 @@ internal class CardRefundServiceTest { val transaction = cardRefundService.create( CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt new file mode 100644 index 000000000..d17e0e5fb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.simulations().inboundFednowTransfers() + + val inboundFednowTransfer = + inboundFednowTransferService.create( + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + ) + + inboundFednowTransfer.validate() + } +} diff --git a/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt b/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt index 5ac6a9ae2..4b3d3ef42 100644 --- a/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt +++ b/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt @@ -74,6 +74,8 @@ internal class ProGuardCompatibilityTest { assertThat(client.inboundCheckDeposits()).isNotNull() assertThat(client.realTimePaymentsTransfers()).isNotNull() assertThat(client.inboundRealTimePaymentsTransfers()).isNotNull() + assertThat(client.fednowTransfers()).isNotNull() + assertThat(client.inboundFednowTransfers()).isNotNull() assertThat(client.checkDeposits()).isNotNull() assertThat(client.lockboxes()).isNotNull() assertThat(client.inboundMailItems()).isNotNull()