diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6c3521308..a7fe876e2 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.459.0"
+ ".": "0.460.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 40873533c..9d5bfb4e6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 234
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b42ffa447aa14da70d972676b1d5ad0c2720ff4e33a483037b2b1bb51190a69f.yml
-openapi_spec_hash: f2a5c5e804880a8e8d13f5f32ca264a1
-config_hash: b7ec7f54fa76c1f8bde7a548710a1d38
+configured_endpoints: 236
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f46fe8b546ee1a4ad24918ef0803f48e6586e061d5445ae1aeb6abc7b8cf64a3.yml
+openapi_spec_hash: 440b743a615d5ecc832affd6c3154809
+config_hash: dda988c5565c2f15cc708122984d7691
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 395eefe51..3643e4569 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 0.460.0 (2026-03-10)
+
+Full Changelog: [v0.459.0...v0.460.0](https://github.com/Increase/increase-java/compare/v0.459.0...v0.460.0)
+
+### Features
+
+* **api:** api update ([71ea8bb](https://github.com/Increase/increase-java/commit/71ea8bbfe4c515f375acd142a6bbc42732f94f0a))
+
+
+### Chores
+
+* **internal:** codegen related update ([31c4344](https://github.com/Increase/increase-java/commit/31c43441e0a17c08ee7c6dde491e75d28dc26edf))
+
## 0.459.0 (2026-03-09)
Full Changelog: [v0.458.0...v0.459.0](https://github.com/Increase/increase-java/compare/v0.458.0...v0.459.0)
diff --git a/README.md b/README.md
index 6852e3cf6..40a76a1a5 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.459.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.459.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.460.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.460.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.459.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.460.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.459.0")
+implementation("com.increase.api:increase-java:0.460.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.459.0")
com.increase.api
increase-java
- 0.459.0
+ 0.460.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 06d9d83c9..bf6148852 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.459.0" // x-release-please-version
+ version = "0.460.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 45a95b6a6..5628c7f29 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
@@ -9,6 +9,7 @@ import com.increase.api.services.blocking.AccountStatementService
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
@@ -167,6 +168,8 @@ interface IncreaseClient {
fun entities(): EntityService
+ fun beneficialOwners(): BeneficialOwnerService
+
fun supplementalDocuments(): SupplementalDocumentService
fun programs(): ProgramService
@@ -307,6 +310,8 @@ interface IncreaseClient {
fun entities(): EntityService.WithRawResponse
+ fun beneficialOwners(): BeneficialOwnerService.WithRawResponse
+
fun supplementalDocuments(): SupplementalDocumentService.WithRawResponse
fun programs(): ProgramService.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 869f37b2a..e20bc342c 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
@@ -9,6 +9,7 @@ import com.increase.api.services.async.AccountStatementServiceAsync
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
@@ -167,6 +168,8 @@ interface IncreaseClientAsync {
fun entities(): EntityServiceAsync
+ fun beneficialOwners(): BeneficialOwnerServiceAsync
+
fun supplementalDocuments(): SupplementalDocumentServiceAsync
fun programs(): ProgramServiceAsync
@@ -311,6 +314,8 @@ interface IncreaseClientAsync {
fun entities(): EntityServiceAsync.WithRawResponse
+ fun beneficialOwners(): BeneficialOwnerServiceAsync.WithRawResponse
+
fun supplementalDocuments(): SupplementalDocumentServiceAsync.WithRawResponse
fun programs(): ProgramServiceAsync.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 6691e016c..0e6801386 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
@@ -16,6 +16,8 @@ import com.increase.api.services.async.AchPrenotificationServiceAsync
import com.increase.api.services.async.AchPrenotificationServiceAsyncImpl
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
@@ -274,6 +276,10 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
EntityServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val beneficialOwners: BeneficialOwnerServiceAsync by lazy {
+ BeneficialOwnerServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
private val supplementalDocuments: SupplementalDocumentServiceAsync by lazy {
SupplementalDocumentServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -446,6 +452,8 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun entities(): EntityServiceAsync = entities
+ override fun beneficialOwners(): BeneficialOwnerServiceAsync = beneficialOwners
+
override fun supplementalDocuments(): SupplementalDocumentServiceAsync = supplementalDocuments
override fun programs(): ProgramServiceAsync = programs
@@ -641,6 +649,10 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
EntityServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val beneficialOwners: BeneficialOwnerServiceAsync.WithRawResponse by lazy {
+ BeneficialOwnerServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val supplementalDocuments:
SupplementalDocumentServiceAsync.WithRawResponse by lazy {
SupplementalDocumentServiceAsyncImpl.WithRawResponseImpl(clientOptions)
@@ -829,6 +841,9 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun entities(): EntityServiceAsync.WithRawResponse = entities
+ override fun beneficialOwners(): BeneficialOwnerServiceAsync.WithRawResponse =
+ beneficialOwners
+
override fun supplementalDocuments(): SupplementalDocumentServiceAsync.WithRawResponse =
supplementalDocuments
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 9d3e2f55f..b4d9db6a8 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
@@ -16,6 +16,8 @@ import com.increase.api.services.blocking.AchPrenotificationService
import com.increase.api.services.blocking.AchPrenotificationServiceImpl
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
@@ -267,6 +269,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
private val entities: EntityService by lazy { EntityServiceImpl(clientOptionsWithUserAgent) }
+ private val beneficialOwners: BeneficialOwnerService by lazy {
+ BeneficialOwnerServiceImpl(clientOptionsWithUserAgent)
+ }
+
private val supplementalDocuments: SupplementalDocumentService by lazy {
SupplementalDocumentServiceImpl(clientOptionsWithUserAgent)
}
@@ -429,6 +435,8 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun entities(): EntityService = entities
+ override fun beneficialOwners(): BeneficialOwnerService = beneficialOwners
+
override fun supplementalDocuments(): SupplementalDocumentService = supplementalDocuments
override fun programs(): ProgramService = programs
@@ -622,6 +630,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
EntityServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val beneficialOwners: BeneficialOwnerService.WithRawResponse by lazy {
+ BeneficialOwnerServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val supplementalDocuments: SupplementalDocumentService.WithRawResponse by lazy {
SupplementalDocumentServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -806,6 +818,8 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun entities(): EntityService.WithRawResponse = entities
+ override fun beneficialOwners(): BeneficialOwnerService.WithRawResponse = beneficialOwners
+
override fun supplementalDocuments(): SupplementalDocumentService.WithRawResponse =
supplementalDocuments
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/http/RetryingHttpClient.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/http/RetryingHttpClient.kt
index d9326237a..533af09a6 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/core/http/RetryingHttpClient.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/core/http/RetryingHttpClient.kt
@@ -201,7 +201,7 @@ private constructor(
?: headers.values("Retry-After").getOrNull(0)?.let { retryAfter ->
retryAfter.toFloatOrNull()?.times(TimeUnit.SECONDS.toNanos(1))
?: try {
- ChronoUnit.MILLIS.between(
+ ChronoUnit.NANOS.between(
OffsetDateTime.now(clock),
OffsetDateTime.parse(
retryAfter,
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPage.kt
new file mode 100644
index 000000000..130859440
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPage.kt
@@ -0,0 +1,133 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+import com.increase.api.core.AutoPager
+import com.increase.api.core.Page
+import com.increase.api.core.checkRequired
+import com.increase.api.services.blocking.BeneficialOwnerService
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** @see BeneficialOwnerService.list */
+class BeneficialOwnerListPage
+private constructor(
+ private val service: BeneficialOwnerService,
+ private val params: BeneficialOwnerListParams,
+ private val response: BeneficialOwnerListPageResponse,
+) : Page {
+
+ /**
+ * Delegates to [BeneficialOwnerListPageResponse], but gracefully handles missing data.
+ *
+ * @see BeneficialOwnerListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [BeneficialOwnerListPageResponse], but gracefully handles missing data.
+ *
+ * @see BeneficialOwnerListPageResponse.nextCursor
+ */
+ fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
+
+ fun nextPageParams(): BeneficialOwnerListParams {
+ val nextCursor =
+ nextCursor().getOrNull()
+ ?: throw IllegalStateException("Cannot construct next page params")
+ return params.toBuilder().cursor(nextCursor).build()
+ }
+
+ override fun nextPage(): BeneficialOwnerListPage = service.list(nextPageParams())
+
+ fun autoPager(): AutoPager = AutoPager.from(this)
+
+ /** The parameters that were used to request this page. */
+ fun params(): BeneficialOwnerListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): BeneficialOwnerListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [BeneficialOwnerListPage].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BeneficialOwnerListPage]. */
+ class Builder internal constructor() {
+
+ private var service: BeneficialOwnerService? = null
+ private var params: BeneficialOwnerListParams? = null
+ private var response: BeneficialOwnerListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(beneficialOwnerListPage: BeneficialOwnerListPage) = apply {
+ service = beneficialOwnerListPage.service
+ params = beneficialOwnerListPage.params
+ response = beneficialOwnerListPage.response
+ }
+
+ fun service(service: BeneficialOwnerService) = apply { this.service = service }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: BeneficialOwnerListParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: BeneficialOwnerListPageResponse) = apply { this.response = response }
+
+ /**
+ * Returns an immutable instance of [BeneficialOwnerListPage].
+ *
+ * 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(): BeneficialOwnerListPage =
+ BeneficialOwnerListPage(
+ checkRequired("service", service),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is BeneficialOwnerListPage &&
+ service == other.service &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, params, response)
+
+ override fun toString() =
+ "BeneficialOwnerListPage{service=$service, params=$params, response=$response}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageAsync.kt
new file mode 100644
index 000000000..b48371a5f
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageAsync.kt
@@ -0,0 +1,148 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+import com.increase.api.core.AutoPagerAsync
+import com.increase.api.core.PageAsync
+import com.increase.api.core.checkRequired
+import com.increase.api.services.async.BeneficialOwnerServiceAsync
+import java.util.Objects
+import java.util.Optional
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.Executor
+import kotlin.jvm.optionals.getOrNull
+
+/** @see BeneficialOwnerServiceAsync.list */
+class BeneficialOwnerListPageAsync
+private constructor(
+ private val service: BeneficialOwnerServiceAsync,
+ private val streamHandlerExecutor: Executor,
+ private val params: BeneficialOwnerListParams,
+ private val response: BeneficialOwnerListPageResponse,
+) : PageAsync {
+
+ /**
+ * Delegates to [BeneficialOwnerListPageResponse], but gracefully handles missing data.
+ *
+ * @see BeneficialOwnerListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [BeneficialOwnerListPageResponse], but gracefully handles missing data.
+ *
+ * @see BeneficialOwnerListPageResponse.nextCursor
+ */
+ fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
+
+ fun nextPageParams(): BeneficialOwnerListParams {
+ 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(): BeneficialOwnerListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): BeneficialOwnerListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [BeneficialOwnerListPageAsync].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BeneficialOwnerListPageAsync]. */
+ class Builder internal constructor() {
+
+ private var service: BeneficialOwnerServiceAsync? = null
+ private var streamHandlerExecutor: Executor? = null
+ private var params: BeneficialOwnerListParams? = null
+ private var response: BeneficialOwnerListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(beneficialOwnerListPageAsync: BeneficialOwnerListPageAsync) = apply {
+ service = beneficialOwnerListPageAsync.service
+ streamHandlerExecutor = beneficialOwnerListPageAsync.streamHandlerExecutor
+ params = beneficialOwnerListPageAsync.params
+ response = beneficialOwnerListPageAsync.response
+ }
+
+ fun service(service: BeneficialOwnerServiceAsync) = apply { this.service = service }
+
+ fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
+ this.streamHandlerExecutor = streamHandlerExecutor
+ }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: BeneficialOwnerListParams) = apply { this.params = params }
+
+ /** The response that this page was parsed from. */
+ fun response(response: BeneficialOwnerListPageResponse) = apply { this.response = response }
+
+ /**
+ * Returns an immutable instance of [BeneficialOwnerListPageAsync].
+ *
+ * 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(): BeneficialOwnerListPageAsync =
+ BeneficialOwnerListPageAsync(
+ 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 BeneficialOwnerListPageAsync &&
+ 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() =
+ "BeneficialOwnerListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageResponse.kt
new file mode 100644
index 000000000..ecf6a70a4
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListPageResponse.kt
@@ -0,0 +1,242 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+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 Beneficial Owner objects. */
+class BeneficialOwnerListPageResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val data: JsonField>,
+ private val nextCursor: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("data")
+ @ExcludeMissing
+ data: JsonField> = JsonMissing.of(),
+ @JsonProperty("next_cursor")
+ @ExcludeMissing
+ nextCursor: JsonField = JsonMissing.of(),
+ ) : this(data, nextCursor, mutableMapOf())
+
+ /**
+ * The contents of the list.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun data(): List = data.getRequired("data")
+
+ /**
+ * A pointer to a place in the list.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun nextCursor(): Optional = nextCursor.getOptional("next_cursor")
+
+ /**
+ * Returns the raw JSON value of [data].
+ *
+ * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data
+
+ /**
+ * Returns the raw JSON value of [nextCursor].
+ *
+ * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [BeneficialOwnerListPageResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * .nextCursor()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BeneficialOwnerListPageResponse]. */
+ class Builder internal constructor() {
+
+ private var data: JsonField>? = null
+ private var nextCursor: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(beneficialOwnerListPageResponse: BeneficialOwnerListPageResponse) =
+ apply {
+ data = beneficialOwnerListPageResponse.data.map { it.toMutableList() }
+ nextCursor = beneficialOwnerListPageResponse.nextCursor
+ additionalProperties =
+ beneficialOwnerListPageResponse.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 [EntityBeneficialOwner] to [Builder.data].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addData(data: EntityBeneficialOwner) = apply {
+ this.data =
+ (this.data ?: JsonField.of(mutableListOf())).also {
+ checkKnown("data", it).add(data)
+ }
+ }
+
+ /** A pointer to a place in the list. */
+ fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor))
+
+ /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */
+ fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull())
+
+ /**
+ * Sets [Builder.nextCursor] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.nextCursor] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [BeneficialOwnerListPageResponse].
+ *
+ * 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(): BeneficialOwnerListPageResponse =
+ BeneficialOwnerListPageResponse(
+ checkRequired("data", data).map { it.toImmutable() },
+ checkRequired("nextCursor", nextCursor),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): BeneficialOwnerListPageResponse = 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 BeneficialOwnerListPageResponse &&
+ 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() =
+ "BeneficialOwnerListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListParams.kt
new file mode 100644
index 000000000..55f214c59
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerListParams.kt
@@ -0,0 +1,283 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+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 java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** List Beneficial Owners */
+class BeneficialOwnerListParams
+private constructor(
+ private val entityId: String,
+ private val cursor: String?,
+ private val idempotencyKey: String?,
+ private val limit: Long?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * The identifier of the Entity to list beneficial owners for. Only `corporation` entities have
+ * beneficial owners.
+ */
+ fun entityId(): String = entityId
+
+ /** 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 {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [BeneficialOwnerListParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .entityId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BeneficialOwnerListParams]. */
+ class Builder internal constructor() {
+
+ private var entityId: String? = null
+ 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(beneficialOwnerListParams: BeneficialOwnerListParams) = apply {
+ entityId = beneficialOwnerListParams.entityId
+ cursor = beneficialOwnerListParams.cursor
+ idempotencyKey = beneficialOwnerListParams.idempotencyKey
+ limit = beneficialOwnerListParams.limit
+ additionalHeaders = beneficialOwnerListParams.additionalHeaders.toBuilder()
+ additionalQueryParams = beneficialOwnerListParams.additionalQueryParams.toBuilder()
+ }
+
+ /**
+ * The identifier of the Entity to list beneficial owners for. Only `corporation` entities
+ * have beneficial owners.
+ */
+ fun entityId(entityId: String) = apply { this.entityId = entityId }
+
+ /** 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 [BeneficialOwnerListParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .entityId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): BeneficialOwnerListParams =
+ BeneficialOwnerListParams(
+ checkRequired("entityId", entityId),
+ cursor,
+ idempotencyKey,
+ limit,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams =
+ QueryParams.builder()
+ .apply {
+ put("entity_id", entityId)
+ 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 BeneficialOwnerListParams &&
+ entityId == other.entityId &&
+ cursor == other.cursor &&
+ idempotencyKey == other.idempotencyKey &&
+ limit == other.limit &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ entityId,
+ cursor,
+ idempotencyKey,
+ limit,
+ additionalHeaders,
+ additionalQueryParams,
+ )
+
+ override fun toString() =
+ "BeneficialOwnerListParams{entityId=$entityId, cursor=$cursor, idempotencyKey=$idempotencyKey, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerRetrieveParams.kt
new file mode 100644
index 000000000..b6f4b6c49
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerRetrieveParams.kt
@@ -0,0 +1,205 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+import com.increase.api.core.Params
+import com.increase.api.core.http.Headers
+import com.increase.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Retrieve a Beneficial Owner */
+class BeneficialOwnerRetrieveParams
+private constructor(
+ private val entityBeneficialOwnerId: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** The identifier of the Beneficial Owner to retrieve. */
+ fun entityBeneficialOwnerId(): Optional = Optional.ofNullable(entityBeneficialOwnerId)
+
+ /** 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(): BeneficialOwnerRetrieveParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [BeneficialOwnerRetrieveParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BeneficialOwnerRetrieveParams]. */
+ class Builder internal constructor() {
+
+ private var entityBeneficialOwnerId: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(beneficialOwnerRetrieveParams: BeneficialOwnerRetrieveParams) = apply {
+ entityBeneficialOwnerId = beneficialOwnerRetrieveParams.entityBeneficialOwnerId
+ additionalHeaders = beneficialOwnerRetrieveParams.additionalHeaders.toBuilder()
+ additionalQueryParams = beneficialOwnerRetrieveParams.additionalQueryParams.toBuilder()
+ }
+
+ /** The identifier of the Beneficial Owner to retrieve. */
+ fun entityBeneficialOwnerId(entityBeneficialOwnerId: String?) = apply {
+ this.entityBeneficialOwnerId = entityBeneficialOwnerId
+ }
+
+ /**
+ * Alias for calling [Builder.entityBeneficialOwnerId] with
+ * `entityBeneficialOwnerId.orElse(null)`.
+ */
+ fun entityBeneficialOwnerId(entityBeneficialOwnerId: Optional) =
+ entityBeneficialOwnerId(entityBeneficialOwnerId.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 [BeneficialOwnerRetrieveParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): BeneficialOwnerRetrieveParams =
+ BeneficialOwnerRetrieveParams(
+ entityBeneficialOwnerId,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> entityBeneficialOwnerId ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is BeneficialOwnerRetrieveParams &&
+ entityBeneficialOwnerId == other.entityBeneficialOwnerId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(entityBeneficialOwnerId, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "BeneficialOwnerRetrieveParams{entityBeneficialOwnerId=$entityBeneficialOwnerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/EntityBeneficialOwner.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/EntityBeneficialOwner.kt
new file mode 100644
index 000000000..1c3f5f471
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/EntityBeneficialOwner.kt
@@ -0,0 +1,1714 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.beneficialowners
+
+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.checkKnown
+import com.increase.api.core.checkRequired
+import com.increase.api.core.toImmutable
+import com.increase.api.errors.IncreaseInvalidDataException
+import java.time.LocalDate
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class EntityBeneficialOwner
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val id: JsonField,
+ private val companyTitle: JsonField,
+ private val createdAt: JsonField,
+ private val individual: JsonField,
+ private val prongs: JsonField>,
+ private val type: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
+ @JsonProperty("company_title")
+ @ExcludeMissing
+ companyTitle: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("individual")
+ @ExcludeMissing
+ individual: JsonField = JsonMissing.of(),
+ @JsonProperty("prongs") @ExcludeMissing prongs: JsonField> = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ ) : this(id, companyTitle, createdAt, individual, prongs, type, mutableMapOf())
+
+ /**
+ * The identifier of this beneficial owner.
+ *
+ * @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")
+
+ /**
+ * This person's role or title within the entity.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun companyTitle(): Optional = companyTitle.getOptional("company_title")
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Beneficial Owner 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")
+
+ /**
+ * Personal details for the beneficial owner.
+ *
+ * @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 individual(): Individual = individual.getRequired("individual")
+
+ /**
+ * Why this person is considered a beneficial owner of the entity.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun prongs(): List = prongs.getRequired("prongs")
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `entity_beneficial_owner`.
+ *
+ * @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 [companyTitle].
+ *
+ * Unlike [companyTitle], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("company_title")
+ @ExcludeMissing
+ fun _companyTitle(): JsonField = companyTitle
+
+ /**
+ * 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 [individual].
+ *
+ * Unlike [individual], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("individual")
+ @ExcludeMissing
+ fun _individual(): JsonField = individual
+
+ /**
+ * Returns the raw JSON value of [prongs].
+ *
+ * Unlike [prongs], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("prongs") @ExcludeMissing fun _prongs(): JsonField> = prongs
+
+ /**
+ * 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 [EntityBeneficialOwner].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .companyTitle()
+ * .createdAt()
+ * .individual()
+ * .prongs()
+ * .type()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [EntityBeneficialOwner]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var companyTitle: JsonField? = null
+ private var createdAt: JsonField? = null
+ private var individual: JsonField? = null
+ private var prongs: JsonField>? = null
+ private var type: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(entityBeneficialOwner: EntityBeneficialOwner) = apply {
+ id = entityBeneficialOwner.id
+ companyTitle = entityBeneficialOwner.companyTitle
+ createdAt = entityBeneficialOwner.createdAt
+ individual = entityBeneficialOwner.individual
+ prongs = entityBeneficialOwner.prongs.map { it.toMutableList() }
+ type = entityBeneficialOwner.type
+ additionalProperties = entityBeneficialOwner.additionalProperties.toMutableMap()
+ }
+
+ /** The identifier of this beneficial owner. */
+ 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 }
+
+ /** This person's role or title within the entity. */
+ fun companyTitle(companyTitle: String?) = companyTitle(JsonField.ofNullable(companyTitle))
+
+ /** Alias for calling [Builder.companyTitle] with `companyTitle.orElse(null)`. */
+ fun companyTitle(companyTitle: Optional) = companyTitle(companyTitle.getOrNull())
+
+ /**
+ * Sets [Builder.companyTitle] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.companyTitle] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun companyTitle(companyTitle: JsonField) = apply {
+ this.companyTitle = companyTitle
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Beneficial Owner
+ * was created.
+ */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+
+ /** Personal details for the beneficial owner. */
+ fun individual(individual: Individual) = individual(JsonField.of(individual))
+
+ /**
+ * Sets [Builder.individual] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.individual] with a well-typed [Individual] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun individual(individual: JsonField) = apply { this.individual = individual }
+
+ /** Why this person is considered a beneficial owner of the entity. */
+ fun prongs(prongs: List) = prongs(JsonField.of(prongs))
+
+ /**
+ * Sets [Builder.prongs] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.prongs] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun prongs(prongs: JsonField>) = apply {
+ this.prongs = prongs.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Prong] to [prongs].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addProng(prong: Prong) = apply {
+ prongs =
+ (prongs ?: JsonField.of(mutableListOf())).also {
+ checkKnown("prongs", it).add(prong)
+ }
+ }
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `entity_beneficial_owner`.
+ */
+ 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 [EntityBeneficialOwner].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .companyTitle()
+ * .createdAt()
+ * .individual()
+ * .prongs()
+ * .type()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): EntityBeneficialOwner =
+ EntityBeneficialOwner(
+ checkRequired("id", id),
+ checkRequired("companyTitle", companyTitle),
+ checkRequired("createdAt", createdAt),
+ checkRequired("individual", individual),
+ checkRequired("prongs", prongs).map { it.toImmutable() },
+ checkRequired("type", type),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): EntityBeneficialOwner = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ companyTitle()
+ createdAt()
+ individual().validate()
+ prongs().forEach { it.validate() }
+ type().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (id.asKnown().isPresent) 1 else 0) +
+ (if (companyTitle.asKnown().isPresent) 1 else 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (individual.asKnown().getOrNull()?.validity() ?: 0) +
+ (prongs.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** Personal details for the beneficial owner. */
+ class Individual
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val address: JsonField,
+ private val dateOfBirth: JsonField,
+ private val identification: JsonField,
+ private val name: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("address") @ExcludeMissing address: JsonField = JsonMissing.of(),
+ @JsonProperty("date_of_birth")
+ @ExcludeMissing
+ dateOfBirth: JsonField = JsonMissing.of(),
+ @JsonProperty("identification")
+ @ExcludeMissing
+ identification: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ ) : this(address, dateOfBirth, identification, name, mutableMapOf())
+
+ /**
+ * The person's address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun address(): Address = address.getRequired("address")
+
+ /**
+ * The person's date of birth in YYYY-MM-DD format.
+ *
+ * @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 dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth")
+
+ /**
+ * A means of verifying the person's identity.
+ *
+ * @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 identification(): Identification = identification.getRequired("identification")
+
+ /**
+ * The person's legal name.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun name(): String = name.getRequired("name")
+
+ /**
+ * Returns the raw JSON value of [address].
+ *
+ * Unlike [address], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("address") @ExcludeMissing fun _address(): JsonField = address
+
+ /**
+ * Returns the raw JSON value of [dateOfBirth].
+ *
+ * Unlike [dateOfBirth], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("date_of_birth")
+ @ExcludeMissing
+ fun _dateOfBirth(): JsonField = dateOfBirth
+
+ /**
+ * Returns the raw JSON value of [identification].
+ *
+ * Unlike [identification], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("identification")
+ @ExcludeMissing
+ fun _identification(): JsonField = identification
+
+ /**
+ * 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 [Individual].
+ *
+ * The following fields are required:
+ * ```java
+ * .address()
+ * .dateOfBirth()
+ * .identification()
+ * .name()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Individual]. */
+ class Builder internal constructor() {
+
+ private var address: JsonField? = null
+ private var dateOfBirth: JsonField? = null
+ private var identification: JsonField? = null
+ private var name: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(individual: Individual) = apply {
+ address = individual.address
+ dateOfBirth = individual.dateOfBirth
+ identification = individual.identification
+ name = individual.name
+ additionalProperties = individual.additionalProperties.toMutableMap()
+ }
+
+ /** The person's address. */
+ fun address(address: Address) = address(JsonField.of(address))
+
+ /**
+ * Sets [Builder.address] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.address] with a well-typed [Address] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun address(address: JsonField) = apply { this.address = address }
+
+ /** The person's date of birth in YYYY-MM-DD format. */
+ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth))
+
+ /**
+ * Sets [Builder.dateOfBirth] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.dateOfBirth] with a well-typed [LocalDate] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun dateOfBirth(dateOfBirth: JsonField) = apply {
+ this.dateOfBirth = dateOfBirth
+ }
+
+ /** A means of verifying the person's identity. */
+ fun identification(identification: Identification) =
+ identification(JsonField.of(identification))
+
+ /**
+ * Sets [Builder.identification] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.identification] with a well-typed [Identification]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun identification(identification: JsonField) = apply {
+ this.identification = identification
+ }
+
+ /** The person's legal name. */
+ 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 [Individual].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .address()
+ * .dateOfBirth()
+ * .identification()
+ * .name()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Individual =
+ Individual(
+ checkRequired("address", address),
+ checkRequired("dateOfBirth", dateOfBirth),
+ checkRequired("identification", identification),
+ checkRequired("name", name),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Individual = apply {
+ if (validated) {
+ return@apply
+ }
+
+ address().validate()
+ dateOfBirth()
+ identification().validate()
+ name()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (address.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (dateOfBirth.asKnown().isPresent) 1 else 0) +
+ (identification.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (name.asKnown().isPresent) 1 else 0)
+
+ /** The person's address. */
+ class Address
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val city: JsonField,
+ private val country: JsonField,
+ private val line1: JsonField,
+ private val line2: JsonField,
+ private val state: JsonField,
+ private val zip: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(),
+ @JsonProperty("country")
+ @ExcludeMissing
+ country: JsonField = JsonMissing.of(),
+ @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(),
+ @JsonProperty("line2") @ExcludeMissing line2: JsonField = JsonMissing.of(),
+ @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
+ @JsonProperty("zip") @ExcludeMissing zip: JsonField = JsonMissing.of(),
+ ) : this(city, country, line1, line2, state, zip, mutableMapOf())
+
+ /**
+ * The city, district, town, or village of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun city(): Optional = city.getOptional("city")
+
+ /**
+ * The two-letter ISO 3166-1 alpha-2 code for the country of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun country(): String = country.getRequired("country")
+
+ /**
+ * The first line of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun line1(): String = line1.getRequired("line1")
+
+ /**
+ * The second line of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun line2(): Optional = line2.getOptional("line2")
+
+ /**
+ * The two-letter United States Postal Service (USPS) abbreviation for the US state,
+ * province, or region of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun state(): Optional = state.getOptional("state")
+
+ /**
+ * The ZIP or postal code of the address.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun zip(): Optional = zip.getOptional("zip")
+
+ /**
+ * Returns the raw JSON value of [city].
+ *
+ * Unlike [city], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city
+
+ /**
+ * Returns the raw JSON value of [country].
+ *
+ * Unlike [country], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("country") @ExcludeMissing fun _country(): JsonField = country
+
+ /**
+ * Returns the raw JSON value of [line1].
+ *
+ * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1
+
+ /**
+ * Returns the raw JSON value of [line2].
+ *
+ * Unlike [line2], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2
+
+ /**
+ * Returns the raw JSON value of [state].
+ *
+ * Unlike [state], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state
+
+ /**
+ * Returns the raw JSON value of [zip].
+ *
+ * Unlike [zip], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("zip") @ExcludeMissing fun _zip(): JsonField = zip
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Address].
+ *
+ * The following fields are required:
+ * ```java
+ * .city()
+ * .country()
+ * .line1()
+ * .line2()
+ * .state()
+ * .zip()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Address]. */
+ class Builder internal constructor() {
+
+ private var city: JsonField? = null
+ private var country: JsonField? = null
+ private var line1: JsonField? = null
+ private var line2: JsonField? = null
+ private var state: JsonField? = null
+ private var zip: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(address: Address) = apply {
+ city = address.city
+ country = address.country
+ line1 = address.line1
+ line2 = address.line2
+ state = address.state
+ zip = address.zip
+ additionalProperties = address.additionalProperties.toMutableMap()
+ }
+
+ /** The city, district, town, or village of the address. */
+ fun city(city: String?) = city(JsonField.ofNullable(city))
+
+ /** Alias for calling [Builder.city] with `city.orElse(null)`. */
+ fun city(city: Optional) = city(city.getOrNull())
+
+ /**
+ * Sets [Builder.city] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.city] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun city(city: JsonField) = apply { this.city = city }
+
+ /** The two-letter ISO 3166-1 alpha-2 code for the country of the address. */
+ fun country(country: String) = country(JsonField.of(country))
+
+ /**
+ * Sets [Builder.country] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.country] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun country(country: JsonField) = apply { this.country = country }
+
+ /** The first line of the address. */
+ fun line1(line1: String) = line1(JsonField.of(line1))
+
+ /**
+ * Sets [Builder.line1] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.line1] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun line1(line1: JsonField) = apply { this.line1 = line1 }
+
+ /** The second line of the address. */
+ fun line2(line2: String?) = line2(JsonField.ofNullable(line2))
+
+ /** Alias for calling [Builder.line2] with `line2.orElse(null)`. */
+ fun line2(line2: Optional) = line2(line2.getOrNull())
+
+ /**
+ * Sets [Builder.line2] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.line2] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun line2(line2: JsonField) = apply { this.line2 = line2 }
+
+ /**
+ * The two-letter United States Postal Service (USPS) abbreviation for the US state,
+ * province, or region of the address.
+ */
+ fun state(state: String?) = state(JsonField.ofNullable(state))
+
+ /** Alias for calling [Builder.state] with `state.orElse(null)`. */
+ fun state(state: Optional) = state(state.getOrNull())
+
+ /**
+ * Sets [Builder.state] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.state] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun state(state: JsonField) = apply { this.state = state }
+
+ /** The ZIP or postal code of the address. */
+ fun zip(zip: String?) = zip(JsonField.ofNullable(zip))
+
+ /** Alias for calling [Builder.zip] with `zip.orElse(null)`. */
+ fun zip(zip: Optional) = zip(zip.getOrNull())
+
+ /**
+ * Sets [Builder.zip] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.zip] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun zip(zip: JsonField) = apply { this.zip = zip }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Address].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .city()
+ * .country()
+ * .line1()
+ * .line2()
+ * .state()
+ * .zip()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Address =
+ Address(
+ checkRequired("city", city),
+ checkRequired("country", country),
+ checkRequired("line1", line1),
+ checkRequired("line2", line2),
+ checkRequired("state", state),
+ checkRequired("zip", zip),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Address = apply {
+ if (validated) {
+ return@apply
+ }
+
+ city()
+ country()
+ line1()
+ line2()
+ state()
+ zip()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (city.asKnown().isPresent) 1 else 0) +
+ (if (country.asKnown().isPresent) 1 else 0) +
+ (if (line1.asKnown().isPresent) 1 else 0) +
+ (if (line2.asKnown().isPresent) 1 else 0) +
+ (if (state.asKnown().isPresent) 1 else 0) +
+ (if (zip.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Address &&
+ city == other.city &&
+ country == other.country &&
+ line1 == other.line1 &&
+ line2 == other.line2 &&
+ state == other.state &&
+ zip == other.zip &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(city, country, line1, line2, state, zip, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Address{city=$city, country=$country, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
+ }
+
+ /** A means of verifying the person's identity. */
+ class Identification
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val method: JsonField,
+ private val numberLast4: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("method")
+ @ExcludeMissing
+ method: JsonField = JsonMissing.of(),
+ @JsonProperty("number_last4")
+ @ExcludeMissing
+ numberLast4: JsonField = JsonMissing.of(),
+ ) : this(method, numberLast4, mutableMapOf())
+
+ /**
+ * A method that can be used to verify the individual's identity.
+ *
+ * @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 method(): Method = method.getRequired("method")
+
+ /**
+ * The last 4 digits of the identification number that can be used to verify the
+ * individual's identity.
+ *
+ * @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 numberLast4(): String = numberLast4.getRequired("number_last4")
+
+ /**
+ * Returns the raw JSON value of [method].
+ *
+ * Unlike [method], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("method") @ExcludeMissing fun _method(): JsonField = method
+
+ /**
+ * Returns the raw JSON value of [numberLast4].
+ *
+ * Unlike [numberLast4], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("number_last4")
+ @ExcludeMissing
+ fun _numberLast4(): JsonField = numberLast4
+
+ @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 [Identification].
+ *
+ * The following fields are required:
+ * ```java
+ * .method()
+ * .numberLast4()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Identification]. */
+ class Builder internal constructor() {
+
+ private var method: JsonField? = null
+ private var numberLast4: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(identification: Identification) = apply {
+ method = identification.method
+ numberLast4 = identification.numberLast4
+ additionalProperties = identification.additionalProperties.toMutableMap()
+ }
+
+ /** A method that can be used to verify the individual's identity. */
+ fun method(method: Method) = method(JsonField.of(method))
+
+ /**
+ * Sets [Builder.method] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.method] with a well-typed [Method] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun method(method: JsonField) = apply { this.method = method }
+
+ /**
+ * The last 4 digits of the identification number that can be used to verify the
+ * individual's identity.
+ */
+ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4))
+
+ /**
+ * Sets [Builder.numberLast4] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.numberLast4] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun numberLast4(numberLast4: JsonField) = apply {
+ this.numberLast4 = numberLast4
+ }
+
+ 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 [Identification].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .method()
+ * .numberLast4()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Identification =
+ Identification(
+ checkRequired("method", method),
+ checkRequired("numberLast4", numberLast4),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Identification = apply {
+ if (validated) {
+ return@apply
+ }
+
+ method().validate()
+ numberLast4()
+ 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 =
+ (method.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (numberLast4.asKnown().isPresent) 1 else 0)
+
+ /** A method that can be used to verify the individual's identity. */
+ class Method @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 social security number. */
+ @JvmField val SOCIAL_SECURITY_NUMBER = of("social_security_number")
+
+ /** An individual taxpayer identification number (ITIN). */
+ @JvmField
+ val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER =
+ of("individual_taxpayer_identification_number")
+
+ /** A passport number. */
+ @JvmField val PASSPORT = of("passport")
+
+ /** A driver's license number. */
+ @JvmField val DRIVERS_LICENSE = of("drivers_license")
+
+ /** Another identifying document. */
+ @JvmField val OTHER = of("other")
+
+ @JvmStatic fun of(value: String) = Method(JsonField.of(value))
+ }
+
+ /** An enum containing [Method]'s known values. */
+ enum class Known {
+ /** A social security number. */
+ SOCIAL_SECURITY_NUMBER,
+ /** An individual taxpayer identification number (ITIN). */
+ INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER,
+ /** A passport number. */
+ PASSPORT,
+ /** A driver's license number. */
+ DRIVERS_LICENSE,
+ /** Another identifying document. */
+ OTHER,
+ }
+
+ /**
+ * An enum containing [Method]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Method] 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 social security number. */
+ SOCIAL_SECURITY_NUMBER,
+ /** An individual taxpayer identification number (ITIN). */
+ INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER,
+ /** A passport number. */
+ PASSPORT,
+ /** A driver's license number. */
+ DRIVERS_LICENSE,
+ /** Another identifying document. */
+ OTHER,
+ /**
+ * An enum member indicating that [Method] 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) {
+ SOCIAL_SECURITY_NUMBER -> Value.SOCIAL_SECURITY_NUMBER
+ INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER ->
+ Value.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER
+ PASSPORT -> Value.PASSPORT
+ DRIVERS_LICENSE -> Value.DRIVERS_LICENSE
+ OTHER -> Value.OTHER
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and
+ * don't want to throw for the unknown case.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value is a not a
+ * known member.
+ */
+ fun known(): Known =
+ when (this) {
+ SOCIAL_SECURITY_NUMBER -> Known.SOCIAL_SECURITY_NUMBER
+ INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER ->
+ Known.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER
+ PASSPORT -> Known.PASSPORT
+ DRIVERS_LICENSE -> Known.DRIVERS_LICENSE
+ OTHER -> Known.OTHER
+ else -> throw IncreaseInvalidDataException("Unknown Method: $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(): Method = 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 Method && 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 Identification &&
+ method == other.method &&
+ numberLast4 == other.numberLast4 &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(method, numberLast4, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Individual &&
+ address == other.address &&
+ dateOfBirth == other.dateOfBirth &&
+ identification == other.identification &&
+ name == other.name &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(address, dateOfBirth, identification, name, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}"
+ }
+
+ class Prong @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 person with 25% or greater direct or indirect ownership of the entity. */
+ @JvmField val OWNERSHIP = of("ownership")
+
+ /** A person who manages, directs, or has significant control of the entity. */
+ @JvmField val CONTROL = of("control")
+
+ @JvmStatic fun of(value: String) = Prong(JsonField.of(value))
+ }
+
+ /** An enum containing [Prong]'s known values. */
+ enum class Known {
+ /** A person with 25% or greater direct or indirect ownership of the entity. */
+ OWNERSHIP,
+ /** A person who manages, directs, or has significant control of the entity. */
+ CONTROL,
+ }
+
+ /**
+ * An enum containing [Prong]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Prong] 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 person with 25% or greater direct or indirect ownership of the entity. */
+ OWNERSHIP,
+ /** A person who manages, directs, or has significant control of the entity. */
+ CONTROL,
+ /** An enum member indicating that [Prong] 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) {
+ OWNERSHIP -> Value.OWNERSHIP
+ CONTROL -> Value.CONTROL
+ 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) {
+ OWNERSHIP -> Known.OWNERSHIP
+ CONTROL -> Known.CONTROL
+ else -> throw IncreaseInvalidDataException("Unknown Prong: $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(): Prong = 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 Prong && 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
+ * `entity_beneficial_owner`.
+ */
+ 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 ENTITY_BENEFICIAL_OWNER = of("entity_beneficial_owner")
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ ENTITY_BENEFICIAL_OWNER
+ }
+
+ /**
+ * 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 {
+ ENTITY_BENEFICIAL_OWNER,
+ /** 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) {
+ ENTITY_BENEFICIAL_OWNER -> Value.ENTITY_BENEFICIAL_OWNER
+ 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) {
+ ENTITY_BENEFICIAL_OWNER -> Known.ENTITY_BENEFICIAL_OWNER
+ 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 EntityBeneficialOwner &&
+ id == other.id &&
+ companyTitle == other.companyTitle &&
+ createdAt == other.createdAt &&
+ individual == other.individual &&
+ prongs == other.prongs &&
+ type == other.type &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(id, companyTitle, createdAt, individual, prongs, type, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "EntityBeneficialOwner{id=$id, companyTitle=$companyTitle, createdAt=$createdAt, individual=$individual, prongs=$prongs, type=$type, additionalProperties=$additionalProperties}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
index ede15978d..abd4f55cd 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
@@ -15,6 +15,7 @@ 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 com.increase.api.models.beneficialowners.EntityBeneficialOwner
import com.increase.api.models.supplementaldocuments.EntitySupplementalDocument
import java.time.LocalDate
import java.time.OffsetDateTime
@@ -954,7 +955,7 @@ private constructor(
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val address: JsonField,
- private val beneficialOwners: JsonField>,
+ private val beneficialOwners: JsonField>,
private val email: JsonField,
private val incorporationState: JsonField,
private val industryCode: JsonField,
@@ -969,7 +970,7 @@ private constructor(
@JsonProperty("address") @ExcludeMissing address: JsonField = JsonMissing.of(),
@JsonProperty("beneficial_owners")
@ExcludeMissing
- beneficialOwners: JsonField> = JsonMissing.of(),
+ beneficialOwners: JsonField> = JsonMissing.of(),
@JsonProperty("email") @ExcludeMissing email: JsonField = JsonMissing.of(),
@JsonProperty("incorporation_state")
@ExcludeMissing
@@ -1008,7 +1009,7 @@ private constructor(
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun beneficialOwners(): List =
+ fun beneficialOwners(): List =
beneficialOwners.getRequired("beneficial_owners")
/**
@@ -1077,7 +1078,7 @@ private constructor(
*/
@JsonProperty("beneficial_owners")
@ExcludeMissing
- fun _beneficialOwners(): JsonField> = beneficialOwners
+ fun _beneficialOwners(): JsonField> = beneficialOwners
/**
* Returns the raw JSON value of [email].
@@ -1166,7 +1167,7 @@ private constructor(
class Builder internal constructor() {
private var address: JsonField? = null
- private var beneficialOwners: JsonField>? = null
+ private var beneficialOwners: JsonField>? = null
private var email: JsonField? = null
private var incorporationState: JsonField? = null
private var industryCode: JsonField? = null
@@ -1204,26 +1205,26 @@ private constructor(
* The identifying details of anyone controlling or owning 25% or more of the
* corporation.
*/
- fun beneficialOwners(beneficialOwners: List) =
+ fun beneficialOwners(beneficialOwners: List) =
beneficialOwners(JsonField.of(beneficialOwners))
/**
* Sets [Builder.beneficialOwners] to an arbitrary JSON value.
*
* You should usually call [Builder.beneficialOwners] with a well-typed
- * `List` value instead. This method is primarily for setting the field
- * to an undocumented or not yet supported value.
+ * `List` value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
*/
- fun beneficialOwners(beneficialOwners: JsonField>) = apply {
+ fun beneficialOwners(beneficialOwners: JsonField>) = apply {
this.beneficialOwners = beneficialOwners.map { it.toMutableList() }
}
/**
- * Adds a single [BeneficialOwner] to [beneficialOwners].
+ * Adds a single [EntityBeneficialOwner] to [beneficialOwners].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
- fun addBeneficialOwner(beneficialOwner: BeneficialOwner) = apply {
+ fun addBeneficialOwner(beneficialOwner: EntityBeneficialOwner) = apply {
beneficialOwners =
(beneficialOwners ?: JsonField.of(mutableListOf())).also {
checkKnown("beneficialOwners", it).add(beneficialOwner)
@@ -1759,1554 +1760,6 @@ private constructor(
"Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
}
- class BeneficialOwner
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val companyTitle: JsonField,
- private val individual: JsonField,
- private val prongs: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("company_title")
- @ExcludeMissing
- companyTitle: JsonField = JsonMissing.of(),
- @JsonProperty("individual")
- @ExcludeMissing
- individual: JsonField = JsonMissing.of(),
- @JsonProperty("prongs")
- @ExcludeMissing
- prongs: JsonField> = JsonMissing.of(),
- ) : this(id, companyTitle, individual, prongs, mutableMapOf())
-
- /**
- * The identifier of this beneficial owner.
- *
- * @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")
-
- /**
- * This person's role or title within the entity.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
- * if the server responded with an unexpected value).
- */
- fun companyTitle(): Optional = companyTitle.getOptional("company_title")
-
- /**
- * Personal details for the beneficial owner.
- *
- * @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 individual(): Individual = individual.getRequired("individual")
-
- /**
- * Why this person is considered a beneficial owner of the entity.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun prongs(): List = prongs.getRequired("prongs")
-
- /**
- * 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 [companyTitle].
- *
- * Unlike [companyTitle], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("company_title")
- @ExcludeMissing
- fun _companyTitle(): JsonField = companyTitle
-
- /**
- * Returns the raw JSON value of [individual].
- *
- * Unlike [individual], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("individual")
- @ExcludeMissing
- fun _individual(): JsonField = individual
-
- /**
- * Returns the raw JSON value of [prongs].
- *
- * Unlike [prongs], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("prongs") @ExcludeMissing fun _prongs(): JsonField> = prongs
-
- @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 [BeneficialOwner].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .companyTitle()
- * .individual()
- * .prongs()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BeneficialOwner]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var companyTitle: JsonField? = null
- private var individual: JsonField? = null
- private var prongs: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(beneficialOwner: BeneficialOwner) = apply {
- id = beneficialOwner.id
- companyTitle = beneficialOwner.companyTitle
- individual = beneficialOwner.individual
- prongs = beneficialOwner.prongs.map { it.toMutableList() }
- additionalProperties = beneficialOwner.additionalProperties.toMutableMap()
- }
-
- /** The identifier of this beneficial owner. */
- 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 }
-
- /** This person's role or title within the entity. */
- fun companyTitle(companyTitle: String?) =
- companyTitle(JsonField.ofNullable(companyTitle))
-
- /** Alias for calling [Builder.companyTitle] with `companyTitle.orElse(null)`. */
- fun companyTitle(companyTitle: Optional) =
- companyTitle(companyTitle.getOrNull())
-
- /**
- * Sets [Builder.companyTitle] to an arbitrary JSON value.
- *
- * You should usually call [Builder.companyTitle] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun companyTitle(companyTitle: JsonField) = apply {
- this.companyTitle = companyTitle
- }
-
- /** Personal details for the beneficial owner. */
- fun individual(individual: Individual) = individual(JsonField.of(individual))
-
- /**
- * Sets [Builder.individual] to an arbitrary JSON value.
- *
- * You should usually call [Builder.individual] with a well-typed [Individual] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun individual(individual: JsonField) = apply {
- this.individual = individual
- }
-
- /** Why this person is considered a beneficial owner of the entity. */
- fun prongs(prongs: List) = prongs(JsonField.of(prongs))
-
- /**
- * Sets [Builder.prongs] to an arbitrary JSON value.
- *
- * You should usually call [Builder.prongs] with a well-typed `List` value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun prongs(prongs: JsonField>) = apply {
- this.prongs = prongs.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [Prong] to [prongs].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addProng(prong: Prong) = apply {
- prongs =
- (prongs ?: JsonField.of(mutableListOf())).also {
- checkKnown("prongs", it).add(prong)
- }
- }
-
- 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 [BeneficialOwner].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .companyTitle()
- * .individual()
- * .prongs()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BeneficialOwner =
- BeneficialOwner(
- checkRequired("id", id),
- checkRequired("companyTitle", companyTitle),
- checkRequired("individual", individual),
- checkRequired("prongs", prongs).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BeneficialOwner = apply {
- if (validated) {
- return@apply
- }
-
- id()
- companyTitle()
- individual().validate()
- prongs().forEach { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (id.asKnown().isPresent) 1 else 0) +
- (if (companyTitle.asKnown().isPresent) 1 else 0) +
- (individual.asKnown().getOrNull()?.validity() ?: 0) +
- (prongs.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
-
- /** Personal details for the beneficial owner. */
- class Individual
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val address: JsonField