diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d05d9de1b..ce10d673b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.462.0" + ".": "0.463.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 61c2836eb..ec36c3af0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-010fcebf036b735c59221760be7726699913ed68102323b49939ddd880a12e32.yml -openapi_spec_hash: 92d7bc1bf2f3034735206e358249ba5c -config_hash: dda988c5565c2f15cc708122984d7691 +configured_endpoints: 237 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-defae23482710e9c09a4a09f19b5de303c58f4b3ffd937c6dfafacb4124f4378.yml +openapi_spec_hash: f1404bbd3ac5cbd9cfb952f3c65bb406 +config_hash: 896b006f9647a513eda3b228cf17c199 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cf2f294f..c9577ec2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.463.0 (2026-03-11) + +Full Changelog: [v0.462.0...v0.463.0](https://github.com/Increase/increase-java/compare/v0.462.0...v0.463.0) + +### Features + +* **api:** api update ([21c7f56](https://github.com/Increase/increase-java/commit/21c7f564dd2cce9144fcf6ae1b16594e046aff6a)) + ## 0.462.0 (2026-03-11) Full Changelog: [v0.461.0...v0.462.0](https://github.com/Increase/increase-java/compare/v0.461.0...v0.462.0) diff --git a/README.md b/README.md index b9d04761f..6776a505b 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.462.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.462.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.462.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.463.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.463.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.463.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.462.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.463.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.462.0") +implementation("com.increase.api:increase-java:0.463.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.462.0") com.increase.api increase-java - 0.462.0 + 0.463.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index c15bccf1e..82eb258a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.462.0" // x-release-please-version + version = "0.463.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParams.kt new file mode 100644 index 000000000..b1aa8687f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParams.kt @@ -0,0 +1,778 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.beneficialowners + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.checkRequired +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Update a Beneficial Owner */ +class BeneficialOwnerUpdateParams +private constructor( + private val entityBeneficialOwnerId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the Beneficial Owner to update. */ + fun entityBeneficialOwnerId(): Optional = Optional.ofNullable(entityBeneficialOwnerId) + + /** + * The individual's physical address. Mail receiving locations like PO Boxes and PMB's are + * disallowed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun address(): Optional
= body.address() + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _address(): JsonField
= body._address() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): BeneficialOwnerUpdateParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [BeneficialOwnerUpdateParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BeneficialOwnerUpdateParams]. */ + class Builder internal constructor() { + + private var entityBeneficialOwnerId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(beneficialOwnerUpdateParams: BeneficialOwnerUpdateParams) = apply { + entityBeneficialOwnerId = beneficialOwnerUpdateParams.entityBeneficialOwnerId + body = beneficialOwnerUpdateParams.body.toBuilder() + additionalHeaders = beneficialOwnerUpdateParams.additionalHeaders.toBuilder() + additionalQueryParams = beneficialOwnerUpdateParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the Beneficial Owner to update. */ + fun entityBeneficialOwnerId(entityBeneficialOwnerId: String?) = apply { + this.entityBeneficialOwnerId = entityBeneficialOwnerId + } + + /** + * Alias for calling [Builder.entityBeneficialOwnerId] with + * `entityBeneficialOwnerId.orElse(null)`. + */ + fun entityBeneficialOwnerId(entityBeneficialOwnerId: Optional) = + entityBeneficialOwnerId(entityBeneficialOwnerId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [address] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * The individual's physical address. Mail receiving locations like PO Boxes and PMB's are + * disallowed. + */ + fun address(address: Address) = apply { body.address(address) } + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun address(address: JsonField
) = apply { body.address(address) } + + 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 [BeneficialOwnerUpdateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): BeneficialOwnerUpdateParams = + BeneficialOwnerUpdateParams( + entityBeneficialOwnerId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> entityBeneficialOwnerId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val address: JsonField
, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of() + ) : this(address, mutableMapOf()) + + /** + * The individual's physical address. Mail receiving locations like PO Boxes and PMB's are + * disallowed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun address(): Optional
= address.getOptional("address") + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var address: JsonField
= JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + address = body.address + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * The individual's physical address. Mail receiving locations like PO Boxes and PMB's + * are disallowed. + */ + fun address(address: Address) = address(JsonField.of(address)) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = Body(address, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + address().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 = (address.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + address == other.address && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(address, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{address=$address, additionalProperties=$additionalProperties}" + } + + /** + * The individual's physical address. Mail receiving locations like PO Boxes and PMB's are + * disallowed. + */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val country: JsonField, + private val line1: JsonField, + private val line2: JsonField, + private val state: JsonField, + private val zip: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("country") @ExcludeMissing country: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") @ExcludeMissing line2: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("zip") @ExcludeMissing zip: JsonField = JsonMissing.of(), + ) : this(city, country, line1, line2, state, zip, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun city(): String = city.getRequired("city") + + /** + * The two-letter ISO 3166-1 alpha-2 code for the country of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun country(): String = country.getRequired("country") + + /** + * The first line of the address. This is usually the street number and street. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun line1(): String = line1.getRequired("line1") + + /** + * The second line of the address. This might be the floor or room number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") + + /** + * The two-letter United States Postal Service (USPS) abbreviation for the US state, + * province, or region of the address. Required in certain countries. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun state(): Optional = state.getOptional("state") + + /** + * The ZIP or postal code of the address. Required in certain countries. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun zip(): Optional = zip.getOptional("zip") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [country]. + * + * Unlike [country], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("country") @ExcludeMissing fun _country(): JsonField = country + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [state]. + * + * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state + + /** + * Returns the raw JSON value of [zip]. + * + * Unlike [zip], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("zip") @ExcludeMissing fun _zip(): JsonField = zip + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Address]. + * + * The following fields are required: + * ```java + * .city() + * .country() + * .line1() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var country: JsonField? = null + private var line1: JsonField? = null + private var line2: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var zip: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + city = address.city + country = address.country + line1 = address.line1 + line2 = address.line2 + state = address.state + zip = address.zip + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String) = city(JsonField.of(city)) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The two-letter ISO 3166-1 alpha-2 code for the country of the address. */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * Sets [Builder.country] to an arbitrary JSON value. + * + * You should usually call [Builder.country] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun country(country: JsonField) = apply { this.country = country } + + /** The first line of the address. This is usually the street number and street. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The second line of the address. This might be the floor or room number. */ + fun line2(line2: String) = line2(JsonField.of(line2)) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** + * The two-letter United States Postal Service (USPS) abbreviation for the US state, + * province, or region of the address. Required in certain countries. + */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The ZIP or postal code of the address. Required in certain countries. */ + fun zip(zip: String) = zip(JsonField.of(zip)) + + /** + * Sets [Builder.zip] to an arbitrary JSON value. + * + * You should usually call [Builder.zip] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun zip(zip: JsonField) = apply { this.zip = zip } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .country() + * .line1() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Address = + Address( + checkRequired("city", city), + checkRequired("country", country), + checkRequired("line1", line1), + line2, + state, + zip, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + city() + country() + line1() + line2() + state() + zip() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (city.asKnown().isPresent) 1 else 0) + + (if (country.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (zip.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Address && + city == other.city && + country == other.country && + line1 == other.line1 && + line2 == other.line2 && + state == other.state && + zip == other.zip && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, country, line1, line2, state, zip, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{city=$city, country=$country, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BeneficialOwnerUpdateParams && + entityBeneficialOwnerId == other.entityBeneficialOwnerId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(entityBeneficialOwnerId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "BeneficialOwnerUpdateParams{entityBeneficialOwnerId=$entityBeneficialOwnerId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsync.kt index 9624e44a3..5f0e4e71e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsync.kt @@ -8,6 +8,7 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.beneficialowners.BeneficialOwnerListPageAsync import com.increase.api.models.beneficialowners.BeneficialOwnerListParams import com.increase.api.models.beneficialowners.BeneficialOwnerRetrieveParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import com.increase.api.models.beneficialowners.EntityBeneficialOwner import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -65,6 +66,45 @@ interface BeneficialOwnerServiceAsync { ): CompletableFuture = retrieve(entityBeneficialOwnerId, BeneficialOwnerRetrieveParams.none(), requestOptions) + /** Update a Beneficial Owner */ + fun update(entityBeneficialOwnerId: String): CompletableFuture = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update( + params.toBuilder().entityBeneficialOwnerId(entityBeneficialOwnerId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + ): CompletableFuture = + update(entityBeneficialOwnerId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update(params: BeneficialOwnerUpdateParams): CompletableFuture = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none(), requestOptions) + /** List Beneficial Owners */ fun list(params: BeneficialOwnerListParams): CompletableFuture = list(params, RequestOptions.none()) @@ -137,6 +177,53 @@ interface BeneficialOwnerServiceAsync { ): CompletableFuture> = retrieve(entityBeneficialOwnerId, BeneficialOwnerRetrieveParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `patch + * /entity_beneficial_owners/{entity_beneficial_owner_id}`, but is otherwise the same as + * [BeneficialOwnerServiceAsync.update]. + */ + fun update( + entityBeneficialOwnerId: String + ): CompletableFuture> = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update( + params.toBuilder().entityBeneficialOwnerId(entityBeneficialOwnerId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + ): CompletableFuture> = + update(entityBeneficialOwnerId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: BeneficialOwnerUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /entity_beneficial_owners`, but is otherwise the * same as [BeneficialOwnerServiceAsync.list]. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncImpl.kt index 8b79fc7fb..d5b9997fc 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncImpl.kt @@ -13,12 +13,14 @@ import com.increase.api.core.http.HttpRequest import com.increase.api.core.http.HttpResponse import com.increase.api.core.http.HttpResponse.Handler import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.beneficialowners.BeneficialOwnerListPageAsync import com.increase.api.models.beneficialowners.BeneficialOwnerListPageResponse import com.increase.api.models.beneficialowners.BeneficialOwnerListParams import com.increase.api.models.beneficialowners.BeneficialOwnerRetrieveParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import com.increase.api.models.beneficialowners.EntityBeneficialOwner import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -45,6 +47,13 @@ internal constructor(private val clientOptions: ClientOptions) : BeneficialOwner // get /entity_beneficial_owners/{entity_beneficial_owner_id} withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + override fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // patch /entity_beneficial_owners/{entity_beneficial_owner_id} + withRawResponse().update(params, requestOptions).thenApply { it.parse() } + override fun list( params: BeneficialOwnerListParams, requestOptions: RequestOptions, @@ -98,6 +107,40 @@ internal constructor(private val clientOptions: ClientOptions) : BeneficialOwner } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("entityBeneficialOwnerId", params.entityBeneficialOwnerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("entity_beneficial_owners", params._pathParam(0)) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerService.kt index 4be5fa304..9e904b15c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerService.kt @@ -9,6 +9,7 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.beneficialowners.BeneficialOwnerListPage import com.increase.api.models.beneficialowners.BeneficialOwnerListParams import com.increase.api.models.beneficialowners.BeneficialOwnerRetrieveParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import com.increase.api.models.beneficialowners.EntityBeneficialOwner import java.util.function.Consumer @@ -64,6 +65,44 @@ interface BeneficialOwnerService { ): EntityBeneficialOwner = retrieve(entityBeneficialOwnerId, BeneficialOwnerRetrieveParams.none(), requestOptions) + /** Update a Beneficial Owner */ + fun update(entityBeneficialOwnerId: String): EntityBeneficialOwner = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): EntityBeneficialOwner = + update( + params.toBuilder().entityBeneficialOwnerId(entityBeneficialOwnerId).build(), + requestOptions, + ) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + ): EntityBeneficialOwner = update(entityBeneficialOwnerId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): EntityBeneficialOwner + + /** @see update */ + fun update(params: BeneficialOwnerUpdateParams): EntityBeneficialOwner = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + entityBeneficialOwnerId: String, + requestOptions: RequestOptions, + ): EntityBeneficialOwner = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none(), requestOptions) + /** List Beneficial Owners */ fun list(params: BeneficialOwnerListParams): BeneficialOwnerListPage = list(params, RequestOptions.none()) @@ -139,6 +178,55 @@ interface BeneficialOwnerService { ): HttpResponseFor = retrieve(entityBeneficialOwnerId, BeneficialOwnerRetrieveParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `patch + * /entity_beneficial_owners/{entity_beneficial_owner_id}`, but is otherwise the same as + * [BeneficialOwnerService.update]. + */ + @MustBeClosed + fun update(entityBeneficialOwnerId: String): HttpResponseFor = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none()) + + /** @see update */ + @MustBeClosed + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update( + params.toBuilder().entityBeneficialOwnerId(entityBeneficialOwnerId).build(), + requestOptions, + ) + + /** @see update */ + @MustBeClosed + fun update( + entityBeneficialOwnerId: String, + params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.none(), + ): HttpResponseFor = + update(entityBeneficialOwnerId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update(params: BeneficialOwnerUpdateParams): HttpResponseFor = + update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + entityBeneficialOwnerId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update(entityBeneficialOwnerId, BeneficialOwnerUpdateParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /entity_beneficial_owners`, but is otherwise the * same as [BeneficialOwnerService.list]. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceImpl.kt index 2ee3d2971..5b9c4bc64 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceImpl.kt @@ -13,12 +13,14 @@ import com.increase.api.core.http.HttpRequest import com.increase.api.core.http.HttpResponse import com.increase.api.core.http.HttpResponse.Handler import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.beneficialowners.BeneficialOwnerListPage import com.increase.api.models.beneficialowners.BeneficialOwnerListPageResponse import com.increase.api.models.beneficialowners.BeneficialOwnerListParams import com.increase.api.models.beneficialowners.BeneficialOwnerRetrieveParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import com.increase.api.models.beneficialowners.EntityBeneficialOwner import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -42,6 +44,13 @@ class BeneficialOwnerServiceImpl internal constructor(private val clientOptions: // get /entity_beneficial_owners/{entity_beneficial_owner_id} withRawResponse().retrieve(params, requestOptions).parse() + override fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions, + ): EntityBeneficialOwner = + // patch /entity_beneficial_owners/{entity_beneficial_owner_id} + withRawResponse().update(params, requestOptions).parse() + override fun list( params: BeneficialOwnerListParams, requestOptions: RequestOptions, @@ -92,6 +101,37 @@ class BeneficialOwnerServiceImpl internal constructor(private val clientOptions: } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: BeneficialOwnerUpdateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("entityBeneficialOwnerId", params.entityBeneficialOwnerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("entity_beneficial_owners", params._pathParam(0)) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParamsTest.kt new file mode 100644 index 000000000..55a22e6b2 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/beneficialowners/BeneficialOwnerUpdateParamsTest.kt @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.beneficialowners + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class BeneficialOwnerUpdateParamsTest { + + @Test + fun create() { + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .address( + BeneficialOwnerUpdateParams.Address.builder() + .city("New York") + .country("US") + .line1("33 Liberty Street") + .line2("Unit 2") + .state("NY") + .zip("10045") + .build() + ) + .build() + } + + @Test + fun pathParams() { + val params = + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .build() + + assertThat(params._pathParam(0)) + .isEqualTo("entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .address( + BeneficialOwnerUpdateParams.Address.builder() + .city("New York") + .country("US") + .line1("33 Liberty Street") + .line2("Unit 2") + .state("NY") + .zip("10045") + .build() + ) + .build() + + val body = params._body() + + assertThat(body.address()) + .contains( + BeneficialOwnerUpdateParams.Address.builder() + .city("New York") + .country("US") + .line1("33 Liberty Street") + .line2("Unit 2") + .state("NY") + .zip("10045") + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .build() + + val body = params._body() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncTest.kt index 4b0d86f6b..393ee73ca 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BeneficialOwnerServiceAsyncTest.kt @@ -5,6 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.beneficialowners.BeneficialOwnerListParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -29,6 +30,38 @@ internal class BeneficialOwnerServiceAsyncTest { entityBeneficialOwner.validate() } + @Test + fun update() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val beneficialOwnerServiceAsync = client.beneficialOwners() + + val entityBeneficialOwnerFuture = + beneficialOwnerServiceAsync.update( + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .address( + BeneficialOwnerUpdateParams.Address.builder() + .city("New York") + .country("US") + .line1("33 Liberty Street") + .line2("Unit 2") + .state("NY") + .zip("10045") + .build() + ) + .build() + ) + + val entityBeneficialOwner = entityBeneficialOwnerFuture.get() + entityBeneficialOwner.validate() + } + @Test fun list() { val client = diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceTest.kt index 927c56ef2..3c16955ed 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BeneficialOwnerServiceTest.kt @@ -5,6 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.beneficialowners.BeneficialOwnerListParams +import com.increase.api.models.beneficialowners.BeneficialOwnerUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -28,6 +29,37 @@ internal class BeneficialOwnerServiceTest { entityBeneficialOwner.validate() } + @Test + fun update() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val beneficialOwnerService = client.beneficialOwners() + + val entityBeneficialOwner = + beneficialOwnerService.update( + BeneficialOwnerUpdateParams.builder() + .entityBeneficialOwnerId( + "entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7" + ) + .address( + BeneficialOwnerUpdateParams.Address.builder() + .city("New York") + .country("US") + .line1("33 Liberty Street") + .line2("Unit 2") + .state("NY") + .zip("10045") + .build() + ) + .build() + ) + + entityBeneficialOwner.validate() + } + @Test fun list() { val client =