diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4a8316f57..8b43e3288 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.390.0"
+ ".": "0.391.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 356c41695..a54aa529c 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 227
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4e978c9426fb846c81f3169f5c1bc7aad137577c13e52ac48fcc756e613a1557.yml
-openapi_spec_hash: b44f228e3feac325305cd744c072ebc9
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e32ea60c7028faaf552e2846c9a58f838b16922041d551664dcb1bfa343f38cf.yml
+openapi_spec_hash: 8d3acf560b411999fee65eedda9e6a73
config_hash: ca52ca9a2968f330339fd50c1a386e05
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 56e2e042d..5165ef5e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.391.0 (2026-01-06)
+
+Full Changelog: [v0.390.0...v0.391.0](https://github.com/Increase/increase-java/compare/v0.390.0...v0.391.0)
+
+### Features
+
+* **api:** api update ([072d558](https://github.com/Increase/increase-java/commit/072d558caf428a0bd34b622b4da6f612524cc7db))
+
## 0.390.0 (2026-01-05)
Full Changelog: [v0.389.0...v0.390.0](https://github.com/Increase/increase-java/compare/v0.389.0...v0.390.0)
diff --git a/README.md b/README.md
index 53dcf5433..54f7b3c11 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.390.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.390.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.391.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.391.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.390.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.391.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.390.0")
+implementation("com.increase.api:increase-java:0.391.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.390.0")
com.increase.api
increase-java
- 0.390.0
+ 0.391.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 31561f226..b6dd4495a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.390.0" // x-release-please-version
+ version = "0.391.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
index c3140e527..63172d64e 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/Entity.kt
@@ -43,6 +43,7 @@ private constructor(
private val status: JsonField,
private val structure: JsonField,
private val supplementalDocuments: JsonField>,
+ private val termsAgreements: JsonField>,
private val thirdPartyVerification: JsonField,
private val trust: JsonField,
private val type: JsonField,
@@ -84,6 +85,9 @@ private constructor(
@JsonProperty("supplemental_documents")
@ExcludeMissing
supplementalDocuments: JsonField> = JsonMissing.of(),
+ @JsonProperty("terms_agreements")
+ @ExcludeMissing
+ termsAgreements: JsonField> = JsonMissing.of(),
@JsonProperty("third_party_verification")
@ExcludeMissing
thirdPartyVerification: JsonField = JsonMissing.of(),
@@ -103,6 +107,7 @@ private constructor(
status,
structure,
supplementalDocuments,
+ termsAgreements,
thirdPartyVerification,
trust,
type,
@@ -224,6 +229,14 @@ private constructor(
fun supplementalDocuments(): List =
supplementalDocuments.getRequired("supplemental_documents")
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this data.
+ *
+ * @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 termsAgreements(): List = termsAgreements.getRequired("terms_agreements")
+
/**
* If you are using a third-party service for identity verification, you can use this field to
* associate this Entity with the identifier that represents them in that service.
@@ -361,6 +374,15 @@ private constructor(
fun _supplementalDocuments(): JsonField> =
supplementalDocuments
+ /**
+ * Returns the raw JSON value of [termsAgreements].
+ *
+ * Unlike [termsAgreements], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("terms_agreements")
+ @ExcludeMissing
+ fun _termsAgreements(): JsonField> = termsAgreements
+
/**
* Returns the raw JSON value of [thirdPartyVerification].
*
@@ -417,6 +439,7 @@ private constructor(
* .status()
* .structure()
* .supplementalDocuments()
+ * .termsAgreements()
* .thirdPartyVerification()
* .trust()
* .type()
@@ -442,6 +465,7 @@ private constructor(
private var structure: JsonField? = null
private var supplementalDocuments: JsonField>? =
null
+ private var termsAgreements: JsonField>? = null
private var thirdPartyVerification: JsonField? = null
private var trust: JsonField? = null
private var type: JsonField? = null
@@ -462,6 +486,7 @@ private constructor(
status = entity.status
structure = entity.structure
supplementalDocuments = entity.supplementalDocuments.map { it.toMutableList() }
+ termsAgreements = entity.termsAgreements.map { it.toMutableList() }
thirdPartyVerification = entity.thirdPartyVerification
trust = entity.trust
type = entity.type
@@ -708,6 +733,35 @@ private constructor(
}
}
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this data.
+ */
+ fun termsAgreements(termsAgreements: List) =
+ termsAgreements(JsonField.of(termsAgreements))
+
+ /**
+ * Sets [Builder.termsAgreements] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.termsAgreements] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun termsAgreements(termsAgreements: JsonField>) = apply {
+ this.termsAgreements = termsAgreements.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [TermsAgreement] to [termsAgreements].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTermsAgreement(termsAgreement: TermsAgreement) = apply {
+ termsAgreements =
+ (termsAgreements ?: JsonField.of(mutableListOf())).also {
+ checkKnown("termsAgreements", it).add(termsAgreement)
+ }
+ }
+
/**
* If you are using a third-party service for identity verification, you can use this field
* to associate this Entity with the identifier that represents them in that service.
@@ -800,6 +854,7 @@ private constructor(
* .status()
* .structure()
* .supplementalDocuments()
+ * .termsAgreements()
* .thirdPartyVerification()
* .trust()
* .type()
@@ -824,6 +879,7 @@ private constructor(
checkRequired("supplementalDocuments", supplementalDocuments).map {
it.toImmutable()
},
+ checkRequired("termsAgreements", termsAgreements).map { it.toImmutable() },
checkRequired("thirdPartyVerification", thirdPartyVerification),
checkRequired("trust", trust),
checkRequired("type", type),
@@ -851,6 +907,7 @@ private constructor(
status().validate()
structure().validate()
supplementalDocuments().forEach { it.validate() }
+ termsAgreements().forEach { it.validate() }
thirdPartyVerification().ifPresent { it.validate() }
trust().ifPresent { it.validate() }
type().validate()
@@ -885,6 +942,7 @@ private constructor(
(status.asKnown().getOrNull()?.validity() ?: 0) +
(structure.asKnown().getOrNull()?.validity() ?: 0) +
(supplementalDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (termsAgreements.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) +
(trust.asKnown().getOrNull()?.validity() ?: 0) +
(type.asKnown().getOrNull()?.validity() ?: 0)
@@ -7290,6 +7348,251 @@ private constructor(
override fun toString() = value.toString()
}
+ class TermsAgreement
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val agreedAt: JsonField,
+ private val ipAddress: JsonField,
+ private val termsUrl: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("agreed_at")
+ @ExcludeMissing
+ agreedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("ip_address")
+ @ExcludeMissing
+ ipAddress: JsonField = JsonMissing.of(),
+ @JsonProperty("terms_url")
+ @ExcludeMissing
+ termsUrl: JsonField = JsonMissing.of(),
+ ) : this(agreedAt, ipAddress, termsUrl, mutableMapOf())
+
+ /**
+ * The timestamp of when the Entity agreed to the terms.
+ *
+ * @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 agreedAt(): OffsetDateTime = agreedAt.getRequired("agreed_at")
+
+ /**
+ * The IP address the Entity accessed reviewed the terms from.
+ *
+ * @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 ipAddress(): String = ipAddress.getRequired("ip_address")
+
+ /**
+ * The URL of the terms agreement. This link will be provided by your bank partner.
+ *
+ * @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 termsUrl(): String = termsUrl.getRequired("terms_url")
+
+ /**
+ * Returns the raw JSON value of [agreedAt].
+ *
+ * Unlike [agreedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("agreed_at")
+ @ExcludeMissing
+ fun _agreedAt(): JsonField = agreedAt
+
+ /**
+ * Returns the raw JSON value of [ipAddress].
+ *
+ * Unlike [ipAddress], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("ip_address") @ExcludeMissing fun _ipAddress(): JsonField = ipAddress
+
+ /**
+ * Returns the raw JSON value of [termsUrl].
+ *
+ * Unlike [termsUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("terms_url") @ExcludeMissing fun _termsUrl(): JsonField = termsUrl
+
+ @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 [TermsAgreement].
+ *
+ * The following fields are required:
+ * ```java
+ * .agreedAt()
+ * .ipAddress()
+ * .termsUrl()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [TermsAgreement]. */
+ class Builder internal constructor() {
+
+ private var agreedAt: JsonField? = null
+ private var ipAddress: JsonField? = null
+ private var termsUrl: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(termsAgreement: TermsAgreement) = apply {
+ agreedAt = termsAgreement.agreedAt
+ ipAddress = termsAgreement.ipAddress
+ termsUrl = termsAgreement.termsUrl
+ additionalProperties = termsAgreement.additionalProperties.toMutableMap()
+ }
+
+ /** The timestamp of when the Entity agreed to the terms. */
+ fun agreedAt(agreedAt: OffsetDateTime) = agreedAt(JsonField.of(agreedAt))
+
+ /**
+ * Sets [Builder.agreedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.agreedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun agreedAt(agreedAt: JsonField) = apply { this.agreedAt = agreedAt }
+
+ /** The IP address the Entity accessed reviewed the terms from. */
+ fun ipAddress(ipAddress: String) = ipAddress(JsonField.of(ipAddress))
+
+ /**
+ * Sets [Builder.ipAddress] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.ipAddress] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun ipAddress(ipAddress: JsonField) = apply { this.ipAddress = ipAddress }
+
+ /** The URL of the terms agreement. This link will be provided by your bank partner. */
+ fun termsUrl(termsUrl: String) = termsUrl(JsonField.of(termsUrl))
+
+ /**
+ * Sets [Builder.termsUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.termsUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun termsUrl(termsUrl: JsonField) = apply { this.termsUrl = termsUrl }
+
+ 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 [TermsAgreement].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .agreedAt()
+ * .ipAddress()
+ * .termsUrl()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): TermsAgreement =
+ TermsAgreement(
+ checkRequired("agreedAt", agreedAt),
+ checkRequired("ipAddress", ipAddress),
+ checkRequired("termsUrl", termsUrl),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): TermsAgreement = apply {
+ if (validated) {
+ return@apply
+ }
+
+ agreedAt()
+ ipAddress()
+ termsUrl()
+ 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 (agreedAt.asKnown().isPresent) 1 else 0) +
+ (if (ipAddress.asKnown().isPresent) 1 else 0) +
+ (if (termsUrl.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is TermsAgreement &&
+ agreedAt == other.agreedAt &&
+ ipAddress == other.ipAddress &&
+ termsUrl == other.termsUrl &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(agreedAt, ipAddress, termsUrl, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "TermsAgreement{agreedAt=$agreedAt, ipAddress=$ipAddress, termsUrl=$termsUrl, additionalProperties=$additionalProperties}"
+ }
+
/**
* If you are using a third-party service for identity verification, you can use this field to
* associate this Entity with the identifier that represents them in that service.
@@ -11195,6 +11498,7 @@ private constructor(
status == other.status &&
structure == other.structure &&
supplementalDocuments == other.supplementalDocuments &&
+ termsAgreements == other.termsAgreements &&
thirdPartyVerification == other.thirdPartyVerification &&
trust == other.trust &&
type == other.type &&
@@ -11216,6 +11520,7 @@ private constructor(
status,
structure,
supplementalDocuments,
+ termsAgreements,
thirdPartyVerification,
trust,
type,
@@ -11226,5 +11531,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Entity{id=$id, corporation=$corporation, createdAt=$createdAt, description=$description, detailsConfirmedAt=$detailsConfirmedAt, governmentAuthority=$governmentAuthority, idempotencyKey=$idempotencyKey, joint=$joint, naturalPerson=$naturalPerson, riskRating=$riskRating, status=$status, structure=$structure, supplementalDocuments=$supplementalDocuments, thirdPartyVerification=$thirdPartyVerification, trust=$trust, type=$type, additionalProperties=$additionalProperties}"
+ "Entity{id=$id, corporation=$corporation, createdAt=$createdAt, description=$description, detailsConfirmedAt=$detailsConfirmedAt, governmentAuthority=$governmentAuthority, idempotencyKey=$idempotencyKey, joint=$joint, naturalPerson=$naturalPerson, riskRating=$riskRating, status=$status, structure=$structure, supplementalDocuments=$supplementalDocuments, termsAgreements=$termsAgreements, thirdPartyVerification=$thirdPartyVerification, trust=$trust, type=$type, additionalProperties=$additionalProperties}"
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt
index 4d7e14e5b..3530fb627 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt
@@ -102,6 +102,14 @@ private constructor(
*/
fun supplementalDocuments(): Optional> = body.supplementalDocuments()
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this data.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun termsAgreements(): Optional> = body.termsAgreements()
+
/**
* If you are using a third-party service for identity verification, you can use this field to
* associate this Entity with the identifier that represents them in that service.
@@ -178,6 +186,13 @@ private constructor(
fun _supplementalDocuments(): JsonField> =
body._supplementalDocuments()
+ /**
+ * Returns the raw JSON value of [termsAgreements].
+ *
+ * Unlike [termsAgreements], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _termsAgreements(): JsonField> = body._termsAgreements()
+
/**
* Returns the raw JSON value of [thirdPartyVerification].
*
@@ -378,6 +393,33 @@ private constructor(
body.addSupplementalDocument(supplementalDocument)
}
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this data.
+ */
+ fun termsAgreements(termsAgreements: List) = apply {
+ body.termsAgreements(termsAgreements)
+ }
+
+ /**
+ * Sets [Builder.termsAgreements] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.termsAgreements] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun termsAgreements(termsAgreements: JsonField>) = apply {
+ body.termsAgreements(termsAgreements)
+ }
+
+ /**
+ * Adds a single [TermsAgreement] to [termsAgreements].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTermsAgreement(termsAgreement: TermsAgreement) = apply {
+ body.addTermsAgreement(termsAgreement)
+ }
+
/**
* If you are using a third-party service for identity verification, you can use this field
* to associate this Entity with the identifier that represents them in that service.
@@ -563,6 +605,7 @@ private constructor(
private val naturalPerson: JsonField,
private val riskRating: JsonField,
private val supplementalDocuments: JsonField>,
+ private val termsAgreements: JsonField>,
private val thirdPartyVerification: JsonField,
private val trust: JsonField,
private val additionalProperties: MutableMap,
@@ -592,6 +635,9 @@ private constructor(
@JsonProperty("supplemental_documents")
@ExcludeMissing
supplementalDocuments: JsonField> = JsonMissing.of(),
+ @JsonProperty("terms_agreements")
+ @ExcludeMissing
+ termsAgreements: JsonField> = JsonMissing.of(),
@JsonProperty("third_party_verification")
@ExcludeMissing
thirdPartyVerification: JsonField = JsonMissing.of(),
@@ -605,6 +651,7 @@ private constructor(
naturalPerson,
riskRating,
supplementalDocuments,
+ termsAgreements,
thirdPartyVerification,
trust,
mutableMapOf(),
@@ -682,6 +729,15 @@ private constructor(
fun supplementalDocuments(): Optional> =
supplementalDocuments.getOptional("supplemental_documents")
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this data.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun termsAgreements(): Optional> =
+ termsAgreements.getOptional("terms_agreements")
+
/**
* If you are using a third-party service for identity verification, you can use this field
* to associate this Entity with the identifier that represents them in that service.
@@ -773,6 +829,16 @@ private constructor(
@ExcludeMissing
fun _supplementalDocuments(): JsonField> = supplementalDocuments
+ /**
+ * Returns the raw JSON value of [termsAgreements].
+ *
+ * Unlike [termsAgreements], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("terms_agreements")
+ @ExcludeMissing
+ fun _termsAgreements(): JsonField> = termsAgreements
+
/**
* Returns the raw JSON value of [thirdPartyVerification].
*
@@ -826,6 +892,7 @@ private constructor(
private var naturalPerson: JsonField = JsonMissing.of()
private var riskRating: JsonField = JsonMissing.of()
private var supplementalDocuments: JsonField>? = null
+ private var termsAgreements: JsonField>? = null
private var thirdPartyVerification: JsonField = JsonMissing.of()
private var trust: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -840,6 +907,7 @@ private constructor(
naturalPerson = body.naturalPerson
riskRating = body.riskRating
supplementalDocuments = body.supplementalDocuments.map { it.toMutableList() }
+ termsAgreements = body.termsAgreements.map { it.toMutableList() }
thirdPartyVerification = body.thirdPartyVerification
trust = body.trust
additionalProperties = body.additionalProperties.toMutableMap()
@@ -986,6 +1054,36 @@ private constructor(
}
}
+ /**
+ * The terms that the Entity agreed to. Not all programs are required to submit this
+ * data.
+ */
+ fun termsAgreements(termsAgreements: List) =
+ termsAgreements(JsonField.of(termsAgreements))
+
+ /**
+ * Sets [Builder.termsAgreements] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.termsAgreements] with a well-typed
+ * `List` value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun termsAgreements(termsAgreements: JsonField>) = apply {
+ this.termsAgreements = termsAgreements.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [TermsAgreement] to [termsAgreements].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addTermsAgreement(termsAgreement: TermsAgreement) = apply {
+ termsAgreements =
+ (termsAgreements ?: JsonField.of(mutableListOf())).also {
+ checkKnown("termsAgreements", it).add(termsAgreement)
+ }
+ }
+
/**
* If you are using a third-party service for identity verification, you can use this
* field to associate this Entity with the identifier that represents them in that
@@ -1061,6 +1159,7 @@ private constructor(
naturalPerson,
riskRating,
(supplementalDocuments ?: JsonMissing.of()).map { it.toImmutable() },
+ (termsAgreements ?: JsonMissing.of()).map { it.toImmutable() },
thirdPartyVerification,
trust,
additionalProperties.toMutableMap(),
@@ -1082,6 +1181,7 @@ private constructor(
naturalPerson().ifPresent { it.validate() }
riskRating().ifPresent { it.validate() }
supplementalDocuments().ifPresent { it.forEach { it.validate() } }
+ termsAgreements().ifPresent { it.forEach { it.validate() } }
thirdPartyVerification().ifPresent { it.validate() }
trust().ifPresent { it.validate() }
validated = true
@@ -1112,6 +1212,7 @@ private constructor(
(riskRating.asKnown().getOrNull()?.validity() ?: 0) +
(supplementalDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() }
?: 0) +
+ (termsAgreements.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) +
(trust.asKnown().getOrNull()?.validity() ?: 0)
@@ -1129,6 +1230,7 @@ private constructor(
naturalPerson == other.naturalPerson &&
riskRating == other.riskRating &&
supplementalDocuments == other.supplementalDocuments &&
+ termsAgreements == other.termsAgreements &&
thirdPartyVerification == other.thirdPartyVerification &&
trust == other.trust &&
additionalProperties == other.additionalProperties
@@ -1144,6 +1246,7 @@ private constructor(
naturalPerson,
riskRating,
supplementalDocuments,
+ termsAgreements,
thirdPartyVerification,
trust,
additionalProperties,
@@ -1153,7 +1256,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Body{structure=$structure, corporation=$corporation, description=$description, governmentAuthority=$governmentAuthority, joint=$joint, naturalPerson=$naturalPerson, riskRating=$riskRating, supplementalDocuments=$supplementalDocuments, thirdPartyVerification=$thirdPartyVerification, trust=$trust, additionalProperties=$additionalProperties}"
+ "Body{structure=$structure, corporation=$corporation, description=$description, governmentAuthority=$governmentAuthority, joint=$joint, naturalPerson=$naturalPerson, riskRating=$riskRating, supplementalDocuments=$supplementalDocuments, termsAgreements=$termsAgreements, thirdPartyVerification=$thirdPartyVerification, trust=$trust, additionalProperties=$additionalProperties}"
}
/** The type of Entity to create. */
@@ -11119,6 +11222,251 @@ private constructor(
"SupplementalDocument{fileId=$fileId, additionalProperties=$additionalProperties}"
}
+ class TermsAgreement
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val agreedAt: JsonField,
+ private val ipAddress: JsonField,
+ private val termsUrl: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("agreed_at")
+ @ExcludeMissing
+ agreedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("ip_address")
+ @ExcludeMissing
+ ipAddress: JsonField = JsonMissing.of(),
+ @JsonProperty("terms_url")
+ @ExcludeMissing
+ termsUrl: JsonField = JsonMissing.of(),
+ ) : this(agreedAt, ipAddress, termsUrl, mutableMapOf())
+
+ /**
+ * The timestamp of when the Entity agreed to the terms.
+ *
+ * @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 agreedAt(): OffsetDateTime = agreedAt.getRequired("agreed_at")
+
+ /**
+ * The IP address the Entity accessed reviewed the terms from.
+ *
+ * @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 ipAddress(): String = ipAddress.getRequired("ip_address")
+
+ /**
+ * The URL of the terms agreement. This link will be provided by your bank partner.
+ *
+ * @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 termsUrl(): String = termsUrl.getRequired("terms_url")
+
+ /**
+ * Returns the raw JSON value of [agreedAt].
+ *
+ * Unlike [agreedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("agreed_at")
+ @ExcludeMissing
+ fun _agreedAt(): JsonField = agreedAt
+
+ /**
+ * Returns the raw JSON value of [ipAddress].
+ *
+ * Unlike [ipAddress], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("ip_address") @ExcludeMissing fun _ipAddress(): JsonField = ipAddress
+
+ /**
+ * Returns the raw JSON value of [termsUrl].
+ *
+ * Unlike [termsUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("terms_url") @ExcludeMissing fun _termsUrl(): JsonField = termsUrl
+
+ @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 [TermsAgreement].
+ *
+ * The following fields are required:
+ * ```java
+ * .agreedAt()
+ * .ipAddress()
+ * .termsUrl()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [TermsAgreement]. */
+ class Builder internal constructor() {
+
+ private var agreedAt: JsonField? = null
+ private var ipAddress: JsonField? = null
+ private var termsUrl: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(termsAgreement: TermsAgreement) = apply {
+ agreedAt = termsAgreement.agreedAt
+ ipAddress = termsAgreement.ipAddress
+ termsUrl = termsAgreement.termsUrl
+ additionalProperties = termsAgreement.additionalProperties.toMutableMap()
+ }
+
+ /** The timestamp of when the Entity agreed to the terms. */
+ fun agreedAt(agreedAt: OffsetDateTime) = agreedAt(JsonField.of(agreedAt))
+
+ /**
+ * Sets [Builder.agreedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.agreedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun agreedAt(agreedAt: JsonField) = apply { this.agreedAt = agreedAt }
+
+ /** The IP address the Entity accessed reviewed the terms from. */
+ fun ipAddress(ipAddress: String) = ipAddress(JsonField.of(ipAddress))
+
+ /**
+ * Sets [Builder.ipAddress] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.ipAddress] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun ipAddress(ipAddress: JsonField) = apply { this.ipAddress = ipAddress }
+
+ /** The URL of the terms agreement. This link will be provided by your bank partner. */
+ fun termsUrl(termsUrl: String) = termsUrl(JsonField.of(termsUrl))
+
+ /**
+ * Sets [Builder.termsUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.termsUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun termsUrl(termsUrl: JsonField) = apply { this.termsUrl = termsUrl }
+
+ 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 [TermsAgreement].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .agreedAt()
+ * .ipAddress()
+ * .termsUrl()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): TermsAgreement =
+ TermsAgreement(
+ checkRequired("agreedAt", agreedAt),
+ checkRequired("ipAddress", ipAddress),
+ checkRequired("termsUrl", termsUrl),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): TermsAgreement = apply {
+ if (validated) {
+ return@apply
+ }
+
+ agreedAt()
+ ipAddress()
+ termsUrl()
+ 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 (agreedAt.asKnown().isPresent) 1 else 0) +
+ (if (ipAddress.asKnown().isPresent) 1 else 0) +
+ (if (termsUrl.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is TermsAgreement &&
+ agreedAt == other.agreedAt &&
+ ipAddress == other.ipAddress &&
+ termsUrl == other.termsUrl &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(agreedAt, ipAddress, termsUrl, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "TermsAgreement{agreedAt=$agreedAt, ipAddress=$ipAddress, termsUrl=$termsUrl, additionalProperties=$additionalProperties}"
+ }
+
/**
* If you are using a third-party service for identity verification, you can use this field to
* associate this Entity with the identifier that represents them in that service.
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityCreateParamsTest.kt
index 03e7abad1..4c7f6e1c1 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityCreateParamsTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityCreateParamsTest.kt
@@ -253,6 +253,13 @@ internal class EntityCreateParamsTest {
.fileId("file_makxrc67oh9l6sg7w9yc")
.build()
)
+ .addTermsAgreement(
+ EntityCreateParams.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
+ .ipAddress("x")
+ .termsUrl("x")
+ .build()
+ )
.thirdPartyVerification(
EntityCreateParams.ThirdPartyVerification.builder()
.reference("x")
@@ -658,6 +665,13 @@ internal class EntityCreateParamsTest {
.fileId("file_makxrc67oh9l6sg7w9yc")
.build()
)
+ .addTermsAgreement(
+ EntityCreateParams.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
+ .ipAddress("x")
+ .termsUrl("x")
+ .build()
+ )
.thirdPartyVerification(
EntityCreateParams.ThirdPartyVerification.builder()
.reference("x")
@@ -1059,6 +1073,14 @@ internal class EntityCreateParamsTest {
.fileId("file_makxrc67oh9l6sg7w9yc")
.build()
)
+ assertThat(body.termsAgreements().getOrNull())
+ .containsExactly(
+ EntityCreateParams.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
+ .ipAddress("x")
+ .termsUrl("x")
+ .build()
+ )
assertThat(body.thirdPartyVerification())
.contains(
EntityCreateParams.ThirdPartyVerification.builder()
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt
index 7cc18d379..6319eb4f0 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt
@@ -176,6 +176,13 @@ internal class EntityListPageResponseTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ .addTermsAgreement(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
.thirdPartyVerification(
Entity.ThirdPartyVerification.builder()
.reference("reference")
@@ -424,6 +431,13 @@ internal class EntityListPageResponseTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ .addTermsAgreement(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
.thirdPartyVerification(
Entity.ThirdPartyVerification.builder()
.reference("reference")
@@ -675,6 +689,13 @@ internal class EntityListPageResponseTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ .addTermsAgreement(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
.thirdPartyVerification(
Entity.ThirdPartyVerification.builder()
.reference("reference")
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityTest.kt
index de6db0860..4e9c1278b 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityTest.kt
@@ -172,6 +172,13 @@ internal class EntityTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ .addTermsAgreement(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
.thirdPartyVerification(
Entity.ThirdPartyVerification.builder()
.reference("reference")
@@ -413,6 +420,14 @@ internal class EntityTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ assertThat(entity.termsAgreements())
+ .containsExactly(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
assertThat(entity.thirdPartyVerification())
.contains(
Entity.ThirdPartyVerification.builder()
@@ -657,6 +672,13 @@ internal class EntityTest {
.type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT)
.build()
)
+ .addTermsAgreement(
+ Entity.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
+ .ipAddress("128.32.0.1")
+ .termsUrl("https://increase.com/example_terms")
+ .build()
+ )
.thirdPartyVerification(
Entity.ThirdPartyVerification.builder()
.reference("reference")
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt
index 8233df4a5..13828329f 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt
@@ -293,6 +293,13 @@ internal class EntityServiceAsyncTest {
.fileId("file_makxrc67oh9l6sg7w9yc")
.build()
)
+ .addTermsAgreement(
+ EntityCreateParams.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
+ .ipAddress("x")
+ .termsUrl("x")
+ .build()
+ )
.thirdPartyVerification(
EntityCreateParams.ThirdPartyVerification.builder()
.reference("x")
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt
index dea4fb86a..b20e0b1c7 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt
@@ -293,6 +293,13 @@ internal class EntityServiceTest {
.fileId("file_makxrc67oh9l6sg7w9yc")
.build()
)
+ .addTermsAgreement(
+ EntityCreateParams.TermsAgreement.builder()
+ .agreedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
+ .ipAddress("x")
+ .termsUrl("x")
+ .build()
+ )
.thirdPartyVerification(
EntityCreateParams.ThirdPartyVerification.builder()
.reference("x")