From 26bd00799bf1badebbaf48ad46a7a29cd90bbc16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 18:46:58 +0000 Subject: [PATCH 1/4] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e029231b5..2c0b26927 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4615e5953fac5a76724144fc2e1f9f675a9722dc05adaeab23e4d09c9577086b.yml -openapi_spec_hash: 6db98497c4dda09b575d5ee12371ef83 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0482ee5f9cf2cd09691221500b562dab1092df43e774e92b714ccebebf618b1b.yml +openapi_spec_hash: 3f1b98e772d86cca81fa3186198a6937 config_hash: b24ba63471a818520cec39b4695e1825 From 118c6f861601da7a97fad8fe9640fc8c76e88b11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:33:47 +0000 Subject: [PATCH 2/4] feat(api): api update --- .stats.yml | 8 +- .../com/increase/api/client/IncreaseClient.kt | 11 +- .../api/client/IncreaseClientAsync.kt | 11 +- .../api/client/IncreaseClientAsyncImpl.kt | 32 +- .../increase/api/client/IncreaseClientImpl.kt | 31 +- .../api/models/checkdeposits/CheckDeposit.kt | 70 +- .../inboundmailitems/InboundMailItem.kt | 141 ++- .../InboundMailItemListParams.kt | 59 +- .../LockboxAddress.kt} | 380 +++----- .../LockboxAddressCreateParams.kt | 397 ++++++++ .../LockboxAddressListPage.kt} | 73 +- .../LockboxAddressListPageAsync.kt} | 76 +- .../LockboxAddressListPageResponse.kt} | 58 +- .../LockboxAddressListParams.kt} | 52 +- .../LockboxAddressRetrieveParams.kt} | 60 +- .../LockboxAddressUpdateParams.kt | 631 ++++++++++++ .../lockboxrecipients/LockboxRecipient.kt | 900 ++++++++++++++++++ .../LockboxRecipientCreateParams.kt} | 144 ++- .../LockboxRecipientListPage.kt | 135 +++ .../LockboxRecipientListPageAsync.kt | 151 +++ .../LockboxRecipientListPageResponse.kt | 246 +++++ .../LockboxRecipientListParams.kt | 506 ++++++++++ .../LockboxRecipientRetrieveParams.kt | 204 ++++ .../LockboxRecipientUpdateParams.kt} | 296 +++--- .../InboundMailItemCreateParams.kt | 229 +++-- .../async/LockboxAddressServiceAsync.kt | 285 ++++++ ...l.kt => LockboxAddressServiceAsyncImpl.kt} | 104 +- .../async/LockboxRecipientServiceAsync.kt | 279 ++++++ .../async/LockboxRecipientServiceAsyncImpl.kt | 221 +++++ .../api/services/async/LockboxServiceAsync.kt | 253 ----- .../blocking/LockboxAddressService.kt | 284 ++++++ ...ceImpl.kt => LockboxAddressServiceImpl.kt} | 106 ++- .../blocking/LockboxRecipientService.kt | 275 ++++++ .../blocking/LockboxRecipientServiceImpl.kt | 205 ++++ .../api/services/blocking/LockboxService.kt | 246 ----- .../CheckDepositListPageResponseTest.kt | 6 +- .../models/checkdeposits/CheckDepositTest.kt | 6 +- .../InboundMailItemListPageResponseTest.kt | 9 +- .../InboundMailItemListParamsTest.kt | 9 +- .../inboundmailitems/InboundMailItemTest.kt | 10 +- .../LockboxAddressCreateParamsTest.kt | 30 + .../LockboxAddressListPageResponseTest.kt} | 70 +- .../LockboxAddressListParamsTest.kt} | 17 +- .../LockboxAddressRetrieveParamsTest.kt | 28 + .../lockboxaddresses/LockboxAddressTest.kt | 83 ++ .../LockboxAddressUpdateParamsTest.kt | 55 ++ .../lockboxes/LockboxCreateParamsTest.kt | 43 - .../api/models/lockboxes/LockboxTest.kt | 88 -- .../lockboxes/LockboxUpdateParamsTest.kt | 53 -- .../LockboxRecipientCreateParamsTest.kt | 51 + .../LockboxRecipientListPageResponseTest.kt | 83 ++ .../LockboxRecipientListParamsTest.kt | 76 ++ .../LockboxRecipientRetrieveParamsTest.kt} | 12 +- .../lockboxrecipients/LockboxRecipientTest.kt | 68 ++ .../LockboxRecipientUpdateParamsTest.kt | 58 ++ .../InboundMailItemCreateParamsTest.kt | 16 +- ...t.kt => LockboxAddressServiceAsyncTest.kt} | 52 +- .../async/LockboxRecipientServiceAsyncTest.kt | 91 ++ .../InboundMailItemServiceAsyncTest.kt | 3 +- ...ceTest.kt => LockboxAddressServiceTest.kt} | 45 +- .../blocking/LockboxRecipientServiceTest.kt | 86 ++ .../simulations/InboundMailItemServiceTest.kt | 3 +- .../api/proguard/ProGuardCompatibilityTest.kt | 3 +- 63 files changed, 6634 insertions(+), 1679 deletions(-) rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/Lockbox.kt => lockboxaddresses/LockboxAddress.kt} (72%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParams.kt rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxListPage.kt => lockboxaddresses/LockboxAddressListPage.kt} (50%) rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxListPageAsync.kt => lockboxaddresses/LockboxAddressListPageAsync.kt} (54%) rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxListPageResponse.kt => lockboxaddresses/LockboxAddressListPageResponse.kt} (79%) rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxListParams.kt => lockboxaddresses/LockboxAddressListParams.kt} (90%) rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxRetrieveParams.kt => lockboxaddresses/LockboxAddressRetrieveParams.kt} (73%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipient.kt rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxCreateParams.kt => lockboxrecipients/LockboxRecipientCreateParams.kt} (77%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPage.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponse.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParams.kt rename increase-java-core/src/main/kotlin/com/increase/api/models/{lockboxes/LockboxUpdateParams.kt => lockboxrecipients/LockboxRecipientUpdateParams.kt} (71%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsync.kt rename increase-java-core/src/main/kotlin/com/increase/api/services/async/{LockboxServiceAsyncImpl.kt => LockboxAddressServiceAsyncImpl.kt} (66%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncImpl.kt delete mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressService.kt rename increase-java-core/src/main/kotlin/com/increase/api/services/blocking/{LockboxServiceImpl.kt => LockboxAddressServiceImpl.kt} (62%) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientService.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceImpl.kt delete mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParamsTest.kt rename increase-java-core/src/test/kotlin/com/increase/api/models/{lockboxes/LockboxListPageResponseTest.kt => lockboxaddresses/LockboxAddressListPageResponseTest.kt} (50%) rename increase-java-core/src/test/kotlin/com/increase/api/models/{lockboxes/LockboxListParamsTest.kt => lockboxaddresses/LockboxAddressListParamsTest.kt} (82%) create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParamsTest.kt delete mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxCreateParamsTest.kt delete mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxTest.kt delete mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponseTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParamsTest.kt rename increase-java-core/src/test/kotlin/com/increase/api/models/{lockboxes/LockboxRetrieveParamsTest.kt => lockboxrecipients/LockboxRecipientRetrieveParamsTest.kt} (52%) create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParamsTest.kt rename increase-java-core/src/test/kotlin/com/increase/api/services/async/{LockboxServiceAsyncTest.kt => LockboxAddressServiceAsyncTest.kt} (50%) create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncTest.kt rename increase-java-core/src/test/kotlin/com/increase/api/services/blocking/{LockboxServiceTest.kt => LockboxAddressServiceTest.kt} (54%) create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 2c0b26927..0f4697e38 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0482ee5f9cf2cd09691221500b562dab1092df43e774e92b714ccebebf618b1b.yml -openapi_spec_hash: 3f1b98e772d86cca81fa3186198a6937 -config_hash: b24ba63471a818520cec39b4695e1825 +configured_endpoints: 236 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-47752267c48d299a01c906499bb7d584228ea8801b7d83e34ae4100d5dec3434.yml +openapi_spec_hash: 132e71b6e6bb1c5f06153f87d50e335b +config_hash: 026e2baa580c7f5f2447c24332081ba8 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 325f50a3e..4f752c65f 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 @@ -42,7 +42,8 @@ import com.increase.api.services.blocking.InboundWireTransferService import com.increase.api.services.blocking.IntrafiAccountEnrollmentService import com.increase.api.services.blocking.IntrafiBalanceService import com.increase.api.services.blocking.IntrafiExclusionService -import com.increase.api.services.blocking.LockboxService +import com.increase.api.services.blocking.LockboxAddressService +import com.increase.api.services.blocking.LockboxRecipientService import com.increase.api.services.blocking.OAuthApplicationService import com.increase.api.services.blocking.OAuthConnectionService import com.increase.api.services.blocking.OAuthTokenService @@ -155,7 +156,9 @@ interface IncreaseClient { fun checkDeposits(): CheckDepositService - fun lockboxes(): LockboxService + fun lockboxAddresses(): LockboxAddressService + + fun lockboxRecipients(): LockboxRecipientService fun inboundMailItems(): InboundMailItemService @@ -291,7 +294,9 @@ interface IncreaseClient { fun checkDeposits(): CheckDepositService.WithRawResponse - fun lockboxes(): LockboxService.WithRawResponse + fun lockboxAddresses(): LockboxAddressService.WithRawResponse + + fun lockboxRecipients(): LockboxRecipientService.WithRawResponse fun inboundMailItems(): InboundMailItemService.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 eb524b929..7bd3c733c 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 @@ -42,7 +42,8 @@ import com.increase.api.services.async.InboundWireTransferServiceAsync import com.increase.api.services.async.IntrafiAccountEnrollmentServiceAsync import com.increase.api.services.async.IntrafiBalanceServiceAsync import com.increase.api.services.async.IntrafiExclusionServiceAsync -import com.increase.api.services.async.LockboxServiceAsync +import com.increase.api.services.async.LockboxAddressServiceAsync +import com.increase.api.services.async.LockboxRecipientServiceAsync import com.increase.api.services.async.OAuthApplicationServiceAsync import com.increase.api.services.async.OAuthConnectionServiceAsync import com.increase.api.services.async.OAuthTokenServiceAsync @@ -155,7 +156,9 @@ interface IncreaseClientAsync { fun checkDeposits(): CheckDepositServiceAsync - fun lockboxes(): LockboxServiceAsync + fun lockboxAddresses(): LockboxAddressServiceAsync + + fun lockboxRecipients(): LockboxRecipientServiceAsync fun inboundMailItems(): InboundMailItemServiceAsync @@ -295,7 +298,9 @@ interface IncreaseClientAsync { fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse - fun lockboxes(): LockboxServiceAsync.WithRawResponse + fun lockboxAddresses(): LockboxAddressServiceAsync.WithRawResponse + + fun lockboxRecipients(): LockboxRecipientServiceAsync.WithRawResponse fun inboundMailItems(): InboundMailItemServiceAsync.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 23415543b..e0396b387 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 @@ -82,8 +82,10 @@ import com.increase.api.services.async.IntrafiBalanceServiceAsync import com.increase.api.services.async.IntrafiBalanceServiceAsyncImpl import com.increase.api.services.async.IntrafiExclusionServiceAsync import com.increase.api.services.async.IntrafiExclusionServiceAsyncImpl -import com.increase.api.services.async.LockboxServiceAsync -import com.increase.api.services.async.LockboxServiceAsyncImpl +import com.increase.api.services.async.LockboxAddressServiceAsync +import com.increase.api.services.async.LockboxAddressServiceAsyncImpl +import com.increase.api.services.async.LockboxRecipientServiceAsync +import com.increase.api.services.async.LockboxRecipientServiceAsyncImpl import com.increase.api.services.async.OAuthApplicationServiceAsync import com.increase.api.services.async.OAuthApplicationServiceAsyncImpl import com.increase.api.services.async.OAuthConnectionServiceAsync @@ -250,8 +252,12 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa CheckDepositServiceAsyncImpl(clientOptionsWithUserAgent) } - private val lockboxes: LockboxServiceAsync by lazy { - LockboxServiceAsyncImpl(clientOptionsWithUserAgent) + private val lockboxAddresses: LockboxAddressServiceAsync by lazy { + LockboxAddressServiceAsyncImpl(clientOptionsWithUserAgent) + } + + private val lockboxRecipients: LockboxRecipientServiceAsync by lazy { + LockboxRecipientServiceAsyncImpl(clientOptionsWithUserAgent) } private val inboundMailItems: InboundMailItemServiceAsync by lazy { @@ -426,7 +432,9 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa override fun checkDeposits(): CheckDepositServiceAsync = checkDeposits - override fun lockboxes(): LockboxServiceAsync = lockboxes + override fun lockboxAddresses(): LockboxAddressServiceAsync = lockboxAddresses + + override fun lockboxRecipients(): LockboxRecipientServiceAsync = lockboxRecipients override fun inboundMailItems(): InboundMailItemServiceAsync = inboundMailItems @@ -608,8 +616,12 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa CheckDepositServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val lockboxes: LockboxServiceAsync.WithRawResponse by lazy { - LockboxServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val lockboxAddresses: LockboxAddressServiceAsync.WithRawResponse by lazy { + LockboxAddressServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val lockboxRecipients: LockboxRecipientServiceAsync.WithRawResponse by lazy { + LockboxRecipientServiceAsyncImpl.WithRawResponseImpl(clientOptions) } private val inboundMailItems: InboundMailItemServiceAsync.WithRawResponse by lazy { @@ -801,7 +813,11 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa override fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse = checkDeposits - override fun lockboxes(): LockboxServiceAsync.WithRawResponse = lockboxes + override fun lockboxAddresses(): LockboxAddressServiceAsync.WithRawResponse = + lockboxAddresses + + override fun lockboxRecipients(): LockboxRecipientServiceAsync.WithRawResponse = + lockboxRecipients override fun inboundMailItems(): InboundMailItemServiceAsync.WithRawResponse = inboundMailItems 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 cd5cece97..b7abfb3bb 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 @@ -82,8 +82,10 @@ import com.increase.api.services.blocking.IntrafiBalanceService import com.increase.api.services.blocking.IntrafiBalanceServiceImpl import com.increase.api.services.blocking.IntrafiExclusionService import com.increase.api.services.blocking.IntrafiExclusionServiceImpl -import com.increase.api.services.blocking.LockboxService -import com.increase.api.services.blocking.LockboxServiceImpl +import com.increase.api.services.blocking.LockboxAddressService +import com.increase.api.services.blocking.LockboxAddressServiceImpl +import com.increase.api.services.blocking.LockboxRecipientService +import com.increase.api.services.blocking.LockboxRecipientServiceImpl import com.increase.api.services.blocking.OAuthApplicationService import com.increase.api.services.blocking.OAuthApplicationServiceImpl import com.increase.api.services.blocking.OAuthConnectionService @@ -247,7 +249,13 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli CheckDepositServiceImpl(clientOptionsWithUserAgent) } - private val lockboxes: LockboxService by lazy { LockboxServiceImpl(clientOptionsWithUserAgent) } + private val lockboxAddresses: LockboxAddressService by lazy { + LockboxAddressServiceImpl(clientOptionsWithUserAgent) + } + + private val lockboxRecipients: LockboxRecipientService by lazy { + LockboxRecipientServiceImpl(clientOptionsWithUserAgent) + } private val inboundMailItems: InboundMailItemService by lazy { InboundMailItemServiceImpl(clientOptionsWithUserAgent) @@ -409,7 +417,9 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli override fun checkDeposits(): CheckDepositService = checkDeposits - override fun lockboxes(): LockboxService = lockboxes + override fun lockboxAddresses(): LockboxAddressService = lockboxAddresses + + override fun lockboxRecipients(): LockboxRecipientService = lockboxRecipients override fun inboundMailItems(): InboundMailItemService = inboundMailItems @@ -589,8 +599,12 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli CheckDepositServiceImpl.WithRawResponseImpl(clientOptions) } - private val lockboxes: LockboxService.WithRawResponse by lazy { - LockboxServiceImpl.WithRawResponseImpl(clientOptions) + private val lockboxAddresses: LockboxAddressService.WithRawResponse by lazy { + LockboxAddressServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val lockboxRecipients: LockboxRecipientService.WithRawResponse by lazy { + LockboxRecipientServiceImpl.WithRawResponseImpl(clientOptions) } private val inboundMailItems: InboundMailItemService.WithRawResponse by lazy { @@ -780,7 +794,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli override fun checkDeposits(): CheckDepositService.WithRawResponse = checkDeposits - override fun lockboxes(): LockboxService.WithRawResponse = lockboxes + override fun lockboxAddresses(): LockboxAddressService.WithRawResponse = lockboxAddresses + + override fun lockboxRecipients(): LockboxRecipientService.WithRawResponse = + lockboxRecipients override fun inboundMailItems(): InboundMailItemService.WithRawResponse = inboundMailItems 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 275227e09..a7b364c39 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 @@ -40,7 +40,7 @@ private constructor( private val idempotencyKey: JsonField, private val inboundFundsHold: JsonField, private val inboundMailItemId: JsonField, - private val lockboxId: JsonField, + private val lockboxRecipientId: JsonField, private val status: JsonField, private val transactionId: JsonField, private val type: JsonField, @@ -88,7 +88,9 @@ private constructor( @JsonProperty("inbound_mail_item_id") @ExcludeMissing inboundMailItemId: JsonField = JsonMissing.of(), - @JsonProperty("lockbox_id") @ExcludeMissing lockboxId: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + lockboxRecipientId: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing @@ -110,7 +112,7 @@ private constructor( idempotencyKey, inboundFundsHold, inboundMailItemId, - lockboxId, + lockboxRecipientId, status, transactionId, type, @@ -252,13 +254,14 @@ private constructor( inboundMailItemId.getOptional("inbound_mail_item_id") /** - * If the Check Deposit was the result of an Inbound Mail Item, this will contain the identifier - * of the Lockbox that received it. + * If the Check Deposit was the result of an Inbound Mail Item routed to a Lockbox Recipient, + * this will contain the identifier of the Lockbox Recipient that received it. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun lockboxId(): Optional = lockboxId.getOptional("lockbox_id") + fun lockboxRecipientId(): Optional = + lockboxRecipientId.getOptional("lockbox_recipient_id") /** * The status of the Check Deposit. @@ -420,11 +423,14 @@ private constructor( fun _inboundMailItemId(): JsonField = inboundMailItemId /** - * Returns the raw JSON value of [lockboxId]. + * Returns the raw JSON value of [lockboxRecipientId]. * - * Unlike [lockboxId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [lockboxRecipientId], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("lockbox_id") @ExcludeMissing fun _lockboxId(): JsonField = lockboxId + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + fun _lockboxRecipientId(): JsonField = lockboxRecipientId /** * Returns the raw JSON value of [status]. @@ -483,7 +489,7 @@ private constructor( * .idempotencyKey() * .inboundFundsHold() * .inboundMailItemId() - * .lockboxId() + * .lockboxRecipientId() * .status() * .transactionId() * .type() @@ -510,7 +516,7 @@ private constructor( private var idempotencyKey: JsonField? = null private var inboundFundsHold: JsonField? = null private var inboundMailItemId: JsonField? = null - private var lockboxId: JsonField? = null + private var lockboxRecipientId: JsonField? = null private var status: JsonField? = null private var transactionId: JsonField? = null private var type: JsonField? = null @@ -533,7 +539,7 @@ private constructor( idempotencyKey = checkDeposit.idempotencyKey inboundFundsHold = checkDeposit.inboundFundsHold inboundMailItemId = checkDeposit.inboundMailItemId - lockboxId = checkDeposit.lockboxId + lockboxRecipientId = checkDeposit.lockboxRecipientId status = checkDeposit.status transactionId = checkDeposit.transactionId type = checkDeposit.type @@ -821,22 +827,28 @@ private constructor( } /** - * If the Check Deposit was the result of an Inbound Mail Item, this will contain the - * identifier of the Lockbox that received it. + * If the Check Deposit was the result of an Inbound Mail Item routed to a Lockbox + * Recipient, this will contain the identifier of the Lockbox Recipient that received it. */ - fun lockboxId(lockboxId: String?) = lockboxId(JsonField.ofNullable(lockboxId)) + fun lockboxRecipientId(lockboxRecipientId: String?) = + lockboxRecipientId(JsonField.ofNullable(lockboxRecipientId)) - /** Alias for calling [Builder.lockboxId] with `lockboxId.orElse(null)`. */ - fun lockboxId(lockboxId: Optional) = lockboxId(lockboxId.getOrNull()) + /** + * Alias for calling [Builder.lockboxRecipientId] with `lockboxRecipientId.orElse(null)`. + */ + fun lockboxRecipientId(lockboxRecipientId: Optional) = + lockboxRecipientId(lockboxRecipientId.getOrNull()) /** - * Sets [Builder.lockboxId] to an arbitrary JSON value. + * Sets [Builder.lockboxRecipientId] to an arbitrary JSON value. * - * You should usually call [Builder.lockboxId] 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.lockboxRecipientId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun lockboxId(lockboxId: JsonField) = apply { this.lockboxId = lockboxId } + fun lockboxRecipientId(lockboxRecipientId: JsonField) = apply { + this.lockboxRecipientId = lockboxRecipientId + } /** The status of the Check Deposit. */ fun status(status: Status) = status(JsonField.of(status)) @@ -923,7 +935,7 @@ private constructor( * .idempotencyKey() * .inboundFundsHold() * .inboundMailItemId() - * .lockboxId() + * .lockboxRecipientId() * .status() * .transactionId() * .type() @@ -948,7 +960,7 @@ private constructor( checkRequired("idempotencyKey", idempotencyKey), checkRequired("inboundFundsHold", inboundFundsHold), checkRequired("inboundMailItemId", inboundMailItemId), - checkRequired("lockboxId", lockboxId), + checkRequired("lockboxRecipientId", lockboxRecipientId), checkRequired("status", status), checkRequired("transactionId", transactionId), checkRequired("type", type), @@ -978,7 +990,7 @@ private constructor( idempotencyKey() inboundFundsHold().ifPresent { it.validate() } inboundMailItemId() - lockboxId() + lockboxRecipientId() status().validate() transactionId() type().validate() @@ -1015,7 +1027,7 @@ private constructor( (if (idempotencyKey.asKnown().isPresent) 1 else 0) + (inboundFundsHold.asKnown().getOrNull()?.validity() ?: 0) + (if (inboundMailItemId.asKnown().isPresent) 1 else 0) + - (if (lockboxId.asKnown().isPresent) 1 else 0) + + (if (lockboxRecipientId.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (transactionId.asKnown().isPresent) 1 else 0) + (type.asKnown().getOrNull()?.validity() ?: 0) @@ -5272,7 +5284,7 @@ private constructor( idempotencyKey == other.idempotencyKey && inboundFundsHold == other.inboundFundsHold && inboundMailItemId == other.inboundMailItemId && - lockboxId == other.lockboxId && + lockboxRecipientId == other.lockboxRecipientId && status == other.status && transactionId == other.transactionId && type == other.type && @@ -5296,7 +5308,7 @@ private constructor( idempotencyKey, inboundFundsHold, inboundMailItemId, - lockboxId, + lockboxRecipientId, status, transactionId, type, @@ -5307,5 +5319,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CheckDeposit{id=$id, accountId=$accountId, amount=$amount, backImageFileId=$backImageFileId, createdAt=$createdAt, depositAcceptance=$depositAcceptance, depositAdjustments=$depositAdjustments, depositRejection=$depositRejection, depositReturn=$depositReturn, depositSubmission=$depositSubmission, description=$description, frontImageFileId=$frontImageFileId, idempotencyKey=$idempotencyKey, inboundFundsHold=$inboundFundsHold, inboundMailItemId=$inboundMailItemId, lockboxId=$lockboxId, status=$status, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" + "CheckDeposit{id=$id, accountId=$accountId, amount=$amount, backImageFileId=$backImageFileId, createdAt=$createdAt, depositAcceptance=$depositAcceptance, depositAdjustments=$depositAdjustments, depositRejection=$depositRejection, depositReturn=$depositReturn, depositSubmission=$depositSubmission, description=$description, frontImageFileId=$frontImageFileId, idempotencyKey=$idempotencyKey, inboundFundsHold=$inboundFundsHold, inboundMailItemId=$inboundMailItemId, lockboxRecipientId=$lockboxRecipientId, status=$status, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt index 426a2c8ff..540c71a2a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt @@ -21,7 +21,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Inbound Mail Items represent pieces of physical mail delivered to a Lockbox. */ +/** Inbound Mail Items represent pieces of physical mail delivered to a Lockbox Address. */ class InboundMailItem @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -29,7 +29,8 @@ private constructor( private val checks: JsonField>, private val createdAt: JsonField, private val fileId: JsonField, - private val lockboxId: JsonField, + private val lockboxAddressId: JsonField, + private val lockboxRecipientId: JsonField, private val recipientName: JsonField, private val rejectionReason: JsonField, private val status: JsonField, @@ -45,7 +46,12 @@ private constructor( @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @JsonProperty("file_id") @ExcludeMissing fileId: JsonField = JsonMissing.of(), - @JsonProperty("lockbox_id") @ExcludeMissing lockboxId: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_address_id") + @ExcludeMissing + lockboxAddressId: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + lockboxRecipientId: JsonField = JsonMissing.of(), @JsonProperty("recipient_name") @ExcludeMissing recipientName: JsonField = JsonMissing.of(), @@ -59,7 +65,8 @@ private constructor( checks, createdAt, fileId, - lockboxId, + lockboxAddressId, + lockboxRecipientId, recipientName, rejectionReason, status, @@ -101,13 +108,22 @@ private constructor( fun fileId(): String = fileId.getRequired("file_id") /** - * The identifier for the Lockbox that received this mail item. For mail items that could not be - * processed due to an invalid address, this will be null. + * The identifier for the Lockbox Address that received this mail item. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun lockboxAddressId(): Optional = lockboxAddressId.getOptional("lockbox_address_id") + + /** + * The identifier for the Lockbox Recipient that received this mail item. For mail items that + * could not be routed to a Lockbox Recipient, this will be null. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun lockboxId(): Optional = lockboxId.getOptional("lockbox_id") + fun lockboxRecipientId(): Optional = + lockboxRecipientId.getOptional("lockbox_recipient_id") /** * The recipient name as written on the mail item. @@ -174,11 +190,24 @@ private constructor( @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId /** - * Returns the raw JSON value of [lockboxId]. + * Returns the raw JSON value of [lockboxAddressId]. * - * Unlike [lockboxId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("lockbox_id") @ExcludeMissing fun _lockboxId(): JsonField = lockboxId + @JsonProperty("lockbox_address_id") + @ExcludeMissing + fun _lockboxAddressId(): JsonField = lockboxAddressId + + /** + * Returns the raw JSON value of [lockboxRecipientId]. + * + * Unlike [lockboxRecipientId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + fun _lockboxRecipientId(): JsonField = lockboxRecipientId /** * Returns the raw JSON value of [recipientName]. @@ -235,7 +264,8 @@ private constructor( * .checks() * .createdAt() * .fileId() - * .lockboxId() + * .lockboxAddressId() + * .lockboxRecipientId() * .recipientName() * .rejectionReason() * .status() @@ -252,7 +282,8 @@ private constructor( private var checks: JsonField>? = null private var createdAt: JsonField? = null private var fileId: JsonField? = null - private var lockboxId: JsonField? = null + private var lockboxAddressId: JsonField? = null + private var lockboxRecipientId: JsonField? = null private var recipientName: JsonField? = null private var rejectionReason: JsonField? = null private var status: JsonField? = null @@ -265,7 +296,8 @@ private constructor( checks = inboundMailItem.checks.map { it.toMutableList() } createdAt = inboundMailItem.createdAt fileId = inboundMailItem.fileId - lockboxId = inboundMailItem.lockboxId + lockboxAddressId = inboundMailItem.lockboxAddressId + lockboxRecipientId = inboundMailItem.lockboxRecipientId recipientName = inboundMailItem.recipientName rejectionReason = inboundMailItem.rejectionReason status = inboundMailItem.status @@ -336,23 +368,48 @@ private constructor( */ fun fileId(fileId: JsonField) = apply { this.fileId = fileId } + /** The identifier for the Lockbox Address that received this mail item. */ + fun lockboxAddressId(lockboxAddressId: String?) = + lockboxAddressId(JsonField.ofNullable(lockboxAddressId)) + + /** Alias for calling [Builder.lockboxAddressId] with `lockboxAddressId.orElse(null)`. */ + fun lockboxAddressId(lockboxAddressId: Optional) = + lockboxAddressId(lockboxAddressId.getOrNull()) + /** - * The identifier for the Lockbox that received this mail item. For mail items that could - * not be processed due to an invalid address, this will be null. + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** + * The identifier for the Lockbox Recipient that received this mail item. For mail items + * that could not be routed to a Lockbox Recipient, this will be null. */ - fun lockboxId(lockboxId: String?) = lockboxId(JsonField.ofNullable(lockboxId)) + fun lockboxRecipientId(lockboxRecipientId: String?) = + lockboxRecipientId(JsonField.ofNullable(lockboxRecipientId)) - /** Alias for calling [Builder.lockboxId] with `lockboxId.orElse(null)`. */ - fun lockboxId(lockboxId: Optional) = lockboxId(lockboxId.getOrNull()) + /** + * Alias for calling [Builder.lockboxRecipientId] with `lockboxRecipientId.orElse(null)`. + */ + fun lockboxRecipientId(lockboxRecipientId: Optional) = + lockboxRecipientId(lockboxRecipientId.getOrNull()) /** - * Sets [Builder.lockboxId] to an arbitrary JSON value. + * Sets [Builder.lockboxRecipientId] to an arbitrary JSON value. * - * You should usually call [Builder.lockboxId] 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.lockboxRecipientId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun lockboxId(lockboxId: JsonField) = apply { this.lockboxId = lockboxId } + fun lockboxRecipientId(lockboxRecipientId: JsonField) = apply { + this.lockboxRecipientId = lockboxRecipientId + } /** The recipient name as written on the mail item. */ fun recipientName(recipientName: String?) = @@ -447,7 +504,8 @@ private constructor( * .checks() * .createdAt() * .fileId() - * .lockboxId() + * .lockboxAddressId() + * .lockboxRecipientId() * .recipientName() * .rejectionReason() * .status() @@ -462,7 +520,8 @@ private constructor( checkRequired("checks", checks).map { it.toImmutable() }, checkRequired("createdAt", createdAt), checkRequired("fileId", fileId), - checkRequired("lockboxId", lockboxId), + checkRequired("lockboxAddressId", lockboxAddressId), + checkRequired("lockboxRecipientId", lockboxRecipientId), checkRequired("recipientName", recipientName), checkRequired("rejectionReason", rejectionReason), checkRequired("status", status), @@ -482,7 +541,8 @@ private constructor( checks().forEach { it.validate() } createdAt() fileId() - lockboxId() + lockboxAddressId() + lockboxRecipientId() recipientName() rejectionReason().ifPresent { it.validate() } status().validate() @@ -509,7 +569,8 @@ private constructor( (checks.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (fileId.asKnown().isPresent) 1 else 0) + - (if (lockboxId.asKnown().isPresent) 1 else 0) + + (if (lockboxAddressId.asKnown().isPresent) 1 else 0) + + (if (lockboxRecipientId.asKnown().isPresent) 1 else 0) + (if (recipientName.asKnown().isPresent) 1 else 0) + (rejectionReason.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + @@ -1035,6 +1096,12 @@ private constructor( /** The Lockbox or its associated Account is not active. */ @JvmField val LOCKBOX_NOT_ACTIVE = of("lockbox_not_active") + /** The Lockbox Address is not active. */ + @JvmField val LOCKBOX_ADDRESS_NOT_ACTIVE = of("lockbox_address_not_active") + + /** The Lockbox Recipient or its associated Account is not active. */ + @JvmField val LOCKBOX_RECIPIENT_NOT_ACTIVE = of("lockbox_recipient_not_active") + @JvmStatic fun of(value: String) = RejectionReason(JsonField.of(value)) } @@ -1046,6 +1113,10 @@ private constructor( NO_CHECK, /** The Lockbox or its associated Account is not active. */ LOCKBOX_NOT_ACTIVE, + /** The Lockbox Address is not active. */ + LOCKBOX_ADDRESS_NOT_ACTIVE, + /** The Lockbox Recipient or its associated Account is not active. */ + LOCKBOX_RECIPIENT_NOT_ACTIVE, } /** @@ -1064,6 +1135,10 @@ private constructor( NO_CHECK, /** The Lockbox or its associated Account is not active. */ LOCKBOX_NOT_ACTIVE, + /** The Lockbox Address is not active. */ + LOCKBOX_ADDRESS_NOT_ACTIVE, + /** The Lockbox Recipient or its associated Account is not active. */ + LOCKBOX_RECIPIENT_NOT_ACTIVE, /** * An enum member indicating that [RejectionReason] was instantiated with an unknown * value. @@ -1083,6 +1158,8 @@ private constructor( NO_MATCHING_LOCKBOX -> Value.NO_MATCHING_LOCKBOX NO_CHECK -> Value.NO_CHECK LOCKBOX_NOT_ACTIVE -> Value.LOCKBOX_NOT_ACTIVE + LOCKBOX_ADDRESS_NOT_ACTIVE -> Value.LOCKBOX_ADDRESS_NOT_ACTIVE + LOCKBOX_RECIPIENT_NOT_ACTIVE -> Value.LOCKBOX_RECIPIENT_NOT_ACTIVE else -> Value._UNKNOWN } @@ -1100,6 +1177,8 @@ private constructor( NO_MATCHING_LOCKBOX -> Known.NO_MATCHING_LOCKBOX NO_CHECK -> Known.NO_CHECK LOCKBOX_NOT_ACTIVE -> Known.LOCKBOX_NOT_ACTIVE + LOCKBOX_ADDRESS_NOT_ACTIVE -> Known.LOCKBOX_ADDRESS_NOT_ACTIVE + LOCKBOX_RECIPIENT_NOT_ACTIVE -> Known.LOCKBOX_RECIPIENT_NOT_ACTIVE else -> throw IncreaseInvalidDataException("Unknown RejectionReason: $value") } @@ -1435,7 +1514,8 @@ private constructor( checks == other.checks && createdAt == other.createdAt && fileId == other.fileId && - lockboxId == other.lockboxId && + lockboxAddressId == other.lockboxAddressId && + lockboxRecipientId == other.lockboxRecipientId && recipientName == other.recipientName && rejectionReason == other.rejectionReason && status == other.status && @@ -1449,7 +1529,8 @@ private constructor( checks, createdAt, fileId, - lockboxId, + lockboxAddressId, + lockboxRecipientId, recipientName, rejectionReason, status, @@ -1461,5 +1542,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundMailItem{id=$id, checks=$checks, createdAt=$createdAt, fileId=$fileId, lockboxId=$lockboxId, recipientName=$recipientName, rejectionReason=$rejectionReason, status=$status, type=$type, additionalProperties=$additionalProperties}" + "InboundMailItem{id=$id, checks=$checks, createdAt=$createdAt, fileId=$fileId, lockboxAddressId=$lockboxAddressId, lockboxRecipientId=$lockboxRecipientId, recipientName=$recipientName, rejectionReason=$rejectionReason, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParams.kt index e279ee5d2..808acdf33 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParams.kt @@ -17,7 +17,8 @@ private constructor( private val createdAt: CreatedAt?, private val cursor: String?, private val limit: Long?, - private val lockboxId: String?, + private val lockboxAddressId: String?, + private val lockboxRecipientId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -30,8 +31,11 @@ private constructor( /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */ fun limit(): Optional = Optional.ofNullable(limit) - /** Filter Inbound Mail Items to ones sent to the provided Lockbox. */ - fun lockboxId(): Optional = Optional.ofNullable(lockboxId) + /** Filter Inbound Mail Items to ones sent to the provided Lockbox Address. */ + fun lockboxAddressId(): Optional = Optional.ofNullable(lockboxAddressId) + + /** Filter Inbound Mail Items to ones sent to the provided Lockbox Recipient. */ + fun lockboxRecipientId(): Optional = Optional.ofNullable(lockboxRecipientId) /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -57,7 +61,8 @@ private constructor( private var createdAt: CreatedAt? = null private var cursor: String? = null private var limit: Long? = null - private var lockboxId: String? = null + private var lockboxAddressId: String? = null + private var lockboxRecipientId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -66,7 +71,8 @@ private constructor( createdAt = inboundMailItemListParams.createdAt cursor = inboundMailItemListParams.cursor limit = inboundMailItemListParams.limit - lockboxId = inboundMailItemListParams.lockboxId + lockboxAddressId = inboundMailItemListParams.lockboxAddressId + lockboxRecipientId = inboundMailItemListParams.lockboxRecipientId additionalHeaders = inboundMailItemListParams.additionalHeaders.toBuilder() additionalQueryParams = inboundMailItemListParams.additionalQueryParams.toBuilder() } @@ -97,11 +103,25 @@ private constructor( /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ fun limit(limit: Optional) = limit(limit.getOrNull()) - /** Filter Inbound Mail Items to ones sent to the provided Lockbox. */ - fun lockboxId(lockboxId: String?) = apply { this.lockboxId = lockboxId } + /** Filter Inbound Mail Items to ones sent to the provided Lockbox Address. */ + fun lockboxAddressId(lockboxAddressId: String?) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** Alias for calling [Builder.lockboxAddressId] with `lockboxAddressId.orElse(null)`. */ + fun lockboxAddressId(lockboxAddressId: Optional) = + lockboxAddressId(lockboxAddressId.getOrNull()) - /** Alias for calling [Builder.lockboxId] with `lockboxId.orElse(null)`. */ - fun lockboxId(lockboxId: Optional) = lockboxId(lockboxId.getOrNull()) + /** Filter Inbound Mail Items to ones sent to the provided Lockbox Recipient. */ + fun lockboxRecipientId(lockboxRecipientId: String?) = apply { + this.lockboxRecipientId = lockboxRecipientId + } + + /** + * Alias for calling [Builder.lockboxRecipientId] with `lockboxRecipientId.orElse(null)`. + */ + fun lockboxRecipientId(lockboxRecipientId: Optional) = + lockboxRecipientId(lockboxRecipientId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -211,7 +231,8 @@ private constructor( createdAt, cursor, limit, - lockboxId, + lockboxAddressId, + lockboxRecipientId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -249,7 +270,8 @@ private constructor( } cursor?.let { put("cursor", it) } limit?.let { put("limit", it.toString()) } - lockboxId?.let { put("lockbox_id", it) } + lockboxAddressId?.let { put("lockbox_address_id", it) } + lockboxRecipientId?.let { put("lockbox_recipient_id", it) } putAll(additionalQueryParams) } .build() @@ -441,14 +463,23 @@ private constructor( createdAt == other.createdAt && cursor == other.cursor && limit == other.limit && - lockboxId == other.lockboxId && + lockboxAddressId == other.lockboxAddressId && + lockboxRecipientId == other.lockboxRecipientId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(createdAt, cursor, limit, lockboxId, additionalHeaders, additionalQueryParams) + Objects.hash( + createdAt, + cursor, + limit, + lockboxAddressId, + lockboxRecipientId, + additionalHeaders, + additionalQueryParams, + ) override fun toString() = - "InboundMailItemListParams{createdAt=$createdAt, cursor=$cursor, limit=$limit, lockboxId=$lockboxId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InboundMailItemListParams{createdAt=$createdAt, cursor=$cursor, limit=$limit, lockboxAddressId=$lockboxAddressId, lockboxRecipientId=$lockboxRecipientId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddress.kt similarity index 72% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddress.kt index 68184474c..1a7482f59 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddress.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter @@ -19,21 +19,16 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** - * Lockboxes are physical locations that can receive mail containing paper checks. Increase will - * automatically create a Check Deposit for checks received this way. - */ -class Lockbox +/** Lockbox Addresses are physical locations that can receive mail containing paper checks. */ +class LockboxAddress @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, - private val accountId: JsonField, private val address: JsonField
, - private val checkDepositBehavior: JsonField, private val createdAt: JsonField, private val description: JsonField, private val idempotencyKey: JsonField, - private val recipientName: JsonField, + private val status: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, ) { @@ -41,11 +36,7 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), - @JsonProperty("check_deposit_behavior") - @ExcludeMissing - checkDepositBehavior: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @@ -55,25 +46,12 @@ private constructor( @JsonProperty("idempotency_key") @ExcludeMissing idempotencyKey: JsonField = JsonMissing.of(), - @JsonProperty("recipient_name") - @ExcludeMissing - recipientName: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - ) : this( - id, - accountId, - address, - checkDepositBehavior, - createdAt, - description, - idempotencyKey, - recipientName, - type, - mutableMapOf(), - ) + ) : this(id, address, createdAt, description, idempotencyKey, status, type, mutableMapOf()) /** - * The Lockbox identifier. + * The Lockbox Address 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). @@ -81,32 +59,16 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The identifier for the Account checks sent to this lockbox will be deposited into. - * - * @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 mailing address for the Lockbox. + * The mailing address for the Lockbox Address. It will be present after Increase generates it. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun address(): Address = address.getRequired("address") - - /** - * Indicates if checks mailed to this lockbox will be deposited. - * - * @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). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun checkDepositBehavior(): CheckDepositBehavior = - checkDepositBehavior.getRequired("check_deposit_behavior") + fun address(): Optional
= address.getOptional("address") /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox was created. + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox Address 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). @@ -114,7 +76,7 @@ private constructor( fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") /** - * The description you choose for the Lockbox. + * The description you choose for the Lockbox Address. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -132,15 +94,16 @@ private constructor( fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key") /** - * The recipient name you choose for the Lockbox. + * The status of the Lockbox Address. * - * @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 recipientName(): Optional = recipientName.getOptional("recipient_name") + fun status(): Status = status.getRequired("status") /** - * A constant representing the object's type. For this resource it will always be `lockbox`. + * A constant representing the object's type. For this resource it will always be + * `lockbox_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). @@ -154,13 +117,6 @@ private constructor( */ @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 [address]. * @@ -168,16 +124,6 @@ private constructor( */ @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address - /** - * Returns the raw JSON value of [checkDepositBehavior]. - * - * Unlike [checkDepositBehavior], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("check_deposit_behavior") - @ExcludeMissing - fun _checkDepositBehavior(): JsonField = checkDepositBehavior - /** * Returns the raw JSON value of [createdAt]. * @@ -204,13 +150,11 @@ private constructor( fun _idempotencyKey(): JsonField = idempotencyKey /** - * Returns the raw JSON value of [recipientName]. + * Returns the raw JSON value of [status]. * - * Unlike [recipientName], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("recipient_name") - @ExcludeMissing - fun _recipientName(): JsonField = recipientName + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status /** * Returns the raw JSON value of [type]. @@ -234,53 +178,47 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Lockbox]. + * Returns a mutable builder for constructing an instance of [LockboxAddress]. * * The following fields are required: * ```java * .id() - * .accountId() * .address() - * .checkDepositBehavior() * .createdAt() * .description() * .idempotencyKey() - * .recipientName() + * .status() * .type() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Lockbox]. */ + /** A builder for [LockboxAddress]. */ class Builder internal constructor() { private var id: JsonField? = null - private var accountId: JsonField? = null private var address: JsonField
? = null - private var checkDepositBehavior: JsonField? = null private var createdAt: JsonField? = null private var description: JsonField? = null private var idempotencyKey: JsonField? = null - private var recipientName: JsonField? = null + private var status: JsonField? = null private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(lockbox: Lockbox) = apply { - id = lockbox.id - accountId = lockbox.accountId - address = lockbox.address - checkDepositBehavior = lockbox.checkDepositBehavior - createdAt = lockbox.createdAt - description = lockbox.description - idempotencyKey = lockbox.idempotencyKey - recipientName = lockbox.recipientName - type = lockbox.type - additionalProperties = lockbox.additionalProperties.toMutableMap() + internal fun from(lockboxAddress: LockboxAddress) = apply { + id = lockboxAddress.id + address = lockboxAddress.address + createdAt = lockboxAddress.createdAt + description = lockboxAddress.description + idempotencyKey = lockboxAddress.idempotencyKey + status = lockboxAddress.status + type = lockboxAddress.type + additionalProperties = lockboxAddress.additionalProperties.toMutableMap() } - /** The Lockbox identifier. */ + /** The Lockbox Address identifier. */ fun id(id: String) = id(JsonField.of(id)) /** @@ -291,20 +229,14 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The identifier for the Account checks sent to this lockbox will be deposited into. */ - 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. + * The mailing address for the Lockbox Address. It will be present after Increase generates + * it. */ - fun accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun address(address: Address?) = address(JsonField.ofNullable(address)) - /** The mailing address for the Lockbox. */ - fun address(address: Address) = address(JsonField.of(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. @@ -314,24 +246,9 @@ private constructor( */ fun address(address: JsonField
) = apply { this.address = address } - /** Indicates if checks mailed to this lockbox will be deposited. */ - fun checkDepositBehavior(checkDepositBehavior: CheckDepositBehavior) = - checkDepositBehavior(JsonField.of(checkDepositBehavior)) - /** - * Sets [Builder.checkDepositBehavior] to an arbitrary JSON value. - * - * You should usually call [Builder.checkDepositBehavior] with a well-typed - * [CheckDepositBehavior] value instead. This method is primarily for setting the field to - * an undocumented or not yet supported value. - */ - fun checkDepositBehavior(checkDepositBehavior: JsonField) = apply { - this.checkDepositBehavior = checkDepositBehavior - } - - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox was - * created. + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox Address + * was created. */ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) @@ -344,7 +261,7 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - /** The description you choose for the Lockbox. */ + /** The description you choose for the Lockbox Address. */ fun description(description: String?) = description(JsonField.ofNullable(description)) /** Alias for calling [Builder.description] with `description.orElse(null)`. */ @@ -382,27 +299,20 @@ private constructor( this.idempotencyKey = idempotencyKey } - /** The recipient name you choose for the Lockbox. */ - fun recipientName(recipientName: String?) = - recipientName(JsonField.ofNullable(recipientName)) - - /** Alias for calling [Builder.recipientName] with `recipientName.orElse(null)`. */ - fun recipientName(recipientName: Optional) = - recipientName(recipientName.getOrNull()) + /** The status of the Lockbox Address. */ + fun status(status: Status) = status(JsonField.of(status)) /** - * Sets [Builder.recipientName] to an arbitrary JSON value. + * Sets [Builder.status] to an arbitrary JSON value. * - * You should usually call [Builder.recipientName] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. + * 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 recipientName(recipientName: JsonField) = apply { - this.recipientName = recipientName - } + fun status(status: JsonField) = apply { this.status = status } /** - * A constant representing the object's type. For this resource it will always be `lockbox`. + * A constant representing the object's type. For this resource it will always be + * `lockbox_address`. */ fun type(type: Type) = type(JsonField.of(type)) @@ -434,35 +344,31 @@ private constructor( } /** - * Returns an immutable instance of [Lockbox]. + * Returns an immutable instance of [LockboxAddress]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .id() - * .accountId() * .address() - * .checkDepositBehavior() * .createdAt() * .description() * .idempotencyKey() - * .recipientName() + * .status() * .type() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Lockbox = - Lockbox( + fun build(): LockboxAddress = + LockboxAddress( checkRequired("id", id), - checkRequired("accountId", accountId), checkRequired("address", address), - checkRequired("checkDepositBehavior", checkDepositBehavior), checkRequired("createdAt", createdAt), checkRequired("description", description), checkRequired("idempotencyKey", idempotencyKey), - checkRequired("recipientName", recipientName), + checkRequired("status", status), checkRequired("type", type), additionalProperties.toMutableMap(), ) @@ -470,19 +376,17 @@ private constructor( private var validated: Boolean = false - fun validate(): Lockbox = apply { + fun validate(): LockboxAddress = apply { if (validated) { return@apply } id() - accountId() - address().validate() - checkDepositBehavior().validate() + address().ifPresent { it.validate() } createdAt() description() idempotencyKey() - recipientName() + status().validate() type().validate() validated = true } @@ -503,16 +407,16 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + - (if (accountId.asKnown().isPresent) 1 else 0) + (address.asKnown().getOrNull()?.validity() ?: 0) + - (checkDepositBehavior.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + - (if (recipientName.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) - /** The mailing address for the Lockbox. */ + /** + * The mailing address for the Lockbox Address. It will be present after Increase generates it. + */ class Address @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -520,7 +424,6 @@ private constructor( private val line1: JsonField, private val line2: JsonField, private val postalCode: JsonField, - private val recipient: JsonField, private val state: JsonField, private val additionalProperties: MutableMap, ) { @@ -533,11 +436,8 @@ private constructor( @JsonProperty("postal_code") @ExcludeMissing postalCode: JsonField = JsonMissing.of(), - @JsonProperty("recipient") - @ExcludeMissing - recipient: JsonField = JsonMissing.of(), @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), - ) : this(city, line1, line2, postalCode, recipient, state, mutableMapOf()) + ) : this(city, line1, line2, postalCode, state, mutableMapOf()) /** * The city of the address. @@ -571,16 +471,6 @@ private constructor( */ fun postalCode(): String = postalCode.getRequired("postal_code") - /** - * The recipient line of the address. This will include the recipient name you provide when - * creating the address, as well as an ATTN suffix to help route the mail to your lockbox. - * Mail senders must include this ATTN line to receive mail at this Lockbox. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun recipient(): Optional = recipient.getOptional("recipient") - /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. @@ -620,13 +510,6 @@ private constructor( @ExcludeMissing fun _postalCode(): JsonField = postalCode - /** - * Returns the raw JSON value of [recipient]. - * - * Unlike [recipient], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("recipient") @ExcludeMissing fun _recipient(): JsonField = recipient - /** * Returns the raw JSON value of [state]. * @@ -657,7 +540,6 @@ private constructor( * .line1() * .line2() * .postalCode() - * .recipient() * .state() * ``` */ @@ -671,7 +553,6 @@ private constructor( private var line1: JsonField? = null private var line2: JsonField? = null private var postalCode: JsonField? = null - private var recipient: JsonField? = null private var state: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -681,7 +562,6 @@ private constructor( line1 = address.line1 line2 = address.line2 postalCode = address.postalCode - recipient = address.recipient state = address.state additionalProperties = address.additionalProperties.toMutableMap() } @@ -734,25 +614,6 @@ private constructor( */ fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - /** - * The recipient line of the address. This will include the recipient name you provide - * when creating the address, as well as an ATTN suffix to help route the mail to your - * lockbox. Mail senders must include this ATTN line to receive mail at this Lockbox. - */ - fun recipient(recipient: String?) = recipient(JsonField.ofNullable(recipient)) - - /** Alias for calling [Builder.recipient] with `recipient.orElse(null)`. */ - fun recipient(recipient: Optional) = recipient(recipient.getOrNull()) - - /** - * Sets [Builder.recipient] to an arbitrary JSON value. - * - * You should usually call [Builder.recipient] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun recipient(recipient: JsonField) = apply { this.recipient = recipient } - /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. @@ -798,7 +659,6 @@ private constructor( * .line1() * .line2() * .postalCode() - * .recipient() * .state() * ``` * @@ -810,7 +670,6 @@ private constructor( checkRequired("line1", line1), checkRequired("line2", line2), checkRequired("postalCode", postalCode), - checkRequired("recipient", recipient), checkRequired("state", state), additionalProperties.toMutableMap(), ) @@ -827,7 +686,6 @@ private constructor( line1() line2() postalCode() - recipient() state() validated = true } @@ -852,7 +710,6 @@ private constructor( (if (line1.asKnown().isPresent) 1 else 0) + (if (line2.asKnown().isPresent) 1 else 0) + (if (postalCode.asKnown().isPresent) 1 else 0) + - (if (recipient.asKnown().isPresent) 1 else 0) + (if (state.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -865,25 +722,22 @@ private constructor( line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && - recipient == other.recipient && state == other.state && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(city, line1, line2, postalCode, recipient, state, additionalProperties) + Objects.hash(city, line1, line2, postalCode, state, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Address{city=$city, line1=$line1, line2=$line2, postalCode=$postalCode, recipient=$recipient, state=$state, additionalProperties=$additionalProperties}" + "Address{city=$city, line1=$line1, line2=$line2, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" } - /** Indicates if checks mailed to this lockbox will be deposited. */ - class CheckDepositBehavior - @JsonCreator - private constructor(private val value: JsonField) : Enum { + /** The status of the Lockbox Address. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -897,49 +751,52 @@ private constructor( companion object { - /** Checks mailed to this Lockbox will be deposited. */ - @JvmField val ENABLED = of("enabled") + /** Increase is generating this Lockbox Address. */ + @JvmField val PENDING = of("pending") + + /** This Lockbox Address is active. */ + @JvmField val ACTIVE = of("active") - /** Checks mailed to this Lockbox will not be deposited. */ + /** This Lockbox Address is disabled. */ @JvmField val DISABLED = of("disabled") - /** Checks mailed to this Lockbox will be pending until actioned. */ - @JvmField val PEND_FOR_PROCESSING = of("pend_for_processing") + /** This Lockbox Address is permanently disabled. */ + @JvmField val CANCELED = of("canceled") - @JvmStatic fun of(value: String) = CheckDepositBehavior(JsonField.of(value)) + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } - /** An enum containing [CheckDepositBehavior]'s known values. */ + /** An enum containing [Status]'s known values. */ enum class Known { - /** Checks mailed to this Lockbox will be deposited. */ - ENABLED, - /** Checks mailed to this Lockbox will not be deposited. */ + /** Increase is generating this Lockbox Address. */ + PENDING, + /** This Lockbox Address is active. */ + ACTIVE, + /** This Lockbox Address is disabled. */ DISABLED, - /** Checks mailed to this Lockbox will be pending until actioned. */ - PEND_FOR_PROCESSING, + /** This Lockbox Address is permanently disabled. */ + CANCELED, } /** - * An enum containing [CheckDepositBehavior]'s known values, as well as an [_UNKNOWN] - * member. + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [CheckDepositBehavior] can contain an unknown value in a couple of cases: + * 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 { - /** Checks mailed to this Lockbox will be deposited. */ - ENABLED, - /** Checks mailed to this Lockbox will not be deposited. */ + /** Increase is generating this Lockbox Address. */ + PENDING, + /** This Lockbox Address is active. */ + ACTIVE, + /** This Lockbox Address is disabled. */ DISABLED, - /** Checks mailed to this Lockbox will be pending until actioned. */ - PEND_FOR_PROCESSING, - /** - * An enum member indicating that [CheckDepositBehavior] was instantiated with an - * unknown value. - */ + /** This Lockbox Address is permanently disabled. */ + CANCELED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } @@ -952,9 +809,10 @@ private constructor( */ fun value(): Value = when (this) { - ENABLED -> Value.ENABLED + PENDING -> Value.PENDING + ACTIVE -> Value.ACTIVE DISABLED -> Value.DISABLED - PEND_FOR_PROCESSING -> Value.PEND_FOR_PROCESSING + CANCELED -> Value.CANCELED else -> Value._UNKNOWN } @@ -969,10 +827,11 @@ private constructor( */ fun known(): Known = when (this) { - ENABLED -> Known.ENABLED + PENDING -> Known.PENDING + ACTIVE -> Known.ACTIVE DISABLED -> Known.DISABLED - PEND_FOR_PROCESSING -> Known.PEND_FOR_PROCESSING - else -> throw IncreaseInvalidDataException("Unknown CheckDepositBehavior: $value") + CANCELED -> Known.CANCELED + else -> throw IncreaseInvalidDataException("Unknown Status: $value") } /** @@ -991,7 +850,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CheckDepositBehavior = apply { + fun validate(): Status = apply { if (validated) { return@apply } @@ -1021,7 +880,7 @@ private constructor( return true } - return other is CheckDepositBehavior && value == other.value + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -1029,7 +888,10 @@ private constructor( override fun toString() = value.toString() } - /** A constant representing the object's type. For this resource it will always be `lockbox`. */ + /** + * A constant representing the object's type. For this resource it will always be + * `lockbox_address`. + */ class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -1044,14 +906,14 @@ private constructor( companion object { - @JvmField val LOCKBOX = of("lockbox") + @JvmField val LOCKBOX_ADDRESS = of("lockbox_address") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } /** An enum containing [Type]'s known values. */ enum class Known { - LOCKBOX + LOCKBOX_ADDRESS } /** @@ -1064,7 +926,7 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - LOCKBOX, + LOCKBOX_ADDRESS, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1078,7 +940,7 @@ private constructor( */ fun value(): Value = when (this) { - LOCKBOX -> Value.LOCKBOX + LOCKBOX_ADDRESS -> Value.LOCKBOX_ADDRESS else -> Value._UNKNOWN } @@ -1093,7 +955,7 @@ private constructor( */ fun known(): Known = when (this) { - LOCKBOX -> Known.LOCKBOX + LOCKBOX_ADDRESS -> Known.LOCKBOX_ADDRESS else -> throw IncreaseInvalidDataException("Unknown Type: $value") } @@ -1156,15 +1018,13 @@ private constructor( return true } - return other is Lockbox && + return other is LockboxAddress && id == other.id && - accountId == other.accountId && address == other.address && - checkDepositBehavior == other.checkDepositBehavior && createdAt == other.createdAt && description == other.description && idempotencyKey == other.idempotencyKey && - recipientName == other.recipientName && + status == other.status && type == other.type && additionalProperties == other.additionalProperties } @@ -1172,13 +1032,11 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( id, - accountId, address, - checkDepositBehavior, createdAt, description, idempotencyKey, - recipientName, + status, type, additionalProperties, ) @@ -1187,5 +1045,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Lockbox{id=$id, accountId=$accountId, address=$address, checkDepositBehavior=$checkDepositBehavior, createdAt=$createdAt, description=$description, idempotencyKey=$idempotencyKey, recipientName=$recipientName, type=$type, additionalProperties=$additionalProperties}" + "LockboxAddress{id=$id, address=$address, createdAt=$createdAt, description=$description, idempotencyKey=$idempotencyKey, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParams.kt new file mode 100644 index 000000000..57755d8e0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParams.kt @@ -0,0 +1,397 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +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.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 + +/** Create a Lockbox Address */ +class LockboxAddressCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The description you choose for the Lockbox Address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun description(): Optional = body.description() + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _description(): JsonField = body._description() + + 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 { + + @JvmStatic fun none(): LockboxAddressCreateParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [LockboxAddressCreateParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxAddressCreateParams]. */ + 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(lockboxAddressCreateParams: LockboxAddressCreateParams) = apply { + body = lockboxAddressCreateParams.body.toBuilder() + additionalHeaders = lockboxAddressCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxAddressCreateParams.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: + * - [description] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The description you choose for the Lockbox Address. */ + fun description(description: String) = apply { body.description(description) } + + /** + * 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 { body.description(description) } + + 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 [LockboxAddressCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LockboxAddressCreateParams = + LockboxAddressCreateParams( + 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 description: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of() + ) : this(description, mutableMapOf()) + + /** + * The description you choose for the Lockbox Address. + * + * @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 [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var description: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + description = body.description + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The description you choose for the Lockbox Address. */ + fun description(description: String) = description(JsonField.of(description)) + + /** + * 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = Body(description, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = 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 Body && + description == other.description && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(description, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{description=$description, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LockboxAddressCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LockboxAddressCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPage.kt similarity index 50% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPage.kt index ade6e2650..4bd6ed350 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPage.kt @@ -1,64 +1,65 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.increase.api.core.AutoPager import com.increase.api.core.Page import com.increase.api.core.checkRequired -import com.increase.api.services.blocking.LockboxService +import com.increase.api.services.blocking.LockboxAddressService import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** @see LockboxService.list */ -class LockboxListPage +/** @see LockboxAddressService.list */ +class LockboxAddressListPage private constructor( - private val service: LockboxService, - private val params: LockboxListParams, - private val response: LockboxListPageResponse, -) : Page { + private val service: LockboxAddressService, + private val params: LockboxAddressListParams, + private val response: LockboxAddressListPageResponse, +) : Page { /** - * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * Delegates to [LockboxAddressListPageResponse], but gracefully handles missing data. * - * @see LockboxListPageResponse.data + * @see LockboxAddressListPageResponse.data */ - fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() /** - * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * Delegates to [LockboxAddressListPageResponse], but gracefully handles missing data. * - * @see LockboxListPageResponse.nextCursor + * @see LockboxAddressListPageResponse.nextCursor */ fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") - override fun items(): List = data() + override fun items(): List = data() override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent - fun nextPageParams(): LockboxListParams { + fun nextPageParams(): LockboxAddressListParams { val nextCursor = nextCursor().getOrNull() ?: throw IllegalStateException("Cannot construct next page params") return params.toBuilder().cursor(nextCursor).build() } - override fun nextPage(): LockboxListPage = service.list(nextPageParams()) + override fun nextPage(): LockboxAddressListPage = service.list(nextPageParams()) - fun autoPager(): AutoPager = AutoPager.from(this) + fun autoPager(): AutoPager = AutoPager.from(this) /** The parameters that were used to request this page. */ - fun params(): LockboxListParams = params + fun params(): LockboxAddressListParams = params /** The response that this page was parsed from. */ - fun response(): LockboxListPageResponse = response + fun response(): LockboxAddressListPageResponse = response fun toBuilder() = Builder().from(this) companion object { /** - * Returns a mutable builder for constructing an instance of [LockboxListPage]. + * Returns a mutable builder for constructing an instance of [LockboxAddressListPage]. * * The following fields are required: * ```java @@ -70,30 +71,30 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxListPage]. */ + /** A builder for [LockboxAddressListPage]. */ class Builder internal constructor() { - private var service: LockboxService? = null - private var params: LockboxListParams? = null - private var response: LockboxListPageResponse? = null + private var service: LockboxAddressService? = null + private var params: LockboxAddressListParams? = null + private var response: LockboxAddressListPageResponse? = null @JvmSynthetic - internal fun from(lockboxListPage: LockboxListPage) = apply { - service = lockboxListPage.service - params = lockboxListPage.params - response = lockboxListPage.response + internal fun from(lockboxAddressListPage: LockboxAddressListPage) = apply { + service = lockboxAddressListPage.service + params = lockboxAddressListPage.params + response = lockboxAddressListPage.response } - fun service(service: LockboxService) = apply { this.service = service } + fun service(service: LockboxAddressService) = apply { this.service = service } /** The parameters that were used to request this page. */ - fun params(params: LockboxListParams) = apply { this.params = params } + fun params(params: LockboxAddressListParams) = apply { this.params = params } /** The response that this page was parsed from. */ - fun response(response: LockboxListPageResponse) = apply { this.response = response } + fun response(response: LockboxAddressListPageResponse) = apply { this.response = response } /** - * Returns an immutable instance of [LockboxListPage]. + * Returns an immutable instance of [LockboxAddressListPage]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -106,8 +107,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): LockboxListPage = - LockboxListPage( + fun build(): LockboxAddressListPage = + LockboxAddressListPage( checkRequired("service", service), checkRequired("params", params), checkRequired("response", response), @@ -119,7 +120,7 @@ private constructor( return true } - return other is LockboxListPage && + return other is LockboxAddressListPage && service == other.service && params == other.params && response == other.response @@ -128,5 +129,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(service, params, response) override fun toString() = - "LockboxListPage{service=$service, params=$params, response=$response}" + "LockboxAddressListPage{service=$service, params=$params, response=$response}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageAsync.kt similarity index 54% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageAsync.kt index 10e81908f..128524907 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageAsync.kt @@ -1,68 +1,70 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.increase.api.core.AutoPagerAsync import com.increase.api.core.PageAsync import com.increase.api.core.checkRequired -import com.increase.api.services.async.LockboxServiceAsync +import com.increase.api.services.async.LockboxAddressServiceAsync import java.util.Objects import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import kotlin.jvm.optionals.getOrNull -/** @see LockboxServiceAsync.list */ -class LockboxListPageAsync +/** @see LockboxAddressServiceAsync.list */ +class LockboxAddressListPageAsync private constructor( - private val service: LockboxServiceAsync, + private val service: LockboxAddressServiceAsync, private val streamHandlerExecutor: Executor, - private val params: LockboxListParams, - private val response: LockboxListPageResponse, -) : PageAsync { + private val params: LockboxAddressListParams, + private val response: LockboxAddressListPageResponse, +) : PageAsync { /** - * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * Delegates to [LockboxAddressListPageResponse], but gracefully handles missing data. * - * @see LockboxListPageResponse.data + * @see LockboxAddressListPageResponse.data */ - fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() /** - * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * Delegates to [LockboxAddressListPageResponse], but gracefully handles missing data. * - * @see LockboxListPageResponse.nextCursor + * @see LockboxAddressListPageResponse.nextCursor */ fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") - override fun items(): List = data() + override fun items(): List = data() override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent - fun nextPageParams(): LockboxListParams { + fun nextPageParams(): LockboxAddressListParams { val nextCursor = nextCursor().getOrNull() ?: throw IllegalStateException("Cannot construct next page params") return params.toBuilder().cursor(nextCursor).build() } - override fun nextPage(): CompletableFuture = + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) - fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) /** The parameters that were used to request this page. */ - fun params(): LockboxListParams = params + fun params(): LockboxAddressListParams = params /** The response that this page was parsed from. */ - fun response(): LockboxListPageResponse = response + fun response(): LockboxAddressListPageResponse = response fun toBuilder() = Builder().from(this) companion object { /** - * Returns a mutable builder for constructing an instance of [LockboxListPageAsync]. + * Returns a mutable builder for constructing an instance of [LockboxAddressListPageAsync]. * * The following fields are required: * ```java @@ -75,36 +77,36 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxListPageAsync]. */ + /** A builder for [LockboxAddressListPageAsync]. */ class Builder internal constructor() { - private var service: LockboxServiceAsync? = null + private var service: LockboxAddressServiceAsync? = null private var streamHandlerExecutor: Executor? = null - private var params: LockboxListParams? = null - private var response: LockboxListPageResponse? = null + private var params: LockboxAddressListParams? = null + private var response: LockboxAddressListPageResponse? = null @JvmSynthetic - internal fun from(lockboxListPageAsync: LockboxListPageAsync) = apply { - service = lockboxListPageAsync.service - streamHandlerExecutor = lockboxListPageAsync.streamHandlerExecutor - params = lockboxListPageAsync.params - response = lockboxListPageAsync.response + internal fun from(lockboxAddressListPageAsync: LockboxAddressListPageAsync) = apply { + service = lockboxAddressListPageAsync.service + streamHandlerExecutor = lockboxAddressListPageAsync.streamHandlerExecutor + params = lockboxAddressListPageAsync.params + response = lockboxAddressListPageAsync.response } - fun service(service: LockboxServiceAsync) = apply { this.service = service } + fun service(service: LockboxAddressServiceAsync) = apply { this.service = service } fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { this.streamHandlerExecutor = streamHandlerExecutor } /** The parameters that were used to request this page. */ - fun params(params: LockboxListParams) = apply { this.params = params } + fun params(params: LockboxAddressListParams) = apply { this.params = params } /** The response that this page was parsed from. */ - fun response(response: LockboxListPageResponse) = apply { this.response = response } + fun response(response: LockboxAddressListPageResponse) = apply { this.response = response } /** - * Returns an immutable instance of [LockboxListPageAsync]. + * Returns an immutable instance of [LockboxAddressListPageAsync]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -118,8 +120,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): LockboxListPageAsync = - LockboxListPageAsync( + fun build(): LockboxAddressListPageAsync = + LockboxAddressListPageAsync( checkRequired("service", service), checkRequired("streamHandlerExecutor", streamHandlerExecutor), checkRequired("params", params), @@ -132,7 +134,7 @@ private constructor( return true } - return other is LockboxListPageAsync && + return other is LockboxAddressListPageAsync && service == other.service && streamHandlerExecutor == other.streamHandlerExecutor && params == other.params && @@ -142,5 +144,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) override fun toString() = - "LockboxListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" + "LockboxAddressListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponse.kt similarity index 79% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponse.kt index 004059007..81ef53142 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter @@ -19,18 +19,20 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** A list of Lockbox objects. */ -class LockboxListPageResponse +/** A list of Lockbox Address objects. */ +class LockboxAddressListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val data: JsonField>, + private val data: JsonField>, private val nextCursor: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), @JsonProperty("next_cursor") @ExcludeMissing nextCursor: JsonField = JsonMissing.of(), @@ -42,7 +44,7 @@ private constructor( * @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") + fun data(): List = data.getRequired("data") /** * A pointer to a place in the list. Pass this as the `cursor` parameter to retrieve the next @@ -58,7 +60,7 @@ private constructor( * * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data /** * Returns the raw JSON value of [nextCursor]. @@ -82,7 +84,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [LockboxListPageResponse]. + * Returns a mutable builder for constructing an instance of + * [LockboxAddressListPageResponse]. * * The following fields are required: * ```java @@ -93,40 +96,41 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxListPageResponse]. */ + /** A builder for [LockboxAddressListPageResponse]. */ class Builder internal constructor() { - private var data: JsonField>? = null + private var data: JsonField>? = null private var nextCursor: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(lockboxListPageResponse: LockboxListPageResponse) = apply { - data = lockboxListPageResponse.data.map { it.toMutableList() } - nextCursor = lockboxListPageResponse.nextCursor - additionalProperties = lockboxListPageResponse.additionalProperties.toMutableMap() + internal fun from(lockboxAddressListPageResponse: LockboxAddressListPageResponse) = apply { + data = lockboxAddressListPageResponse.data.map { it.toMutableList() } + nextCursor = lockboxAddressListPageResponse.nextCursor + additionalProperties = + lockboxAddressListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ - fun data(data: List) = data(JsonField.of(data)) + 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. + * 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 { + fun data(data: JsonField>) = apply { this.data = data.map { it.toMutableList() } } /** - * Adds a single [Lockbox] to [Builder.data]. + * Adds a single [LockboxAddress] to [Builder.data]. * * @throws IllegalStateException if the field was previously set to a non-list. */ - fun addData(data: Lockbox) = apply { + fun addData(data: LockboxAddress) = apply { this.data = (this.data ?: JsonField.of(mutableListOf())).also { checkKnown("data", it).add(data) @@ -171,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [LockboxListPageResponse]. + * Returns an immutable instance of [LockboxAddressListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): LockboxListPageResponse = - LockboxListPageResponse( + fun build(): LockboxAddressListPageResponse = + LockboxAddressListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): LockboxListPageResponse = apply { + fun validate(): LockboxAddressListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +230,7 @@ private constructor( return true } - return other is LockboxListPageResponse && + return other is LockboxAddressListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LockboxListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "LockboxAddressListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParams.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListParams.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParams.kt index 7c0c67caa..d9c5a4ce8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.increase.api.core.Params import com.increase.api.core.http.Headers @@ -11,10 +11,9 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** List Lockboxes */ -class LockboxListParams +/** List Lockbox Addresses */ +class LockboxAddressListParams private constructor( - private val accountId: String?, private val createdAt: CreatedAt?, private val cursor: String?, private val idempotencyKey: String?, @@ -23,9 +22,6 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** Filter Lockboxes to those associated with the provided Account. */ - fun accountId(): Optional = Optional.ofNullable(accountId) - fun createdAt(): Optional = Optional.ofNullable(createdAt) /** Return the page of entries after this one. */ @@ -51,16 +47,15 @@ private constructor( companion object { - @JvmStatic fun none(): LockboxListParams = builder().build() + @JvmStatic fun none(): LockboxAddressListParams = builder().build() - /** Returns a mutable builder for constructing an instance of [LockboxListParams]. */ + /** Returns a mutable builder for constructing an instance of [LockboxAddressListParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxListParams]. */ + /** A builder for [LockboxAddressListParams]. */ class Builder internal constructor() { - private var accountId: String? = null private var createdAt: CreatedAt? = null private var cursor: String? = null private var idempotencyKey: String? = null @@ -69,22 +64,15 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(lockboxListParams: LockboxListParams) = apply { - accountId = lockboxListParams.accountId - createdAt = lockboxListParams.createdAt - cursor = lockboxListParams.cursor - idempotencyKey = lockboxListParams.idempotencyKey - limit = lockboxListParams.limit - additionalHeaders = lockboxListParams.additionalHeaders.toBuilder() - additionalQueryParams = lockboxListParams.additionalQueryParams.toBuilder() + internal fun from(lockboxAddressListParams: LockboxAddressListParams) = apply { + createdAt = lockboxAddressListParams.createdAt + cursor = lockboxAddressListParams.cursor + idempotencyKey = lockboxAddressListParams.idempotencyKey + limit = lockboxAddressListParams.limit + additionalHeaders = lockboxAddressListParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxAddressListParams.additionalQueryParams.toBuilder() } - /** Filter Lockboxes to those associated with the provided 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)`. */ @@ -222,13 +210,12 @@ private constructor( } /** - * Returns an immutable instance of [LockboxListParams]. + * Returns an immutable instance of [LockboxAddressListParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): LockboxListParams = - LockboxListParams( - accountId, + fun build(): LockboxAddressListParams = + LockboxAddressListParams( createdAt, cursor, idempotencyKey, @@ -243,7 +230,6 @@ private constructor( 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)) @@ -459,8 +445,7 @@ private constructor( return true } - return other is LockboxListParams && - accountId == other.accountId && + return other is LockboxAddressListParams && createdAt == other.createdAt && cursor == other.cursor && idempotencyKey == other.idempotencyKey && @@ -471,7 +456,6 @@ private constructor( override fun hashCode(): Int = Objects.hash( - accountId, createdAt, cursor, idempotencyKey, @@ -481,5 +465,5 @@ private constructor( ) override fun toString() = - "LockboxListParams{accountId=$accountId, createdAt=$createdAt, cursor=$cursor, idempotencyKey=$idempotencyKey, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LockboxAddressListParams{createdAt=$createdAt, cursor=$cursor, idempotencyKey=$idempotencyKey, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParams.kt similarity index 73% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxRetrieveParams.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParams.kt index 133aeaecd..06f391afe 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxRetrieveParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.increase.api.core.Params import com.increase.api.core.http.Headers @@ -9,16 +9,16 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Retrieve a Lockbox */ -class LockboxRetrieveParams +/** Retrieve a Lockbox Address */ +class LockboxAddressRetrieveParams private constructor( - private val lockboxId: String?, + private val lockboxAddressId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - /** The identifier of the Lockbox to retrieve. */ - fun lockboxId(): Optional = Optional.ofNullable(lockboxId) + /** The identifier of the Lockbox Address to retrieve. */ + fun lockboxAddressId(): Optional = Optional.ofNullable(lockboxAddressId) /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -30,31 +30,36 @@ private constructor( companion object { - @JvmStatic fun none(): LockboxRetrieveParams = builder().build() + @JvmStatic fun none(): LockboxAddressRetrieveParams = builder().build() - /** Returns a mutable builder for constructing an instance of [LockboxRetrieveParams]. */ + /** + * Returns a mutable builder for constructing an instance of [LockboxAddressRetrieveParams]. + */ @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxRetrieveParams]. */ + /** A builder for [LockboxAddressRetrieveParams]. */ class Builder internal constructor() { - private var lockboxId: String? = null + private var lockboxAddressId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(lockboxRetrieveParams: LockboxRetrieveParams) = apply { - lockboxId = lockboxRetrieveParams.lockboxId - additionalHeaders = lockboxRetrieveParams.additionalHeaders.toBuilder() - additionalQueryParams = lockboxRetrieveParams.additionalQueryParams.toBuilder() + internal fun from(lockboxAddressRetrieveParams: LockboxAddressRetrieveParams) = apply { + lockboxAddressId = lockboxAddressRetrieveParams.lockboxAddressId + additionalHeaders = lockboxAddressRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxAddressRetrieveParams.additionalQueryParams.toBuilder() } - /** The identifier of the Lockbox to retrieve. */ - fun lockboxId(lockboxId: String?) = apply { this.lockboxId = lockboxId } + /** The identifier of the Lockbox Address to retrieve. */ + fun lockboxAddressId(lockboxAddressId: String?) = apply { + this.lockboxAddressId = lockboxAddressId + } - /** Alias for calling [Builder.lockboxId] with `lockboxId.orElse(null)`. */ - fun lockboxId(lockboxId: Optional) = lockboxId(lockboxId.getOrNull()) + /** Alias for calling [Builder.lockboxAddressId] with `lockboxAddressId.orElse(null)`. */ + fun lockboxAddressId(lockboxAddressId: Optional) = + lockboxAddressId(lockboxAddressId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -155,13 +160,13 @@ private constructor( } /** - * Returns an immutable instance of [LockboxRetrieveParams]. + * Returns an immutable instance of [LockboxAddressRetrieveParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): LockboxRetrieveParams = - LockboxRetrieveParams( - lockboxId, + fun build(): LockboxAddressRetrieveParams = + LockboxAddressRetrieveParams( + lockboxAddressId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -169,7 +174,7 @@ private constructor( fun _pathParam(index: Int): String = when (index) { - 0 -> lockboxId ?: "" + 0 -> lockboxAddressId ?: "" else -> "" } @@ -182,14 +187,15 @@ private constructor( return true } - return other is LockboxRetrieveParams && - lockboxId == other.lockboxId && + return other is LockboxAddressRetrieveParams && + lockboxAddressId == other.lockboxAddressId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = Objects.hash(lockboxId, additionalHeaders, additionalQueryParams) + override fun hashCode(): Int = + Objects.hash(lockboxAddressId, additionalHeaders, additionalQueryParams) override fun toString() = - "LockboxRetrieveParams{lockboxId=$lockboxId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LockboxAddressRetrieveParams{lockboxAddressId=$lockboxAddressId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParams.kt new file mode 100644 index 000000000..4c6fcf2e8 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParams.kt @@ -0,0 +1,631 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +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.Params +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 + +/** Update a Lockbox Address */ +class LockboxAddressUpdateParams +private constructor( + private val lockboxAddressId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the Lockbox Address. */ + fun lockboxAddressId(): Optional = Optional.ofNullable(lockboxAddressId) + + /** + * The description you choose for the Lockbox Address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun description(): Optional = body.description() + + /** + * The status of the Lockbox Address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun status(): Optional = body.status() + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _description(): JsonField = body._description() + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + + 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 { + + @JvmStatic fun none(): LockboxAddressUpdateParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [LockboxAddressUpdateParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxAddressUpdateParams]. */ + class Builder internal constructor() { + + private var lockboxAddressId: String? = null + 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(lockboxAddressUpdateParams: LockboxAddressUpdateParams) = apply { + lockboxAddressId = lockboxAddressUpdateParams.lockboxAddressId + body = lockboxAddressUpdateParams.body.toBuilder() + additionalHeaders = lockboxAddressUpdateParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxAddressUpdateParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the Lockbox Address. */ + fun lockboxAddressId(lockboxAddressId: String?) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** Alias for calling [Builder.lockboxAddressId] with `lockboxAddressId.orElse(null)`. */ + fun lockboxAddressId(lockboxAddressId: Optional) = + lockboxAddressId(lockboxAddressId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [description] + * - [status] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The description you choose for the Lockbox Address. */ + fun description(description: String) = apply { body.description(description) } + + /** + * 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 { body.description(description) } + + /** The status of the Lockbox Address. */ + fun status(status: Status) = apply { body.status(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 { body.status(status) } + + 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 [LockboxAddressUpdateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LockboxAddressUpdateParams = + LockboxAddressUpdateParams( + lockboxAddressId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> lockboxAddressId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val description: JsonField, + private val status: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + ) : this(description, status, mutableMapOf()) + + /** + * The description you choose for the Lockbox Address. + * + * @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") + + /** + * The status of the Lockbox Address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + + /** + * 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 + + /** + * 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 + + @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]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var description: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + description = body.description + status = body.status + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The description you choose for the Lockbox Address. */ + fun description(description: String) = description(JsonField.of(description)) + + /** + * 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 + } + + /** The status of the Lockbox Address. */ + 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 } + + 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. + */ + fun build(): Body = Body(description, status, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + description() + status().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 (description.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + description == other.description && + status == other.status && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(description, status, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{description=$description, status=$status, additionalProperties=$additionalProperties}" + } + + /** The status of the Lockbox Address. */ + 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 { + + /** This Lockbox Address is active. */ + @JvmField val ACTIVE = of("active") + + /** This Lockbox Address is disabled. */ + @JvmField val DISABLED = of("disabled") + + /** This Lockbox Address is permanently disabled. */ + @JvmField val CANCELED = of("canceled") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** This Lockbox Address is active. */ + ACTIVE, + /** This Lockbox Address is disabled. */ + DISABLED, + /** This Lockbox Address is permanently disabled. */ + CANCELED, + } + + /** + * 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 { + /** This Lockbox Address is active. */ + ACTIVE, + /** This Lockbox Address is disabled. */ + DISABLED, + /** This Lockbox Address is permanently disabled. */ + CANCELED, + /** 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) { + ACTIVE -> Value.ACTIVE + DISABLED -> Value.DISABLED + CANCELED -> Value.CANCELED + 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) { + ACTIVE -> Known.ACTIVE + DISABLED -> Known.DISABLED + CANCELED -> Known.CANCELED + 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() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LockboxAddressUpdateParams && + lockboxAddressId == other.lockboxAddressId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(lockboxAddressId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LockboxAddressUpdateParams{lockboxAddressId=$lockboxAddressId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipient.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipient.kt new file mode 100644 index 000000000..6fa4273aa --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipient.kt @@ -0,0 +1,900 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 + +/** + * Lockbox Recipients represent an inbox at a Lockbox Address. Checks received for a Lockbox + * Recipient are deposited into its associated Account. + */ +class LockboxRecipient +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val accountId: JsonField, + private val createdAt: JsonField, + private val description: JsonField, + private val idempotencyKey: JsonField, + private val lockboxAddressId: JsonField, + private val mailStopCode: JsonField, + private val recipientName: JsonField, + private val status: JsonField, + private val type: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("idempotency_key") + @ExcludeMissing + idempotencyKey: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_address_id") + @ExcludeMissing + lockboxAddressId: JsonField = JsonMissing.of(), + @JsonProperty("mail_stop_code") + @ExcludeMissing + mailStopCode: JsonField = JsonMissing.of(), + @JsonProperty("recipient_name") + @ExcludeMissing + recipientName: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + ) : this( + id, + accountId, + createdAt, + description, + idempotencyKey, + lockboxAddressId, + mailStopCode, + recipientName, + status, + type, + mutableMapOf(), + ) + + /** + * The Lockbox Recipient 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 identifier for the Account that checks sent to this Lockbox Recipient will be deposited + * into. + * + * @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 [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox Recipient + * 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 description of the Lockbox Recipient. + * + * @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") + + /** + * 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 identifier for the Lockbox Address where this Lockbox Recipient may receive physical + * mail. + * + * @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 lockboxAddressId(): String = lockboxAddressId.getRequired("lockbox_address_id") + + /** + * The mail stop code uniquely identifying this Lockbox Recipient at its Lockbox Address. It + * should be included in the mailing address intended for this Lockbox Recipient. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun mailStopCode(): String = mailStopCode.getRequired("mail_stop_code") + + /** + * The name of the Lockbox Recipient. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun recipientName(): Optional = recipientName.getOptional("recipient_name") + + /** + * The status of the Lockbox Recipient. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + + /** + * A constant representing the object's type. For this resource it will always be + * `lockbox_recipient`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun type(): Type = type.getRequired("type") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [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 [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 [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + + /** + * 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 [lockboxAddressId]. + * + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("lockbox_address_id") + @ExcludeMissing + fun _lockboxAddressId(): JsonField = lockboxAddressId + + /** + * Returns the raw JSON value of [mailStopCode]. + * + * Unlike [mailStopCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("mail_stop_code") + @ExcludeMissing + fun _mailStopCode(): JsonField = mailStopCode + + /** + * Returns the raw JSON value of [recipientName]. + * + * Unlike [recipientName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("recipient_name") + @ExcludeMissing + fun _recipientName(): JsonField = recipientName + + /** + * Returns the raw JSON value of [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 [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LockboxRecipient]. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .createdAt() + * .description() + * .idempotencyKey() + * .lockboxAddressId() + * .mailStopCode() + * .recipientName() + * .status() + * .type() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipient]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var accountId: JsonField? = null + private var createdAt: JsonField? = null + private var description: JsonField? = null + private var idempotencyKey: JsonField? = null + private var lockboxAddressId: JsonField? = null + private var mailStopCode: JsonField? = null + private var recipientName: JsonField? = null + private var status: JsonField? = null + private var type: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(lockboxRecipient: LockboxRecipient) = apply { + id = lockboxRecipient.id + accountId = lockboxRecipient.accountId + createdAt = lockboxRecipient.createdAt + description = lockboxRecipient.description + idempotencyKey = lockboxRecipient.idempotencyKey + lockboxAddressId = lockboxRecipient.lockboxAddressId + mailStopCode = lockboxRecipient.mailStopCode + recipientName = lockboxRecipient.recipientName + status = lockboxRecipient.status + type = lockboxRecipient.type + additionalProperties = lockboxRecipient.additionalProperties.toMutableMap() + } + + /** The Lockbox Recipient 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 identifier for the Account that checks sent to this Lockbox Recipient will be + * deposited into. + */ + 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 [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox + * Recipient 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 description of the Lockbox Recipient. */ + 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 } + + /** + * 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 identifier for the Lockbox Address where this Lockbox Recipient may receive physical + * mail. + */ + fun lockboxAddressId(lockboxAddressId: String) = + lockboxAddressId(JsonField.of(lockboxAddressId)) + + /** + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** + * The mail stop code uniquely identifying this Lockbox Recipient at its Lockbox Address. It + * should be included in the mailing address intended for this Lockbox Recipient. + */ + fun mailStopCode(mailStopCode: String) = mailStopCode(JsonField.of(mailStopCode)) + + /** + * Sets [Builder.mailStopCode] to an arbitrary JSON value. + * + * You should usually call [Builder.mailStopCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun mailStopCode(mailStopCode: JsonField) = apply { + this.mailStopCode = mailStopCode + } + + /** The name of the Lockbox Recipient. */ + fun recipientName(recipientName: String?) = + recipientName(JsonField.ofNullable(recipientName)) + + /** Alias for calling [Builder.recipientName] with `recipientName.orElse(null)`. */ + fun recipientName(recipientName: Optional) = + recipientName(recipientName.getOrNull()) + + /** + * Sets [Builder.recipientName] to an arbitrary JSON value. + * + * You should usually call [Builder.recipientName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun recipientName(recipientName: JsonField) = apply { + this.recipientName = recipientName + } + + /** The status of the Lockbox Recipient. */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * 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 } + + /** + * A constant representing the object's type. For this resource it will always be + * `lockbox_recipient`. + */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LockboxRecipient]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .createdAt() + * .description() + * .idempotencyKey() + * .lockboxAddressId() + * .mailStopCode() + * .recipientName() + * .status() + * .type() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LockboxRecipient = + LockboxRecipient( + checkRequired("id", id), + checkRequired("accountId", accountId), + checkRequired("createdAt", createdAt), + checkRequired("description", description), + checkRequired("idempotencyKey", idempotencyKey), + checkRequired("lockboxAddressId", lockboxAddressId), + checkRequired("mailStopCode", mailStopCode), + checkRequired("recipientName", recipientName), + checkRequired("status", status), + checkRequired("type", type), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LockboxRecipient = apply { + if (validated) { + return@apply + } + + id() + accountId() + createdAt() + description() + idempotencyKey() + lockboxAddressId() + mailStopCode() + recipientName() + status().ifPresent { it.validate() } + type().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (accountId.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + + (if (lockboxAddressId.asKnown().isPresent) 1 else 0) + + (if (mailStopCode.asKnown().isPresent) 1 else 0) + + (if (recipientName.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + /** The status of the Lockbox Recipient. */ + 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 { + + /** This Lockbox Recipient is active. */ + @JvmField val ACTIVE = of("active") + + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ + @JvmField val DISABLED = of("disabled") + + /** + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. + */ + @JvmField val CANCELED = of("canceled") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** This Lockbox Recipient is active. */ + ACTIVE, + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ + DISABLED, + /** + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. + */ + CANCELED, + } + + /** + * 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 { + /** This Lockbox Recipient is active. */ + ACTIVE, + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ + DISABLED, + /** + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. + */ + CANCELED, + /** 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) { + ACTIVE -> Value.ACTIVE + DISABLED -> Value.DISABLED + CANCELED -> Value.CANCELED + 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) { + ACTIVE -> Known.ACTIVE + DISABLED -> Known.DISABLED + CANCELED -> Known.CANCELED + 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 + * `lockbox_recipient`. + */ + 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 LOCKBOX_RECIPIENT = of("lockbox_recipient") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + LOCKBOX_RECIPIENT + } + + /** + * 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 { + LOCKBOX_RECIPIENT, + /** 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) { + LOCKBOX_RECIPIENT -> Value.LOCKBOX_RECIPIENT + 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) { + LOCKBOX_RECIPIENT -> Known.LOCKBOX_RECIPIENT + 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 LockboxRecipient && + id == other.id && + accountId == other.accountId && + createdAt == other.createdAt && + description == other.description && + idempotencyKey == other.idempotencyKey && + lockboxAddressId == other.lockboxAddressId && + mailStopCode == other.mailStopCode && + recipientName == other.recipientName && + status == other.status && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + accountId, + createdAt, + description, + idempotencyKey, + lockboxAddressId, + mailStopCode, + recipientName, + status, + type, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LockboxRecipient{id=$id, accountId=$accountId, createdAt=$createdAt, description=$description, idempotencyKey=$idempotencyKey, lockboxAddressId=$lockboxAddressId, mailStopCode=$mailStopCode, recipientName=$recipientName, status=$status, type=$type, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParams.kt similarity index 77% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxCreateParams.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParams.kt index 2a0e540ff..11aadc0ed 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxrecipients import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter @@ -19,8 +19,8 @@ import java.util.Collections import java.util.Objects import java.util.Optional -/** Create a Lockbox */ -class LockboxCreateParams +/** Create a Lockbox Recipient */ +class LockboxRecipientCreateParams private constructor( private val body: Body, private val additionalHeaders: Headers, @@ -28,7 +28,7 @@ private constructor( ) : Params { /** - * The Account checks sent to this Lockbox should be deposited into. + * The Account that checks sent to this Lockbox Recipient should be deposited into. * * @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). @@ -36,7 +36,15 @@ private constructor( fun accountId(): String = body.accountId() /** - * The description you choose for the Lockbox, for display purposes. + * The Lockbox Address where this Lockbox Recipient may receive mail. + * + * @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 lockboxAddressId(): String = body.lockboxAddressId() + + /** + * The description you choose for the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -44,7 +52,7 @@ private constructor( fun description(): Optional = body.description() /** - * The name of the recipient that will receive mail at this location. + * The name of the Lockbox Recipient * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -58,6 +66,14 @@ private constructor( */ fun _accountId(): JsonField = body._accountId() + /** + * Returns the raw JSON value of [lockboxAddressId]. + * + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _lockboxAddressId(): JsonField = body._lockboxAddressId() + /** * Returns the raw JSON value of [description]. * @@ -85,17 +101,18 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [LockboxCreateParams]. + * Returns a mutable builder for constructing an instance of [LockboxRecipientCreateParams]. * * The following fields are required: * ```java * .accountId() + * .lockboxAddressId() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxCreateParams]. */ + /** A builder for [LockboxRecipientCreateParams]. */ class Builder internal constructor() { private var body: Body.Builder = Body.builder() @@ -103,10 +120,10 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(lockboxCreateParams: LockboxCreateParams) = apply { - body = lockboxCreateParams.body.toBuilder() - additionalHeaders = lockboxCreateParams.additionalHeaders.toBuilder() - additionalQueryParams = lockboxCreateParams.additionalQueryParams.toBuilder() + internal fun from(lockboxRecipientCreateParams: LockboxRecipientCreateParams) = apply { + body = lockboxRecipientCreateParams.body.toBuilder() + additionalHeaders = lockboxRecipientCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxRecipientCreateParams.additionalQueryParams.toBuilder() } /** @@ -115,12 +132,13 @@ 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: * - [accountId] + * - [lockboxAddressId] * - [description] * - [recipientName] */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** The Account checks sent to this Lockbox should be deposited into. */ + /** The Account that checks sent to this Lockbox Recipient should be deposited into. */ fun accountId(accountId: String) = apply { body.accountId(accountId) } /** @@ -132,7 +150,23 @@ private constructor( */ fun accountId(accountId: JsonField) = apply { body.accountId(accountId) } - /** The description you choose for the Lockbox, for display purposes. */ + /** The Lockbox Address where this Lockbox Recipient may receive mail. */ + fun lockboxAddressId(lockboxAddressId: String) = apply { + body.lockboxAddressId(lockboxAddressId) + } + + /** + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + body.lockboxAddressId(lockboxAddressId) + } + + /** The description you choose for the Lockbox Recipient. */ fun description(description: String) = apply { body.description(description) } /** @@ -144,7 +178,7 @@ private constructor( */ fun description(description: JsonField) = apply { body.description(description) } - /** The name of the recipient that will receive mail at this location. */ + /** The name of the Lockbox Recipient */ fun recipientName(recipientName: String) = apply { body.recipientName(recipientName) } /** @@ -276,19 +310,20 @@ private constructor( } /** - * Returns an immutable instance of [LockboxCreateParams]. + * Returns an immutable instance of [LockboxRecipientCreateParams]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .accountId() + * .lockboxAddressId() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): LockboxCreateParams = - LockboxCreateParams( + fun build(): LockboxRecipientCreateParams = + LockboxRecipientCreateParams( body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -305,6 +340,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val accountId: JsonField, + private val lockboxAddressId: JsonField, private val description: JsonField, private val recipientName: JsonField, private val additionalProperties: MutableMap, @@ -315,16 +351,19 @@ private constructor( @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_address_id") + @ExcludeMissing + lockboxAddressId: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("recipient_name") @ExcludeMissing recipientName: JsonField = JsonMissing.of(), - ) : this(accountId, description, recipientName, mutableMapOf()) + ) : this(accountId, lockboxAddressId, description, recipientName, mutableMapOf()) /** - * The Account checks sent to this Lockbox should be deposited into. + * The Account that checks sent to this Lockbox Recipient should be deposited into. * * @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). @@ -332,7 +371,15 @@ private constructor( fun accountId(): String = accountId.getRequired("account_id") /** - * The description you choose for the Lockbox, for display purposes. + * The Lockbox Address where this Lockbox Recipient may receive mail. + * + * @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 lockboxAddressId(): String = lockboxAddressId.getRequired("lockbox_address_id") + + /** + * The description you choose for the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -340,7 +387,7 @@ private constructor( fun description(): Optional = description.getOptional("description") /** - * The name of the recipient that will receive mail at this location. + * The name of the Lockbox Recipient * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -354,6 +401,16 @@ private constructor( */ @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + /** + * Returns the raw JSON value of [lockboxAddressId]. + * + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("lockbox_address_id") + @ExcludeMissing + fun _lockboxAddressId(): JsonField = lockboxAddressId + /** * Returns the raw JSON value of [description]. * @@ -393,6 +450,7 @@ private constructor( * The following fields are required: * ```java * .accountId() + * .lockboxAddressId() * ``` */ @JvmStatic fun builder() = Builder() @@ -402,6 +460,7 @@ private constructor( class Builder internal constructor() { private var accountId: JsonField? = null + private var lockboxAddressId: JsonField? = null private var description: JsonField = JsonMissing.of() private var recipientName: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -409,12 +468,13 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { accountId = body.accountId + lockboxAddressId = body.lockboxAddressId description = body.description recipientName = body.recipientName additionalProperties = body.additionalProperties.toMutableMap() } - /** The Account checks sent to this Lockbox should be deposited into. */ + /** The Account that checks sent to this Lockbox Recipient should be deposited into. */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** @@ -426,7 +486,22 @@ private constructor( */ fun accountId(accountId: JsonField) = apply { this.accountId = accountId } - /** The description you choose for the Lockbox, for display purposes. */ + /** The Lockbox Address where this Lockbox Recipient may receive mail. */ + fun lockboxAddressId(lockboxAddressId: String) = + lockboxAddressId(JsonField.of(lockboxAddressId)) + + /** + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** The description you choose for the Lockbox Recipient. */ fun description(description: String) = description(JsonField.of(description)) /** @@ -440,7 +515,7 @@ private constructor( this.description = description } - /** The name of the recipient that will receive mail at this location. */ + /** The name of the Lockbox Recipient */ fun recipientName(recipientName: String) = recipientName(JsonField.of(recipientName)) /** @@ -481,6 +556,7 @@ private constructor( * The following fields are required: * ```java * .accountId() + * .lockboxAddressId() * ``` * * @throws IllegalStateException if any required field is unset. @@ -488,6 +564,7 @@ private constructor( fun build(): Body = Body( checkRequired("accountId", accountId), + checkRequired("lockboxAddressId", lockboxAddressId), description, recipientName, additionalProperties.toMutableMap(), @@ -502,6 +579,7 @@ private constructor( } accountId() + lockboxAddressId() description() recipientName() validated = true @@ -524,6 +602,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (accountId.asKnown().isPresent) 1 else 0) + + (if (lockboxAddressId.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + (if (recipientName.asKnown().isPresent) 1 else 0) @@ -534,19 +613,26 @@ private constructor( return other is Body && accountId == other.accountId && + lockboxAddressId == other.lockboxAddressId && description == other.description && recipientName == other.recipientName && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(accountId, description, recipientName, additionalProperties) + Objects.hash( + accountId, + lockboxAddressId, + description, + recipientName, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{accountId=$accountId, description=$description, recipientName=$recipientName, additionalProperties=$additionalProperties}" + "Body{accountId=$accountId, lockboxAddressId=$lockboxAddressId, description=$description, recipientName=$recipientName, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -554,7 +640,7 @@ private constructor( return true } - return other is LockboxCreateParams && + return other is LockboxRecipientCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -563,5 +649,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = - "LockboxCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LockboxRecipientCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPage.kt new file mode 100644 index 000000000..111c896d5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.LockboxRecipientService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see LockboxRecipientService.list */ +class LockboxRecipientListPage +private constructor( + private val service: LockboxRecipientService, + private val params: LockboxRecipientListParams, + private val response: LockboxRecipientListPageResponse, +) : Page { + + /** + * Delegates to [LockboxRecipientListPageResponse], but gracefully handles missing data. + * + * @see LockboxRecipientListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LockboxRecipientListPageResponse], but gracefully handles missing data. + * + * @see LockboxRecipientListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): LockboxRecipientListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): LockboxRecipientListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): LockboxRecipientListParams = params + + /** The response that this page was parsed from. */ + fun response(): LockboxRecipientListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LockboxRecipientListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipientListPage]. */ + class Builder internal constructor() { + + private var service: LockboxRecipientService? = null + private var params: LockboxRecipientListParams? = null + private var response: LockboxRecipientListPageResponse? = null + + @JvmSynthetic + internal fun from(lockboxRecipientListPage: LockboxRecipientListPage) = apply { + service = lockboxRecipientListPage.service + params = lockboxRecipientListPage.params + response = lockboxRecipientListPage.response + } + + fun service(service: LockboxRecipientService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: LockboxRecipientListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LockboxRecipientListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [LockboxRecipientListPage]. + * + * 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(): LockboxRecipientListPage = + LockboxRecipientListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LockboxRecipientListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "LockboxRecipientListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageAsync.kt new file mode 100644 index 000000000..75b11c449 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.LockboxRecipientServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see LockboxRecipientServiceAsync.list */ +class LockboxRecipientListPageAsync +private constructor( + private val service: LockboxRecipientServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: LockboxRecipientListParams, + private val response: LockboxRecipientListPageResponse, +) : PageAsync { + + /** + * Delegates to [LockboxRecipientListPageResponse], but gracefully handles missing data. + * + * @see LockboxRecipientListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LockboxRecipientListPageResponse], but gracefully handles missing data. + * + * @see LockboxRecipientListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): LockboxRecipientListParams { + 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(): LockboxRecipientListParams = params + + /** The response that this page was parsed from. */ + fun response(): LockboxRecipientListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [LockboxRecipientListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipientListPageAsync]. */ + class Builder internal constructor() { + + private var service: LockboxRecipientServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: LockboxRecipientListParams? = null + private var response: LockboxRecipientListPageResponse? = null + + @JvmSynthetic + internal fun from(lockboxRecipientListPageAsync: LockboxRecipientListPageAsync) = apply { + service = lockboxRecipientListPageAsync.service + streamHandlerExecutor = lockboxRecipientListPageAsync.streamHandlerExecutor + params = lockboxRecipientListPageAsync.params + response = lockboxRecipientListPageAsync.response + } + + fun service(service: LockboxRecipientServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: LockboxRecipientListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LockboxRecipientListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [LockboxRecipientListPageAsync]. + * + * 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(): LockboxRecipientListPageAsync = + LockboxRecipientListPageAsync( + 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 LockboxRecipientListPageAsync && + 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() = + "LockboxRecipientListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponse.kt new file mode 100644 index 000000000..8bfb900b5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponse.kt @@ -0,0 +1,246 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 Lockbox Recipient objects. */ +class LockboxRecipientListPageResponse +@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. Pass this as the `cursor` parameter to retrieve the next + * page of results. If there are no more results, the value will be `null`. + * + * @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 + * [LockboxRecipientListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipientListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(lockboxRecipientListPageResponse: LockboxRecipientListPageResponse) = + apply { + data = lockboxRecipientListPageResponse.data.map { it.toMutableList() } + nextCursor = lockboxRecipientListPageResponse.nextCursor + additionalProperties = + lockboxRecipientListPageResponse.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 [LockboxRecipient] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: LockboxRecipient) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** + * A pointer to a place in the list. Pass this as the `cursor` parameter to retrieve the + * next page of results. If there are no more results, the value will be `null`. + */ + 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 [LockboxRecipientListPageResponse]. + * + * 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(): LockboxRecipientListPageResponse = + LockboxRecipientListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LockboxRecipientListPageResponse = 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 LockboxRecipientListPageResponse && + 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() = + "LockboxRecipientListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParams.kt new file mode 100644 index 000000000..a52d7c2af --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParams.kt @@ -0,0 +1,506 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 Lockbox Recipients */ +class LockboxRecipientListParams +private constructor( + private val accountId: String?, + private val createdAt: CreatedAt?, + private val cursor: String?, + private val idempotencyKey: String?, + private val limit: Long?, + private val lockboxAddressId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Filter Lockbox Recipients to those associated with the provided 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 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) + + /** Filter Lockbox Recipients to those associated with the provided Lockbox Address. */ + fun lockboxAddressId(): Optional = Optional.ofNullable(lockboxAddressId) + + /** 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(): LockboxRecipientListParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [LockboxRecipientListParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipientListParams]. */ + class Builder internal constructor() { + + private var accountId: String? = null + private var createdAt: CreatedAt? = null + private var cursor: String? = null + private var idempotencyKey: String? = null + private var limit: Long? = null + private var lockboxAddressId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(lockboxRecipientListParams: LockboxRecipientListParams) = apply { + accountId = lockboxRecipientListParams.accountId + createdAt = lockboxRecipientListParams.createdAt + cursor = lockboxRecipientListParams.cursor + idempotencyKey = lockboxRecipientListParams.idempotencyKey + limit = lockboxRecipientListParams.limit + lockboxAddressId = lockboxRecipientListParams.lockboxAddressId + additionalHeaders = lockboxRecipientListParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxRecipientListParams.additionalQueryParams.toBuilder() + } + + /** Filter Lockbox Recipients to those associated with the provided 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 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()) + + /** Filter Lockbox Recipients to those associated with the provided Lockbox Address. */ + fun lockboxAddressId(lockboxAddressId: String?) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** Alias for calling [Builder.lockboxAddressId] with `lockboxAddressId.orElse(null)`. */ + fun lockboxAddressId(lockboxAddressId: Optional) = + lockboxAddressId(lockboxAddressId.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 [LockboxRecipientListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LockboxRecipientListParams = + LockboxRecipientListParams( + accountId, + createdAt, + cursor, + idempotencyKey, + limit, + lockboxAddressId, + 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) } + idempotencyKey?.let { put("idempotency_key", it) } + limit?.let { put("limit", it.toString()) } + lockboxAddressId?.let { put("lockbox_address_id", it) } + 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 LockboxRecipientListParams && + accountId == other.accountId && + createdAt == other.createdAt && + cursor == other.cursor && + idempotencyKey == other.idempotencyKey && + limit == other.limit && + lockboxAddressId == other.lockboxAddressId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + createdAt, + cursor, + idempotencyKey, + limit, + lockboxAddressId, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "LockboxRecipientListParams{accountId=$accountId, createdAt=$createdAt, cursor=$cursor, idempotencyKey=$idempotencyKey, limit=$limit, lockboxAddressId=$lockboxAddressId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParams.kt new file mode 100644 index 000000000..f1ef85c83 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParams.kt @@ -0,0 +1,204 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 Lockbox Recipient */ +class LockboxRecipientRetrieveParams +private constructor( + private val lockboxRecipientId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the Lockbox Recipient to retrieve. */ + fun lockboxRecipientId(): Optional = Optional.ofNullable(lockboxRecipientId) + + /** 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(): LockboxRecipientRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [LockboxRecipientRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxRecipientRetrieveParams]. */ + class Builder internal constructor() { + + private var lockboxRecipientId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(lockboxRecipientRetrieveParams: LockboxRecipientRetrieveParams) = apply { + lockboxRecipientId = lockboxRecipientRetrieveParams.lockboxRecipientId + additionalHeaders = lockboxRecipientRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxRecipientRetrieveParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the Lockbox Recipient to retrieve. */ + fun lockboxRecipientId(lockboxRecipientId: String?) = apply { + this.lockboxRecipientId = lockboxRecipientId + } + + /** + * Alias for calling [Builder.lockboxRecipientId] with `lockboxRecipientId.orElse(null)`. + */ + fun lockboxRecipientId(lockboxRecipientId: Optional) = + lockboxRecipientId(lockboxRecipientId.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 [LockboxRecipientRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): LockboxRecipientRetrieveParams = + LockboxRecipientRetrieveParams( + lockboxRecipientId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> lockboxRecipientId ?: "" + 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 LockboxRecipientRetrieveParams && + lockboxRecipientId == other.lockboxRecipientId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(lockboxRecipientId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "LockboxRecipientRetrieveParams{lockboxRecipientId=$lockboxRecipientId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParams.kt similarity index 71% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParams.kt index 2d0f44494..f54de4239 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxrecipients import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter @@ -20,28 +20,20 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Update a Lockbox */ -class LockboxUpdateParams +/** Update a Lockbox Recipient */ +class LockboxRecipientUpdateParams private constructor( - private val lockboxId: String?, + private val lockboxRecipientId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - /** The identifier of the Lockbox. */ - fun lockboxId(): Optional = Optional.ofNullable(lockboxId) + /** The identifier of the Lockbox Recipient. */ + fun lockboxRecipientId(): Optional = Optional.ofNullable(lockboxRecipientId) /** - * This indicates if checks mailed to this lockbox will be deposited. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun checkDepositBehavior(): Optional = body.checkDepositBehavior() - - /** - * The description you choose for the Lockbox. + * The description you choose for the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -49,7 +41,7 @@ private constructor( fun description(): Optional = body.description() /** - * The recipient name you choose for the Lockbox. + * The name of the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -57,12 +49,12 @@ private constructor( fun recipientName(): Optional = body.recipientName() /** - * Returns the raw JSON value of [checkDepositBehavior]. + * The status of the Lockbox Recipient. * - * Unlike [checkDepositBehavior], this method doesn't throw if the JSON field has an unexpected - * type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun _checkDepositBehavior(): JsonField = body._checkDepositBehavior() + fun status(): Optional = body.status() /** * Returns the raw JSON value of [description]. @@ -78,6 +70,13 @@ private constructor( */ fun _recipientName(): JsonField = body._recipientName() + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -90,62 +89,53 @@ private constructor( companion object { - @JvmStatic fun none(): LockboxUpdateParams = builder().build() + @JvmStatic fun none(): LockboxRecipientUpdateParams = builder().build() - /** Returns a mutable builder for constructing an instance of [LockboxUpdateParams]. */ + /** + * Returns a mutable builder for constructing an instance of [LockboxRecipientUpdateParams]. + */ @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxUpdateParams]. */ + /** A builder for [LockboxRecipientUpdateParams]. */ class Builder internal constructor() { - private var lockboxId: String? = null + private var lockboxRecipientId: String? = null 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(lockboxUpdateParams: LockboxUpdateParams) = apply { - lockboxId = lockboxUpdateParams.lockboxId - body = lockboxUpdateParams.body.toBuilder() - additionalHeaders = lockboxUpdateParams.additionalHeaders.toBuilder() - additionalQueryParams = lockboxUpdateParams.additionalQueryParams.toBuilder() + internal fun from(lockboxRecipientUpdateParams: LockboxRecipientUpdateParams) = apply { + lockboxRecipientId = lockboxRecipientUpdateParams.lockboxRecipientId + body = lockboxRecipientUpdateParams.body.toBuilder() + additionalHeaders = lockboxRecipientUpdateParams.additionalHeaders.toBuilder() + additionalQueryParams = lockboxRecipientUpdateParams.additionalQueryParams.toBuilder() } - /** The identifier of the Lockbox. */ - fun lockboxId(lockboxId: String?) = apply { this.lockboxId = lockboxId } + /** The identifier of the Lockbox Recipient. */ + fun lockboxRecipientId(lockboxRecipientId: String?) = apply { + this.lockboxRecipientId = lockboxRecipientId + } - /** Alias for calling [Builder.lockboxId] with `lockboxId.orElse(null)`. */ - fun lockboxId(lockboxId: Optional) = lockboxId(lockboxId.getOrNull()) + /** + * Alias for calling [Builder.lockboxRecipientId] with `lockboxRecipientId.orElse(null)`. + */ + fun lockboxRecipientId(lockboxRecipientId: Optional) = + lockboxRecipientId(lockboxRecipientId.getOrNull()) /** * Sets the entire request body. * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: - * - [checkDepositBehavior] * - [description] * - [recipientName] + * - [status] */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** This indicates if checks mailed to this lockbox will be deposited. */ - fun checkDepositBehavior(checkDepositBehavior: CheckDepositBehavior) = apply { - body.checkDepositBehavior(checkDepositBehavior) - } - - /** - * Sets [Builder.checkDepositBehavior] to an arbitrary JSON value. - * - * You should usually call [Builder.checkDepositBehavior] with a well-typed - * [CheckDepositBehavior] value instead. This method is primarily for setting the field to - * an undocumented or not yet supported value. - */ - fun checkDepositBehavior(checkDepositBehavior: JsonField) = apply { - body.checkDepositBehavior(checkDepositBehavior) - } - - /** The description you choose for the Lockbox. */ + /** The description you choose for the Lockbox Recipient. */ fun description(description: String) = apply { body.description(description) } /** @@ -157,7 +147,7 @@ private constructor( */ fun description(description: JsonField) = apply { body.description(description) } - /** The recipient name you choose for the Lockbox. */ + /** The name of the Lockbox Recipient. */ fun recipientName(recipientName: String) = apply { body.recipientName(recipientName) } /** @@ -171,6 +161,17 @@ private constructor( body.recipientName(recipientName) } + /** The status of the Lockbox Recipient. */ + fun status(status: Status) = apply { body.status(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 { body.status(status) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -289,13 +290,13 @@ private constructor( } /** - * Returns an immutable instance of [LockboxUpdateParams]. + * Returns an immutable instance of [LockboxRecipientUpdateParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): LockboxUpdateParams = - LockboxUpdateParams( - lockboxId, + fun build(): LockboxRecipientUpdateParams = + LockboxRecipientUpdateParams( + lockboxRecipientId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -306,7 +307,7 @@ private constructor( fun _pathParam(index: Int): String = when (index) { - 0 -> lockboxId ?: "" + 0 -> lockboxRecipientId ?: "" else -> "" } @@ -317,36 +318,25 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val checkDepositBehavior: JsonField, private val description: JsonField, private val recipientName: JsonField, + private val status: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("check_deposit_behavior") - @ExcludeMissing - checkDepositBehavior: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("recipient_name") @ExcludeMissing recipientName: JsonField = JsonMissing.of(), - ) : this(checkDepositBehavior, description, recipientName, mutableMapOf()) - - /** - * This indicates if checks mailed to this lockbox will be deposited. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun checkDepositBehavior(): Optional = - checkDepositBehavior.getOptional("check_deposit_behavior") + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + ) : this(description, recipientName, status, mutableMapOf()) /** - * The description you choose for the Lockbox. + * The description you choose for the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -354,7 +344,7 @@ private constructor( fun description(): Optional = description.getOptional("description") /** - * The recipient name you choose for the Lockbox. + * The name of the Lockbox Recipient. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -362,14 +352,12 @@ private constructor( fun recipientName(): Optional = recipientName.getOptional("recipient_name") /** - * Returns the raw JSON value of [checkDepositBehavior]. + * The status of the Lockbox Recipient. * - * Unlike [checkDepositBehavior], this method doesn't throw if the JSON field has an - * unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("check_deposit_behavior") - @ExcludeMissing - fun _checkDepositBehavior(): JsonField = checkDepositBehavior + fun status(): Optional = status.getOptional("status") /** * Returns the raw JSON value of [description]. @@ -390,6 +378,13 @@ private constructor( @ExcludeMissing fun _recipientName(): JsonField = recipientName + /** + * 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 + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -411,36 +406,20 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { - private var checkDepositBehavior: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var recipientName: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { - checkDepositBehavior = body.checkDepositBehavior description = body.description recipientName = body.recipientName + status = body.status additionalProperties = body.additionalProperties.toMutableMap() } - /** This indicates if checks mailed to this lockbox will be deposited. */ - fun checkDepositBehavior(checkDepositBehavior: CheckDepositBehavior) = - checkDepositBehavior(JsonField.of(checkDepositBehavior)) - - /** - * Sets [Builder.checkDepositBehavior] to an arbitrary JSON value. - * - * You should usually call [Builder.checkDepositBehavior] with a well-typed - * [CheckDepositBehavior] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun checkDepositBehavior(checkDepositBehavior: JsonField) = - apply { - this.checkDepositBehavior = checkDepositBehavior - } - - /** The description you choose for the Lockbox. */ + /** The description you choose for the Lockbox Recipient. */ fun description(description: String) = description(JsonField.of(description)) /** @@ -454,7 +433,7 @@ private constructor( this.description = description } - /** The recipient name you choose for the Lockbox. */ + /** The name of the Lockbox Recipient. */ fun recipientName(recipientName: String) = recipientName(JsonField.of(recipientName)) /** @@ -468,6 +447,18 @@ private constructor( this.recipientName = recipientName } + /** The status of the Lockbox Recipient. */ + 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 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -493,12 +484,7 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): Body = - Body( - checkDepositBehavior, - description, - recipientName, - additionalProperties.toMutableMap(), - ) + Body(description, recipientName, status, additionalProperties.toMutableMap()) } private var validated: Boolean = false @@ -508,9 +494,9 @@ private constructor( return@apply } - checkDepositBehavior().ifPresent { it.validate() } description() recipientName() + status().ifPresent { it.validate() } validated = true } @@ -530,9 +516,9 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (checkDepositBehavior.asKnown().getOrNull()?.validity() ?: 0) + - (if (description.asKnown().isPresent) 1 else 0) + - (if (recipientName.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (recipientName.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -540,26 +526,24 @@ private constructor( } return other is Body && - checkDepositBehavior == other.checkDepositBehavior && description == other.description && recipientName == other.recipientName && + status == other.status && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(checkDepositBehavior, description, recipientName, additionalProperties) + Objects.hash(description, recipientName, status, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{checkDepositBehavior=$checkDepositBehavior, description=$description, recipientName=$recipientName, additionalProperties=$additionalProperties}" + "Body{description=$description, recipientName=$recipientName, status=$status, additionalProperties=$additionalProperties}" } - /** This indicates if checks mailed to this lockbox will be deposited. */ - class CheckDepositBehavior - @JsonCreator - private constructor(private val value: JsonField) : Enum { + /** The status of the Lockbox Recipient. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -573,49 +557,63 @@ private constructor( companion object { - /** Checks mailed to this Lockbox will be deposited. */ - @JvmField val ENABLED = of("enabled") + /** This Lockbox Recipient is active. */ + @JvmField val ACTIVE = of("active") - /** Checks mailed to this Lockbox will not be deposited. */ + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ @JvmField val DISABLED = of("disabled") - /** Checks mailed to this Lockbox will be pending until actioned. */ - @JvmField val PEND_FOR_PROCESSING = of("pend_for_processing") + /** + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. + */ + @JvmField val CANCELED = of("canceled") - @JvmStatic fun of(value: String) = CheckDepositBehavior(JsonField.of(value)) + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } - /** An enum containing [CheckDepositBehavior]'s known values. */ + /** An enum containing [Status]'s known values. */ enum class Known { - /** Checks mailed to this Lockbox will be deposited. */ - ENABLED, - /** Checks mailed to this Lockbox will not be deposited. */ + /** This Lockbox Recipient is active. */ + ACTIVE, + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ DISABLED, - /** Checks mailed to this Lockbox will be pending until actioned. */ - PEND_FOR_PROCESSING, + /** + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. + */ + CANCELED, } /** - * An enum containing [CheckDepositBehavior]'s known values, as well as an [_UNKNOWN] - * member. + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [CheckDepositBehavior] can contain an unknown value in a couple of cases: + * 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 { - /** Checks mailed to this Lockbox will be deposited. */ - ENABLED, - /** Checks mailed to this Lockbox will not be deposited. */ + /** This Lockbox Recipient is active. */ + ACTIVE, + /** + * This Lockbox Recipient is disabled. Checks mailed to this Lockbox Recipient will be + * rejected. + */ DISABLED, - /** Checks mailed to this Lockbox will be pending until actioned. */ - PEND_FOR_PROCESSING, /** - * An enum member indicating that [CheckDepositBehavior] was instantiated with an - * unknown value. + * This Lockbox Recipient is canceled and cannot be modified. Checks mailed to this + * Lockbox Recipient will be rejected. */ + CANCELED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } @@ -628,9 +626,9 @@ private constructor( */ fun value(): Value = when (this) { - ENABLED -> Value.ENABLED + ACTIVE -> Value.ACTIVE DISABLED -> Value.DISABLED - PEND_FOR_PROCESSING -> Value.PEND_FOR_PROCESSING + CANCELED -> Value.CANCELED else -> Value._UNKNOWN } @@ -645,10 +643,10 @@ private constructor( */ fun known(): Known = when (this) { - ENABLED -> Known.ENABLED + ACTIVE -> Known.ACTIVE DISABLED -> Known.DISABLED - PEND_FOR_PROCESSING -> Known.PEND_FOR_PROCESSING - else -> throw IncreaseInvalidDataException("Unknown CheckDepositBehavior: $value") + CANCELED -> Known.CANCELED + else -> throw IncreaseInvalidDataException("Unknown Status: $value") } /** @@ -667,7 +665,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CheckDepositBehavior = apply { + fun validate(): Status = apply { if (validated) { return@apply } @@ -697,7 +695,7 @@ private constructor( return true } - return other is CheckDepositBehavior && value == other.value + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -710,16 +708,16 @@ private constructor( return true } - return other is LockboxUpdateParams && - lockboxId == other.lockboxId && + return other is LockboxRecipientUpdateParams && + lockboxRecipientId == other.lockboxRecipientId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(lockboxId, body, additionalHeaders, additionalQueryParams) + Objects.hash(lockboxRecipientId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "LockboxUpdateParams{lockboxId=$lockboxId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LockboxRecipientUpdateParams{lockboxRecipientId=$lockboxRecipientId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParams.kt index 646f308de..718baa4e6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParams.kt @@ -39,35 +39,36 @@ private constructor( fun amount(): Long = body.amount() /** - * The identifier of the Lockbox to simulate inbound mail to. + * The file containing the PDF contents. If not present, a default check image file will be + * used. * - * @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). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun lockboxId(): String = body.lockboxId() + fun contentsFileId(): Optional = body.contentsFileId() /** - * The file containing the PDF contents. If not present, a default check image file will be - * used. + * The identifier of the Lockbox Address to simulate inbound mail to. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun contentsFileId(): Optional = body.contentsFileId() + fun lockboxAddressId(): Optional = body.lockboxAddressId() /** - * Returns the raw JSON value of [amount]. + * The identifier of the Lockbox Recipient to simulate inbound mail to. * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun _amount(): JsonField = body._amount() + fun lockboxRecipientId(): Optional = body.lockboxRecipientId() /** - * Returns the raw JSON value of [lockboxId]. + * Returns the raw JSON value of [amount]. * - * Unlike [lockboxId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. */ - fun _lockboxId(): JsonField = body._lockboxId() + fun _amount(): JsonField = body._amount() /** * Returns the raw JSON value of [contentsFileId]. @@ -76,6 +77,22 @@ private constructor( */ fun _contentsFileId(): JsonField = body._contentsFileId() + /** + * Returns the raw JSON value of [lockboxAddressId]. + * + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _lockboxAddressId(): JsonField = body._lockboxAddressId() + + /** + * Returns the raw JSON value of [lockboxRecipientId]. + * + * Unlike [lockboxRecipientId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _lockboxRecipientId(): JsonField = body._lockboxRecipientId() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -94,7 +111,6 @@ private constructor( * The following fields are required: * ```java * .amount() - * .lockboxId() * ``` */ @JvmStatic fun builder() = Builder() @@ -120,8 +136,9 @@ 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] - * - [lockboxId] * - [contentsFileId] + * - [lockboxAddressId] + * - [lockboxRecipientId] */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -136,18 +153,6 @@ private constructor( */ fun amount(amount: JsonField) = apply { body.amount(amount) } - /** The identifier of the Lockbox to simulate inbound mail to. */ - fun lockboxId(lockboxId: String) = apply { body.lockboxId(lockboxId) } - - /** - * Sets [Builder.lockboxId] to an arbitrary JSON value. - * - * You should usually call [Builder.lockboxId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun lockboxId(lockboxId: JsonField) = apply { body.lockboxId(lockboxId) } - /** * The file containing the PDF contents. If not present, a default check image file will be * used. @@ -165,6 +170,38 @@ private constructor( body.contentsFileId(contentsFileId) } + /** The identifier of the Lockbox Address to simulate inbound mail to. */ + fun lockboxAddressId(lockboxAddressId: String) = apply { + body.lockboxAddressId(lockboxAddressId) + } + + /** + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + body.lockboxAddressId(lockboxAddressId) + } + + /** The identifier of the Lockbox Recipient to simulate inbound mail to. */ + fun lockboxRecipientId(lockboxRecipientId: String) = apply { + body.lockboxRecipientId(lockboxRecipientId) + } + + /** + * Sets [Builder.lockboxRecipientId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxRecipientId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxRecipientId(lockboxRecipientId: JsonField) = apply { + body.lockboxRecipientId(lockboxRecipientId) + } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -290,7 +327,6 @@ private constructor( * The following fields are required: * ```java * .amount() - * .lockboxId() * ``` * * @throws IllegalStateException if any required field is unset. @@ -313,21 +349,25 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, - private val lockboxId: JsonField, private val contentsFileId: JsonField, + private val lockboxAddressId: JsonField, + private val lockboxRecipientId: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("lockbox_id") - @ExcludeMissing - lockboxId: JsonField = JsonMissing.of(), @JsonProperty("contents_file_id") @ExcludeMissing contentsFileId: JsonField = JsonMissing.of(), - ) : this(amount, lockboxId, contentsFileId, mutableMapOf()) + @JsonProperty("lockbox_address_id") + @ExcludeMissing + lockboxAddressId: JsonField = JsonMissing.of(), + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + lockboxRecipientId: JsonField = JsonMissing.of(), + ) : this(amount, contentsFileId, lockboxAddressId, lockboxRecipientId, mutableMapOf()) /** * The amount of the check to be simulated, in cents. @@ -338,35 +378,38 @@ private constructor( fun amount(): Long = amount.getRequired("amount") /** - * The identifier of the Lockbox to simulate inbound mail to. + * The file containing the PDF contents. If not present, a default check image file will be + * used. * - * @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). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - fun lockboxId(): String = lockboxId.getRequired("lockbox_id") + fun contentsFileId(): Optional = contentsFileId.getOptional("contents_file_id") /** - * The file containing the PDF contents. If not present, a default check image file will be - * used. + * The identifier of the Lockbox Address to simulate inbound mail to. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun contentsFileId(): Optional = contentsFileId.getOptional("contents_file_id") + fun lockboxAddressId(): Optional = + lockboxAddressId.getOptional("lockbox_address_id") /** - * Returns the raw JSON value of [amount]. + * The identifier of the Lockbox Recipient to simulate inbound mail to. * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + fun lockboxRecipientId(): Optional = + lockboxRecipientId.getOptional("lockbox_recipient_id") /** - * Returns the raw JSON value of [lockboxId]. + * Returns the raw JSON value of [amount]. * - * Unlike [lockboxId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("lockbox_id") @ExcludeMissing fun _lockboxId(): JsonField = lockboxId + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** * Returns the raw JSON value of [contentsFileId]. @@ -378,6 +421,26 @@ private constructor( @ExcludeMissing fun _contentsFileId(): JsonField = contentsFileId + /** + * Returns the raw JSON value of [lockboxAddressId]. + * + * Unlike [lockboxAddressId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("lockbox_address_id") + @ExcludeMissing + fun _lockboxAddressId(): JsonField = lockboxAddressId + + /** + * Returns the raw JSON value of [lockboxRecipientId]. + * + * Unlike [lockboxRecipientId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("lockbox_recipient_id") + @ExcludeMissing + fun _lockboxRecipientId(): JsonField = lockboxRecipientId + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -398,7 +461,6 @@ private constructor( * The following fields are required: * ```java * .amount() - * .lockboxId() * ``` */ @JvmStatic fun builder() = Builder() @@ -408,15 +470,17 @@ private constructor( class Builder internal constructor() { private var amount: JsonField? = null - private var lockboxId: JsonField? = null private var contentsFileId: JsonField = JsonMissing.of() + private var lockboxAddressId: JsonField = JsonMissing.of() + private var lockboxRecipientId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { amount = body.amount - lockboxId = body.lockboxId contentsFileId = body.contentsFileId + lockboxAddressId = body.lockboxAddressId + lockboxRecipientId = body.lockboxRecipientId additionalProperties = body.additionalProperties.toMutableMap() } @@ -432,18 +496,6 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** The identifier of the Lockbox to simulate inbound mail to. */ - fun lockboxId(lockboxId: String) = lockboxId(JsonField.of(lockboxId)) - - /** - * Sets [Builder.lockboxId] to an arbitrary JSON value. - * - * You should usually call [Builder.lockboxId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun lockboxId(lockboxId: JsonField) = apply { this.lockboxId = lockboxId } - /** * The file containing the PDF contents. If not present, a default check image file will * be used. @@ -462,6 +514,36 @@ private constructor( this.contentsFileId = contentsFileId } + /** The identifier of the Lockbox Address to simulate inbound mail to. */ + fun lockboxAddressId(lockboxAddressId: String) = + lockboxAddressId(JsonField.of(lockboxAddressId)) + + /** + * Sets [Builder.lockboxAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxAddressId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxAddressId(lockboxAddressId: JsonField) = apply { + this.lockboxAddressId = lockboxAddressId + } + + /** The identifier of the Lockbox Recipient to simulate inbound mail to. */ + fun lockboxRecipientId(lockboxRecipientId: String) = + lockboxRecipientId(JsonField.of(lockboxRecipientId)) + + /** + * Sets [Builder.lockboxRecipientId] to an arbitrary JSON value. + * + * You should usually call [Builder.lockboxRecipientId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lockboxRecipientId(lockboxRecipientId: JsonField) = apply { + this.lockboxRecipientId = lockboxRecipientId + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -489,7 +571,6 @@ private constructor( * The following fields are required: * ```java * .amount() - * .lockboxId() * ``` * * @throws IllegalStateException if any required field is unset. @@ -497,8 +578,9 @@ private constructor( fun build(): Body = Body( checkRequired("amount", amount), - checkRequired("lockboxId", lockboxId), contentsFileId, + lockboxAddressId, + lockboxRecipientId, additionalProperties.toMutableMap(), ) } @@ -511,8 +593,9 @@ private constructor( } amount() - lockboxId() contentsFileId() + lockboxAddressId() + lockboxRecipientId() validated = true } @@ -533,8 +616,9 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (amount.asKnown().isPresent) 1 else 0) + - (if (lockboxId.asKnown().isPresent) 1 else 0) + - (if (contentsFileId.asKnown().isPresent) 1 else 0) + (if (contentsFileId.asKnown().isPresent) 1 else 0) + + (if (lockboxAddressId.asKnown().isPresent) 1 else 0) + + (if (lockboxRecipientId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -543,19 +627,26 @@ private constructor( return other is Body && amount == other.amount && - lockboxId == other.lockboxId && contentsFileId == other.contentsFileId && + lockboxAddressId == other.lockboxAddressId && + lockboxRecipientId == other.lockboxRecipientId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(amount, lockboxId, contentsFileId, additionalProperties) + Objects.hash( + amount, + contentsFileId, + lockboxAddressId, + lockboxRecipientId, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{amount=$amount, lockboxId=$lockboxId, contentsFileId=$contentsFileId, additionalProperties=$additionalProperties}" + "Body{amount=$amount, contentsFileId=$contentsFileId, lockboxAddressId=$lockboxAddressId, lockboxRecipientId=$lockboxRecipientId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsync.kt new file mode 100644 index 000000000..28e01a7d5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsync.kt @@ -0,0 +1,285 @@ +// 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.lockboxaddresses.LockboxAddress +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressListPageAsync +import com.increase.api.models.lockboxaddresses.LockboxAddressListParams +import com.increase.api.models.lockboxaddresses.LockboxAddressRetrieveParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface LockboxAddressServiceAsync { + + /** + * 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): LockboxAddressServiceAsync + + /** Create a Lockbox Address */ + fun create(): CompletableFuture = create(LockboxAddressCreateParams.none()) + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none() + ): CompletableFuture = create(params, RequestOptions.none()) + + /** @see create */ + fun create(requestOptions: RequestOptions): CompletableFuture = + create(LockboxAddressCreateParams.none(), requestOptions) + + /** Retrieve a Lockbox Address */ + fun retrieve(lockboxAddressId: String): CompletableFuture = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + ): CompletableFuture = retrieve(lockboxAddressId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxAddressRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve(params: LockboxAddressRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none(), requestOptions) + + /** Update a Lockbox Address */ + fun update(lockboxAddressId: String): CompletableFuture = + update(lockboxAddressId, LockboxAddressUpdateParams.none()) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + ): CompletableFuture = update(lockboxAddressId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxAddressUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update(params: LockboxAddressUpdateParams): CompletableFuture = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update(lockboxAddressId, LockboxAddressUpdateParams.none(), requestOptions) + + /** List Lockbox Addresses */ + fun list(): CompletableFuture = + list(LockboxAddressListParams.none()) + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(LockboxAddressListParams.none(), requestOptions) + + /** + * A view of [LockboxAddressServiceAsync] 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 + ): LockboxAddressServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /lockbox_addresses`, but is otherwise the same as + * [LockboxAddressServiceAsync.create]. + */ + fun create(): CompletableFuture> = + create(LockboxAddressCreateParams.none()) + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none() + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + requestOptions: RequestOptions + ): CompletableFuture> = + create(LockboxAddressCreateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_addresses/{lockbox_address_id}`, but is + * otherwise the same as [LockboxAddressServiceAsync.retrieve]. + */ + fun retrieve(lockboxAddressId: String): CompletableFuture> = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + ): CompletableFuture> = + retrieve(lockboxAddressId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxAddressRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: LockboxAddressRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `patch /lockbox_addresses/{lockbox_address_id}`, but is + * otherwise the same as [LockboxAddressServiceAsync.update]. + */ + fun update(lockboxAddressId: String): CompletableFuture> = + update(lockboxAddressId, LockboxAddressUpdateParams.none()) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + ): CompletableFuture> = + update(lockboxAddressId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxAddressUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: LockboxAddressUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update(lockboxAddressId, LockboxAddressUpdateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_addresses`, but is otherwise the same as + * [LockboxAddressServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(LockboxAddressListParams.none()) + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(LockboxAddressListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncImpl.kt similarity index 66% rename from increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt rename to increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncImpl.kt index 47eb14424..49cc3b808 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncImpl.kt @@ -16,81 +16,84 @@ 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.lockboxes.Lockbox -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListPageAsync -import com.increase.api.models.lockboxes.LockboxListPageResponse -import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxRetrieveParams -import com.increase.api.models.lockboxes.LockboxUpdateParams +import com.increase.api.models.lockboxaddresses.LockboxAddress +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressListPageAsync +import com.increase.api.models.lockboxaddresses.LockboxAddressListPageResponse +import com.increase.api.models.lockboxaddresses.LockboxAddressListParams +import com.increase.api.models.lockboxaddresses.LockboxAddressRetrieveParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull -class LockboxServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - LockboxServiceAsync { +class LockboxAddressServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : LockboxAddressServiceAsync { - private val withRawResponse: LockboxServiceAsync.WithRawResponse by lazy { + private val withRawResponse: LockboxAddressServiceAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): LockboxServiceAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): LockboxAddressServiceAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): LockboxServiceAsync = - LockboxServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions( + modifier: Consumer + ): LockboxAddressServiceAsync = + LockboxAddressServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun create( - params: LockboxCreateParams, + params: LockboxAddressCreateParams, requestOptions: RequestOptions, - ): CompletableFuture = - // post /lockboxes + ): CompletableFuture = + // post /lockbox_addresses withRawResponse().create(params, requestOptions).thenApply { it.parse() } override fun retrieve( - params: LockboxRetrieveParams, + params: LockboxAddressRetrieveParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /lockboxes/{lockbox_id} + ): CompletableFuture = + // get /lockbox_addresses/{lockbox_address_id} withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } override fun update( - params: LockboxUpdateParams, + params: LockboxAddressUpdateParams, requestOptions: RequestOptions, - ): CompletableFuture = - // patch /lockboxes/{lockbox_id} + ): CompletableFuture = + // patch /lockbox_addresses/{lockbox_address_id} withRawResponse().update(params, requestOptions).thenApply { it.parse() } override fun list( - params: LockboxListParams, + params: LockboxAddressListParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /lockboxes + ): CompletableFuture = + // get /lockbox_addresses withRawResponse().list(params, requestOptions).thenApply { it.parse() } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - LockboxServiceAsync.WithRawResponse { + LockboxAddressServiceAsync.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): LockboxServiceAsync.WithRawResponse = - LockboxServiceAsyncImpl.WithRawResponseImpl( + ): LockboxAddressServiceAsync.WithRawResponse = + LockboxAddressServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun create( - params: LockboxCreateParams, + params: LockboxAddressCreateParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.POST) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes") + .addPathSegments("lockbox_addresses") .body(json(clientOptions.jsonMapper, params._body())) .build() .prepareAsync(clientOptions, params) @@ -110,21 +113,21 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val retrieveHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun retrieve( - params: LockboxRetrieveParams, + params: LockboxAddressRetrieveParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { // We check here instead of in the params builder because this can be specified // positionally or in the params class. - checkRequired("lockboxId", params.lockboxId().getOrNull()) + checkRequired("lockboxAddressId", params.lockboxAddressId().getOrNull()) val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes", params._pathParam(0)) + .addPathSegments("lockbox_addresses", params._pathParam(0)) .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -143,20 +146,21 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun update( - params: LockboxUpdateParams, + params: LockboxAddressUpdateParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { // We check here instead of in the params builder because this can be specified // positionally or in the params class. - checkRequired("lockboxId", params.lockboxId().getOrNull()) + checkRequired("lockboxAddressId", params.lockboxAddressId().getOrNull()) val request = HttpRequest.builder() .method(HttpMethod.PATCH) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes", params._pathParam(0)) + .addPathSegments("lockbox_addresses", params._pathParam(0)) .body(json(clientOptions.jsonMapper, params._body())) .build() .prepareAsync(clientOptions, params) @@ -176,18 +180,18 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( - params: LockboxListParams, + params: LockboxAddressListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes") + .addPathSegments("lockbox_addresses") .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -203,8 +207,8 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl } } .let { - LockboxListPageAsync.builder() - .service(LockboxServiceAsyncImpl(clientOptions)) + LockboxAddressListPageAsync.builder() + .service(LockboxAddressServiceAsyncImpl(clientOptions)) .streamHandlerExecutor(clientOptions.streamHandlerExecutor) .params(params) .response(it) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsync.kt new file mode 100644 index 000000000..6932f96dc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsync.kt @@ -0,0 +1,279 @@ +// 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.lockboxrecipients.LockboxRecipient +import com.increase.api.models.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPageAsync +import com.increase.api.models.lockboxrecipients.LockboxRecipientListParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientRetrieveParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface LockboxRecipientServiceAsync { + + /** + * 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): LockboxRecipientServiceAsync + + /** Create a Lockbox Recipient */ + fun create(params: LockboxRecipientCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** Retrieve a Lockbox Recipient */ + fun retrieve(lockboxRecipientId: String): CompletableFuture = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + ): CompletableFuture = + retrieve(lockboxRecipientId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve(params: LockboxRecipientRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none(), requestOptions) + + /** Update a Lockbox Recipient */ + fun update(lockboxRecipientId: String): CompletableFuture = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none()) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update(params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), requestOptions) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + ): CompletableFuture = + update(lockboxRecipientId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update(params: LockboxRecipientUpdateParams): CompletableFuture = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none(), requestOptions) + + /** List Lockbox Recipients */ + fun list(): CompletableFuture = + list(LockboxRecipientListParams.none()) + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(LockboxRecipientListParams.none(), requestOptions) + + /** + * A view of [LockboxRecipientServiceAsync] 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 + ): LockboxRecipientServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /lockbox_recipients`, but is otherwise the same as + * [LockboxRecipientServiceAsync.create]. + */ + fun create( + params: LockboxRecipientCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /lockbox_recipients/{lockbox_recipient_id}`, but is + * otherwise the same as [LockboxRecipientServiceAsync.retrieve]. + */ + fun retrieve( + lockboxRecipientId: String + ): CompletableFuture> = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve( + params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + ): CompletableFuture> = + retrieve(lockboxRecipientId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: LockboxRecipientRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `patch /lockbox_recipients/{lockbox_recipient_id}`, but + * is otherwise the same as [LockboxRecipientServiceAsync.update]. + */ + fun update( + lockboxRecipientId: String + ): CompletableFuture> = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none()) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update( + params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + ): CompletableFuture> = + update(lockboxRecipientId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: LockboxRecipientUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_recipients`, but is otherwise the same as + * [LockboxRecipientServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(LockboxRecipientListParams.none()) + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(LockboxRecipientListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncImpl.kt new file mode 100644 index 000000000..651c64bca --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncImpl.kt @@ -0,0 +1,221 @@ +// 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.lockboxrecipients.LockboxRecipient +import com.increase.api.models.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPageAsync +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPageResponse +import com.increase.api.models.lockboxrecipients.LockboxRecipientListParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientRetrieveParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LockboxRecipientServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : LockboxRecipientServiceAsync { + + private val withRawResponse: LockboxRecipientServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): LockboxRecipientServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): LockboxRecipientServiceAsync = + LockboxRecipientServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /lockbox_recipients + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + override fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /lockbox_recipients/{lockbox_recipient_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // patch /lockbox_recipients/{lockbox_recipient_id} + withRawResponse().update(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: LockboxRecipientListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /lockbox_recipients + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LockboxRecipientServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): LockboxRecipientServiceAsync.WithRawResponse = + LockboxRecipientServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("lockboxRecipientId", params.lockboxRecipientId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients", 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 updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("lockboxRecipientId", params.lockboxRecipientId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients", params._pathParam(0)) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LockboxRecipientListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients") + .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 { + LockboxRecipientListPageAsync.builder() + .service(LockboxRecipientServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt deleted file mode 100644 index 82fee8d70..000000000 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt +++ /dev/null @@ -1,253 +0,0 @@ -// 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.lockboxes.Lockbox -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListPageAsync -import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxRetrieveParams -import com.increase.api.models.lockboxes.LockboxUpdateParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -interface LockboxServiceAsync { - - /** - * 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): LockboxServiceAsync - - /** Create a Lockbox */ - fun create(params: LockboxCreateParams): CompletableFuture = - create(params, RequestOptions.none()) - - /** @see create */ - fun create( - params: LockboxCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** Retrieve a Lockbox */ - fun retrieve(lockboxId: String): CompletableFuture = - retrieve(lockboxId, LockboxRetrieveParams.none()) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - retrieve(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - ): CompletableFuture = retrieve(lockboxId, params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve( - params: LockboxRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see retrieve */ - fun retrieve(params: LockboxRetrieveParams): CompletableFuture = - retrieve(params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve(lockboxId: String, requestOptions: RequestOptions): CompletableFuture = - retrieve(lockboxId, LockboxRetrieveParams.none(), requestOptions) - - /** Update a Lockbox */ - fun update(lockboxId: String): CompletableFuture = - update(lockboxId, LockboxUpdateParams.none()) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - update(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - ): CompletableFuture = update(lockboxId, params, RequestOptions.none()) - - /** @see update */ - fun update( - params: LockboxUpdateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see update */ - fun update(params: LockboxUpdateParams): CompletableFuture = - update(params, RequestOptions.none()) - - /** @see update */ - fun update(lockboxId: String, requestOptions: RequestOptions): CompletableFuture = - update(lockboxId, LockboxUpdateParams.none(), requestOptions) - - /** List Lockboxes */ - fun list(): CompletableFuture = list(LockboxListParams.none()) - - /** @see list */ - fun list( - params: LockboxListParams = LockboxListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see list */ - fun list( - params: LockboxListParams = LockboxListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = - list(LockboxListParams.none(), requestOptions) - - /** - * A view of [LockboxServiceAsync] 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 - ): LockboxServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `post /lockboxes`, but is otherwise the same as - * [LockboxServiceAsync.create]. - */ - fun create(params: LockboxCreateParams): CompletableFuture> = - create(params, RequestOptions.none()) - - /** @see create */ - fun create( - params: LockboxCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** - * Returns a raw HTTP response for `get /lockboxes/{lockbox_id}`, but is otherwise the same - * as [LockboxServiceAsync.retrieve]. - */ - fun retrieve(lockboxId: String): CompletableFuture> = - retrieve(lockboxId, LockboxRetrieveParams.none()) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - retrieve(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - ): CompletableFuture> = - retrieve(lockboxId, params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve( - params: LockboxRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see retrieve */ - fun retrieve(params: LockboxRetrieveParams): CompletableFuture> = - retrieve(params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - retrieve(lockboxId, LockboxRetrieveParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `patch /lockboxes/{lockbox_id}`, but is otherwise the - * same as [LockboxServiceAsync.update]. - */ - fun update(lockboxId: String): CompletableFuture> = - update(lockboxId, LockboxUpdateParams.none()) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - update(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - ): CompletableFuture> = - update(lockboxId, params, RequestOptions.none()) - - /** @see update */ - fun update( - params: LockboxUpdateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see update */ - fun update(params: LockboxUpdateParams): CompletableFuture> = - update(params, RequestOptions.none()) - - /** @see update */ - fun update( - lockboxId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - update(lockboxId, LockboxUpdateParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /lockboxes`, but is otherwise the same as - * [LockboxServiceAsync.list]. - */ - fun list(): CompletableFuture> = - list(LockboxListParams.none()) - - /** @see list */ - fun list( - params: LockboxListParams = LockboxListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see list */ - fun list( - params: LockboxListParams = LockboxListParams.none() - ): CompletableFuture> = - list(params, RequestOptions.none()) - - /** @see list */ - fun list( - requestOptions: RequestOptions - ): CompletableFuture> = - list(LockboxListParams.none(), requestOptions) - } -} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressService.kt new file mode 100644 index 000000000..2a0210622 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressService.kt @@ -0,0 +1,284 @@ +// 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.lockboxaddresses.LockboxAddress +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressListPage +import com.increase.api.models.lockboxaddresses.LockboxAddressListParams +import com.increase.api.models.lockboxaddresses.LockboxAddressRetrieveParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams +import java.util.function.Consumer + +interface LockboxAddressService { + + /** + * 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): LockboxAddressService + + /** Create a Lockbox Address */ + fun create(): LockboxAddress = create(LockboxAddressCreateParams.none()) + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddress + + /** @see create */ + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none() + ): LockboxAddress = create(params, RequestOptions.none()) + + /** @see create */ + fun create(requestOptions: RequestOptions): LockboxAddress = + create(LockboxAddressCreateParams.none(), requestOptions) + + /** Retrieve a Lockbox Address */ + fun retrieve(lockboxAddressId: String): LockboxAddress = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddress = + retrieve(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + ): LockboxAddress = retrieve(lockboxAddressId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxAddressRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddress + + /** @see retrieve */ + fun retrieve(params: LockboxAddressRetrieveParams): LockboxAddress = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve(lockboxAddressId: String, requestOptions: RequestOptions): LockboxAddress = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none(), requestOptions) + + /** Update a Lockbox Address */ + fun update(lockboxAddressId: String): LockboxAddress = + update(lockboxAddressId, LockboxAddressUpdateParams.none()) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddress = + update(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see update */ + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + ): LockboxAddress = update(lockboxAddressId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxAddressUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddress + + /** @see update */ + fun update(params: LockboxAddressUpdateParams): LockboxAddress = + update(params, RequestOptions.none()) + + /** @see update */ + fun update(lockboxAddressId: String, requestOptions: RequestOptions): LockboxAddress = + update(lockboxAddressId, LockboxAddressUpdateParams.none(), requestOptions) + + /** List Lockbox Addresses */ + fun list(): LockboxAddressListPage = list(LockboxAddressListParams.none()) + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxAddressListPage + + /** @see list */ + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none() + ): LockboxAddressListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): LockboxAddressListPage = + list(LockboxAddressListParams.none(), requestOptions) + + /** + * A view of [LockboxAddressService] 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 + ): LockboxAddressService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /lockbox_addresses`, but is otherwise the same as + * [LockboxAddressService.create]. + */ + @MustBeClosed + fun create(): HttpResponseFor = create(LockboxAddressCreateParams.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see create */ + @MustBeClosed + fun create( + params: LockboxAddressCreateParams = LockboxAddressCreateParams.none() + ): HttpResponseFor = create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create(requestOptions: RequestOptions): HttpResponseFor = + create(LockboxAddressCreateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_addresses/{lockbox_address_id}`, but is + * otherwise the same as [LockboxAddressService.retrieve]. + */ + @MustBeClosed + fun retrieve(lockboxAddressId: String): HttpResponseFor = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxAddressId: String, + params: LockboxAddressRetrieveParams = LockboxAddressRetrieveParams.none(), + ): HttpResponseFor = + retrieve(lockboxAddressId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: LockboxAddressRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: LockboxAddressRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(lockboxAddressId, LockboxAddressRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `patch /lockbox_addresses/{lockbox_address_id}`, but is + * otherwise the same as [LockboxAddressService.update]. + */ + @MustBeClosed + fun update(lockboxAddressId: String): HttpResponseFor = + update(lockboxAddressId, LockboxAddressUpdateParams.none()) + + /** @see update */ + @MustBeClosed + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update(params.toBuilder().lockboxAddressId(lockboxAddressId).build(), requestOptions) + + /** @see update */ + @MustBeClosed + fun update( + lockboxAddressId: String, + params: LockboxAddressUpdateParams = LockboxAddressUpdateParams.none(), + ): HttpResponseFor = update(lockboxAddressId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: LockboxAddressUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update(params: LockboxAddressUpdateParams): HttpResponseFor = + update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + lockboxAddressId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update(lockboxAddressId, LockboxAddressUpdateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_addresses`, but is otherwise the same as + * [LockboxAddressService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = list(LockboxAddressListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: LockboxAddressListParams = LockboxAddressListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(LockboxAddressListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressServiceImpl.kt similarity index 62% rename from increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt rename to increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressServiceImpl.kt index 5bf790592..0c5c2b8c3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxAddressServiceImpl.kt @@ -16,68 +16,81 @@ 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.lockboxes.Lockbox -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListPage -import com.increase.api.models.lockboxes.LockboxListPageResponse -import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxRetrieveParams -import com.increase.api.models.lockboxes.LockboxUpdateParams +import com.increase.api.models.lockboxaddresses.LockboxAddress +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressListPage +import com.increase.api.models.lockboxaddresses.LockboxAddressListPageResponse +import com.increase.api.models.lockboxaddresses.LockboxAddressListParams +import com.increase.api.models.lockboxaddresses.LockboxAddressRetrieveParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull -class LockboxServiceImpl internal constructor(private val clientOptions: ClientOptions) : - LockboxService { +class LockboxAddressServiceImpl internal constructor(private val clientOptions: ClientOptions) : + LockboxAddressService { - private val withRawResponse: LockboxService.WithRawResponse by lazy { + private val withRawResponse: LockboxAddressService.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): LockboxService.WithRawResponse = withRawResponse + override fun withRawResponse(): LockboxAddressService.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): LockboxService = - LockboxServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): LockboxAddressService = + LockboxAddressServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun create(params: LockboxCreateParams, requestOptions: RequestOptions): Lockbox = - // post /lockboxes + override fun create( + params: LockboxAddressCreateParams, + requestOptions: RequestOptions, + ): LockboxAddress = + // post /lockbox_addresses withRawResponse().create(params, requestOptions).parse() - override fun retrieve(params: LockboxRetrieveParams, requestOptions: RequestOptions): Lockbox = - // get /lockboxes/{lockbox_id} + override fun retrieve( + params: LockboxAddressRetrieveParams, + requestOptions: RequestOptions, + ): LockboxAddress = + // get /lockbox_addresses/{lockbox_address_id} withRawResponse().retrieve(params, requestOptions).parse() - override fun update(params: LockboxUpdateParams, requestOptions: RequestOptions): Lockbox = - // patch /lockboxes/{lockbox_id} + override fun update( + params: LockboxAddressUpdateParams, + requestOptions: RequestOptions, + ): LockboxAddress = + // patch /lockbox_addresses/{lockbox_address_id} withRawResponse().update(params, requestOptions).parse() - override fun list(params: LockboxListParams, requestOptions: RequestOptions): LockboxListPage = - // get /lockboxes + override fun list( + params: LockboxAddressListParams, + requestOptions: RequestOptions, + ): LockboxAddressListPage = + // get /lockbox_addresses withRawResponse().list(params, requestOptions).parse() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - LockboxService.WithRawResponse { + LockboxAddressService.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): LockboxService.WithRawResponse = - LockboxServiceImpl.WithRawResponseImpl( + ): LockboxAddressService.WithRawResponse = + LockboxAddressServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun create( - params: LockboxCreateParams, + params: LockboxAddressCreateParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.POST) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes") + .addPathSegments("lockbox_addresses") .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) @@ -94,21 +107,21 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO } } - private val retrieveHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun retrieve( - params: LockboxRetrieveParams, + params: LockboxAddressRetrieveParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { // We check here instead of in the params builder because this can be specified // positionally or in the params class. - checkRequired("lockboxId", params.lockboxId().getOrNull()) + checkRequired("lockboxAddressId", params.lockboxAddressId().getOrNull()) val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes", params._pathParam(0)) + .addPathSegments("lockbox_addresses", params._pathParam(0)) .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -124,20 +137,21 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO } } - private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun update( - params: LockboxUpdateParams, + params: LockboxAddressUpdateParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { // We check here instead of in the params builder because this can be specified // positionally or in the params class. - checkRequired("lockboxId", params.lockboxId().getOrNull()) + checkRequired("lockboxAddressId", params.lockboxAddressId().getOrNull()) val request = HttpRequest.builder() .method(HttpMethod.PATCH) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes", params._pathParam(0)) + .addPathSegments("lockbox_addresses", params._pathParam(0)) .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) @@ -154,18 +168,18 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( - params: LockboxListParams, + params: LockboxAddressListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("lockboxes") + .addPathSegments("lockbox_addresses") .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -179,8 +193,8 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO } } .let { - LockboxListPage.builder() - .service(LockboxServiceImpl(clientOptions)) + LockboxAddressListPage.builder() + .service(LockboxAddressServiceImpl(clientOptions)) .params(params) .response(it) .build() diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientService.kt new file mode 100644 index 000000000..df25698ba --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientService.kt @@ -0,0 +1,275 @@ +// 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.lockboxrecipients.LockboxRecipient +import com.increase.api.models.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPage +import com.increase.api.models.lockboxrecipients.LockboxRecipientListParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientRetrieveParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import java.util.function.Consumer + +interface LockboxRecipientService { + + /** + * 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): LockboxRecipientService + + /** Create a Lockbox Recipient */ + fun create(params: LockboxRecipientCreateParams): LockboxRecipient = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipient + + /** Retrieve a Lockbox Recipient */ + fun retrieve(lockboxRecipientId: String): LockboxRecipient = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipient = + retrieve(params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + ): LockboxRecipient = retrieve(lockboxRecipientId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipient + + /** @see retrieve */ + fun retrieve(params: LockboxRecipientRetrieveParams): LockboxRecipient = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve(lockboxRecipientId: String, requestOptions: RequestOptions): LockboxRecipient = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none(), requestOptions) + + /** Update a Lockbox Recipient */ + fun update(lockboxRecipientId: String): LockboxRecipient = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none()) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipient = + update(params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), requestOptions) + + /** @see update */ + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + ): LockboxRecipient = update(lockboxRecipientId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipient + + /** @see update */ + fun update(params: LockboxRecipientUpdateParams): LockboxRecipient = + update(params, RequestOptions.none()) + + /** @see update */ + fun update(lockboxRecipientId: String, requestOptions: RequestOptions): LockboxRecipient = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none(), requestOptions) + + /** List Lockbox Recipients */ + fun list(): LockboxRecipientListPage = list(LockboxRecipientListParams.none()) + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): LockboxRecipientListPage + + /** @see list */ + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none() + ): LockboxRecipientListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): LockboxRecipientListPage = + list(LockboxRecipientListParams.none(), requestOptions) + + /** + * A view of [LockboxRecipientService] 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 + ): LockboxRecipientService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /lockbox_recipients`, but is otherwise the same as + * [LockboxRecipientService.create]. + */ + @MustBeClosed + fun create(params: LockboxRecipientCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /lockbox_recipients/{lockbox_recipient_id}`, but is + * otherwise the same as [LockboxRecipientService.retrieve]. + */ + @MustBeClosed + fun retrieve(lockboxRecipientId: String): HttpResponseFor = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve( + params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), + requestOptions, + ) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxRecipientId: String, + params: LockboxRecipientRetrieveParams = LockboxRecipientRetrieveParams.none(), + ): HttpResponseFor = + retrieve(lockboxRecipientId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: LockboxRecipientRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(lockboxRecipientId, LockboxRecipientRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `patch /lockbox_recipients/{lockbox_recipient_id}`, but + * is otherwise the same as [LockboxRecipientService.update]. + */ + @MustBeClosed + fun update(lockboxRecipientId: String): HttpResponseFor = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none()) + + /** @see update */ + @MustBeClosed + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update( + params.toBuilder().lockboxRecipientId(lockboxRecipientId).build(), + requestOptions, + ) + + /** @see update */ + @MustBeClosed + fun update( + lockboxRecipientId: String, + params: LockboxRecipientUpdateParams = LockboxRecipientUpdateParams.none(), + ): HttpResponseFor = + update(lockboxRecipientId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update(params: LockboxRecipientUpdateParams): HttpResponseFor = + update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + lockboxRecipientId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update(lockboxRecipientId, LockboxRecipientUpdateParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /lockbox_recipients`, but is otherwise the same as + * [LockboxRecipientService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = + list(LockboxRecipientListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: LockboxRecipientListParams = LockboxRecipientListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(LockboxRecipientListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceImpl.kt new file mode 100644 index 000000000..80adf45f9 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceImpl.kt @@ -0,0 +1,205 @@ +// 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.lockboxrecipients.LockboxRecipient +import com.increase.api.models.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPage +import com.increase.api.models.lockboxrecipients.LockboxRecipientListPageResponse +import com.increase.api.models.lockboxrecipients.LockboxRecipientListParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientRetrieveParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class LockboxRecipientServiceImpl internal constructor(private val clientOptions: ClientOptions) : + LockboxRecipientService { + + private val withRawResponse: LockboxRecipientService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): LockboxRecipientService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): LockboxRecipientService = + LockboxRecipientServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions, + ): LockboxRecipient = + // post /lockbox_recipients + withRawResponse().create(params, requestOptions).parse() + + override fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions, + ): LockboxRecipient = + // get /lockbox_recipients/{lockbox_recipient_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions, + ): LockboxRecipient = + // patch /lockbox_recipients/{lockbox_recipient_id} + withRawResponse().update(params, requestOptions).parse() + + override fun list( + params: LockboxRecipientListParams, + requestOptions: RequestOptions, + ): LockboxRecipientListPage = + // get /lockbox_recipients + withRawResponse().list(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + LockboxRecipientService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): LockboxRecipientService.WithRawResponse = + LockboxRecipientServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: LockboxRecipientCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: LockboxRecipientRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("lockboxRecipientId", params.lockboxRecipientId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients", 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 updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: LockboxRecipientUpdateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("lockboxRecipientId", params.lockboxRecipientId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients", params._pathParam(0)) + .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 { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: LockboxRecipientListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("lockbox_recipients") + .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 { + LockboxRecipientListPage.builder() + .service(LockboxRecipientServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt deleted file mode 100644 index cde1eb2c6..000000000 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt +++ /dev/null @@ -1,246 +0,0 @@ -// 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.lockboxes.Lockbox -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListPage -import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxRetrieveParams -import com.increase.api.models.lockboxes.LockboxUpdateParams -import java.util.function.Consumer - -interface LockboxService { - - /** - * 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): LockboxService - - /** Create a Lockbox */ - fun create(params: LockboxCreateParams): Lockbox = create(params, RequestOptions.none()) - - /** @see create */ - fun create( - params: LockboxCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): Lockbox - - /** Retrieve a Lockbox */ - fun retrieve(lockboxId: String): Lockbox = retrieve(lockboxId, LockboxRetrieveParams.none()) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): Lockbox = retrieve(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see retrieve */ - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - ): Lockbox = retrieve(lockboxId, params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve( - params: LockboxRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): Lockbox - - /** @see retrieve */ - fun retrieve(params: LockboxRetrieveParams): Lockbox = retrieve(params, RequestOptions.none()) - - /** @see retrieve */ - fun retrieve(lockboxId: String, requestOptions: RequestOptions): Lockbox = - retrieve(lockboxId, LockboxRetrieveParams.none(), requestOptions) - - /** Update a Lockbox */ - fun update(lockboxId: String): Lockbox = update(lockboxId, LockboxUpdateParams.none()) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): Lockbox = update(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see update */ - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - ): Lockbox = update(lockboxId, params, RequestOptions.none()) - - /** @see update */ - fun update( - params: LockboxUpdateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): Lockbox - - /** @see update */ - fun update(params: LockboxUpdateParams): Lockbox = update(params, RequestOptions.none()) - - /** @see update */ - fun update(lockboxId: String, requestOptions: RequestOptions): Lockbox = - update(lockboxId, LockboxUpdateParams.none(), requestOptions) - - /** List Lockboxes */ - fun list(): LockboxListPage = list(LockboxListParams.none()) - - /** @see list */ - fun list( - params: LockboxListParams = LockboxListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): LockboxListPage - - /** @see list */ - fun list(params: LockboxListParams = LockboxListParams.none()): LockboxListPage = - list(params, RequestOptions.none()) - - /** @see list */ - fun list(requestOptions: RequestOptions): LockboxListPage = - list(LockboxListParams.none(), requestOptions) - - /** A view of [LockboxService] 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): LockboxService.WithRawResponse - - /** - * Returns a raw HTTP response for `post /lockboxes`, but is otherwise the same as - * [LockboxService.create]. - */ - @MustBeClosed - fun create(params: LockboxCreateParams): HttpResponseFor = - create(params, RequestOptions.none()) - - /** @see create */ - @MustBeClosed - fun create( - params: LockboxCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `get /lockboxes/{lockbox_id}`, but is otherwise the same - * as [LockboxService.retrieve]. - */ - @MustBeClosed - fun retrieve(lockboxId: String): HttpResponseFor = - retrieve(lockboxId, LockboxRetrieveParams.none()) - - /** @see retrieve */ - @MustBeClosed - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - retrieve(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see retrieve */ - @MustBeClosed - fun retrieve( - lockboxId: String, - params: LockboxRetrieveParams = LockboxRetrieveParams.none(), - ): HttpResponseFor = retrieve(lockboxId, params, RequestOptions.none()) - - /** @see retrieve */ - @MustBeClosed - fun retrieve( - params: LockboxRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see retrieve */ - @MustBeClosed - fun retrieve(params: LockboxRetrieveParams): HttpResponseFor = - retrieve(params, RequestOptions.none()) - - /** @see retrieve */ - @MustBeClosed - fun retrieve(lockboxId: String, requestOptions: RequestOptions): HttpResponseFor = - retrieve(lockboxId, LockboxRetrieveParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `patch /lockboxes/{lockbox_id}`, but is otherwise the - * same as [LockboxService.update]. - */ - @MustBeClosed - fun update(lockboxId: String): HttpResponseFor = - update(lockboxId, LockboxUpdateParams.none()) - - /** @see update */ - @MustBeClosed - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - update(params.toBuilder().lockboxId(lockboxId).build(), requestOptions) - - /** @see update */ - @MustBeClosed - fun update( - lockboxId: String, - params: LockboxUpdateParams = LockboxUpdateParams.none(), - ): HttpResponseFor = update(lockboxId, params, RequestOptions.none()) - - /** @see update */ - @MustBeClosed - fun update( - params: LockboxUpdateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see update */ - @MustBeClosed - fun update(params: LockboxUpdateParams): HttpResponseFor = - update(params, RequestOptions.none()) - - /** @see update */ - @MustBeClosed - fun update(lockboxId: String, requestOptions: RequestOptions): HttpResponseFor = - update(lockboxId, LockboxUpdateParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /lockboxes`, but is otherwise the same as - * [LockboxService.list]. - */ - @MustBeClosed fun list(): HttpResponseFor = list(LockboxListParams.none()) - - /** @see list */ - @MustBeClosed - fun list( - params: LockboxListParams = LockboxListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see list */ - @MustBeClosed - fun list( - params: LockboxListParams = LockboxListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) - - /** @see list */ - @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = - list(LockboxListParams.none(), requestOptions) - } -} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt index 14a8bee02..108cce1c1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt @@ -88,7 +88,7 @@ internal class CheckDepositListPageResponseTest { .build() ) .inboundMailItemId(null) - .lockboxId(null) + .lockboxRecipientId(null) .status(CheckDeposit.Status.SUBMITTED) .transactionId("transaction_uyrp7fld2ium70oa7oi") .type(CheckDeposit.Type.CHECK_DEPOSIT) @@ -170,7 +170,7 @@ internal class CheckDepositListPageResponseTest { .build() ) .inboundMailItemId(null) - .lockboxId(null) + .lockboxRecipientId(null) .status(CheckDeposit.Status.SUBMITTED) .transactionId("transaction_uyrp7fld2ium70oa7oi") .type(CheckDeposit.Type.CHECK_DEPOSIT) @@ -258,7 +258,7 @@ internal class CheckDepositListPageResponseTest { .build() ) .inboundMailItemId(null) - .lockboxId(null) + .lockboxRecipientId(null) .status(CheckDeposit.Status.SUBMITTED) .transactionId("transaction_uyrp7fld2ium70oa7oi") .type(CheckDeposit.Type.CHECK_DEPOSIT) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt index cd7cdad99..76a206944 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt @@ -82,7 +82,7 @@ internal class CheckDepositTest { .build() ) .inboundMailItemId(null) - .lockboxId(null) + .lockboxRecipientId(null) .status(CheckDeposit.Status.SUBMITTED) .transactionId("transaction_uyrp7fld2ium70oa7oi") .type(CheckDeposit.Type.CHECK_DEPOSIT) @@ -162,7 +162,7 @@ internal class CheckDepositTest { .build() ) assertThat(checkDeposit.inboundMailItemId()).isEmpty - assertThat(checkDeposit.lockboxId()).isEmpty + assertThat(checkDeposit.lockboxRecipientId()).isEmpty assertThat(checkDeposit.status()).isEqualTo(CheckDeposit.Status.SUBMITTED) assertThat(checkDeposit.transactionId()).contains("transaction_uyrp7fld2ium70oa7oi") assertThat(checkDeposit.type()).isEqualTo(CheckDeposit.Type.CHECK_DEPOSIT) @@ -241,7 +241,7 @@ internal class CheckDepositTest { .build() ) .inboundMailItemId(null) - .lockboxId(null) + .lockboxRecipientId(null) .status(CheckDeposit.Status.SUBMITTED) .transactionId("transaction_uyrp7fld2ium70oa7oi") .type(CheckDeposit.Type.CHECK_DEPOSIT) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt index 768d45eb6..ab47fc2d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt @@ -37,7 +37,8 @@ internal class InboundMailItemListPageResponseTest { ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .fileId("file_makxrc67oh9l6sg7w9yc") - .lockboxId("lockbox_3xt21ok13q19advds4t5") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .recipientName("Ian Crease") .rejectionReason(null) .status(InboundMailItem.Status.PROCESSED) @@ -71,7 +72,8 @@ internal class InboundMailItemListPageResponseTest { ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .fileId("file_makxrc67oh9l6sg7w9yc") - .lockboxId("lockbox_3xt21ok13q19advds4t5") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .recipientName("Ian Crease") .rejectionReason(null) .status(InboundMailItem.Status.PROCESSED) @@ -109,7 +111,8 @@ internal class InboundMailItemListPageResponseTest { ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .fileId("file_makxrc67oh9l6sg7w9yc") - .lockboxId("lockbox_3xt21ok13q19advds4t5") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .recipientName("Ian Crease") .rejectionReason(null) .status(InboundMailItem.Status.PROCESSED) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParamsTest.kt index 8b1fb44a6..3c7450a05 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListParamsTest.kt @@ -22,7 +22,8 @@ internal class InboundMailItemListParamsTest { ) .cursor("cursor") .limit(1L) - .lockboxId("lockbox_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_recipient_id") .build() } @@ -40,7 +41,8 @@ internal class InboundMailItemListParamsTest { ) .cursor("cursor") .limit(1L) - .lockboxId("lockbox_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_recipient_id") .build() val queryParams = params._queryParams() @@ -54,7 +56,8 @@ internal class InboundMailItemListParamsTest { .put("created_at.on_or_before", "2019-12-27T18:11:19.117Z") .put("cursor", "cursor") .put("limit", "1") - .put("lockbox_id", "lockbox_id") + .put("lockbox_address_id", "lockbox_address_id") + .put("lockbox_recipient_id", "lockbox_recipient_id") .build() ) } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt index e5d1e5996..62c272456 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt @@ -35,7 +35,8 @@ internal class InboundMailItemTest { ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .fileId("file_makxrc67oh9l6sg7w9yc") - .lockboxId("lockbox_3xt21ok13q19advds4t5") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .recipientName("Ian Crease") .rejectionReason(null) .status(InboundMailItem.Status.PROCESSED) @@ -63,7 +64,9 @@ internal class InboundMailItemTest { assertThat(inboundMailItem.createdAt()) .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) assertThat(inboundMailItem.fileId()).isEqualTo("file_makxrc67oh9l6sg7w9yc") - assertThat(inboundMailItem.lockboxId()).contains("lockbox_3xt21ok13q19advds4t5") + assertThat(inboundMailItem.lockboxAddressId()) + .contains("lockbox_address_lw6sbzl9ol5dfd8hdml6") + assertThat(inboundMailItem.lockboxRecipientId()).contains("lockbox_3xt21ok13q19advds4t5") assertThat(inboundMailItem.recipientName()).contains("Ian Crease") assertThat(inboundMailItem.rejectionReason()).isEmpty assertThat(inboundMailItem.status()).isEqualTo(InboundMailItem.Status.PROCESSED) @@ -96,7 +99,8 @@ internal class InboundMailItemTest { ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .fileId("file_makxrc67oh9l6sg7w9yc") - .lockboxId("lockbox_3xt21ok13q19advds4t5") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .recipientName("Ian Crease") .rejectionReason(null) .status(InboundMailItem.Status.PROCESSED) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParamsTest.kt new file mode 100644 index 000000000..cf31897a7 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressCreateParamsTest.kt @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LockboxAddressCreateParamsTest { + + @Test + fun create() { + LockboxAddressCreateParams.builder().description("Lockbox Address 1").build() + } + + @Test + fun body() { + val params = LockboxAddressCreateParams.builder().description("Lockbox Address 1").build() + + val body = params._body() + + assertThat(body.description()).contains("Lockbox Address 1") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = LockboxAddressCreateParams.builder().build() + + val body = params._body() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponseTest.kt similarity index 50% rename from increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponseTest.kt index 10f673ed9..dc37f1daf 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListPageResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.increase.api.core.jsonMapper @@ -8,99 +8,91 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class LockboxListPageResponseTest { +internal class LockboxAddressListPageResponseTest { @Test fun create() { - val lockboxListPageResponse = - LockboxListPageResponse.builder() + val lockboxAddressListPageResponse = + LockboxAddressListPageResponse.builder() .addData( - Lockbox.builder() - .id("lockbox_3xt21ok13q19advds4t5") - .accountId("account_in71c4amph0vgo2qllky") + LockboxAddress.builder() + .id("lockbox_address_lw6sbzl9ol5dfd8hdml6") .address( - Lockbox.Address.builder() + LockboxAddress.Address.builder() .city("San Francisco") .line1("1234 Market St") .line2("Ste 567") .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") .state("CA") .build() ) - .checkDepositBehavior(Lockbox.CheckDepositBehavior.ENABLED) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .description("Lockbox 1") + .description("Lockbox Address 1") .idempotencyKey(null) - .recipientName("Company Inc.") - .type(Lockbox.Type.LOCKBOX) + .status(LockboxAddress.Status.ACTIVE) + .type(LockboxAddress.Type.LOCKBOX_ADDRESS) .build() ) .nextCursor("v57w5d") .build() - assertThat(lockboxListPageResponse.data()) + assertThat(lockboxAddressListPageResponse.data()) .containsExactly( - Lockbox.builder() - .id("lockbox_3xt21ok13q19advds4t5") - .accountId("account_in71c4amph0vgo2qllky") + LockboxAddress.builder() + .id("lockbox_address_lw6sbzl9ol5dfd8hdml6") .address( - Lockbox.Address.builder() + LockboxAddress.Address.builder() .city("San Francisco") .line1("1234 Market St") .line2("Ste 567") .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") .state("CA") .build() ) - .checkDepositBehavior(Lockbox.CheckDepositBehavior.ENABLED) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .description("Lockbox 1") + .description("Lockbox Address 1") .idempotencyKey(null) - .recipientName("Company Inc.") - .type(Lockbox.Type.LOCKBOX) + .status(LockboxAddress.Status.ACTIVE) + .type(LockboxAddress.Type.LOCKBOX_ADDRESS) .build() ) - assertThat(lockboxListPageResponse.nextCursor()).contains("v57w5d") + assertThat(lockboxAddressListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val lockboxListPageResponse = - LockboxListPageResponse.builder() + val lockboxAddressListPageResponse = + LockboxAddressListPageResponse.builder() .addData( - Lockbox.builder() - .id("lockbox_3xt21ok13q19advds4t5") - .accountId("account_in71c4amph0vgo2qllky") + LockboxAddress.builder() + .id("lockbox_address_lw6sbzl9ol5dfd8hdml6") .address( - Lockbox.Address.builder() + LockboxAddress.Address.builder() .city("San Francisco") .line1("1234 Market St") .line2("Ste 567") .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") .state("CA") .build() ) - .checkDepositBehavior(Lockbox.CheckDepositBehavior.ENABLED) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .description("Lockbox 1") + .description("Lockbox Address 1") .idempotencyKey(null) - .recipientName("Company Inc.") - .type(Lockbox.Type.LOCKBOX) + .status(LockboxAddress.Status.ACTIVE) + .type(LockboxAddress.Type.LOCKBOX_ADDRESS) .build() ) .nextCursor("v57w5d") .build() - val roundtrippedLockboxListPageResponse = + val roundtrippedLockboxAddressListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(lockboxListPageResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(lockboxAddressListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedLockboxListPageResponse).isEqualTo(lockboxListPageResponse) + assertThat(roundtrippedLockboxAddressListPageResponse) + .isEqualTo(lockboxAddressListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParamsTest.kt similarity index 82% rename from increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListParamsTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParamsTest.kt index 5ab225cd4..df936b9b1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressListParamsTest.kt @@ -1,20 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxaddresses 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 LockboxListParamsTest { +internal class LockboxAddressListParamsTest { @Test fun create() { - LockboxListParams.builder() - .accountId("account_id") + LockboxAddressListParams.builder() .createdAt( - LockboxListParams.CreatedAt.builder() + LockboxAddressListParams.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")) @@ -30,10 +29,9 @@ internal class LockboxListParamsTest { @Test fun queryParams() { val params = - LockboxListParams.builder() - .accountId("account_id") + LockboxAddressListParams.builder() .createdAt( - LockboxListParams.CreatedAt.builder() + LockboxAddressListParams.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")) @@ -50,7 +48,6 @@ internal class LockboxListParamsTest { 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") @@ -64,7 +61,7 @@ internal class LockboxListParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = LockboxListParams.builder().build() + val params = LockboxAddressListParams.builder().build() val queryParams = params._queryParams() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParamsTest.kt new file mode 100644 index 000000000..80ab5533a --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LockboxAddressRetrieveParamsTest { + + @Test + fun create() { + LockboxAddressRetrieveParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .build() + } + + @Test + fun pathParams() { + val params = + LockboxAddressRetrieveParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .build() + + assertThat(params._pathParam(0)).isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressTest.kt new file mode 100644 index 000000000..1ab997dfa --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressTest.kt @@ -0,0 +1,83 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +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 LockboxAddressTest { + + @Test + fun create() { + val lockboxAddress = + LockboxAddress.builder() + .id("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .address( + LockboxAddress.Address.builder() + .city("San Francisco") + .line1("1234 Market St") + .line2("Ste 567") + .postalCode("94114") + .state("CA") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description("Lockbox Address 1") + .idempotencyKey(null) + .status(LockboxAddress.Status.ACTIVE) + .type(LockboxAddress.Type.LOCKBOX_ADDRESS) + .build() + + assertThat(lockboxAddress.id()).isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + assertThat(lockboxAddress.address()) + .contains( + LockboxAddress.Address.builder() + .city("San Francisco") + .line1("1234 Market St") + .line2("Ste 567") + .postalCode("94114") + .state("CA") + .build() + ) + assertThat(lockboxAddress.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(lockboxAddress.description()).contains("Lockbox Address 1") + assertThat(lockboxAddress.idempotencyKey()).isEmpty + assertThat(lockboxAddress.status()).isEqualTo(LockboxAddress.Status.ACTIVE) + assertThat(lockboxAddress.type()).isEqualTo(LockboxAddress.Type.LOCKBOX_ADDRESS) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val lockboxAddress = + LockboxAddress.builder() + .id("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .address( + LockboxAddress.Address.builder() + .city("San Francisco") + .line1("1234 Market St") + .line2("Ste 567") + .postalCode("94114") + .state("CA") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description("Lockbox Address 1") + .idempotencyKey(null) + .status(LockboxAddress.Status.ACTIVE) + .type(LockboxAddress.Type.LOCKBOX_ADDRESS) + .build() + + val roundtrippedLockboxAddress = + jsonMapper.readValue( + jsonMapper.writeValueAsString(lockboxAddress), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLockboxAddress).isEqualTo(lockboxAddress) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParamsTest.kt new file mode 100644 index 000000000..815da3487 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxaddresses/LockboxAddressUpdateParamsTest.kt @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxaddresses + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LockboxAddressUpdateParamsTest { + + @Test + fun create() { + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .status(LockboxAddressUpdateParams.Status.DISABLED) + .build() + } + + @Test + fun pathParams() { + val params = + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .build() + + assertThat(params._pathParam(0)).isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .status(LockboxAddressUpdateParams.Status.DISABLED) + .build() + + val body = params._body() + + assertThat(body.description()).contains("x") + assertThat(body.status()).contains(LockboxAddressUpdateParams.Status.DISABLED) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .build() + + val body = params._body() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxCreateParamsTest.kt deleted file mode 100644 index 3938f57cf..000000000 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxCreateParamsTest.kt +++ /dev/null @@ -1,43 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.increase.api.models.lockboxes - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class LockboxCreateParamsTest { - - @Test - fun create() { - LockboxCreateParams.builder() - .accountId("account_in71c4amph0vgo2qllky") - .description("Rent payments") - .recipientName("x") - .build() - } - - @Test - fun body() { - val params = - LockboxCreateParams.builder() - .accountId("account_in71c4amph0vgo2qllky") - .description("Rent payments") - .recipientName("x") - .build() - - val body = params._body() - - assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") - assertThat(body.description()).contains("Rent payments") - assertThat(body.recipientName()).contains("x") - } - - @Test - fun bodyWithoutOptionalFields() { - val params = LockboxCreateParams.builder().accountId("account_in71c4amph0vgo2qllky").build() - - val body = params._body() - - assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") - } -} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxTest.kt deleted file mode 100644 index 2eaa9160d..000000000 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxTest.kt +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.increase.api.models.lockboxes - -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 LockboxTest { - - @Test - fun create() { - val lockbox = - Lockbox.builder() - .id("lockbox_3xt21ok13q19advds4t5") - .accountId("account_in71c4amph0vgo2qllky") - .address( - Lockbox.Address.builder() - .city("San Francisco") - .line1("1234 Market St") - .line2("Ste 567") - .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") - .state("CA") - .build() - ) - .checkDepositBehavior(Lockbox.CheckDepositBehavior.ENABLED) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .description("Lockbox 1") - .idempotencyKey(null) - .recipientName("Company Inc.") - .type(Lockbox.Type.LOCKBOX) - .build() - - assertThat(lockbox.id()).isEqualTo("lockbox_3xt21ok13q19advds4t5") - assertThat(lockbox.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") - assertThat(lockbox.address()) - .isEqualTo( - Lockbox.Address.builder() - .city("San Francisco") - .line1("1234 Market St") - .line2("Ste 567") - .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") - .state("CA") - .build() - ) - assertThat(lockbox.checkDepositBehavior()).isEqualTo(Lockbox.CheckDepositBehavior.ENABLED) - assertThat(lockbox.createdAt()).isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - assertThat(lockbox.description()).contains("Lockbox 1") - assertThat(lockbox.idempotencyKey()).isEmpty - assertThat(lockbox.recipientName()).contains("Company Inc.") - assertThat(lockbox.type()).isEqualTo(Lockbox.Type.LOCKBOX) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val lockbox = - Lockbox.builder() - .id("lockbox_3xt21ok13q19advds4t5") - .accountId("account_in71c4amph0vgo2qllky") - .address( - Lockbox.Address.builder() - .city("San Francisco") - .line1("1234 Market St") - .line2("Ste 567") - .postalCode("94114") - .recipient("Company Inc. ATTN: VRE6P") - .state("CA") - .build() - ) - .checkDepositBehavior(Lockbox.CheckDepositBehavior.ENABLED) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .description("Lockbox 1") - .idempotencyKey(null) - .recipientName("Company Inc.") - .type(Lockbox.Type.LOCKBOX) - .build() - - val roundtrippedLockbox = - jsonMapper.readValue(jsonMapper.writeValueAsString(lockbox), jacksonTypeRef()) - - assertThat(roundtrippedLockbox).isEqualTo(lockbox) - } -} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParamsTest.kt deleted file mode 100644 index f52dc3a5c..000000000 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParamsTest.kt +++ /dev/null @@ -1,53 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.increase.api.models.lockboxes - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class LockboxUpdateParamsTest { - - @Test - fun create() { - LockboxUpdateParams.builder() - .lockboxId("lockbox_3xt21ok13q19advds4t5") - .checkDepositBehavior(LockboxUpdateParams.CheckDepositBehavior.DISABLED) - .description("x") - .recipientName("x") - .build() - } - - @Test - fun pathParams() { - val params = LockboxUpdateParams.builder().lockboxId("lockbox_3xt21ok13q19advds4t5").build() - - assertThat(params._pathParam(0)).isEqualTo("lockbox_3xt21ok13q19advds4t5") - // out-of-bound path param - assertThat(params._pathParam(1)).isEqualTo("") - } - - @Test - fun body() { - val params = - LockboxUpdateParams.builder() - .lockboxId("lockbox_3xt21ok13q19advds4t5") - .checkDepositBehavior(LockboxUpdateParams.CheckDepositBehavior.DISABLED) - .description("x") - .recipientName("x") - .build() - - val body = params._body() - - assertThat(body.checkDepositBehavior()) - .contains(LockboxUpdateParams.CheckDepositBehavior.DISABLED) - assertThat(body.description()).contains("x") - assertThat(body.recipientName()).contains("x") - } - - @Test - fun bodyWithoutOptionalFields() { - val params = LockboxUpdateParams.builder().lockboxId("lockbox_3xt21ok13q19advds4t5").build() - - val body = params._body() - } -} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParamsTest.kt new file mode 100644 index 000000000..146e93b38 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientCreateParamsTest.kt @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LockboxRecipientCreateParamsTest { + + @Test + fun create() { + LockboxRecipientCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .recipientName("Ian Crease") + .build() + } + + @Test + fun body() { + val params = + LockboxRecipientCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .recipientName("Ian Crease") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.lockboxAddressId()).isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + assertThat(body.description()).contains("x") + assertThat(body.recipientName()).contains("Ian Crease") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + LockboxRecipientCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.lockboxAddressId()).isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponseTest.kt new file mode 100644 index 000000000..0e9e4f8c2 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListPageResponseTest.kt @@ -0,0 +1,83 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 LockboxRecipientListPageResponseTest { + + @Test + fun create() { + val lockboxRecipientListPageResponse = + LockboxRecipientListPageResponse.builder() + .addData( + LockboxRecipient.builder() + .id("lockbox_3xt21ok13q19advds4t5") + .accountId("account_in71c4amph0vgo2qllky") + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description(null) + .idempotencyKey(null) + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .mailStopCode("VRE6P") + .recipientName("Company Inc.") + .status(LockboxRecipient.Status.ACTIVE) + .type(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(lockboxRecipientListPageResponse.data()) + .containsExactly( + LockboxRecipient.builder() + .id("lockbox_3xt21ok13q19advds4t5") + .accountId("account_in71c4amph0vgo2qllky") + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description(null) + .idempotencyKey(null) + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .mailStopCode("VRE6P") + .recipientName("Company Inc.") + .status(LockboxRecipient.Status.ACTIVE) + .type(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + .build() + ) + assertThat(lockboxRecipientListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val lockboxRecipientListPageResponse = + LockboxRecipientListPageResponse.builder() + .addData( + LockboxRecipient.builder() + .id("lockbox_3xt21ok13q19advds4t5") + .accountId("account_in71c4amph0vgo2qllky") + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description(null) + .idempotencyKey(null) + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .mailStopCode("VRE6P") + .recipientName("Company Inc.") + .status(LockboxRecipient.Status.ACTIVE) + .type(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedLockboxRecipientListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(lockboxRecipientListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLockboxRecipientListPageResponse) + .isEqualTo(lockboxRecipientListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParamsTest.kt new file mode 100644 index 000000000..579f03787 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientListParamsTest.kt @@ -0,0 +1,76 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 LockboxRecipientListParamsTest { + + @Test + fun create() { + LockboxRecipientListParams.builder() + .accountId("account_id") + .createdAt( + LockboxRecipientListParams.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") + .idempotencyKey("x") + .limit(1L) + .lockboxAddressId("lockbox_address_id") + .build() + } + + @Test + fun queryParams() { + val params = + LockboxRecipientListParams.builder() + .accountId("account_id") + .createdAt( + LockboxRecipientListParams.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") + .idempotencyKey("x") + .limit(1L) + .lockboxAddressId("lockbox_address_id") + .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("idempotency_key", "x") + .put("limit", "1") + .put("lockbox_address_id", "lockbox_address_id") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = LockboxRecipientListParams.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/lockboxes/LockboxRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParamsTest.kt similarity index 52% rename from increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxRetrieveParamsTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParamsTest.kt index e4f157b32..d2ebfc626 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxRetrieveParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientRetrieveParamsTest.kt @@ -1,21 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.increase.api.models.lockboxes +package com.increase.api.models.lockboxrecipients import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class LockboxRetrieveParamsTest { +internal class LockboxRecipientRetrieveParamsTest { @Test fun create() { - LockboxRetrieveParams.builder().lockboxId("lockbox_3xt21ok13q19advds4t5").build() + LockboxRecipientRetrieveParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .build() } @Test fun pathParams() { val params = - LockboxRetrieveParams.builder().lockboxId("lockbox_3xt21ok13q19advds4t5").build() + LockboxRecipientRetrieveParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .build() assertThat(params._pathParam(0)).isEqualTo("lockbox_3xt21ok13q19advds4t5") // out-of-bound path param diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientTest.kt new file mode 100644 index 000000000..5026f6c5b --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientTest.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +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 LockboxRecipientTest { + + @Test + fun create() { + val lockboxRecipient = + LockboxRecipient.builder() + .id("lockbox_3xt21ok13q19advds4t5") + .accountId("account_in71c4amph0vgo2qllky") + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description(null) + .idempotencyKey(null) + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .mailStopCode("VRE6P") + .recipientName("Company Inc.") + .status(LockboxRecipient.Status.ACTIVE) + .type(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + .build() + + assertThat(lockboxRecipient.id()).isEqualTo("lockbox_3xt21ok13q19advds4t5") + assertThat(lockboxRecipient.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(lockboxRecipient.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(lockboxRecipient.description()).isEmpty + assertThat(lockboxRecipient.idempotencyKey()).isEmpty + assertThat(lockboxRecipient.lockboxAddressId()) + .isEqualTo("lockbox_address_lw6sbzl9ol5dfd8hdml6") + assertThat(lockboxRecipient.mailStopCode()).isEqualTo("VRE6P") + assertThat(lockboxRecipient.recipientName()).contains("Company Inc.") + assertThat(lockboxRecipient.status()).contains(LockboxRecipient.Status.ACTIVE) + assertThat(lockboxRecipient.type()).isEqualTo(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val lockboxRecipient = + LockboxRecipient.builder() + .id("lockbox_3xt21ok13q19advds4t5") + .accountId("account_in71c4amph0vgo2qllky") + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .description(null) + .idempotencyKey(null) + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .mailStopCode("VRE6P") + .recipientName("Company Inc.") + .status(LockboxRecipient.Status.ACTIVE) + .type(LockboxRecipient.Type.LOCKBOX_RECIPIENT) + .build() + + val roundtrippedLockboxRecipient = + jsonMapper.readValue( + jsonMapper.writeValueAsString(lockboxRecipient), + jacksonTypeRef(), + ) + + assertThat(roundtrippedLockboxRecipient).isEqualTo(lockboxRecipient) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParamsTest.kt new file mode 100644 index 000000000..251680079 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxrecipients/LockboxRecipientUpdateParamsTest.kt @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxrecipients + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class LockboxRecipientUpdateParamsTest { + + @Test + fun create() { + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .description("x") + .recipientName("x") + .status(LockboxRecipientUpdateParams.Status.ACTIVE) + .build() + } + + @Test + fun pathParams() { + val params = + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .build() + + assertThat(params._pathParam(0)).isEqualTo("lockbox_3xt21ok13q19advds4t5") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .description("x") + .recipientName("x") + .status(LockboxRecipientUpdateParams.Status.ACTIVE) + .build() + + val body = params._body() + + assertThat(body.description()).contains("x") + assertThat(body.recipientName()).contains("x") + assertThat(body.status()).contains(LockboxRecipientUpdateParams.Status.ACTIVE) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .build() + + val body = params._body() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParamsTest.kt index b3d63a951..444cc6ee2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundmailitems/InboundMailItemCreateParamsTest.kt @@ -11,8 +11,9 @@ internal class InboundMailItemCreateParamsTest { fun create() { InboundMailItemCreateParams.builder() .amount(1000L) - .lockboxId("lockbox_3xt21ok13q19advds4t5") .contentsFileId("contents_file_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .build() } @@ -21,28 +22,25 @@ internal class InboundMailItemCreateParamsTest { val params = InboundMailItemCreateParams.builder() .amount(1000L) - .lockboxId("lockbox_3xt21ok13q19advds4t5") .contentsFileId("contents_file_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .build() val body = params._body() assertThat(body.amount()).isEqualTo(1000L) - assertThat(body.lockboxId()).isEqualTo("lockbox_3xt21ok13q19advds4t5") assertThat(body.contentsFileId()).contains("contents_file_id") + assertThat(body.lockboxAddressId()).contains("lockbox_address_id") + assertThat(body.lockboxRecipientId()).contains("lockbox_3xt21ok13q19advds4t5") } @Test fun bodyWithoutOptionalFields() { - val params = - InboundMailItemCreateParams.builder() - .amount(1000L) - .lockboxId("lockbox_3xt21ok13q19advds4t5") - .build() + val params = InboundMailItemCreateParams.builder().amount(1000L).build() val body = params._body() assertThat(body.amount()).isEqualTo(1000L) - assertThat(body.lockboxId()).isEqualTo("lockbox_3xt21ok13q19advds4t5") } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncTest.kt similarity index 50% rename from increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncTest.kt index 722e1d4a9..a39c310d1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxAddressServiceAsyncTest.kt @@ -4,13 +4,13 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxUpdateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) -internal class LockboxServiceAsyncTest { +internal class LockboxAddressServiceAsyncTest { @Test fun create() { @@ -19,19 +19,15 @@ internal class LockboxServiceAsyncTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxServiceAsync = client.lockboxes() + val lockboxAddressServiceAsync = client.lockboxAddresses() - val lockboxFuture = - lockboxServiceAsync.create( - LockboxCreateParams.builder() - .accountId("account_in71c4amph0vgo2qllky") - .description("Rent payments") - .recipientName("x") - .build() + val lockboxAddressFuture = + lockboxAddressServiceAsync.create( + LockboxAddressCreateParams.builder().description("Lockbox Address 1").build() ) - val lockbox = lockboxFuture.get() - lockbox.validate() + val lockboxAddress = lockboxAddressFuture.get() + lockboxAddress.validate() } @Test @@ -41,12 +37,13 @@ internal class LockboxServiceAsyncTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxServiceAsync = client.lockboxes() + val lockboxAddressServiceAsync = client.lockboxAddresses() - val lockboxFuture = lockboxServiceAsync.retrieve("lockbox_3xt21ok13q19advds4t5") + val lockboxAddressFuture = + lockboxAddressServiceAsync.retrieve("lockbox_address_lw6sbzl9ol5dfd8hdml6") - val lockbox = lockboxFuture.get() - lockbox.validate() + val lockboxAddress = lockboxAddressFuture.get() + lockboxAddress.validate() } @Test @@ -56,20 +53,19 @@ internal class LockboxServiceAsyncTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxServiceAsync = client.lockboxes() + val lockboxAddressServiceAsync = client.lockboxAddresses() - val lockboxFuture = - lockboxServiceAsync.update( - LockboxUpdateParams.builder() - .lockboxId("lockbox_3xt21ok13q19advds4t5") - .checkDepositBehavior(LockboxUpdateParams.CheckDepositBehavior.DISABLED) + val lockboxAddressFuture = + lockboxAddressServiceAsync.update( + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") .description("x") - .recipientName("x") + .status(LockboxAddressUpdateParams.Status.DISABLED) .build() ) - val lockbox = lockboxFuture.get() - lockbox.validate() + val lockboxAddress = lockboxAddressFuture.get() + lockboxAddress.validate() } @Test @@ -79,9 +75,9 @@ internal class LockboxServiceAsyncTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxServiceAsync = client.lockboxes() + val lockboxAddressServiceAsync = client.lockboxAddresses() - val pageFuture = lockboxServiceAsync.list() + val pageFuture = lockboxAddressServiceAsync.list() val page = pageFuture.get() page.response().validate() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncTest.kt new file mode 100644 index 000000000..22262dd77 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxRecipientServiceAsyncTest.kt @@ -0,0 +1,91 @@ +// 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.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LockboxRecipientServiceAsyncTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientServiceAsync = client.lockboxRecipients() + + val lockboxRecipientFuture = + lockboxRecipientServiceAsync.create( + LockboxRecipientCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .recipientName("Ian Crease") + .build() + ) + + val lockboxRecipient = lockboxRecipientFuture.get() + lockboxRecipient.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientServiceAsync = client.lockboxRecipients() + + val lockboxRecipientFuture = + lockboxRecipientServiceAsync.retrieve("lockbox_3xt21ok13q19advds4t5") + + val lockboxRecipient = lockboxRecipientFuture.get() + lockboxRecipient.validate() + } + + @Test + fun update() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientServiceAsync = client.lockboxRecipients() + + val lockboxRecipientFuture = + lockboxRecipientServiceAsync.update( + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .description("x") + .recipientName("x") + .status(LockboxRecipientUpdateParams.Status.ACTIVE) + .build() + ) + + val lockboxRecipient = lockboxRecipientFuture.get() + lockboxRecipient.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientServiceAsync = client.lockboxRecipients() + + val pageFuture = lockboxRecipientServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundMailItemServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundMailItemServiceAsyncTest.kt index e07b9e4fe..e8d38cb18 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundMailItemServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundMailItemServiceAsyncTest.kt @@ -24,8 +24,9 @@ internal class InboundMailItemServiceAsyncTest { inboundMailItemServiceAsync.create( InboundMailItemCreateParams.builder() .amount(1000L) - .lockboxId("lockbox_3xt21ok13q19advds4t5") .contentsFileId("contents_file_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxAddressServiceTest.kt similarity index 54% rename from increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxAddressServiceTest.kt index 41da8d7e3..5b78bce83 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxAddressServiceTest.kt @@ -4,13 +4,13 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxUpdateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressCreateParams +import com.increase.api.models.lockboxaddresses.LockboxAddressUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) -internal class LockboxServiceTest { +internal class LockboxAddressServiceTest { @Test fun create() { @@ -19,18 +19,14 @@ internal class LockboxServiceTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxService = client.lockboxes() + val lockboxAddressService = client.lockboxAddresses() - val lockbox = - lockboxService.create( - LockboxCreateParams.builder() - .accountId("account_in71c4amph0vgo2qllky") - .description("Rent payments") - .recipientName("x") - .build() + val lockboxAddress = + lockboxAddressService.create( + LockboxAddressCreateParams.builder().description("Lockbox Address 1").build() ) - lockbox.validate() + lockboxAddress.validate() } @Test @@ -40,11 +36,11 @@ internal class LockboxServiceTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxService = client.lockboxes() + val lockboxAddressService = client.lockboxAddresses() - val lockbox = lockboxService.retrieve("lockbox_3xt21ok13q19advds4t5") + val lockboxAddress = lockboxAddressService.retrieve("lockbox_address_lw6sbzl9ol5dfd8hdml6") - lockbox.validate() + lockboxAddress.validate() } @Test @@ -54,19 +50,18 @@ internal class LockboxServiceTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxService = client.lockboxes() + val lockboxAddressService = client.lockboxAddresses() - val lockbox = - lockboxService.update( - LockboxUpdateParams.builder() - .lockboxId("lockbox_3xt21ok13q19advds4t5") - .checkDepositBehavior(LockboxUpdateParams.CheckDepositBehavior.DISABLED) + val lockboxAddress = + lockboxAddressService.update( + LockboxAddressUpdateParams.builder() + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") .description("x") - .recipientName("x") + .status(LockboxAddressUpdateParams.Status.DISABLED) .build() ) - lockbox.validate() + lockboxAddress.validate() } @Test @@ -76,9 +71,9 @@ internal class LockboxServiceTest { .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() - val lockboxService = client.lockboxes() + val lockboxAddressService = client.lockboxAddresses() - val page = lockboxService.list() + val page = lockboxAddressService.list() page.response().validate() } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceTest.kt new file mode 100644 index 000000000..5db0dbb8f --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxRecipientServiceTest.kt @@ -0,0 +1,86 @@ +// 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.lockboxrecipients.LockboxRecipientCreateParams +import com.increase.api.models.lockboxrecipients.LockboxRecipientUpdateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class LockboxRecipientServiceTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientService = client.lockboxRecipients() + + val lockboxRecipient = + lockboxRecipientService.create( + LockboxRecipientCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .lockboxAddressId("lockbox_address_lw6sbzl9ol5dfd8hdml6") + .description("x") + .recipientName("Ian Crease") + .build() + ) + + lockboxRecipient.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientService = client.lockboxRecipients() + + val lockboxRecipient = lockboxRecipientService.retrieve("lockbox_3xt21ok13q19advds4t5") + + lockboxRecipient.validate() + } + + @Test + fun update() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientService = client.lockboxRecipients() + + val lockboxRecipient = + lockboxRecipientService.update( + LockboxRecipientUpdateParams.builder() + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") + .description("x") + .recipientName("x") + .status(LockboxRecipientUpdateParams.Status.ACTIVE) + .build() + ) + + lockboxRecipient.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val lockboxRecipientService = client.lockboxRecipients() + + val page = lockboxRecipientService.list() + + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundMailItemServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundMailItemServiceTest.kt index ddd790849..de3fe68ec 100755 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundMailItemServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundMailItemServiceTest.kt @@ -24,8 +24,9 @@ internal class InboundMailItemServiceTest { inboundMailItemService.create( InboundMailItemCreateParams.builder() .amount(1000L) - .lockboxId("lockbox_3xt21ok13q19advds4t5") .contentsFileId("contents_file_id") + .lockboxAddressId("lockbox_address_id") + .lockboxRecipientId("lockbox_3xt21ok13q19advds4t5") .build() ) 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 927dc50f8..b948afa10 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 @@ -78,7 +78,8 @@ internal class ProGuardCompatibilityTest { assertThat(client.inboundFednowTransfers()).isNotNull() assertThat(client.swiftTransfers()).isNotNull() assertThat(client.checkDeposits()).isNotNull() - assertThat(client.lockboxes()).isNotNull() + assertThat(client.lockboxAddresses()).isNotNull() + assertThat(client.lockboxRecipients()).isNotNull() assertThat(client.inboundMailItems()).isNotNull() assertThat(client.routingNumbers()).isNotNull() assertThat(client.externalAccounts()).isNotNull() From 5e996394faa744ab511d666d1abc7b887f1828b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:50:42 +0000 Subject: [PATCH 3/4] feat(api): api update --- .stats.yml | 2 +- .../api/models/cardpushtransfers/CardPushTransfer.kt | 9 +++++++++ .../api/models/cardtokens/CardTokenCapabilities.kt | 9 +++++++++ .../api/models/cardvalidations/CardValidation.kt | 9 +++++++++ .../simulations/cardtokens/CardTokenCreateParams.kt | 9 +++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0f4697e38..6f61c3b1a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 236 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-47752267c48d299a01c906499bb7d584228ea8801b7d83e34ae4100d5dec3434.yml -openapi_spec_hash: 132e71b6e6bb1c5f06153f87d50e335b +openapi_spec_hash: 9ea8bc6dc383de626d3fa15c823227ae config_hash: 026e2baa580c7f5f2447c24332081ba8 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt index f39344f7b..6f764f509 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt @@ -6525,6 +6525,9 @@ private constructor( /** Mastercard and Maestro */ @JvmField val MASTERCARD = of("mastercard") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Route(JsonField.of(value)) } @@ -6534,6 +6537,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, } /** @@ -6550,6 +6555,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, /** An enum member indicating that [Route] was instantiated with an unknown value. */ _UNKNOWN, } @@ -6565,6 +6572,7 @@ private constructor( when (this) { VISA -> Value.VISA MASTERCARD -> Value.MASTERCARD + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -6581,6 +6589,7 @@ private constructor( when (this) { VISA -> Known.VISA MASTERCARD -> Known.MASTERCARD + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Route: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenCapabilities.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenCapabilities.kt index 6bd598f57..b262bdd98 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenCapabilities.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenCapabilities.kt @@ -811,6 +811,9 @@ private constructor( /** Mastercard and Maestro */ @JvmField val MASTERCARD = of("mastercard") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = InnerRoute(JsonField.of(value)) } @@ -820,6 +823,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, } /** @@ -836,6 +841,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, /** * An enum member indicating that [InnerRoute] was instantiated with an unknown * value. @@ -854,6 +861,7 @@ private constructor( when (this) { VISA -> Value.VISA MASTERCARD -> Value.MASTERCARD + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -870,6 +878,7 @@ private constructor( when (this) { VISA -> Known.VISA MASTERCARD -> Known.MASTERCARD + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown InnerRoute: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt index 0bb6714f2..773b4c75f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt @@ -4956,6 +4956,9 @@ private constructor( /** Mastercard and Maestro */ @JvmField val MASTERCARD = of("mastercard") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Route(JsonField.of(value)) } @@ -4965,6 +4968,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, } /** @@ -4981,6 +4986,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, /** An enum member indicating that [Route] was instantiated with an unknown value. */ _UNKNOWN, } @@ -4996,6 +5003,7 @@ private constructor( when (this) { VISA -> Value.VISA MASTERCARD -> Value.MASTERCARD + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -5012,6 +5020,7 @@ private constructor( when (this) { VISA -> Known.VISA MASTERCARD -> Known.MASTERCARD + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Route: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardtokens/CardTokenCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardtokens/CardTokenCreateParams.kt index 193bcf716..afa3eb2b5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardtokens/CardTokenCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardtokens/CardTokenCreateParams.kt @@ -1304,6 +1304,9 @@ private constructor( /** Mastercard and Maestro */ @JvmField val MASTERCARD = of("mastercard") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Route(JsonField.of(value)) } @@ -1313,6 +1316,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, } /** @@ -1329,6 +1334,8 @@ private constructor( VISA, /** Mastercard and Maestro */ MASTERCARD, + /** Pulse */ + PULSE, /** * An enum member indicating that [Route] was instantiated with an unknown value. */ @@ -1346,6 +1353,7 @@ private constructor( when (this) { VISA -> Value.VISA MASTERCARD -> Value.MASTERCARD + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -1362,6 +1370,7 @@ private constructor( when (this) { VISA -> Known.VISA MASTERCARD -> Known.MASTERCARD + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Route: $value") } From 620e05509f0c6369908e448dc2633a95d82bb846 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:51:22 +0000 Subject: [PATCH 4/4] release: 0.526.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2607471c1..1c8721128 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.525.0" + ".": "0.526.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e346bdb1..9897f539f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.526.0 (2026-04-27) + +Full Changelog: [v0.525.0...v0.526.0](https://github.com/Increase/increase-java/compare/v0.525.0...v0.526.0) + +### Features + +* **api:** api update ([5e99639](https://github.com/Increase/increase-java/commit/5e996394faa744ab511d666d1abc7b887f1828b8)) +* **api:** api update ([118c6f8](https://github.com/Increase/increase-java/commit/118c6f861601da7a97fad8fe9640fc8c76e88b11)) + ## 0.525.0 (2026-04-22) Full Changelog: [v0.524.0...v0.525.0](https://github.com/Increase/increase-java/compare/v0.524.0...v0.525.0) diff --git a/README.md b/README.md index 9f2c1fb9e..b80aeaff4 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.525.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.525.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.525.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.526.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.526.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.526.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.525.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.526.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.525.0") +implementation("com.increase.api:increase-java:0.526.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.525.0") com.increase.api increase-java - 0.525.0 + 0.526.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 7db5af3e2..6696adc6b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.525.0" // x-release-please-version + version = "0.526.0" // x-release-please-version } subprojects {