diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 5d20cc498..2607471c1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.524.0"
+ ".": "0.525.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 2715c40d0..e029231b5 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 241
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1f2c653a8b55e63d756d60f9110ceadb18f87a6039762b5ee31b5373bbc4499a.yml
-openapi_spec_hash: a7b01c23c92b07f280117e6ba6262a7e
-config_hash: cb5b8736705c06b670f6a25484622d62
+configured_endpoints: 232
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4615e5953fac5a76724144fc2e1f9f675a9722dc05adaeab23e4d09c9577086b.yml
+openapi_spec_hash: 6db98497c4dda09b575d5ee12371ef83
+config_hash: b24ba63471a818520cec39b4695e1825
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31ebb62e7..8e346bdb1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 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)
+
+### Features
+
+* **api:** api update ([988c18c](https://github.com/Increase/increase-java/commit/988c18c167cd5c84b0a16fb106e85ca4b1f8c77f))
+
## 0.524.0 (2026-04-20)
Full Changelog: [v0.523.0...v0.524.0](https://github.com/Increase/increase-java/compare/v0.523.0...v0.524.0)
diff --git a/README.md b/README.md
index 028d571c1..9f2c1fb9e 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.524.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.524.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.525.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.525.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.524.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.525.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.524.0")
+implementation("com.increase.api:increase-java:0.525.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.524.0")
com.increase.api
increase-java
- 0.524.0
+ 0.525.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 03076e758..7db5af3e2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.524.0" // x-release-please-version
+ version = "0.525.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
index afd764ab5..325f50a3e 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
@@ -10,9 +10,6 @@ import com.increase.api.services.blocking.AccountTransferService
import com.increase.api.services.blocking.AchPrenotificationService
import com.increase.api.services.blocking.AchTransferService
import com.increase.api.services.blocking.BeneficialOwnerService
-import com.increase.api.services.blocking.BookkeepingAccountService
-import com.increase.api.services.blocking.BookkeepingEntryService
-import com.increase.api.services.blocking.BookkeepingEntrySetService
import com.increase.api.services.blocking.CardDisputeService
import com.increase.api.services.blocking.CardPaymentService
import com.increase.api.services.blocking.CardPurchaseSupplementService
@@ -190,12 +187,6 @@ interface IncreaseClient {
fun realTimeDecisions(): RealTimeDecisionService
- fun bookkeepingAccounts(): BookkeepingAccountService
-
- fun bookkeepingEntrySets(): BookkeepingEntrySetService
-
- fun bookkeepingEntries(): BookkeepingEntryService
-
fun groups(): GroupService
fun oauthApplications(): OAuthApplicationService
@@ -332,12 +323,6 @@ interface IncreaseClient {
fun realTimeDecisions(): RealTimeDecisionService.WithRawResponse
- fun bookkeepingAccounts(): BookkeepingAccountService.WithRawResponse
-
- fun bookkeepingEntrySets(): BookkeepingEntrySetService.WithRawResponse
-
- fun bookkeepingEntries(): BookkeepingEntryService.WithRawResponse
-
fun groups(): GroupService.WithRawResponse
fun oauthApplications(): OAuthApplicationService.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 0f74f0f91..eb524b929 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
@@ -10,9 +10,6 @@ import com.increase.api.services.async.AccountTransferServiceAsync
import com.increase.api.services.async.AchPrenotificationServiceAsync
import com.increase.api.services.async.AchTransferServiceAsync
import com.increase.api.services.async.BeneficialOwnerServiceAsync
-import com.increase.api.services.async.BookkeepingAccountServiceAsync
-import com.increase.api.services.async.BookkeepingEntryServiceAsync
-import com.increase.api.services.async.BookkeepingEntrySetServiceAsync
import com.increase.api.services.async.CardDisputeServiceAsync
import com.increase.api.services.async.CardPaymentServiceAsync
import com.increase.api.services.async.CardPurchaseSupplementServiceAsync
@@ -190,12 +187,6 @@ interface IncreaseClientAsync {
fun realTimeDecisions(): RealTimeDecisionServiceAsync
- fun bookkeepingAccounts(): BookkeepingAccountServiceAsync
-
- fun bookkeepingEntrySets(): BookkeepingEntrySetServiceAsync
-
- fun bookkeepingEntries(): BookkeepingEntryServiceAsync
-
fun groups(): GroupServiceAsync
fun oauthApplications(): OAuthApplicationServiceAsync
@@ -336,12 +327,6 @@ interface IncreaseClientAsync {
fun realTimeDecisions(): RealTimeDecisionServiceAsync.WithRawResponse
- fun bookkeepingAccounts(): BookkeepingAccountServiceAsync.WithRawResponse
-
- fun bookkeepingEntrySets(): BookkeepingEntrySetServiceAsync.WithRawResponse
-
- fun bookkeepingEntries(): BookkeepingEntryServiceAsync.WithRawResponse
-
fun groups(): GroupServiceAsync.WithRawResponse
fun oauthApplications(): OAuthApplicationServiceAsync.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 19629f4e2..23415543b 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
@@ -18,12 +18,6 @@ import com.increase.api.services.async.AchTransferServiceAsync
import com.increase.api.services.async.AchTransferServiceAsyncImpl
import com.increase.api.services.async.BeneficialOwnerServiceAsync
import com.increase.api.services.async.BeneficialOwnerServiceAsyncImpl
-import com.increase.api.services.async.BookkeepingAccountServiceAsync
-import com.increase.api.services.async.BookkeepingAccountServiceAsyncImpl
-import com.increase.api.services.async.BookkeepingEntryServiceAsync
-import com.increase.api.services.async.BookkeepingEntryServiceAsyncImpl
-import com.increase.api.services.async.BookkeepingEntrySetServiceAsync
-import com.increase.api.services.async.BookkeepingEntrySetServiceAsyncImpl
import com.increase.api.services.async.CardDisputeServiceAsync
import com.increase.api.services.async.CardDisputeServiceAsyncImpl
import com.increase.api.services.async.CardPaymentServiceAsync
@@ -318,18 +312,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
RealTimeDecisionServiceAsyncImpl(clientOptionsWithUserAgent)
}
- private val bookkeepingAccounts: BookkeepingAccountServiceAsync by lazy {
- BookkeepingAccountServiceAsyncImpl(clientOptionsWithUserAgent)
- }
-
- private val bookkeepingEntrySets: BookkeepingEntrySetServiceAsync by lazy {
- BookkeepingEntrySetServiceAsyncImpl(clientOptionsWithUserAgent)
- }
-
- private val bookkeepingEntries: BookkeepingEntryServiceAsync by lazy {
- BookkeepingEntryServiceAsyncImpl(clientOptionsWithUserAgent)
- }
-
private val groups: GroupServiceAsync by lazy {
GroupServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -477,12 +459,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun realTimeDecisions(): RealTimeDecisionServiceAsync = realTimeDecisions
- override fun bookkeepingAccounts(): BookkeepingAccountServiceAsync = bookkeepingAccounts
-
- override fun bookkeepingEntrySets(): BookkeepingEntrySetServiceAsync = bookkeepingEntrySets
-
- override fun bookkeepingEntries(): BookkeepingEntryServiceAsync = bookkeepingEntries
-
override fun groups(): GroupServiceAsync = groups
override fun oauthApplications(): OAuthApplicationServiceAsync = oauthApplications
@@ -698,18 +674,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
RealTimeDecisionServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
- private val bookkeepingAccounts: BookkeepingAccountServiceAsync.WithRawResponse by lazy {
- BookkeepingAccountServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val bookkeepingEntrySets: BookkeepingEntrySetServiceAsync.WithRawResponse by lazy {
- BookkeepingEntrySetServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val bookkeepingEntries: BookkeepingEntryServiceAsync.WithRawResponse by lazy {
- BookkeepingEntryServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
private val groups: GroupServiceAsync.WithRawResponse by lazy {
GroupServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -877,15 +841,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun realTimeDecisions(): RealTimeDecisionServiceAsync.WithRawResponse =
realTimeDecisions
- override fun bookkeepingAccounts(): BookkeepingAccountServiceAsync.WithRawResponse =
- bookkeepingAccounts
-
- override fun bookkeepingEntrySets(): BookkeepingEntrySetServiceAsync.WithRawResponse =
- bookkeepingEntrySets
-
- override fun bookkeepingEntries(): BookkeepingEntryServiceAsync.WithRawResponse =
- bookkeepingEntries
-
override fun groups(): GroupServiceAsync.WithRawResponse = groups
override fun oauthApplications(): OAuthApplicationServiceAsync.WithRawResponse =
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 306af6c3b..cd5cece97 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
@@ -18,12 +18,6 @@ import com.increase.api.services.blocking.AchTransferService
import com.increase.api.services.blocking.AchTransferServiceImpl
import com.increase.api.services.blocking.BeneficialOwnerService
import com.increase.api.services.blocking.BeneficialOwnerServiceImpl
-import com.increase.api.services.blocking.BookkeepingAccountService
-import com.increase.api.services.blocking.BookkeepingAccountServiceImpl
-import com.increase.api.services.blocking.BookkeepingEntryService
-import com.increase.api.services.blocking.BookkeepingEntryServiceImpl
-import com.increase.api.services.blocking.BookkeepingEntrySetService
-import com.increase.api.services.blocking.BookkeepingEntrySetServiceImpl
import com.increase.api.services.blocking.CardDisputeService
import com.increase.api.services.blocking.CardDisputeServiceImpl
import com.increase.api.services.blocking.CardPaymentService
@@ -305,18 +299,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
RealTimeDecisionServiceImpl(clientOptionsWithUserAgent)
}
- private val bookkeepingAccounts: BookkeepingAccountService by lazy {
- BookkeepingAccountServiceImpl(clientOptionsWithUserAgent)
- }
-
- private val bookkeepingEntrySets: BookkeepingEntrySetService by lazy {
- BookkeepingEntrySetServiceImpl(clientOptionsWithUserAgent)
- }
-
- private val bookkeepingEntries: BookkeepingEntryService by lazy {
- BookkeepingEntryServiceImpl(clientOptionsWithUserAgent)
- }
-
private val groups: GroupService by lazy { GroupServiceImpl(clientOptionsWithUserAgent) }
private val oauthApplications: OAuthApplicationService by lazy {
@@ -460,12 +442,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun realTimeDecisions(): RealTimeDecisionService = realTimeDecisions
- override fun bookkeepingAccounts(): BookkeepingAccountService = bookkeepingAccounts
-
- override fun bookkeepingEntrySets(): BookkeepingEntrySetService = bookkeepingEntrySets
-
- override fun bookkeepingEntries(): BookkeepingEntryService = bookkeepingEntries
-
override fun groups(): GroupService = groups
override fun oauthApplications(): OAuthApplicationService = oauthApplications
@@ -678,18 +654,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
RealTimeDecisionServiceImpl.WithRawResponseImpl(clientOptions)
}
- private val bookkeepingAccounts: BookkeepingAccountService.WithRawResponse by lazy {
- BookkeepingAccountServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val bookkeepingEntrySets: BookkeepingEntrySetService.WithRawResponse by lazy {
- BookkeepingEntrySetServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val bookkeepingEntries: BookkeepingEntryService.WithRawResponse by lazy {
- BookkeepingEntryServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
private val groups: GroupService.WithRawResponse by lazy {
GroupServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -853,15 +817,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun realTimeDecisions(): RealTimeDecisionService.WithRawResponse =
realTimeDecisions
- override fun bookkeepingAccounts(): BookkeepingAccountService.WithRawResponse =
- bookkeepingAccounts
-
- override fun bookkeepingEntrySets(): BookkeepingEntrySetService.WithRawResponse =
- bookkeepingEntrySets
-
- override fun bookkeepingEntries(): BookkeepingEntryService.WithRawResponse =
- bookkeepingEntries
-
override fun groups(): GroupService.WithRawResponse = groups
override fun oauthApplications(): OAuthApplicationService.WithRawResponse =
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccount.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccount.kt
deleted file mode 100644
index 5ec6cc62b..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccount.kt
+++ /dev/null
@@ -1,728 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/**
- * Accounts are T-accounts. They can store accounting entries. Your compliance setup might require
- * annotating money movements using this API. Learn more in our
- * [guide to Bookkeeping](https://increase.com/documentation/bookkeeping#bookkeeping).
- */
-class BookkeepingAccount
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val accountId: JsonField,
- private val complianceCategory: JsonField,
- private val entityId: JsonField,
- private val idempotencyKey: JsonField,
- private val name: 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("compliance_category")
- @ExcludeMissing
- complianceCategory: JsonField = JsonMissing.of(),
- @JsonProperty("entity_id") @ExcludeMissing entityId: JsonField = JsonMissing.of(),
- @JsonProperty("idempotency_key")
- @ExcludeMissing
- idempotencyKey: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- ) : this(
- id,
- accountId,
- complianceCategory,
- entityId,
- idempotencyKey,
- name,
- type,
- mutableMapOf(),
- )
-
- /**
- * The account 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 API Account associated with this bookkeeping account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun accountId(): Optional = accountId.getOptional("account_id")
-
- /**
- * The compliance category of the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun complianceCategory(): Optional =
- complianceCategory.getOptional("compliance_category")
-
- /**
- * The Entity associated with this bookkeeping account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun entityId(): Optional = entityId.getOptional("entity_id")
-
- /**
- * The idempotency key you chose for this object. This value is unique across Increase and is
- * used to ensure that a request is only processed once. Learn more about
- * [idempotency](https://increase.com/documentation/idempotency-keys).
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key")
-
- /**
- * The name you choose for the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_account`.
- *
- * @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 [complianceCategory].
- *
- * Unlike [complianceCategory], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("compliance_category")
- @ExcludeMissing
- fun _complianceCategory(): JsonField = complianceCategory
-
- /**
- * Returns the raw JSON value of [entityId].
- *
- * Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("entity_id") @ExcludeMissing fun _entityId(): JsonField = entityId
-
- /**
- * 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 [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [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 [BookkeepingAccount].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .accountId()
- * .complianceCategory()
- * .entityId()
- * .idempotencyKey()
- * .name()
- * .type()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccount]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var accountId: JsonField? = null
- private var complianceCategory: JsonField? = null
- private var entityId: JsonField? = null
- private var idempotencyKey: JsonField? = null
- private var name: JsonField? = null
- private var type: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(bookkeepingAccount: BookkeepingAccount) = apply {
- id = bookkeepingAccount.id
- accountId = bookkeepingAccount.accountId
- complianceCategory = bookkeepingAccount.complianceCategory
- entityId = bookkeepingAccount.entityId
- idempotencyKey = bookkeepingAccount.idempotencyKey
- name = bookkeepingAccount.name
- type = bookkeepingAccount.type
- additionalProperties = bookkeepingAccount.additionalProperties.toMutableMap()
- }
-
- /** The account 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 API Account associated with this bookkeeping account. */
- fun accountId(accountId: String?) = accountId(JsonField.ofNullable(accountId))
-
- /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */
- fun accountId(accountId: Optional) = accountId(accountId.getOrNull())
-
- /**
- * 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 compliance category of the account. */
- fun complianceCategory(complianceCategory: ComplianceCategory?) =
- complianceCategory(JsonField.ofNullable(complianceCategory))
-
- /**
- * Alias for calling [Builder.complianceCategory] with `complianceCategory.orElse(null)`.
- */
- fun complianceCategory(complianceCategory: Optional) =
- complianceCategory(complianceCategory.getOrNull())
-
- /**
- * Sets [Builder.complianceCategory] to an arbitrary JSON value.
- *
- * You should usually call [Builder.complianceCategory] with a well-typed
- * [ComplianceCategory] value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun complianceCategory(complianceCategory: JsonField) = apply {
- this.complianceCategory = complianceCategory
- }
-
- /** The Entity associated with this bookkeeping account. */
- fun entityId(entityId: String?) = entityId(JsonField.ofNullable(entityId))
-
- /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */
- fun entityId(entityId: Optional) = entityId(entityId.getOrNull())
-
- /**
- * Sets [Builder.entityId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.entityId] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun entityId(entityId: JsonField) = apply { this.entityId = entityId }
-
- /**
- * 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 name you choose for the account. */
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_account`.
- */
- 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 [BookkeepingAccount].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .accountId()
- * .complianceCategory()
- * .entityId()
- * .idempotencyKey()
- * .name()
- * .type()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BookkeepingAccount =
- BookkeepingAccount(
- checkRequired("id", id),
- checkRequired("accountId", accountId),
- checkRequired("complianceCategory", complianceCategory),
- checkRequired("entityId", entityId),
- checkRequired("idempotencyKey", idempotencyKey),
- checkRequired("name", name),
- checkRequired("type", type),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BookkeepingAccount = apply {
- if (validated) {
- return@apply
- }
-
- id()
- accountId()
- complianceCategory().ifPresent { it.validate() }
- entityId()
- idempotencyKey()
- name()
- 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) +
- (complianceCategory.asKnown().getOrNull()?.validity() ?: 0) +
- (if (entityId.asKnown().isPresent) 1 else 0) +
- (if (idempotencyKey.asKnown().isPresent) 1 else 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /** The compliance category of the account. */
- class ComplianceCategory
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is on an
- * older version than the API, then the API may respond with new members that the SDK is
- * unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** A cash in an commingled Increase Account. */
- @JvmField val COMMINGLED_CASH = of("commingled_cash")
-
- /** A customer balance. */
- @JvmField val CUSTOMER_BALANCE = of("customer_balance")
-
- @JvmStatic fun of(value: String) = ComplianceCategory(JsonField.of(value))
- }
-
- /** An enum containing [ComplianceCategory]'s known values. */
- enum class Known {
- /** A cash in an commingled Increase Account. */
- COMMINGLED_CASH,
- /** A customer balance. */
- CUSTOMER_BALANCE,
- }
-
- /**
- * An enum containing [ComplianceCategory]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [ComplianceCategory] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if the
- * SDK is on an older version than the API, then the API may respond with new members that
- * the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- /** A cash in an commingled Increase Account. */
- COMMINGLED_CASH,
- /** A customer balance. */
- CUSTOMER_BALANCE,
- /**
- * An enum member indicating that [ComplianceCategory] 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) {
- COMMINGLED_CASH -> Value.COMMINGLED_CASH
- CUSTOMER_BALANCE -> Value.CUSTOMER_BALANCE
- 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) {
- COMMINGLED_CASH -> Known.COMMINGLED_CASH
- CUSTOMER_BALANCE -> Known.CUSTOMER_BALANCE
- else -> throw IncreaseInvalidDataException("Unknown ComplianceCategory: $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(): ComplianceCategory = 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 ComplianceCategory && 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
- * `bookkeeping_account`.
- */
- 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 BOOKKEEPING_ACCOUNT = of("bookkeeping_account")
-
- @JvmStatic fun of(value: String) = Type(JsonField.of(value))
- }
-
- /** An enum containing [Type]'s known values. */
- enum class Known {
- BOOKKEEPING_ACCOUNT
- }
-
- /**
- * 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 {
- BOOKKEEPING_ACCOUNT,
- /** 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) {
- BOOKKEEPING_ACCOUNT -> Value.BOOKKEEPING_ACCOUNT
- 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) {
- BOOKKEEPING_ACCOUNT -> Known.BOOKKEEPING_ACCOUNT
- 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 BookkeepingAccount &&
- id == other.id &&
- accountId == other.accountId &&
- complianceCategory == other.complianceCategory &&
- entityId == other.entityId &&
- idempotencyKey == other.idempotencyKey &&
- name == other.name &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- accountId,
- complianceCategory,
- entityId,
- idempotencyKey,
- name,
- type,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BookkeepingAccount{id=$id, accountId=$accountId, complianceCategory=$complianceCategory, entityId=$entityId, idempotencyKey=$idempotencyKey, name=$name, type=$type, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountBalanceParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountBalanceParams.kt
deleted file mode 100644
index b4cdd3e4f..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountBalanceParams.kt
+++ /dev/null
@@ -1,229 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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
-
-/** Retrieve a Bookkeeping Account Balance */
-class BookkeepingAccountBalanceParams
-private constructor(
- private val bookkeepingAccountId: String?,
- private val atTime: OffsetDateTime?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /** The identifier of the Bookkeeping Account to retrieve. */
- fun bookkeepingAccountId(): Optional = Optional.ofNullable(bookkeepingAccountId)
-
- /** The moment to query the balance at. If not set, returns the current balances. */
- fun atTime(): Optional = Optional.ofNullable(atTime)
-
- /** 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(): BookkeepingAccountBalanceParams = builder().build()
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [BookkeepingAccountBalanceParams].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountBalanceParams]. */
- class Builder internal constructor() {
-
- private var bookkeepingAccountId: String? = null
- private var atTime: OffsetDateTime? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(bookkeepingAccountBalanceParams: BookkeepingAccountBalanceParams) =
- apply {
- bookkeepingAccountId = bookkeepingAccountBalanceParams.bookkeepingAccountId
- atTime = bookkeepingAccountBalanceParams.atTime
- additionalHeaders = bookkeepingAccountBalanceParams.additionalHeaders.toBuilder()
- additionalQueryParams =
- bookkeepingAccountBalanceParams.additionalQueryParams.toBuilder()
- }
-
- /** The identifier of the Bookkeeping Account to retrieve. */
- fun bookkeepingAccountId(bookkeepingAccountId: String?) = apply {
- this.bookkeepingAccountId = bookkeepingAccountId
- }
-
- /**
- * Alias for calling [Builder.bookkeepingAccountId] with
- * `bookkeepingAccountId.orElse(null)`.
- */
- fun bookkeepingAccountId(bookkeepingAccountId: Optional) =
- bookkeepingAccountId(bookkeepingAccountId.getOrNull())
-
- /** The moment to query the balance at. If not set, returns the current balances. */
- fun atTime(atTime: OffsetDateTime?) = apply { this.atTime = atTime }
-
- /** Alias for calling [Builder.atTime] with `atTime.orElse(null)`. */
- fun atTime(atTime: Optional) = atTime(atTime.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 [BookkeepingAccountBalanceParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): BookkeepingAccountBalanceParams =
- BookkeepingAccountBalanceParams(
- bookkeepingAccountId,
- atTime,
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _pathParam(index: Int): String =
- when (index) {
- 0 -> bookkeepingAccountId ?: ""
- else -> ""
- }
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams =
- QueryParams.builder()
- .apply {
- atTime?.let { put("at_time", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) }
- putAll(additionalQueryParams)
- }
- .build()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BookkeepingAccountBalanceParams &&
- bookkeepingAccountId == other.bookkeepingAccountId &&
- atTime == other.atTime &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int =
- Objects.hash(bookkeepingAccountId, atTime, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "BookkeepingAccountBalanceParams{bookkeepingAccountId=$bookkeepingAccountId, atTime=$atTime, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountCreateParams.kt
deleted file mode 100644
index 3517a92b4..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountCreateParams.kt
+++ /dev/null
@@ -1,771 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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.checkRequired
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** Create a Bookkeeping Account */
-class BookkeepingAccountCreateParams
-private constructor(
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /**
- * The name you choose for the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = body.name()
-
- /**
- * The account, if `compliance_category` is `commingled_cash`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun accountId(): Optional = body.accountId()
-
- /**
- * The account compliance category.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun complianceCategory(): Optional = body.complianceCategory()
-
- /**
- * The entity, if `compliance_category` is `customer_balance`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun entityId(): Optional = body.entityId()
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _name(): JsonField = body._name()
-
- /**
- * Returns the raw JSON value of [accountId].
- *
- * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _accountId(): JsonField = body._accountId()
-
- /**
- * Returns the raw JSON value of [complianceCategory].
- *
- * Unlike [complianceCategory], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- fun _complianceCategory(): JsonField = body._complianceCategory()
-
- /**
- * Returns the raw JSON value of [entityId].
- *
- * Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _entityId(): JsonField = body._entityId()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [BookkeepingAccountCreateParams].
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountCreateParams]. */
- 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(bookkeepingAccountCreateParams: BookkeepingAccountCreateParams) = apply {
- body = bookkeepingAccountCreateParams.body.toBuilder()
- additionalHeaders = bookkeepingAccountCreateParams.additionalHeaders.toBuilder()
- additionalQueryParams = bookkeepingAccountCreateParams.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:
- * - [name]
- * - [accountId]
- * - [complianceCategory]
- * - [entityId]
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /** The name you choose for the account. */
- fun name(name: String) = apply { body.name(name) }
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun name(name: JsonField) = apply { body.name(name) }
-
- /** The account, if `compliance_category` is `commingled_cash`. */
- fun accountId(accountId: String) = apply { body.accountId(accountId) }
-
- /**
- * Sets [Builder.accountId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun accountId(accountId: JsonField) = apply { body.accountId(accountId) }
-
- /** The account compliance category. */
- fun complianceCategory(complianceCategory: ComplianceCategory) = apply {
- body.complianceCategory(complianceCategory)
- }
-
- /**
- * Sets [Builder.complianceCategory] to an arbitrary JSON value.
- *
- * You should usually call [Builder.complianceCategory] with a well-typed
- * [ComplianceCategory] value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun complianceCategory(complianceCategory: JsonField) = apply {
- body.complianceCategory(complianceCategory)
- }
-
- /** The entity, if `compliance_category` is `customer_balance`. */
- fun entityId(entityId: String) = apply { body.entityId(entityId) }
-
- /**
- * Sets [Builder.entityId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.entityId] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun entityId(entityId: JsonField) = apply { body.entityId(entityId) }
-
- 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 [BookkeepingAccountCreateParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BookkeepingAccountCreateParams =
- BookkeepingAccountCreateParams(
- 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 name: JsonField,
- private val accountId: JsonField,
- private val complianceCategory: JsonField,
- private val entityId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("account_id")
- @ExcludeMissing
- accountId: JsonField = JsonMissing.of(),
- @JsonProperty("compliance_category")
- @ExcludeMissing
- complianceCategory: JsonField = JsonMissing.of(),
- @JsonProperty("entity_id")
- @ExcludeMissing
- entityId: JsonField = JsonMissing.of(),
- ) : this(name, accountId, complianceCategory, entityId, mutableMapOf())
-
- /**
- * The name you choose for the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * The account, if `compliance_category` is `commingled_cash`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun accountId(): Optional = accountId.getOptional("account_id")
-
- /**
- * The account compliance category.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun complianceCategory(): Optional =
- complianceCategory.getOptional("compliance_category")
-
- /**
- * The entity, if `compliance_category` is `customer_balance`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun entityId(): Optional = entityId.getOptional("entity_id")
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [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 [complianceCategory].
- *
- * Unlike [complianceCategory], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("compliance_category")
- @ExcludeMissing
- fun _complianceCategory(): JsonField = complianceCategory
-
- /**
- * Returns the raw JSON value of [entityId].
- *
- * Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("entity_id") @ExcludeMissing fun _entityId(): JsonField = entityId
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Body].
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var name: JsonField? = null
- private var accountId: JsonField = JsonMissing.of()
- private var complianceCategory: JsonField = JsonMissing.of()
- private var entityId: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- name = body.name
- accountId = body.accountId
- complianceCategory = body.complianceCategory
- entityId = body.entityId
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /** The name you choose for the account. */
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- /** The account, if `compliance_category` is `commingled_cash`. */
- 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 account compliance category. */
- fun complianceCategory(complianceCategory: ComplianceCategory) =
- complianceCategory(JsonField.of(complianceCategory))
-
- /**
- * Sets [Builder.complianceCategory] to an arbitrary JSON value.
- *
- * You should usually call [Builder.complianceCategory] with a well-typed
- * [ComplianceCategory] value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
- */
- fun complianceCategory(complianceCategory: JsonField) = apply {
- this.complianceCategory = complianceCategory
- }
-
- /** The entity, if `compliance_category` is `customer_balance`. */
- fun entityId(entityId: String) = entityId(JsonField.of(entityId))
-
- /**
- * Sets [Builder.entityId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.entityId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun entityId(entityId: JsonField) = apply { this.entityId = entityId }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(
- checkRequired("name", name),
- accountId,
- complianceCategory,
- entityId,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- name()
- accountId()
- complianceCategory().ifPresent { it.validate() }
- entityId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (name.asKnown().isPresent) 1 else 0) +
- (if (accountId.asKnown().isPresent) 1 else 0) +
- (complianceCategory.asKnown().getOrNull()?.validity() ?: 0) +
- (if (entityId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- name == other.name &&
- accountId == other.accountId &&
- complianceCategory == other.complianceCategory &&
- entityId == other.entityId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(name, accountId, complianceCategory, entityId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Body{name=$name, accountId=$accountId, complianceCategory=$complianceCategory, entityId=$entityId, additionalProperties=$additionalProperties}"
- }
-
- /** The account compliance category. */
- class ComplianceCategory
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is on an
- * older version than the API, then the API may respond with new members that the SDK is
- * unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** A cash in an commingled Increase Account. */
- @JvmField val COMMINGLED_CASH = of("commingled_cash")
-
- /** A customer balance. */
- @JvmField val CUSTOMER_BALANCE = of("customer_balance")
-
- @JvmStatic fun of(value: String) = ComplianceCategory(JsonField.of(value))
- }
-
- /** An enum containing [ComplianceCategory]'s known values. */
- enum class Known {
- /** A cash in an commingled Increase Account. */
- COMMINGLED_CASH,
- /** A customer balance. */
- CUSTOMER_BALANCE,
- }
-
- /**
- * An enum containing [ComplianceCategory]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [ComplianceCategory] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if the
- * SDK is on an older version than the API, then the API may respond with new members that
- * the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- /** A cash in an commingled Increase Account. */
- COMMINGLED_CASH,
- /** A customer balance. */
- CUSTOMER_BALANCE,
- /**
- * An enum member indicating that [ComplianceCategory] 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) {
- COMMINGLED_CASH -> Value.COMMINGLED_CASH
- CUSTOMER_BALANCE -> Value.CUSTOMER_BALANCE
- 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) {
- COMMINGLED_CASH -> Known.COMMINGLED_CASH
- CUSTOMER_BALANCE -> Known.CUSTOMER_BALANCE
- else -> throw IncreaseInvalidDataException("Unknown ComplianceCategory: $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(): ComplianceCategory = 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 ComplianceCategory && 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 BookkeepingAccountCreateParams &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "BookkeepingAccountCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt
deleted file mode 100644
index cd7b6b4e7..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt
+++ /dev/null
@@ -1,135 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-import com.increase.api.core.AutoPager
-import com.increase.api.core.Page
-import com.increase.api.core.checkRequired
-import com.increase.api.services.blocking.BookkeepingAccountService
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** @see BookkeepingAccountService.list */
-class BookkeepingAccountListPage
-private constructor(
- private val service: BookkeepingAccountService,
- private val params: BookkeepingAccountListParams,
- private val response: BookkeepingAccountListPageResponse,
-) : Page {
-
- /**
- * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data.
- *
- * @see BookkeepingAccountListPageResponse.data
- */
- fun data(): List =
- response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data.
- *
- * @see BookkeepingAccountListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): BookkeepingAccountListParams {
- val nextCursor =
- nextCursor().getOrNull()
- ?: throw IllegalStateException("Cannot construct next page params")
- return params.toBuilder().cursor(nextCursor).build()
- }
-
- override fun nextPage(): BookkeepingAccountListPage = service.list(nextPageParams())
-
- fun autoPager(): AutoPager = AutoPager.from(this)
-
- /** The parameters that were used to request this page. */
- fun params(): BookkeepingAccountListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): BookkeepingAccountListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [BookkeepingAccountListPage].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountListPage]. */
- class Builder internal constructor() {
-
- private var service: BookkeepingAccountService? = null
- private var params: BookkeepingAccountListParams? = null
- private var response: BookkeepingAccountListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(bookkeepingAccountListPage: BookkeepingAccountListPage) = apply {
- service = bookkeepingAccountListPage.service
- params = bookkeepingAccountListPage.params
- response = bookkeepingAccountListPage.response
- }
-
- fun service(service: BookkeepingAccountService) = apply { this.service = service }
-
- /** The parameters that were used to request this page. */
- fun params(params: BookkeepingAccountListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: BookkeepingAccountListPageResponse) = apply {
- this.response = response
- }
-
- /**
- * Returns an immutable instance of [BookkeepingAccountListPage].
- *
- * 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(): BookkeepingAccountListPage =
- BookkeepingAccountListPage(
- checkRequired("service", service),
- checkRequired("params", params),
- checkRequired("response", response),
- )
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BookkeepingAccountListPage &&
- service == other.service &&
- params == other.params &&
- response == other.response
- }
-
- override fun hashCode(): Int = Objects.hash(service, params, response)
-
- override fun toString() =
- "BookkeepingAccountListPage{service=$service, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt
deleted file mode 100644
index 80eecd7c9..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt
+++ /dev/null
@@ -1,152 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-import com.increase.api.core.AutoPagerAsync
-import com.increase.api.core.PageAsync
-import com.increase.api.core.checkRequired
-import com.increase.api.services.async.BookkeepingAccountServiceAsync
-import java.util.Objects
-import java.util.Optional
-import java.util.concurrent.CompletableFuture
-import java.util.concurrent.Executor
-import kotlin.jvm.optionals.getOrNull
-
-/** @see BookkeepingAccountServiceAsync.list */
-class BookkeepingAccountListPageAsync
-private constructor(
- private val service: BookkeepingAccountServiceAsync,
- private val streamHandlerExecutor: Executor,
- private val params: BookkeepingAccountListParams,
- private val response: BookkeepingAccountListPageResponse,
-) : PageAsync {
-
- /**
- * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data.
- *
- * @see BookkeepingAccountListPageResponse.data
- */
- fun data(): List =
- response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data.
- *
- * @see BookkeepingAccountListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): BookkeepingAccountListParams {
- 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(): BookkeepingAccountListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): BookkeepingAccountListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [BookkeepingAccountListPageAsync].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .streamHandlerExecutor()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountListPageAsync]. */
- class Builder internal constructor() {
-
- private var service: BookkeepingAccountServiceAsync? = null
- private var streamHandlerExecutor: Executor? = null
- private var params: BookkeepingAccountListParams? = null
- private var response: BookkeepingAccountListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(bookkeepingAccountListPageAsync: BookkeepingAccountListPageAsync) =
- apply {
- service = bookkeepingAccountListPageAsync.service
- streamHandlerExecutor = bookkeepingAccountListPageAsync.streamHandlerExecutor
- params = bookkeepingAccountListPageAsync.params
- response = bookkeepingAccountListPageAsync.response
- }
-
- fun service(service: BookkeepingAccountServiceAsync) = apply { this.service = service }
-
- fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
- this.streamHandlerExecutor = streamHandlerExecutor
- }
-
- /** The parameters that were used to request this page. */
- fun params(params: BookkeepingAccountListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: BookkeepingAccountListPageResponse) = apply {
- this.response = response
- }
-
- /**
- * Returns an immutable instance of [BookkeepingAccountListPageAsync].
- *
- * 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(): BookkeepingAccountListPageAsync =
- BookkeepingAccountListPageAsync(
- 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 BookkeepingAccountListPageAsync &&
- 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() =
- "BookkeepingAccountListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt
deleted file mode 100644
index 1b661f937..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt
+++ /dev/null
@@ -1,246 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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 Bookkeeping Account objects. */
-class BookkeepingAccountListPageResponse
-@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
- * [BookkeepingAccountListPageResponse].
- *
- * The following fields are required:
- * ```java
- * .data()
- * .nextCursor()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountListPageResponse]. */
- class Builder internal constructor() {
-
- private var data: JsonField>? = null
- private var nextCursor: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(bookkeepingAccountListPageResponse: BookkeepingAccountListPageResponse) =
- apply {
- data = bookkeepingAccountListPageResponse.data.map { it.toMutableList() }
- nextCursor = bookkeepingAccountListPageResponse.nextCursor
- additionalProperties =
- bookkeepingAccountListPageResponse.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 [BookkeepingAccount] to [Builder.data].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addData(data: BookkeepingAccount) = 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 [BookkeepingAccountListPageResponse].
- *
- * 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(): BookkeepingAccountListPageResponse =
- BookkeepingAccountListPageResponse(
- checkRequired("data", data).map { it.toImmutable() },
- checkRequired("nextCursor", nextCursor),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BookkeepingAccountListPageResponse = 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 BookkeepingAccountListPageResponse &&
- 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() =
- "BookkeepingAccountListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListParams.kt
deleted file mode 100644
index 33f07577f..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListParams.kt
+++ /dev/null
@@ -1,247 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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
-
-/** List Bookkeeping Accounts */
-class BookkeepingAccountListParams
-private constructor(
- private val cursor: String?,
- private val idempotencyKey: String?,
- private val limit: Long?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /** 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)
-
- /** 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(): BookkeepingAccountListParams = builder().build()
-
- /**
- * Returns a mutable builder for constructing an instance of [BookkeepingAccountListParams].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountListParams]. */
- class Builder internal constructor() {
-
- private var cursor: String? = null
- private var idempotencyKey: String? = null
- private var limit: Long? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(bookkeepingAccountListParams: BookkeepingAccountListParams) = apply {
- cursor = bookkeepingAccountListParams.cursor
- idempotencyKey = bookkeepingAccountListParams.idempotencyKey
- limit = bookkeepingAccountListParams.limit
- additionalHeaders = bookkeepingAccountListParams.additionalHeaders.toBuilder()
- additionalQueryParams = bookkeepingAccountListParams.additionalQueryParams.toBuilder()
- }
-
- /** 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())
-
- 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 [BookkeepingAccountListParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): BookkeepingAccountListParams =
- BookkeepingAccountListParams(
- cursor,
- idempotencyKey,
- limit,
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams =
- QueryParams.builder()
- .apply {
- cursor?.let { put("cursor", it) }
- idempotencyKey?.let { put("idempotency_key", it) }
- limit?.let { put("limit", it.toString()) }
- putAll(additionalQueryParams)
- }
- .build()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BookkeepingAccountListParams &&
- cursor == other.cursor &&
- idempotencyKey == other.idempotencyKey &&
- limit == other.limit &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int =
- Objects.hash(cursor, idempotencyKey, limit, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "BookkeepingAccountListParams{cursor=$cursor, idempotencyKey=$idempotencyKey, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountUpdateParams.kt
deleted file mode 100644
index 5a90a6dcd..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountUpdateParams.kt
+++ /dev/null
@@ -1,444 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.increase.api.core.ExcludeMissing
-import com.increase.api.core.JsonField
-import com.increase.api.core.JsonMissing
-import com.increase.api.core.JsonValue
-import com.increase.api.core.Params
-import com.increase.api.core.checkRequired
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** Update a Bookkeeping Account */
-class BookkeepingAccountUpdateParams
-private constructor(
- private val bookkeepingAccountId: String?,
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /** The bookkeeping account you would like to update. */
- fun bookkeepingAccountId(): Optional = Optional.ofNullable(bookkeepingAccountId)
-
- /**
- * The name you choose for the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = body.name()
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _name(): JsonField = body._name()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of
- * [BookkeepingAccountUpdateParams].
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingAccountUpdateParams]. */
- class Builder internal constructor() {
-
- private var bookkeepingAccountId: 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(bookkeepingAccountUpdateParams: BookkeepingAccountUpdateParams) = apply {
- bookkeepingAccountId = bookkeepingAccountUpdateParams.bookkeepingAccountId
- body = bookkeepingAccountUpdateParams.body.toBuilder()
- additionalHeaders = bookkeepingAccountUpdateParams.additionalHeaders.toBuilder()
- additionalQueryParams = bookkeepingAccountUpdateParams.additionalQueryParams.toBuilder()
- }
-
- /** The bookkeeping account you would like to update. */
- fun bookkeepingAccountId(bookkeepingAccountId: String?) = apply {
- this.bookkeepingAccountId = bookkeepingAccountId
- }
-
- /**
- * Alias for calling [Builder.bookkeepingAccountId] with
- * `bookkeepingAccountId.orElse(null)`.
- */
- fun bookkeepingAccountId(bookkeepingAccountId: Optional) =
- bookkeepingAccountId(bookkeepingAccountId.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:
- * - [name]
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /** The name you choose for the account. */
- fun name(name: String) = apply { body.name(name) }
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun name(name: JsonField) = apply { body.name(name) }
-
- 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 [BookkeepingAccountUpdateParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BookkeepingAccountUpdateParams =
- BookkeepingAccountUpdateParams(
- bookkeepingAccountId,
- body.build(),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- fun _pathParam(index: Int): String =
- when (index) {
- 0 -> bookkeepingAccountId ?: ""
- else -> ""
- }
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- class Body
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val name: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of()
- ) : this(name, mutableMapOf())
-
- /**
- * The name you choose for the account.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Body].
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var name: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- name = body.name
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /** The name you choose for the account. */
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(checkRequired("name", name), additionalProperties.toMutableMap())
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- name()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = (if (name.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- name == other.name &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() = "Body{name=$name, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BookkeepingAccountUpdateParams &&
- bookkeepingAccountId == other.bookkeepingAccountId &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int =
- Objects.hash(bookkeepingAccountId, body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "BookkeepingAccountUpdateParams{bookkeepingAccountId=$bookkeepingAccountId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingBalanceLookup.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingBalanceLookup.kt
deleted file mode 100644
index dca69e8bf..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingBalanceLookup.kt
+++ /dev/null
@@ -1,394 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingaccounts
-
-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.util.Collections
-import java.util.Objects
-import kotlin.jvm.optionals.getOrNull
-
-/** Represents a request to lookup the balance of a Bookkeeping Account at a given point in time. */
-class BookkeepingBalanceLookup
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val balance: JsonField,
- private val bookkeepingAccountId: JsonField,
- private val type: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("balance") @ExcludeMissing balance: JsonField = JsonMissing.of(),
- @JsonProperty("bookkeeping_account_id")
- @ExcludeMissing
- bookkeepingAccountId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- ) : this(balance, bookkeepingAccountId, type, mutableMapOf())
-
- /**
- * The Bookkeeping Account's current balance, representing the sum of all Bookkeeping Entries on
- * the Bookkeeping Account.
- *
- * @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 balance(): Long = balance.getRequired("balance")
-
- /**
- * The identifier for the account for which the balance was queried.
- *
- * @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 bookkeepingAccountId(): String = bookkeepingAccountId.getRequired("bookkeeping_account_id")
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_balance_lookup`.
- *
- * @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 [balance].
- *
- * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance
-
- /**
- * Returns the raw JSON value of [bookkeepingAccountId].
- *
- * Unlike [bookkeepingAccountId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("bookkeeping_account_id")
- @ExcludeMissing
- fun _bookkeepingAccountId(): JsonField = bookkeepingAccountId
-
- /**
- * 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 [BookkeepingBalanceLookup].
- *
- * The following fields are required:
- * ```java
- * .balance()
- * .bookkeepingAccountId()
- * .type()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingBalanceLookup]. */
- class Builder internal constructor() {
-
- private var balance: JsonField? = null
- private var bookkeepingAccountId: JsonField? = null
- private var type: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(bookkeepingBalanceLookup: BookkeepingBalanceLookup) = apply {
- balance = bookkeepingBalanceLookup.balance
- bookkeepingAccountId = bookkeepingBalanceLookup.bookkeepingAccountId
- type = bookkeepingBalanceLookup.type
- additionalProperties = bookkeepingBalanceLookup.additionalProperties.toMutableMap()
- }
-
- /**
- * The Bookkeeping Account's current balance, representing the sum of all Bookkeeping
- * Entries on the Bookkeeping Account.
- */
- fun balance(balance: Long) = balance(JsonField.of(balance))
-
- /**
- * Sets [Builder.balance] to an arbitrary JSON value.
- *
- * You should usually call [Builder.balance] with a well-typed [Long] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun balance(balance: JsonField) = apply { this.balance = balance }
-
- /** The identifier for the account for which the balance was queried. */
- fun bookkeepingAccountId(bookkeepingAccountId: String) =
- bookkeepingAccountId(JsonField.of(bookkeepingAccountId))
-
- /**
- * Sets [Builder.bookkeepingAccountId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.bookkeepingAccountId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun bookkeepingAccountId(bookkeepingAccountId: JsonField) = apply {
- this.bookkeepingAccountId = bookkeepingAccountId
- }
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_balance_lookup`.
- */
- 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 [BookkeepingBalanceLookup].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .balance()
- * .bookkeepingAccountId()
- * .type()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BookkeepingBalanceLookup =
- BookkeepingBalanceLookup(
- checkRequired("balance", balance),
- checkRequired("bookkeepingAccountId", bookkeepingAccountId),
- checkRequired("type", type),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BookkeepingBalanceLookup = apply {
- if (validated) {
- return@apply
- }
-
- balance()
- bookkeepingAccountId()
- 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 (balance.asKnown().isPresent) 1 else 0) +
- (if (bookkeepingAccountId.asKnown().isPresent) 1 else 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_balance_lookup`.
- */
- 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 BOOKKEEPING_BALANCE_LOOKUP = of("bookkeeping_balance_lookup")
-
- @JvmStatic fun of(value: String) = Type(JsonField.of(value))
- }
-
- /** An enum containing [Type]'s known values. */
- enum class Known {
- BOOKKEEPING_BALANCE_LOOKUP
- }
-
- /**
- * 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 {
- BOOKKEEPING_BALANCE_LOOKUP,
- /** 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) {
- BOOKKEEPING_BALANCE_LOOKUP -> Value.BOOKKEEPING_BALANCE_LOOKUP
- 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) {
- BOOKKEEPING_BALANCE_LOOKUP -> Known.BOOKKEEPING_BALANCE_LOOKUP
- 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 BookkeepingBalanceLookup &&
- balance == other.balance &&
- bookkeepingAccountId == other.bookkeepingAccountId &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(balance, bookkeepingAccountId, type, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BookkeepingBalanceLookup{balance=$balance, bookkeepingAccountId=$bookkeepingAccountId, type=$type, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntry.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntry.kt
deleted file mode 100644
index 3812c42ea..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntry.kt
+++ /dev/null
@@ -1,506 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.bookkeepingentries
-
-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 kotlin.jvm.optionals.getOrNull
-
-/**
- * Entries are T-account entries recording debits and credits. Your compliance setup might require
- * annotating money movements using this API. Learn more in our
- * [guide to Bookkeeping](https://increase.com/documentation/bookkeeping#bookkeeping).
- */
-class BookkeepingEntry
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val accountId: JsonField,
- private val amount: JsonField,
- private val createdAt: JsonField,
- private val entrySetId: 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("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- @JsonProperty("created_at")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("entry_set_id")
- @ExcludeMissing
- entrySetId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- ) : this(id, accountId, amount, createdAt, entrySetId, type, mutableMapOf())
-
- /**
- * The entry 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 the Entry belongs to.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun accountId(): String = accountId.getRequired("account_id")
-
- /**
- * The Entry amount in the minor unit of its currency. For dollars, for example, this is cents.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun amount(): Long = amount.getRequired("amount")
-
- /**
- * When the entry set 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 identifier for the Entry Set the Entry belongs to.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun entrySetId(): String = entrySetId.getRequired("entry_set_id")
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `bookkeeping_entry`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun 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 [amount].
- *
- * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
-
- /**
- * Returns the raw JSON value of [createdAt].
- *
- * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("created_at")
- @ExcludeMissing
- fun _createdAt(): JsonField = createdAt
-
- /**
- * Returns the raw JSON value of [entrySetId].
- *
- * Unlike [entrySetId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("entry_set_id") @ExcludeMissing fun _entrySetId(): JsonField = entrySetId
-
- /**
- * 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 [BookkeepingEntry].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .accountId()
- * .amount()
- * .createdAt()
- * .entrySetId()
- * .type()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BookkeepingEntry]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var accountId: JsonField? = null
- private var amount: JsonField? = null
- private var createdAt: JsonField