diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 78058d763..727bf2d62 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.386.0"
+ ".": "0.387.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index bc6173cca..4bf821dee 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 231
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2304a782c25d2a6b9586de2f6e2b536b5abbf62735f9c18ed0551607f134b714.yml
-openapi_spec_hash: 67d6de7181215abe88dcc3da557a1e0d
-config_hash: 5a0bf28bf735edf93f36c6c808711847
+configured_endpoints: 227
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-60f9bca532c8805735c227730bbb14858faa64bfd5f83a1a78640f0119a3f99c.yml
+openapi_spec_hash: 17ddd87efe6c029f2fa660c8781ccfaf
+config_hash: ca52ca9a2968f330339fd50c1a386e05
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d675761d..471f0830e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.387.0 (2025-12-18)
+
+Full Changelog: [v0.386.0...v0.387.0](https://github.com/Increase/increase-java/compare/v0.386.0...v0.387.0)
+
+### Features
+
+* **api:** api update ([010a893](https://github.com/Increase/increase-java/commit/010a89332ca59f6c123c8d1d95c86c470e0aa15b))
+
## 0.386.0 (2025-12-18)
Full Changelog: [v0.385.0...v0.386.0](https://github.com/Increase/increase-java/compare/v0.385.0...v0.386.0)
diff --git a/README.md b/README.md
index 0edb3dd46..340662753 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.386.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.386.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.387.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.387.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.386.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.387.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.386.0")
+implementation("com.increase.api:increase-java:0.387.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.386.0")
com.increase.api
increase-java
- 0.386.0
+ 0.387.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index f01f4d5c2..2aae0c2a7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.386.0" // x-release-please-version
+ version = "0.387.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 dc57ab706..e3f11a5cb 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
@@ -24,7 +24,6 @@ import com.increase.api.services.blocking.CheckTransferService
import com.increase.api.services.blocking.DeclinedTransactionService
import com.increase.api.services.blocking.DigitalCardProfileService
import com.increase.api.services.blocking.DigitalWalletTokenService
-import com.increase.api.services.blocking.DocumentService
import com.increase.api.services.blocking.EntityService
import com.increase.api.services.blocking.EventService
import com.increase.api.services.blocking.EventSubscriptionService
@@ -175,8 +174,6 @@ interface IncreaseClient {
fun fileLinks(): FileLinkService
- fun documents(): DocumentService
-
fun exports(): ExportService
fun events(): EventService
@@ -315,8 +312,6 @@ interface IncreaseClient {
fun fileLinks(): FileLinkService.WithRawResponse
- fun documents(): DocumentService.WithRawResponse
-
fun exports(): ExportService.WithRawResponse
fun events(): EventService.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 be4579776..5f2257a8f 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
@@ -24,7 +24,6 @@ import com.increase.api.services.async.CheckTransferServiceAsync
import com.increase.api.services.async.DeclinedTransactionServiceAsync
import com.increase.api.services.async.DigitalCardProfileServiceAsync
import com.increase.api.services.async.DigitalWalletTokenServiceAsync
-import com.increase.api.services.async.DocumentServiceAsync
import com.increase.api.services.async.EntityServiceAsync
import com.increase.api.services.async.EventServiceAsync
import com.increase.api.services.async.EventSubscriptionServiceAsync
@@ -175,8 +174,6 @@ interface IncreaseClientAsync {
fun fileLinks(): FileLinkServiceAsync
- fun documents(): DocumentServiceAsync
-
fun exports(): ExportServiceAsync
fun events(): EventServiceAsync
@@ -319,8 +316,6 @@ interface IncreaseClientAsync {
fun fileLinks(): FileLinkServiceAsync.WithRawResponse
- fun documents(): DocumentServiceAsync.WithRawResponse
-
fun exports(): ExportServiceAsync.WithRawResponse
fun events(): EventServiceAsync.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 ddb03d381..ffd99e1dd 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
@@ -46,8 +46,6 @@ import com.increase.api.services.async.DigitalCardProfileServiceAsync
import com.increase.api.services.async.DigitalCardProfileServiceAsyncImpl
import com.increase.api.services.async.DigitalWalletTokenServiceAsync
import com.increase.api.services.async.DigitalWalletTokenServiceAsyncImpl
-import com.increase.api.services.async.DocumentServiceAsync
-import com.increase.api.services.async.DocumentServiceAsyncImpl
import com.increase.api.services.async.EntityServiceAsync
import com.increase.api.services.async.EntityServiceAsyncImpl
import com.increase.api.services.async.EventServiceAsync
@@ -288,10 +286,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
FileLinkServiceAsyncImpl(clientOptionsWithUserAgent)
}
- private val documents: DocumentServiceAsync by lazy {
- DocumentServiceAsyncImpl(clientOptionsWithUserAgent)
- }
-
private val exports: ExportServiceAsync by lazy {
ExportServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -454,8 +448,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun fileLinks(): FileLinkServiceAsync = fileLinks
- override fun documents(): DocumentServiceAsync = documents
-
override fun exports(): ExportServiceAsync = exports
override fun events(): EventServiceAsync = events
@@ -658,10 +650,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
FileLinkServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
- private val documents: DocumentServiceAsync.WithRawResponse by lazy {
- DocumentServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
private val exports: ExportServiceAsync.WithRawResponse by lazy {
ExportServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -839,8 +827,6 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun fileLinks(): FileLinkServiceAsync.WithRawResponse = fileLinks
- override fun documents(): DocumentServiceAsync.WithRawResponse = documents
-
override fun exports(): ExportServiceAsync.WithRawResponse = exports
override fun events(): EventServiceAsync.WithRawResponse = events
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 021a9434d..411587c38 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
@@ -46,8 +46,6 @@ import com.increase.api.services.blocking.DigitalCardProfileService
import com.increase.api.services.blocking.DigitalCardProfileServiceImpl
import com.increase.api.services.blocking.DigitalWalletTokenService
import com.increase.api.services.blocking.DigitalWalletTokenServiceImpl
-import com.increase.api.services.blocking.DocumentService
-import com.increase.api.services.blocking.DocumentServiceImpl
import com.increase.api.services.blocking.EntityService
import com.increase.api.services.blocking.EntityServiceImpl
import com.increase.api.services.blocking.EventService
@@ -279,10 +277,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
FileLinkServiceImpl(clientOptionsWithUserAgent)
}
- private val documents: DocumentService by lazy {
- DocumentServiceImpl(clientOptionsWithUserAgent)
- }
-
private val exports: ExportService by lazy { ExportServiceImpl(clientOptionsWithUserAgent) }
private val events: EventService by lazy { EventServiceImpl(clientOptionsWithUserAgent) }
@@ -437,8 +431,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun fileLinks(): FileLinkService = fileLinks
- override fun documents(): DocumentService = documents
-
override fun exports(): ExportService = exports
override fun events(): EventService = events
@@ -638,10 +630,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
FileLinkServiceImpl.WithRawResponseImpl(clientOptions)
}
- private val documents: DocumentService.WithRawResponse by lazy {
- DocumentServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
private val exports: ExportService.WithRawResponse by lazy {
ExportServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -816,8 +804,6 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun fileLinks(): FileLinkService.WithRawResponse = fileLinks
- override fun documents(): DocumentService.WithRawResponse = documents
-
override fun exports(): ExportService.WithRawResponse = exports
override fun events(): EventService.WithRawResponse = events
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/Document.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/Document.kt
deleted file mode 100644
index f1b1df6d4..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/Document.kt
+++ /dev/null
@@ -1,1215 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.increase.api.core.Enum
-import com.increase.api.core.ExcludeMissing
-import com.increase.api.core.JsonField
-import com.increase.api.core.JsonMissing
-import com.increase.api.core.JsonValue
-import com.increase.api.core.checkRequired
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.time.OffsetDateTime
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/**
- * Increase generates certain documents / forms automatically for your application; they can be
- * listed here.
- */
-class Document
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val accountVerificationLetter: JsonField,
- private val category: JsonField,
- private val createdAt: JsonField,
- private val entityId: JsonField,
- private val fileId: JsonField,
- private val fundingInstructions: JsonField,
- private val idempotencyKey: JsonField,
- private val type: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("account_verification_letter")
- @ExcludeMissing
- accountVerificationLetter: JsonField = JsonMissing.of(),
- @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(),
- @JsonProperty("created_at")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("entity_id") @ExcludeMissing entityId: JsonField = JsonMissing.of(),
- @JsonProperty("file_id") @ExcludeMissing fileId: JsonField = JsonMissing.of(),
- @JsonProperty("funding_instructions")
- @ExcludeMissing
- fundingInstructions: JsonField = JsonMissing.of(),
- @JsonProperty("idempotency_key")
- @ExcludeMissing
- idempotencyKey: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- ) : this(
- id,
- accountVerificationLetter,
- category,
- createdAt,
- entityId,
- fileId,
- fundingInstructions,
- idempotencyKey,
- type,
- mutableMapOf(),
- )
-
- /**
- * The Document identifier.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * Properties of an account verification letter document.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun accountVerificationLetter(): Optional =
- accountVerificationLetter.getOptional("account_verification_letter")
-
- /**
- * The type of document.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun category(): Category = category.getRequired("category")
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Document was
- * created.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
-
- /**
- * The identifier of the Entity the document was generated for.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun entityId(): Optional = entityId.getOptional("entity_id")
-
- /**
- * The identifier of the File containing the Document's contents.
- *
- * @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 fileId(): String = fileId.getRequired("file_id")
-
- /**
- * Properties of a funding instructions document.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun fundingInstructions(): Optional =
- fundingInstructions.getOptional("funding_instructions")
-
- /**
- * The idempotency key you chose for this object. This value is unique across Increase and is
- * used to ensure that a request is only processed once. Learn more about
- * [idempotency](https://increase.com/documentation/idempotency-keys).
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key")
-
- /**
- * A constant representing the object's type. For this resource it will always be `document`.
- *
- * @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 [accountVerificationLetter].
- *
- * Unlike [accountVerificationLetter], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("account_verification_letter")
- @ExcludeMissing
- fun _accountVerificationLetter(): JsonField =
- accountVerificationLetter
-
- /**
- * Returns the raw JSON value of [category].
- *
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category
-
- /**
- * Returns the raw JSON value of [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 [entityId].
- *
- * Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("entity_id") @ExcludeMissing fun _entityId(): JsonField = entityId
-
- /**
- * Returns the raw JSON value of [fileId].
- *
- * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId
-
- /**
- * Returns the raw JSON value of [fundingInstructions].
- *
- * Unlike [fundingInstructions], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("funding_instructions")
- @ExcludeMissing
- fun _fundingInstructions(): JsonField = fundingInstructions
-
- /**
- * Returns the raw JSON value of [idempotencyKey].
- *
- * Unlike [idempotencyKey], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("idempotency_key")
- @ExcludeMissing
- fun _idempotencyKey(): JsonField = idempotencyKey
-
- /**
- * Returns the raw JSON value of [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 [Document].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .accountVerificationLetter()
- * .category()
- * .createdAt()
- * .entityId()
- * .fileId()
- * .fundingInstructions()
- * .idempotencyKey()
- * .type()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Document]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var accountVerificationLetter: JsonField? = null
- private var category: JsonField? = null
- private var createdAt: JsonField? = null
- private var entityId: JsonField? = null
- private var fileId: JsonField? = null
- private var fundingInstructions: JsonField? = null
- private var idempotencyKey: JsonField? = null
- private var type: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(document: Document) = apply {
- id = document.id
- accountVerificationLetter = document.accountVerificationLetter
- category = document.category
- createdAt = document.createdAt
- entityId = document.entityId
- fileId = document.fileId
- fundingInstructions = document.fundingInstructions
- idempotencyKey = document.idempotencyKey
- type = document.type
- additionalProperties = document.additionalProperties.toMutableMap()
- }
-
- /** The Document identifier. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- /** Properties of an account verification letter document. */
- fun accountVerificationLetter(accountVerificationLetter: AccountVerificationLetter?) =
- accountVerificationLetter(JsonField.ofNullable(accountVerificationLetter))
-
- /**
- * Alias for calling [Builder.accountVerificationLetter] with
- * `accountVerificationLetter.orElse(null)`.
- */
- fun accountVerificationLetter(
- accountVerificationLetter: Optional
- ) = accountVerificationLetter(accountVerificationLetter.getOrNull())
-
- /**
- * Sets [Builder.accountVerificationLetter] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountVerificationLetter] with a well-typed
- * [AccountVerificationLetter] value instead. This method is primarily for setting the field
- * to an undocumented or not yet supported value.
- */
- fun accountVerificationLetter(
- accountVerificationLetter: JsonField
- ) = apply { this.accountVerificationLetter = accountVerificationLetter }
-
- /** The type of document. */
- fun category(category: Category) = category(JsonField.of(category))
-
- /**
- * Sets [Builder.category] to an arbitrary JSON value.
- *
- * You should usually call [Builder.category] with a well-typed [Category] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun category(category: JsonField) = apply { this.category = category }
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Document was
- * created.
- */
- fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
-
- /**
- * Sets [Builder.createdAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
-
- /** The identifier of the Entity the document was generated for. */
- fun entityId(entityId: String?) = entityId(JsonField.ofNullable(entityId))
-
- /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */
- fun entityId(entityId: Optional) = entityId(entityId.getOrNull())
-
- /**
- * Sets [Builder.entityId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.entityId] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun entityId(entityId: JsonField) = apply { this.entityId = entityId }
-
- /** The identifier of the File containing the Document's contents. */
- fun fileId(fileId: String) = fileId(JsonField.of(fileId))
-
- /**
- * Sets [Builder.fileId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fileId] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun fileId(fileId: JsonField) = apply { this.fileId = fileId }
-
- /** Properties of a funding instructions document. */
- fun fundingInstructions(fundingInstructions: FundingInstructions?) =
- fundingInstructions(JsonField.ofNullable(fundingInstructions))
-
- /**
- * Alias for calling [Builder.fundingInstructions] with `fundingInstructions.orElse(null)`.
- */
- fun fundingInstructions(fundingInstructions: Optional) =
- fundingInstructions(fundingInstructions.getOrNull())
-
- /**
- * Sets [Builder.fundingInstructions] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fundingInstructions] with a well-typed
- * [FundingInstructions] value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun fundingInstructions(fundingInstructions: JsonField) = apply {
- this.fundingInstructions = fundingInstructions
- }
-
- /**
- * The idempotency key you chose for this object. This value is unique across Increase and
- * is used to ensure that a request is only processed once. Learn more about
- * [idempotency](https://increase.com/documentation/idempotency-keys).
- */
- fun idempotencyKey(idempotencyKey: String?) =
- idempotencyKey(JsonField.ofNullable(idempotencyKey))
-
- /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */
- fun idempotencyKey(idempotencyKey: Optional) =
- idempotencyKey(idempotencyKey.getOrNull())
-
- /**
- * Sets [Builder.idempotencyKey] to an arbitrary JSON value.
- *
- * You should usually call [Builder.idempotencyKey] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun idempotencyKey(idempotencyKey: JsonField) = apply {
- this.idempotencyKey = idempotencyKey
- }
-
- /**
- * A constant representing the object's type. For this resource it will always be
- * `document`.
- */
- 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 [Document].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .accountVerificationLetter()
- * .category()
- * .createdAt()
- * .entityId()
- * .fileId()
- * .fundingInstructions()
- * .idempotencyKey()
- * .type()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Document =
- Document(
- checkRequired("id", id),
- checkRequired("accountVerificationLetter", accountVerificationLetter),
- checkRequired("category", category),
- checkRequired("createdAt", createdAt),
- checkRequired("entityId", entityId),
- checkRequired("fileId", fileId),
- checkRequired("fundingInstructions", fundingInstructions),
- checkRequired("idempotencyKey", idempotencyKey),
- checkRequired("type", type),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Document = apply {
- if (validated) {
- return@apply
- }
-
- id()
- accountVerificationLetter().ifPresent { it.validate() }
- category().validate()
- createdAt()
- entityId()
- fileId()
- fundingInstructions().ifPresent { it.validate() }
- idempotencyKey()
- 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) +
- (accountVerificationLetter.asKnown().getOrNull()?.validity() ?: 0) +
- (category.asKnown().getOrNull()?.validity() ?: 0) +
- (if (createdAt.asKnown().isPresent) 1 else 0) +
- (if (entityId.asKnown().isPresent) 1 else 0) +
- (if (fileId.asKnown().isPresent) 1 else 0) +
- (fundingInstructions.asKnown().getOrNull()?.validity() ?: 0) +
- (if (idempotencyKey.asKnown().isPresent) 1 else 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0)
-
- /** Properties of an account verification letter document. */
- class AccountVerificationLetter
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val accountNumberId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("account_number_id")
- @ExcludeMissing
- accountNumberId: JsonField = JsonMissing.of()
- ) : this(accountNumberId, mutableMapOf())
-
- /**
- * The identifier of the Account Number the document was generated for.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun accountNumberId(): String = accountNumberId.getRequired("account_number_id")
-
- /**
- * Returns the raw JSON value of [accountNumberId].
- *
- * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("account_number_id")
- @ExcludeMissing
- fun _accountNumberId(): JsonField = accountNumberId
-
- @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
- * [AccountVerificationLetter].
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [AccountVerificationLetter]. */
- class Builder internal constructor() {
-
- private var accountNumberId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(accountVerificationLetter: AccountVerificationLetter) = apply {
- accountNumberId = accountVerificationLetter.accountNumberId
- additionalProperties = accountVerificationLetter.additionalProperties.toMutableMap()
- }
-
- /** The identifier of the Account Number the document was generated for. */
- fun accountNumberId(accountNumberId: String) =
- accountNumberId(JsonField.of(accountNumberId))
-
- /**
- * Sets [Builder.accountNumberId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountNumberId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun accountNumberId(accountNumberId: JsonField) = apply {
- this.accountNumberId = accountNumberId
- }
-
- 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 [AccountVerificationLetter].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): AccountVerificationLetter =
- AccountVerificationLetter(
- checkRequired("accountNumberId", accountNumberId),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): AccountVerificationLetter = apply {
- if (validated) {
- return@apply
- }
-
- accountNumberId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = (if (accountNumberId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is AccountVerificationLetter &&
- accountNumberId == other.accountNumberId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(accountNumberId, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "AccountVerificationLetter{accountNumberId=$accountNumberId, additionalProperties=$additionalProperties}"
- }
-
- /** The type of document. */
- class Category @JsonCreator private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is on an
- * older version than the API, then the API may respond with new members that the SDK is
- * unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** Internal Revenue Service Form 1099-INT. */
- @JvmField val FORM_1099_INT = of("form_1099_int")
-
- /** Internal Revenue Service Form 1099-MISC. */
- @JvmField val FORM_1099_MISC = of("form_1099_misc")
-
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- @JvmField val PROOF_OF_AUTHORIZATION = of("proof_of_authorization")
-
- /**
- * Company information, such a policies or procedures, typically submitted during our
- * due diligence process.
- */
- @JvmField val COMPANY_INFORMATION = of("company_information")
-
- /** An account verification letter. */
- @JvmField val ACCOUNT_VERIFICATION_LETTER = of("account_verification_letter")
-
- /** Funding instructions. */
- @JvmField val FUNDING_INSTRUCTIONS = of("funding_instructions")
-
- @JvmStatic fun of(value: String) = Category(JsonField.of(value))
- }
-
- /** An enum containing [Category]'s known values. */
- enum class Known {
- /** Internal Revenue Service Form 1099-INT. */
- FORM_1099_INT,
- /** Internal Revenue Service Form 1099-MISC. */
- FORM_1099_MISC,
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- PROOF_OF_AUTHORIZATION,
- /**
- * Company information, such a policies or procedures, typically submitted during our
- * due diligence process.
- */
- COMPANY_INFORMATION,
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- }
-
- /**
- * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [Category] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if the
- * SDK is on an older version than the API, then the API may respond with new members that
- * the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- /** Internal Revenue Service Form 1099-INT. */
- FORM_1099_INT,
- /** Internal Revenue Service Form 1099-MISC. */
- FORM_1099_MISC,
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- PROOF_OF_AUTHORIZATION,
- /**
- * Company information, such a policies or procedures, typically submitted during our
- * due diligence process.
- */
- COMPANY_INFORMATION,
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- /** An enum member indicating that [Category] was instantiated with an unknown value. */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
- * if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if you want
- * to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- FORM_1099_INT -> Value.FORM_1099_INT
- FORM_1099_MISC -> Value.FORM_1099_MISC
- PROOF_OF_AUTHORIZATION -> Value.PROOF_OF_AUTHORIZATION
- COMPANY_INFORMATION -> Value.COMPANY_INFORMATION
- ACCOUNT_VERIFICATION_LETTER -> Value.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Value.FUNDING_INSTRUCTIONS
- 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) {
- FORM_1099_INT -> Known.FORM_1099_INT
- FORM_1099_MISC -> Known.FORM_1099_MISC
- PROOF_OF_AUTHORIZATION -> Known.PROOF_OF_AUTHORIZATION
- COMPANY_INFORMATION -> Known.COMPANY_INFORMATION
- ACCOUNT_VERIFICATION_LETTER -> Known.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Known.FUNDING_INSTRUCTIONS
- else -> throw IncreaseInvalidDataException("Unknown Category: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for debugging
- * and generally doesn't throw.
- *
- * @throws IncreaseInvalidDataException if this class instance's value does not have the
- * expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Category = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Category && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /** Properties of a funding instructions document. */
- class FundingInstructions
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val accountNumberId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("account_number_id")
- @ExcludeMissing
- accountNumberId: JsonField = JsonMissing.of()
- ) : this(accountNumberId, mutableMapOf())
-
- /**
- * The identifier of the Account Number the document was generated for.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun accountNumberId(): String = accountNumberId.getRequired("account_number_id")
-
- /**
- * Returns the raw JSON value of [accountNumberId].
- *
- * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("account_number_id")
- @ExcludeMissing
- fun _accountNumberId(): JsonField = accountNumberId
-
- @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 [FundingInstructions].
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [FundingInstructions]. */
- class Builder internal constructor() {
-
- private var accountNumberId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(fundingInstructions: FundingInstructions) = apply {
- accountNumberId = fundingInstructions.accountNumberId
- additionalProperties = fundingInstructions.additionalProperties.toMutableMap()
- }
-
- /** The identifier of the Account Number the document was generated for. */
- fun accountNumberId(accountNumberId: String) =
- accountNumberId(JsonField.of(accountNumberId))
-
- /**
- * Sets [Builder.accountNumberId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountNumberId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun accountNumberId(accountNumberId: JsonField) = apply {
- this.accountNumberId = accountNumberId
- }
-
- 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 [FundingInstructions].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): FundingInstructions =
- FundingInstructions(
- checkRequired("accountNumberId", accountNumberId),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): FundingInstructions = apply {
- if (validated) {
- return@apply
- }
-
- accountNumberId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = (if (accountNumberId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is FundingInstructions &&
- accountNumberId == other.accountNumberId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(accountNumberId, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "FundingInstructions{accountNumberId=$accountNumberId, additionalProperties=$additionalProperties}"
- }
-
- /**
- * A constant representing the object's type. For this resource it will always be `document`.
- */
- 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 DOCUMENT = of("document")
-
- @JvmStatic fun of(value: String) = Type(JsonField.of(value))
- }
-
- /** An enum containing [Type]'s known values. */
- enum class Known {
- DOCUMENT
- }
-
- /**
- * 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 {
- DOCUMENT,
- /** 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) {
- DOCUMENT -> Value.DOCUMENT
- 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) {
- DOCUMENT -> Known.DOCUMENT
- 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 Document &&
- id == other.id &&
- accountVerificationLetter == other.accountVerificationLetter &&
- category == other.category &&
- createdAt == other.createdAt &&
- entityId == other.entityId &&
- fileId == other.fileId &&
- fundingInstructions == other.fundingInstructions &&
- idempotencyKey == other.idempotencyKey &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- accountVerificationLetter,
- category,
- createdAt,
- entityId,
- fileId,
- fundingInstructions,
- idempotencyKey,
- type,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Document{id=$id, accountVerificationLetter=$accountVerificationLetter, category=$category, createdAt=$createdAt, entityId=$entityId, fileId=$fileId, fundingInstructions=$fundingInstructions, idempotencyKey=$idempotencyKey, type=$type, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentCreateParams.kt
deleted file mode 100644
index fe31568fe..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentCreateParams.kt
+++ /dev/null
@@ -1,1123 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.increase.api.core.Enum
-import com.increase.api.core.ExcludeMissing
-import com.increase.api.core.JsonField
-import com.increase.api.core.JsonMissing
-import com.increase.api.core.JsonValue
-import com.increase.api.core.Params
-import com.increase.api.core.checkRequired
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.time.LocalDate
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** Create a Document */
-class DocumentCreateParams
-private constructor(
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /**
- * The type of document to create.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun category(): Category = body.category()
-
- /**
- * An account verification letter. Required if and only if `category` is
- * `account_verification_letter`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun accountVerificationLetter(): Optional =
- body.accountVerificationLetter()
-
- /**
- * Funding instructions. Required if and only if `category` is `funding_instructions`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun fundingInstructions(): Optional = body.fundingInstructions()
-
- /**
- * Returns the raw JSON value of [category].
- *
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _category(): JsonField = body._category()
-
- /**
- * Returns the raw JSON value of [accountVerificationLetter].
- *
- * Unlike [accountVerificationLetter], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- fun _accountVerificationLetter(): JsonField =
- body._accountVerificationLetter()
-
- /**
- * Returns the raw JSON value of [fundingInstructions].
- *
- * Unlike [fundingInstructions], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- fun _fundingInstructions(): JsonField = body._fundingInstructions()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [DocumentCreateParams].
- *
- * The following fields are required:
- * ```java
- * .category()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentCreateParams]. */
- class Builder internal constructor() {
-
- private var body: Body.Builder = Body.builder()
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(documentCreateParams: DocumentCreateParams) = apply {
- body = documentCreateParams.body.toBuilder()
- additionalHeaders = documentCreateParams.additionalHeaders.toBuilder()
- additionalQueryParams = documentCreateParams.additionalQueryParams.toBuilder()
- }
-
- /**
- * Sets the entire request body.
- *
- * This is generally only useful if you are already constructing the body separately.
- * Otherwise, it's more convenient to use the top-level setters instead:
- * - [category]
- * - [accountVerificationLetter]
- * - [fundingInstructions]
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /** The type of document to create. */
- fun category(category: Category) = apply { body.category(category) }
-
- /**
- * Sets [Builder.category] to an arbitrary JSON value.
- *
- * You should usually call [Builder.category] with a well-typed [Category] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun category(category: JsonField) = apply { body.category(category) }
-
- /**
- * An account verification letter. Required if and only if `category` is
- * `account_verification_letter`.
- */
- fun accountVerificationLetter(accountVerificationLetter: AccountVerificationLetter) =
- apply {
- body.accountVerificationLetter(accountVerificationLetter)
- }
-
- /**
- * Sets [Builder.accountVerificationLetter] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountVerificationLetter] with a well-typed
- * [AccountVerificationLetter] value instead. This method is primarily for setting the field
- * to an undocumented or not yet supported value.
- */
- fun accountVerificationLetter(
- accountVerificationLetter: JsonField
- ) = apply { body.accountVerificationLetter(accountVerificationLetter) }
-
- /** Funding instructions. Required if and only if `category` is `funding_instructions`. */
- fun fundingInstructions(fundingInstructions: FundingInstructions) = apply {
- body.fundingInstructions(fundingInstructions)
- }
-
- /**
- * Sets [Builder.fundingInstructions] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fundingInstructions] with a well-typed
- * [FundingInstructions] value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
- */
- fun fundingInstructions(fundingInstructions: JsonField) = apply {
- body.fundingInstructions(fundingInstructions)
- }
-
- fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
- body.additionalProperties(additionalBodyProperties)
- }
-
- fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
- body.putAdditionalProperty(key, value)
- }
-
- fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
- apply {
- body.putAllAdditionalProperties(additionalBodyProperties)
- }
-
- fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
-
- fun removeAllAdditionalBodyProperties(keys: Set) = apply {
- body.removeAllAdditionalProperties(keys)
- }
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.put(name, values)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun replaceAdditionalHeaders(name: String, value: String) = apply {
- additionalHeaders.replace(name, value)
- }
-
- fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.replace(name, values)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
-
- fun removeAllAdditionalHeaders(names: Set) = apply {
- additionalHeaders.removeAll(names)
- }
-
- fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun additionalQueryParams(additionalQueryParams: Map>) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun putAdditionalQueryParam(key: String, value: String) = apply {
- additionalQueryParams.put(key, value)
- }
-
- fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.put(key, values)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun replaceAdditionalQueryParams(key: String, value: String) = apply {
- additionalQueryParams.replace(key, value)
- }
-
- fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.replace(key, values)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
-
- fun removeAllAdditionalQueryParams(keys: Set) = apply {
- additionalQueryParams.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [DocumentCreateParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .category()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): DocumentCreateParams =
- DocumentCreateParams(
- body.build(),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- class Body
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val category: JsonField,
- private val accountVerificationLetter: JsonField,
- private val fundingInstructions: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("category")
- @ExcludeMissing
- category: JsonField = JsonMissing.of(),
- @JsonProperty("account_verification_letter")
- @ExcludeMissing
- accountVerificationLetter: JsonField = JsonMissing.of(),
- @JsonProperty("funding_instructions")
- @ExcludeMissing
- fundingInstructions: JsonField = JsonMissing.of(),
- ) : this(category, accountVerificationLetter, fundingInstructions, mutableMapOf())
-
- /**
- * The type of document to create.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun category(): Category = category.getRequired("category")
-
- /**
- * An account verification letter. Required if and only if `category` is
- * `account_verification_letter`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun accountVerificationLetter(): Optional =
- accountVerificationLetter.getOptional("account_verification_letter")
-
- /**
- * Funding instructions. Required if and only if `category` is `funding_instructions`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun fundingInstructions(): Optional =
- fundingInstructions.getOptional("funding_instructions")
-
- /**
- * Returns the raw JSON value of [category].
- *
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category
-
- /**
- * Returns the raw JSON value of [accountVerificationLetter].
- *
- * Unlike [accountVerificationLetter], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("account_verification_letter")
- @ExcludeMissing
- fun _accountVerificationLetter(): JsonField =
- accountVerificationLetter
-
- /**
- * Returns the raw JSON value of [fundingInstructions].
- *
- * Unlike [fundingInstructions], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("funding_instructions")
- @ExcludeMissing
- fun _fundingInstructions(): JsonField = fundingInstructions
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Body].
- *
- * The following fields are required:
- * ```java
- * .category()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var category: JsonField? = null
- private var accountVerificationLetter: JsonField =
- JsonMissing.of()
- private var fundingInstructions: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- category = body.category
- accountVerificationLetter = body.accountVerificationLetter
- fundingInstructions = body.fundingInstructions
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /** The type of document to create. */
- fun category(category: Category) = category(JsonField.of(category))
-
- /**
- * Sets [Builder.category] to an arbitrary JSON value.
- *
- * You should usually call [Builder.category] with a well-typed [Category] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun category(category: JsonField) = apply { this.category = category }
-
- /**
- * An account verification letter. Required if and only if `category` is
- * `account_verification_letter`.
- */
- fun accountVerificationLetter(accountVerificationLetter: AccountVerificationLetter) =
- accountVerificationLetter(JsonField.of(accountVerificationLetter))
-
- /**
- * Sets [Builder.accountVerificationLetter] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountVerificationLetter] with a well-typed
- * [AccountVerificationLetter] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun accountVerificationLetter(
- accountVerificationLetter: JsonField
- ) = apply { this.accountVerificationLetter = accountVerificationLetter }
-
- /**
- * Funding instructions. Required if and only if `category` is `funding_instructions`.
- */
- fun fundingInstructions(fundingInstructions: FundingInstructions) =
- fundingInstructions(JsonField.of(fundingInstructions))
-
- /**
- * Sets [Builder.fundingInstructions] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fundingInstructions] with a well-typed
- * [FundingInstructions] value instead. This method is primarily for setting the field
- * to an undocumented or not yet supported value.
- */
- fun fundingInstructions(fundingInstructions: JsonField) = apply {
- this.fundingInstructions = fundingInstructions
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .category()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(
- checkRequired("category", category),
- accountVerificationLetter,
- fundingInstructions,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- category().validate()
- accountVerificationLetter().ifPresent { it.validate() }
- fundingInstructions().ifPresent { it.validate() }
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (category.asKnown().getOrNull()?.validity() ?: 0) +
- (accountVerificationLetter.asKnown().getOrNull()?.validity() ?: 0) +
- (fundingInstructions.asKnown().getOrNull()?.validity() ?: 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- category == other.category &&
- accountVerificationLetter == other.accountVerificationLetter &&
- fundingInstructions == other.fundingInstructions &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- category,
- accountVerificationLetter,
- fundingInstructions,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Body{category=$category, accountVerificationLetter=$accountVerificationLetter, fundingInstructions=$fundingInstructions, additionalProperties=$additionalProperties}"
- }
-
- /** The type of document to create. */
- class Category @JsonCreator private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is on an
- * older version than the API, then the API may respond with new members that the SDK is
- * unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** An account verification letter. */
- @JvmField val ACCOUNT_VERIFICATION_LETTER = of("account_verification_letter")
-
- /** Funding instructions. */
- @JvmField val FUNDING_INSTRUCTIONS = of("funding_instructions")
-
- @JvmStatic fun of(value: String) = Category(JsonField.of(value))
- }
-
- /** An enum containing [Category]'s known values. */
- enum class Known {
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- }
-
- /**
- * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [Category] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if the
- * SDK is on an older version than the API, then the API may respond with new members that
- * the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- /** An enum member indicating that [Category] was instantiated with an unknown value. */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
- * if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if you want
- * to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- ACCOUNT_VERIFICATION_LETTER -> Value.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Value.FUNDING_INSTRUCTIONS
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always known and don't
- * want to throw for the unknown case.
- *
- * @throws IncreaseInvalidDataException if this class instance's value is a not a known
- * member.
- */
- fun known(): Known =
- when (this) {
- ACCOUNT_VERIFICATION_LETTER -> Known.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Known.FUNDING_INSTRUCTIONS
- else -> throw IncreaseInvalidDataException("Unknown Category: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for debugging
- * and generally doesn't throw.
- *
- * @throws IncreaseInvalidDataException if this class instance's value does not have the
- * expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Category = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Category && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /**
- * An account verification letter. Required if and only if `category` is
- * `account_verification_letter`.
- */
- class AccountVerificationLetter
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val accountNumberId: JsonField,
- private val balanceDate: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("account_number_id")
- @ExcludeMissing
- accountNumberId: JsonField = JsonMissing.of(),
- @JsonProperty("balance_date")
- @ExcludeMissing
- balanceDate: JsonField = JsonMissing.of(),
- ) : this(accountNumberId, balanceDate, mutableMapOf())
-
- /**
- * The Account Number the bank letter should be generated for.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun accountNumberId(): String = accountNumberId.getRequired("account_number_id")
-
- /**
- * If provided, the letter will include the Account's balance as of the date.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun balanceDate(): Optional = balanceDate.getOptional("balance_date")
-
- /**
- * Returns the raw JSON value of [accountNumberId].
- *
- * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("account_number_id")
- @ExcludeMissing
- fun _accountNumberId(): JsonField = accountNumberId
-
- /**
- * Returns the raw JSON value of [balanceDate].
- *
- * Unlike [balanceDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("balance_date")
- @ExcludeMissing
- fun _balanceDate(): JsonField = balanceDate
-
- @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
- * [AccountVerificationLetter].
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [AccountVerificationLetter]. */
- class Builder internal constructor() {
-
- private var accountNumberId: JsonField? = null
- private var balanceDate: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(accountVerificationLetter: AccountVerificationLetter) = apply {
- accountNumberId = accountVerificationLetter.accountNumberId
- balanceDate = accountVerificationLetter.balanceDate
- additionalProperties = accountVerificationLetter.additionalProperties.toMutableMap()
- }
-
- /** The Account Number the bank letter should be generated for. */
- fun accountNumberId(accountNumberId: String) =
- accountNumberId(JsonField.of(accountNumberId))
-
- /**
- * Sets [Builder.accountNumberId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountNumberId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun accountNumberId(accountNumberId: JsonField) = apply {
- this.accountNumberId = accountNumberId
- }
-
- /** If provided, the letter will include the Account's balance as of the date. */
- fun balanceDate(balanceDate: LocalDate) = balanceDate(JsonField.of(balanceDate))
-
- /**
- * Sets [Builder.balanceDate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.balanceDate] with a well-typed [LocalDate] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun balanceDate(balanceDate: JsonField) = apply {
- this.balanceDate = balanceDate
- }
-
- 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 [AccountVerificationLetter].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): AccountVerificationLetter =
- AccountVerificationLetter(
- checkRequired("accountNumberId", accountNumberId),
- balanceDate,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): AccountVerificationLetter = apply {
- if (validated) {
- return@apply
- }
-
- accountNumberId()
- balanceDate()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (accountNumberId.asKnown().isPresent) 1 else 0) +
- (if (balanceDate.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is AccountVerificationLetter &&
- accountNumberId == other.accountNumberId &&
- balanceDate == other.balanceDate &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(accountNumberId, balanceDate, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "AccountVerificationLetter{accountNumberId=$accountNumberId, balanceDate=$balanceDate, additionalProperties=$additionalProperties}"
- }
-
- /** Funding instructions. Required if and only if `category` is `funding_instructions`. */
- class FundingInstructions
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val accountNumberId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("account_number_id")
- @ExcludeMissing
- accountNumberId: JsonField = JsonMissing.of()
- ) : this(accountNumberId, mutableMapOf())
-
- /**
- * The Account Number the funding instructions should be generated for.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun accountNumberId(): String = accountNumberId.getRequired("account_number_id")
-
- /**
- * Returns the raw JSON value of [accountNumberId].
- *
- * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("account_number_id")
- @ExcludeMissing
- fun _accountNumberId(): JsonField = accountNumberId
-
- @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 [FundingInstructions].
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [FundingInstructions]. */
- class Builder internal constructor() {
-
- private var accountNumberId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(fundingInstructions: FundingInstructions) = apply {
- accountNumberId = fundingInstructions.accountNumberId
- additionalProperties = fundingInstructions.additionalProperties.toMutableMap()
- }
-
- /** The Account Number the funding instructions should be generated for. */
- fun accountNumberId(accountNumberId: String) =
- accountNumberId(JsonField.of(accountNumberId))
-
- /**
- * Sets [Builder.accountNumberId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountNumberId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun accountNumberId(accountNumberId: JsonField) = apply {
- this.accountNumberId = accountNumberId
- }
-
- 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 [FundingInstructions].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .accountNumberId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): FundingInstructions =
- FundingInstructions(
- checkRequired("accountNumberId", accountNumberId),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): FundingInstructions = apply {
- if (validated) {
- return@apply
- }
-
- accountNumberId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = (if (accountNumberId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is FundingInstructions &&
- accountNumberId == other.accountNumberId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(accountNumberId, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "FundingInstructions{accountNumberId=$accountNumberId, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is DocumentCreateParams &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "DocumentCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt
deleted file mode 100644
index 43fe262a0..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt
+++ /dev/null
@@ -1,132 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-import com.increase.api.core.AutoPager
-import com.increase.api.core.Page
-import com.increase.api.core.checkRequired
-import com.increase.api.services.blocking.DocumentService
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** @see DocumentService.list */
-class DocumentListPage
-private constructor(
- private val service: DocumentService,
- private val params: DocumentListParams,
- private val response: DocumentListPageResponse,
-) : Page {
-
- /**
- * Delegates to [DocumentListPageResponse], but gracefully handles missing data.
- *
- * @see DocumentListPageResponse.data
- */
- fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [DocumentListPageResponse], but gracefully handles missing data.
- *
- * @see DocumentListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): DocumentListParams {
- val nextCursor =
- nextCursor().getOrNull()
- ?: throw IllegalStateException("Cannot construct next page params")
- return params.toBuilder().cursor(nextCursor).build()
- }
-
- override fun nextPage(): DocumentListPage = service.list(nextPageParams())
-
- fun autoPager(): AutoPager = AutoPager.from(this)
-
- /** The parameters that were used to request this page. */
- fun params(): DocumentListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): DocumentListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [DocumentListPage].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentListPage]. */
- class Builder internal constructor() {
-
- private var service: DocumentService? = null
- private var params: DocumentListParams? = null
- private var response: DocumentListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(documentListPage: DocumentListPage) = apply {
- service = documentListPage.service
- params = documentListPage.params
- response = documentListPage.response
- }
-
- fun service(service: DocumentService) = apply { this.service = service }
-
- /** The parameters that were used to request this page. */
- fun params(params: DocumentListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: DocumentListPageResponse) = apply { this.response = response }
-
- /**
- * Returns an immutable instance of [DocumentListPage].
- *
- * 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(): DocumentListPage =
- DocumentListPage(
- checkRequired("service", service),
- checkRequired("params", params),
- checkRequired("response", response),
- )
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is DocumentListPage &&
- service == other.service &&
- params == other.params &&
- response == other.response
- }
-
- override fun hashCode(): Int = Objects.hash(service, params, response)
-
- override fun toString() =
- "DocumentListPage{service=$service, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt
deleted file mode 100644
index 1f25b5f54..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt
+++ /dev/null
@@ -1,146 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-import com.increase.api.core.AutoPagerAsync
-import com.increase.api.core.PageAsync
-import com.increase.api.core.checkRequired
-import com.increase.api.services.async.DocumentServiceAsync
-import java.util.Objects
-import java.util.Optional
-import java.util.concurrent.CompletableFuture
-import java.util.concurrent.Executor
-import kotlin.jvm.optionals.getOrNull
-
-/** @see DocumentServiceAsync.list */
-class DocumentListPageAsync
-private constructor(
- private val service: DocumentServiceAsync,
- private val streamHandlerExecutor: Executor,
- private val params: DocumentListParams,
- private val response: DocumentListPageResponse,
-) : PageAsync {
-
- /**
- * Delegates to [DocumentListPageResponse], but gracefully handles missing data.
- *
- * @see DocumentListPageResponse.data
- */
- fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [DocumentListPageResponse], but gracefully handles missing data.
- *
- * @see DocumentListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): DocumentListParams {
- 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(): DocumentListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): DocumentListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [DocumentListPageAsync].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .streamHandlerExecutor()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentListPageAsync]. */
- class Builder internal constructor() {
-
- private var service: DocumentServiceAsync? = null
- private var streamHandlerExecutor: Executor? = null
- private var params: DocumentListParams? = null
- private var response: DocumentListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(documentListPageAsync: DocumentListPageAsync) = apply {
- service = documentListPageAsync.service
- streamHandlerExecutor = documentListPageAsync.streamHandlerExecutor
- params = documentListPageAsync.params
- response = documentListPageAsync.response
- }
-
- fun service(service: DocumentServiceAsync) = apply { this.service = service }
-
- fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
- this.streamHandlerExecutor = streamHandlerExecutor
- }
-
- /** The parameters that were used to request this page. */
- fun params(params: DocumentListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: DocumentListPageResponse) = apply { this.response = response }
-
- /**
- * Returns an immutable instance of [DocumentListPageAsync].
- *
- * 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(): DocumentListPageAsync =
- DocumentListPageAsync(
- 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 DocumentListPageAsync &&
- 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() =
- "DocumentListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt
deleted file mode 100644
index 93f51e96a..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt
+++ /dev/null
@@ -1,237 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-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 Document objects. */
-class DocumentListPageResponse
-@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 [DocumentListPageResponse].
- *
- * The following fields are required:
- * ```java
- * .data()
- * .nextCursor()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentListPageResponse]. */
- class Builder internal constructor() {
-
- private var data: JsonField>? = null
- private var nextCursor: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(documentListPageResponse: DocumentListPageResponse) = apply {
- data = documentListPageResponse.data.map { it.toMutableList() }
- nextCursor = documentListPageResponse.nextCursor
- additionalProperties = documentListPageResponse.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 [Document] to [Builder.data].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addData(data: Document) = 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 [DocumentListPageResponse].
- *
- * 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(): DocumentListPageResponse =
- DocumentListPageResponse(
- checkRequired("data", data).map { it.toImmutable() },
- checkRequired("nextCursor", nextCursor),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): DocumentListPageResponse = 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 DocumentListPageResponse &&
- 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() =
- "DocumentListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListParams.kt
deleted file mode 100644
index aea25a3f3..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListParams.kt
+++ /dev/null
@@ -1,825 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.increase.api.core.Enum
-import com.increase.api.core.JsonField
-import com.increase.api.core.Params
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.core.toImmutable
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.time.OffsetDateTime
-import java.time.format.DateTimeFormatter
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** List Documents */
-class DocumentListParams
-private constructor(
- private val category: Category?,
- private val createdAt: CreatedAt?,
- private val cursor: String?,
- private val entityId: String?,
- private val idempotencyKey: String?,
- private val limit: Long?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- fun category(): Optional = Optional.ofNullable(category)
-
- fun createdAt(): Optional = Optional.ofNullable(createdAt)
-
- /** Return the page of entries after this one. */
- fun cursor(): Optional = Optional.ofNullable(cursor)
-
- /** Filter Documents to ones belonging to the specified Entity. */
- fun entityId(): Optional = Optional.ofNullable(entityId)
-
- /**
- * Filter records to the one with the specified `idempotency_key` you chose for that object.
- * This value is unique across Increase and is used to ensure that a request is only processed
- * once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
- */
- fun idempotencyKey(): Optional = Optional.ofNullable(idempotencyKey)
-
- /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */
- fun limit(): Optional = Optional.ofNullable(limit)
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun none(): DocumentListParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [DocumentListParams]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentListParams]. */
- class Builder internal constructor() {
-
- private var category: Category? = null
- private var createdAt: CreatedAt? = null
- private var cursor: String? = null
- private var entityId: 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(documentListParams: DocumentListParams) = apply {
- category = documentListParams.category
- createdAt = documentListParams.createdAt
- cursor = documentListParams.cursor
- entityId = documentListParams.entityId
- idempotencyKey = documentListParams.idempotencyKey
- limit = documentListParams.limit
- additionalHeaders = documentListParams.additionalHeaders.toBuilder()
- additionalQueryParams = documentListParams.additionalQueryParams.toBuilder()
- }
-
- fun category(category: Category?) = apply { this.category = category }
-
- /** Alias for calling [Builder.category] with `category.orElse(null)`. */
- fun category(category: Optional) = category(category.getOrNull())
-
- fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt }
-
- /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
- fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull())
-
- /** Return the page of entries after this one. */
- fun cursor(cursor: String?) = apply { this.cursor = cursor }
-
- /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */
- fun cursor(cursor: Optional) = cursor(cursor.getOrNull())
-
- /** Filter Documents to ones belonging to the specified Entity. */
- fun entityId(entityId: String?) = apply { this.entityId = entityId }
-
- /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */
- fun entityId(entityId: Optional) = entityId(entityId.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 [DocumentListParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): DocumentListParams =
- DocumentListParams(
- category,
- createdAt,
- cursor,
- entityId,
- idempotencyKey,
- limit,
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams =
- QueryParams.builder()
- .apply {
- category?.let {
- it.in_().ifPresent {
- put("category.in", it.joinToString(",") { it.toString() })
- }
- it._additionalProperties().keys().forEach { key ->
- it._additionalProperties().values(key).forEach { value ->
- put("category.$key", value)
- }
- }
- }
- createdAt?.let {
- it.after().ifPresent {
- put("created_at.after", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it))
- }
- it.before().ifPresent {
- put("created_at.before", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it))
- }
- it.onOrAfter().ifPresent {
- put(
- "created_at.on_or_after",
- DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it),
- )
- }
- it.onOrBefore().ifPresent {
- put(
- "created_at.on_or_before",
- DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it),
- )
- }
- it._additionalProperties().keys().forEach { key ->
- it._additionalProperties().values(key).forEach { value ->
- put("created_at.$key", value)
- }
- }
- }
- cursor?.let { put("cursor", it) }
- entityId?.let { put("entity_id", it) }
- idempotencyKey?.let { put("idempotency_key", it) }
- limit?.let { put("limit", it.toString()) }
- putAll(additionalQueryParams)
- }
- .build()
-
- class Category
- private constructor(private val in_: List?, private val additionalProperties: QueryParams) {
-
- /**
- * Filter Documents for those with the specified category or categories. For GET requests,
- * this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
- */
- fun in_(): Optional> = Optional.ofNullable(in_)
-
- /** Query params to send with the request. */
- fun _additionalProperties(): QueryParams = additionalProperties
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [Category]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Category]. */
- class Builder internal constructor() {
-
- private var in_: MutableList? = null
- private var additionalProperties: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(category: Category) = apply {
- in_ = category.in_?.toMutableList()
- additionalProperties = category.additionalProperties.toBuilder()
- }
-
- /**
- * Filter Documents for those with the specified category or categories. For GET
- * requests, this should be encoded as a comma-delimited string, such as
- * `?in=one,two,three`.
- */
- fun in_(in_: List?) = apply { this.in_ = in_?.toMutableList() }
-
- /** Alias for calling [Builder.in_] with `in_.orElse(null)`. */
- fun in_(in_: Optional>) = in_(in_.getOrNull())
-
- /**
- * Adds a single [In] to [Builder.in_].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addIn(in_: In) = apply {
- this.in_ = (this.in_ ?: mutableListOf()).apply { add(in_) }
- }
-
- fun additionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun additionalProperties(additionalProperties: Map>) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: String) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAdditionalProperties(key: String, values: Iterable) = apply {
- additionalProperties.put(key, values)
- }
-
- fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map>) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun replaceAdditionalProperties(key: String, value: String) = apply {
- additionalProperties.replace(key, value)
- }
-
- fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
- additionalProperties.replace(key, values)
- }
-
- fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.replaceAll(additionalProperties)
- }
-
- fun replaceAllAdditionalProperties(
- additionalProperties: Map>
- ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
-
- fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- additionalProperties.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [Category].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): Category = Category(in_?.toImmutable(), additionalProperties.build())
- }
-
- class In @JsonCreator private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is
- * on an older version than the API, then the API may respond with new members that the
- * SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** Internal Revenue Service Form 1099-INT. */
- @JvmField val FORM_1099_INT = of("form_1099_int")
-
- /** Internal Revenue Service Form 1099-MISC. */
- @JvmField val FORM_1099_MISC = of("form_1099_misc")
-
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- @JvmField val PROOF_OF_AUTHORIZATION = of("proof_of_authorization")
-
- /**
- * Company information, such a policies or procedures, typically submitted during
- * our due diligence process.
- */
- @JvmField val COMPANY_INFORMATION = of("company_information")
-
- /** An account verification letter. */
- @JvmField val ACCOUNT_VERIFICATION_LETTER = of("account_verification_letter")
-
- /** Funding instructions. */
- @JvmField val FUNDING_INSTRUCTIONS = of("funding_instructions")
-
- @JvmStatic fun of(value: String) = In(JsonField.of(value))
- }
-
- /** An enum containing [In]'s known values. */
- enum class Known {
- /** Internal Revenue Service Form 1099-INT. */
- FORM_1099_INT,
- /** Internal Revenue Service Form 1099-MISC. */
- FORM_1099_MISC,
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- PROOF_OF_AUTHORIZATION,
- /**
- * Company information, such a policies or procedures, typically submitted during
- * our due diligence process.
- */
- COMPANY_INFORMATION,
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- }
-
- /**
- * An enum containing [In]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [In] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if
- * the SDK is on an older version than the API, then the API may respond with new
- * members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- /** Internal Revenue Service Form 1099-INT. */
- FORM_1099_INT,
- /** Internal Revenue Service Form 1099-MISC. */
- FORM_1099_MISC,
- /**
- * A document submitted in response to a proof of authorization request for an ACH
- * transfer.
- */
- PROOF_OF_AUTHORIZATION,
- /**
- * Company information, such a policies or procedures, typically submitted during
- * our due diligence process.
- */
- COMPANY_INFORMATION,
- /** An account verification letter. */
- ACCOUNT_VERIFICATION_LETTER,
- /** Funding instructions. */
- FUNDING_INSTRUCTIONS,
- /** An enum member indicating that [In] was instantiated with an unknown value. */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if you
- * want to throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- FORM_1099_INT -> Value.FORM_1099_INT
- FORM_1099_MISC -> Value.FORM_1099_MISC
- PROOF_OF_AUTHORIZATION -> Value.PROOF_OF_AUTHORIZATION
- COMPANY_INFORMATION -> Value.COMPANY_INFORMATION
- ACCOUNT_VERIFICATION_LETTER -> Value.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Value.FUNDING_INSTRUCTIONS
- 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) {
- FORM_1099_INT -> Known.FORM_1099_INT
- FORM_1099_MISC -> Known.FORM_1099_MISC
- PROOF_OF_AUTHORIZATION -> Known.PROOF_OF_AUTHORIZATION
- COMPANY_INFORMATION -> Known.COMPANY_INFORMATION
- ACCOUNT_VERIFICATION_LETTER -> Known.ACCOUNT_VERIFICATION_LETTER
- FUNDING_INSTRUCTIONS -> Known.FUNDING_INSTRUCTIONS
- else -> throw IncreaseInvalidDataException("Unknown In: $value")
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for
- * debugging and generally doesn't throw.
- *
- * @throws IncreaseInvalidDataException if this class instance's value does not have the
- * expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): In = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is In && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Category &&
- in_ == other.in_ &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(in_, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() = "Category{in_=$in_, additionalProperties=$additionalProperties}"
- }
-
- class CreatedAt
- private constructor(
- private val after: OffsetDateTime?,
- private val before: OffsetDateTime?,
- private val onOrAfter: OffsetDateTime?,
- private val onOrBefore: OffsetDateTime?,
- private val additionalProperties: QueryParams,
- ) {
-
- /**
- * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
- */
- fun after(): Optional = Optional.ofNullable(after)
-
- /**
- * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
- */
- fun before(): Optional = Optional.ofNullable(before)
-
- /**
- * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun onOrAfter(): Optional = Optional.ofNullable(onOrAfter)
-
- /**
- * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun onOrBefore(): Optional = Optional.ofNullable(onOrBefore)
-
- /** Query params to send with the request. */
- fun _additionalProperties(): QueryParams = additionalProperties
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [CreatedAt]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CreatedAt]. */
- class Builder internal constructor() {
-
- private var after: OffsetDateTime? = null
- private var before: OffsetDateTime? = null
- private var onOrAfter: OffsetDateTime? = null
- private var onOrBefore: OffsetDateTime? = null
- private var additionalProperties: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(createdAt: CreatedAt) = apply {
- after = createdAt.after
- before = createdAt.before
- onOrAfter = createdAt.onOrAfter
- onOrBefore = createdAt.onOrBefore
- additionalProperties = createdAt.additionalProperties.toBuilder()
- }
-
- /**
- * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun after(after: OffsetDateTime?) = apply { this.after = after }
-
- /** Alias for calling [Builder.after] with `after.orElse(null)`. */
- fun after(after: Optional) = after(after.getOrNull())
-
- /**
- * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun before(before: OffsetDateTime?) = apply { this.before = before }
-
- /** Alias for calling [Builder.before] with `before.orElse(null)`. */
- fun before(before: Optional) = before(before.getOrNull())
-
- /**
- * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun onOrAfter(onOrAfter: OffsetDateTime?) = apply { this.onOrAfter = onOrAfter }
-
- /** Alias for calling [Builder.onOrAfter] with `onOrAfter.orElse(null)`. */
- fun onOrAfter(onOrAfter: Optional) = onOrAfter(onOrAfter.getOrNull())
-
- /**
- * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
- * timestamp.
- */
- fun onOrBefore(onOrBefore: OffsetDateTime?) = apply { this.onOrBefore = onOrBefore }
-
- /** Alias for calling [Builder.onOrBefore] with `onOrBefore.orElse(null)`. */
- fun onOrBefore(onOrBefore: Optional) =
- onOrBefore(onOrBefore.getOrNull())
-
- fun additionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun additionalProperties(additionalProperties: Map>) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: String) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAdditionalProperties(key: String, values: Iterable) = apply {
- additionalProperties.put(key, values)
- }
-
- fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map>) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun replaceAdditionalProperties(key: String, value: String) = apply {
- additionalProperties.replace(key, value)
- }
-
- fun replaceAdditionalProperties(key: String, values: Iterable) = apply {
- additionalProperties.replace(key, values)
- }
-
- fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply {
- this.additionalProperties.replaceAll(additionalProperties)
- }
-
- fun replaceAllAdditionalProperties(
- additionalProperties: Map>
- ) = apply { this.additionalProperties.replaceAll(additionalProperties) }
-
- fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- additionalProperties.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [CreatedAt].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): CreatedAt =
- CreatedAt(after, before, onOrAfter, onOrBefore, additionalProperties.build())
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CreatedAt &&
- after == other.after &&
- before == other.before &&
- onOrAfter == other.onOrAfter &&
- onOrBefore == other.onOrBefore &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(after, before, onOrAfter, onOrBefore, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "CreatedAt{after=$after, before=$before, onOrAfter=$onOrAfter, onOrBefore=$onOrBefore, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is DocumentListParams &&
- category == other.category &&
- createdAt == other.createdAt &&
- cursor == other.cursor &&
- entityId == other.entityId &&
- idempotencyKey == other.idempotencyKey &&
- limit == other.limit &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int =
- Objects.hash(
- category,
- createdAt,
- cursor,
- entityId,
- idempotencyKey,
- limit,
- additionalHeaders,
- additionalQueryParams,
- )
-
- override fun toString() =
- "DocumentListParams{category=$category, createdAt=$createdAt, cursor=$cursor, entityId=$entityId, idempotencyKey=$idempotencyKey, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentRetrieveParams.kt
deleted file mode 100644
index 95f168ce4..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentRetrieveParams.kt
+++ /dev/null
@@ -1,196 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.documents
-
-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 Document */
-class DocumentRetrieveParams
-private constructor(
- private val documentId: String?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /** The identifier of the Document to retrieve. */
- fun documentId(): Optional = Optional.ofNullable(documentId)
-
- /** 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(): DocumentRetrieveParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [DocumentRetrieveParams]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [DocumentRetrieveParams]. */
- class Builder internal constructor() {
-
- private var documentId: String? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(documentRetrieveParams: DocumentRetrieveParams) = apply {
- documentId = documentRetrieveParams.documentId
- additionalHeaders = documentRetrieveParams.additionalHeaders.toBuilder()
- additionalQueryParams = documentRetrieveParams.additionalQueryParams.toBuilder()
- }
-
- /** The identifier of the Document to retrieve. */
- fun documentId(documentId: String?) = apply { this.documentId = documentId }
-
- /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */
- fun documentId(documentId: Optional) = documentId(documentId.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