com.increase.api.models.EntityUpdateBeneficialOwnerAddressParams.kt Maven / Gradle / Ivy
// File generated from our OpenAPI spec by Stainless.
package com.increase.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.http.Headers
import com.increase.api.core.http.QueryParams
import com.increase.api.core.toImmutable
import com.increase.api.models.*
import java.util.Objects
class EntityUpdateBeneficialOwnerAddressParams
constructor(
private val entityId: String,
private val address: Address,
private val beneficialOwnerId: String,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map,
) {
fun entityId(): String = entityId
fun address(): Address = address
fun beneficialOwnerId(): String = beneficialOwnerId
internal fun getBody(): EntityUpdateBeneficialOwnerAddressBody {
return EntityUpdateBeneficialOwnerAddressBody(
address,
beneficialOwnerId,
additionalBodyProperties,
)
}
internal fun getHeaders(): Headers = additionalHeaders
internal fun getQueryParams(): QueryParams = additionalQueryParams
fun getPathParam(index: Int): String {
return when (index) {
0 -> entityId
else -> ""
}
}
@JsonDeserialize(builder = EntityUpdateBeneficialOwnerAddressBody.Builder::class)
@NoAutoDetect
class EntityUpdateBeneficialOwnerAddressBody
internal constructor(
private val address: Address?,
private val beneficialOwnerId: String?,
private val additionalProperties: Map,
) {
/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are
* disallowed.
*/
@JsonProperty("address") fun address(): Address? = address
/**
* The identifying details of anyone controlling or owning 25% or more of the corporation.
*/
@JsonProperty("beneficial_owner_id") fun beneficialOwnerId(): String? = beneficialOwnerId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var address: Address? = null
private var beneficialOwnerId: String? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(
entityUpdateBeneficialOwnerAddressBody: EntityUpdateBeneficialOwnerAddressBody
) = apply {
this.address = entityUpdateBeneficialOwnerAddressBody.address
this.beneficialOwnerId = entityUpdateBeneficialOwnerAddressBody.beneficialOwnerId
additionalProperties(entityUpdateBeneficialOwnerAddressBody.additionalProperties)
}
/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's
* are disallowed.
*/
@JsonProperty("address")
fun address(address: Address) = apply { this.address = address }
/**
* The identifying details of anyone controlling or owning 25% or more of the
* corporation.
*/
@JsonProperty("beneficial_owner_id")
fun beneficialOwnerId(beneficialOwnerId: String) = apply {
this.beneficialOwnerId = beneficialOwnerId
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): EntityUpdateBeneficialOwnerAddressBody =
EntityUpdateBeneficialOwnerAddressBody(
checkNotNull(address) { "`address` is required but was not set" },
checkNotNull(beneficialOwnerId) {
"`beneficialOwnerId` is required but was not set"
},
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is EntityUpdateBeneficialOwnerAddressBody && this.address == other.address && this.beneficialOwnerId == other.beneficialOwnerId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(address, beneficialOwnerId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"EntityUpdateBeneficialOwnerAddressBody{address=$address, beneficialOwnerId=$beneficialOwnerId, additionalProperties=$additionalProperties}"
}
fun _additionalHeaders(): Headers = additionalHeaders
fun _additionalQueryParams(): QueryParams = additionalQueryParams
fun _additionalBodyProperties(): Map = additionalBodyProperties
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is EntityUpdateBeneficialOwnerAddressParams && this.entityId == other.entityId && this.address == other.address && this.beneficialOwnerId == other.beneficialOwnerId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}
override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(entityId, address, beneficialOwnerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
}
override fun toString() =
"EntityUpdateBeneficialOwnerAddressParams{entityId=$entityId, address=$address, beneficialOwnerId=$beneficialOwnerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
@NoAutoDetect
class Builder {
private var entityId: String? = null
private var address: Address? = null
private var beneficialOwnerId: String? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
private var additionalBodyProperties: MutableMap = mutableMapOf()
internal fun from(
entityUpdateBeneficialOwnerAddressParams: EntityUpdateBeneficialOwnerAddressParams
) = apply {
this.entityId = entityUpdateBeneficialOwnerAddressParams.entityId
this.address = entityUpdateBeneficialOwnerAddressParams.address
this.beneficialOwnerId = entityUpdateBeneficialOwnerAddressParams.beneficialOwnerId
additionalHeaders(entityUpdateBeneficialOwnerAddressParams.additionalHeaders)
additionalQueryParams(entityUpdateBeneficialOwnerAddressParams.additionalQueryParams)
additionalBodyProperties(
entityUpdateBeneficialOwnerAddressParams.additionalBodyProperties
)
}
/**
* The identifier of the Entity associated with the Beneficial Owner whose address is being
* updated.
*/
fun entityId(entityId: String) = apply { this.entityId = entityId }
/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are
* disallowed.
*/
fun address(address: Address) = apply { this.address = address }
/**
* The identifying details of anyone controlling or owning 25% or more of the corporation.
*/
fun beneficialOwnerId(beneficialOwnerId: String) = apply {
this.beneficialOwnerId = beneficialOwnerId
}
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)
}
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
this.additionalBodyProperties.clear()
putAllAdditionalBodyProperties(additionalBodyProperties)
}
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
additionalBodyProperties.put(key, value)
}
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun removeAdditionalBodyProperty(key: String) = apply {
additionalBodyProperties.remove(key)
}
fun removeAllAdditionalBodyProperties(keys: Set) = apply {
keys.forEach(::removeAdditionalBodyProperty)
}
fun build(): EntityUpdateBeneficialOwnerAddressParams =
EntityUpdateBeneficialOwnerAddressParams(
checkNotNull(entityId) { "`entityId` is required but was not set" },
checkNotNull(address) { "`address` is required but was not set" },
checkNotNull(beneficialOwnerId) {
"`beneficialOwnerId` is required but was not set"
},
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
)
}
/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are
* disallowed.
*/
@JsonDeserialize(builder = Address.Builder::class)
@NoAutoDetect
class Address
private constructor(
private val city: String?,
private val line1: String?,
private val line2: String?,
private val state: String?,
private val zip: String?,
private val additionalProperties: Map,
) {
/** The city of the address. */
@JsonProperty("city") fun city(): String? = city
/** The first line of the address. This is usually the street number and street. */
@JsonProperty("line1") fun line1(): String? = line1
/** The second line of the address. This might be the floor or room number. */
@JsonProperty("line2") fun line2(): String? = line2
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
@JsonProperty("state") fun state(): String? = state
/** The ZIP code of the address. */
@JsonProperty("zip") fun zip(): String? = zip
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var city: String? = null
private var line1: String? = null
private var line2: String? = null
private var state: String? = null
private var zip: String? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(address: Address) = apply {
this.city = address.city
this.line1 = address.line1
this.line2 = address.line2
this.state = address.state
this.zip = address.zip
additionalProperties(address.additionalProperties)
}
/** The city of the address. */
@JsonProperty("city") fun city(city: String) = apply { this.city = city }
/** The first line of the address. This is usually the street number and street. */
@JsonProperty("line1") fun line1(line1: String) = apply { this.line1 = line1 }
/** The second line of the address. This might be the floor or room number. */
@JsonProperty("line2") fun line2(line2: String) = apply { this.line2 = line2 }
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
@JsonProperty("state") fun state(state: String) = apply { this.state = state }
/** The ZIP code of the address. */
@JsonProperty("zip") fun zip(zip: String) = apply { this.zip = zip }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): Address =
Address(
checkNotNull(city) { "`city` is required but was not set" },
checkNotNull(line1) { "`line1` is required but was not set" },
line2,
checkNotNull(state) { "`state` is required but was not set" },
checkNotNull(zip) { "`zip` is required but was not set" },
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy