com.increase.api.models.Entity.kt Maven / Gradle / Ivy
The newest version!
// 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.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.Enum
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonField
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toUnmodifiable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
/**
* Entities are the legal entities that own accounts. They can be people, corporations,
* partnerships, government authorities, or trusts.
*/
@JsonDeserialize(builder = Entity.Builder::class)
@NoAutoDetect
class Entity
private constructor(
private val corporation: JsonField,
private val createdAt: JsonField,
private val description: JsonField,
private val detailsConfirmedAt: JsonField,
private val governmentAuthority: JsonField,
private val id: JsonField,
private val idempotencyKey: JsonField,
private val joint: JsonField,
private val naturalPerson: JsonField,
private val status: JsonField,
private val structure: JsonField,
private val supplementalDocuments: JsonField>,
private val trust: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
*/
fun corporation(): Corporation? = corporation.getNullable("corporation")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/** The entity's description for display purposes. */
fun description(): String? = description.getNullable("description")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
* were most recently confirmed.
*/
fun detailsConfirmedAt(): OffsetDateTime? =
detailsConfirmedAt.getNullable("details_confirmed_at")
/**
* Details of the government authority entity. Will be present if `structure` is equal to
* `government_authority`.
*/
fun governmentAuthority(): GovernmentAuthority? =
governmentAuthority.getNullable("government_authority")
/** The entity's identifier. */
fun id(): String = id.getRequired("id")
/**
* The idempotency key you chose for this object. This value is unique across Increase and is
* used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
fun idempotencyKey(): String? = idempotencyKey.getNullable("idempotency_key")
/** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
fun joint(): Joint? = joint.getNullable("joint")
/**
* Details of the natural person entity. Will be present if `structure` is equal to
* `natural_person`.
*/
fun naturalPerson(): NaturalPerson? = naturalPerson.getNullable("natural_person")
/** The status of the entity. */
fun status(): Status = status.getRequired("status")
/** The entity's legal structure. */
fun structure(): Structure = structure.getRequired("structure")
/**
* Additional documentation associated with the entity. This is limited to the first 10
* documents for an entity. If an entity has more than 10 documents, use the GET
* /entity_supplemental_documents list endpoint to retrieve them.
*/
fun supplementalDocuments(): List =
supplementalDocuments.getRequired("supplemental_documents")
/** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
fun trust(): Trust? = trust.getNullable("trust")
/** A constant representing the object's type. For this resource it will always be `entity`. */
fun type(): Type = type.getRequired("type")
/**
* Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
*/
@JsonProperty("corporation") @ExcludeMissing fun _corporation() = corporation
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/** The entity's description for display purposes. */
@JsonProperty("description") @ExcludeMissing fun _description() = description
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
* were most recently confirmed.
*/
@JsonProperty("details_confirmed_at")
@ExcludeMissing
fun _detailsConfirmedAt() = detailsConfirmedAt
/**
* Details of the government authority entity. Will be present if `structure` is equal to
* `government_authority`.
*/
@JsonProperty("government_authority")
@ExcludeMissing
fun _governmentAuthority() = governmentAuthority
/** The entity's identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The idempotency key you chose for this object. This value is unique across Increase and is
* used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
@JsonProperty("idempotency_key") @ExcludeMissing fun _idempotencyKey() = idempotencyKey
/** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
@JsonProperty("joint") @ExcludeMissing fun _joint() = joint
/**
* Details of the natural person entity. Will be present if `structure` is equal to
* `natural_person`.
*/
@JsonProperty("natural_person") @ExcludeMissing fun _naturalPerson() = naturalPerson
/** The status of the entity. */
@JsonProperty("status") @ExcludeMissing fun _status() = status
/** The entity's legal structure. */
@JsonProperty("structure") @ExcludeMissing fun _structure() = structure
/**
* Additional documentation associated with the entity. This is limited to the first 10
* documents for an entity. If an entity has more than 10 documents, use the GET
* /entity_supplemental_documents list endpoint to retrieve them.
*/
@JsonProperty("supplemental_documents")
@ExcludeMissing
fun _supplementalDocuments() = supplementalDocuments
/** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
@JsonProperty("trust") @ExcludeMissing fun _trust() = trust
/** A constant representing the object's type. For this resource it will always be `entity`. */
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Entity = apply {
if (!validated) {
corporation()?.validate()
createdAt()
description()
detailsConfirmedAt()
governmentAuthority()?.validate()
id()
idempotencyKey()
joint()?.validate()
naturalPerson()?.validate()
status()
structure()
supplementalDocuments().forEach { it.validate() }
trust()?.validate()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Entity &&
this.corporation == other.corporation &&
this.createdAt == other.createdAt &&
this.description == other.description &&
this.detailsConfirmedAt == other.detailsConfirmedAt &&
this.governmentAuthority == other.governmentAuthority &&
this.id == other.id &&
this.idempotencyKey == other.idempotencyKey &&
this.joint == other.joint &&
this.naturalPerson == other.naturalPerson &&
this.status == other.status &&
this.structure == other.structure &&
this.supplementalDocuments == other.supplementalDocuments &&
this.trust == other.trust &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
corporation,
createdAt,
description,
detailsConfirmedAt,
governmentAuthority,
id,
idempotencyKey,
joint,
naturalPerson,
status,
structure,
supplementalDocuments,
trust,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Entity{corporation=$corporation, createdAt=$createdAt, description=$description, detailsConfirmedAt=$detailsConfirmedAt, governmentAuthority=$governmentAuthority, id=$id, idempotencyKey=$idempotencyKey, joint=$joint, naturalPerson=$naturalPerson, status=$status, structure=$structure, supplementalDocuments=$supplementalDocuments, trust=$trust, type=$type, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var corporation: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var description: JsonField = JsonMissing.of()
private var detailsConfirmedAt: JsonField = JsonMissing.of()
private var governmentAuthority: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var idempotencyKey: JsonField = JsonMissing.of()
private var joint: JsonField = JsonMissing.of()
private var naturalPerson: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
private var structure: JsonField = JsonMissing.of()
private var supplementalDocuments: JsonField> =
JsonMissing.of()
private var trust: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(entity: Entity) = apply {
this.corporation = entity.corporation
this.createdAt = entity.createdAt
this.description = entity.description
this.detailsConfirmedAt = entity.detailsConfirmedAt
this.governmentAuthority = entity.governmentAuthority
this.id = entity.id
this.idempotencyKey = entity.idempotencyKey
this.joint = entity.joint
this.naturalPerson = entity.naturalPerson
this.status = entity.status
this.structure = entity.structure
this.supplementalDocuments = entity.supplementalDocuments
this.trust = entity.trust
this.type = entity.type
additionalProperties(entity.additionalProperties)
}
/**
* Details of the corporation entity. Will be present if `structure` is equal to
* `corporation`.
*/
fun corporation(corporation: Corporation) = corporation(JsonField.of(corporation))
/**
* Details of the corporation entity. Will be present if `structure` is equal to
* `corporation`.
*/
@JsonProperty("corporation")
@ExcludeMissing
fun corporation(corporation: JsonField) = apply {
this.corporation = corporation
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was
* created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was
* created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
/** The entity's description for display purposes. */
fun description(description: String) = description(JsonField.of(description))
/** The entity's description for display purposes. */
@JsonProperty("description")
@ExcludeMissing
fun description(description: JsonField) = apply { this.description = description }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
* were most recently confirmed.
*/
fun detailsConfirmedAt(detailsConfirmedAt: OffsetDateTime) =
detailsConfirmedAt(JsonField.of(detailsConfirmedAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
* were most recently confirmed.
*/
@JsonProperty("details_confirmed_at")
@ExcludeMissing
fun detailsConfirmedAt(detailsConfirmedAt: JsonField) = apply {
this.detailsConfirmedAt = detailsConfirmedAt
}
/**
* Details of the government authority entity. Will be present if `structure` is equal to
* `government_authority`.
*/
fun governmentAuthority(governmentAuthority: GovernmentAuthority) =
governmentAuthority(JsonField.of(governmentAuthority))
/**
* Details of the government authority entity. Will be present if `structure` is equal to
* `government_authority`.
*/
@JsonProperty("government_authority")
@ExcludeMissing
fun governmentAuthority(governmentAuthority: JsonField) = apply {
this.governmentAuthority = governmentAuthority
}
/** The entity's identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The entity's identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/**
* The idempotency key you chose for this object. This value is unique across Increase and
* is used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
fun idempotencyKey(idempotencyKey: String) = idempotencyKey(JsonField.of(idempotencyKey))
/**
* The idempotency key you chose for this object. This value is unique across Increase and
* is used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
@JsonProperty("idempotency_key")
@ExcludeMissing
fun idempotencyKey(idempotencyKey: JsonField) = apply {
this.idempotencyKey = idempotencyKey
}
/** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
fun joint(joint: Joint) = joint(JsonField.of(joint))
/** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
@JsonProperty("joint")
@ExcludeMissing
fun joint(joint: JsonField) = apply { this.joint = joint }
/**
* Details of the natural person entity. Will be present if `structure` is equal to
* `natural_person`.
*/
fun naturalPerson(naturalPerson: NaturalPerson) = naturalPerson(JsonField.of(naturalPerson))
/**
* Details of the natural person entity. Will be present if `structure` is equal to
* `natural_person`.
*/
@JsonProperty("natural_person")
@ExcludeMissing
fun naturalPerson(naturalPerson: JsonField) = apply {
this.naturalPerson = naturalPerson
}
/** The status of the entity. */
fun status(status: Status) = status(JsonField.of(status))
/** The status of the entity. */
@JsonProperty("status")
@ExcludeMissing
fun status(status: JsonField) = apply { this.status = status }
/** The entity's legal structure. */
fun structure(structure: Structure) = structure(JsonField.of(structure))
/** The entity's legal structure. */
@JsonProperty("structure")
@ExcludeMissing
fun structure(structure: JsonField) = apply { this.structure = structure }
/**
* Additional documentation associated with the entity. This is limited to the first 10
* documents for an entity. If an entity has more than 10 documents, use the GET
* /entity_supplemental_documents list endpoint to retrieve them.
*/
fun supplementalDocuments(supplementalDocuments: List) =
supplementalDocuments(JsonField.of(supplementalDocuments))
/**
* Additional documentation associated with the entity. This is limited to the first 10
* documents for an entity. If an entity has more than 10 documents, use the GET
* /entity_supplemental_documents list endpoint to retrieve them.
*/
@JsonProperty("supplemental_documents")
@ExcludeMissing
fun supplementalDocuments(
supplementalDocuments: JsonField>
) = apply { this.supplementalDocuments = supplementalDocuments }
/** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
fun trust(trust: Trust) = trust(JsonField.of(trust))
/** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
@JsonProperty("trust")
@ExcludeMissing
fun trust(trust: JsonField) = apply { this.trust = trust }
/**
* A constant representing the object's type. For this resource it will always be `entity`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be `entity`.
*/
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
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(): Entity =
Entity(
corporation,
createdAt,
description,
detailsConfirmedAt,
governmentAuthority,
id,
idempotencyKey,
joint,
naturalPerson,
status,
structure,
supplementalDocuments.map { it.toUnmodifiable() },
trust,
type,
additionalProperties.toUnmodifiable(),
)
}
/**
* Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
*/
@JsonDeserialize(builder = Corporation.Builder::class)
@NoAutoDetect
class Corporation
private constructor(
private val address: JsonField,
private val beneficialOwners: JsonField>,
private val incorporationState: JsonField,
private val industryCode: JsonField,
private val name: JsonField,
private val taxIdentifier: JsonField,
private val website: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The corporation's address. */
fun address(): Address = address.getRequired("address")
/**
* The identifying details of anyone controlling or owning 25% or more of the corporation.
*/
fun beneficialOwners(): List =
beneficialOwners.getRequired("beneficial_owners")
/**
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
* state of incorporation.
*/
fun incorporationState(): String? = incorporationState.getNullable("incorporation_state")
/**
* The numeric North American Industry Classification System (NAICS) code submitted for the
* corporation.
*/
fun industryCode(): String? = industryCode.getNullable("industry_code")
/** The legal name of the corporation. */
fun name(): String = name.getRequired("name")
/** The Employer Identification Number (EIN) for the corporation. */
fun taxIdentifier(): String? = taxIdentifier.getNullable("tax_identifier")
/** The website of the corporation. */
fun website(): String? = website.getNullable("website")
/** The corporation's address. */
@JsonProperty("address") @ExcludeMissing fun _address() = address
/**
* The identifying details of anyone controlling or owning 25% or more of the corporation.
*/
@JsonProperty("beneficial_owners")
@ExcludeMissing
fun _beneficialOwners() = beneficialOwners
/**
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
* state of incorporation.
*/
@JsonProperty("incorporation_state")
@ExcludeMissing
fun _incorporationState() = incorporationState
/**
* The numeric North American Industry Classification System (NAICS) code submitted for the
* corporation.
*/
@JsonProperty("industry_code") @ExcludeMissing fun _industryCode() = industryCode
/** The legal name of the corporation. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
/** The Employer Identification Number (EIN) for the corporation. */
@JsonProperty("tax_identifier") @ExcludeMissing fun _taxIdentifier() = taxIdentifier
/** The website of the corporation. */
@JsonProperty("website") @ExcludeMissing fun _website() = website
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Corporation = apply {
if (!validated) {
address().validate()
beneficialOwners().forEach { it.validate() }
incorporationState()
industryCode()
name()
taxIdentifier()
website()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Corporation &&
this.address == other.address &&
this.beneficialOwners == other.beneficialOwners &&
this.incorporationState == other.incorporationState &&
this.industryCode == other.industryCode &&
this.name == other.name &&
this.taxIdentifier == other.taxIdentifier &&
this.website == other.website &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
address,
beneficialOwners,
incorporationState,
industryCode,
name,
taxIdentifier,
website,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Corporation{address=$address, beneficialOwners=$beneficialOwners, incorporationState=$incorporationState, industryCode=$industryCode, name=$name, taxIdentifier=$taxIdentifier, website=$website, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var address: JsonField = JsonMissing.of()
private var beneficialOwners: JsonField> = JsonMissing.of()
private var incorporationState: JsonField = JsonMissing.of()
private var industryCode: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var taxIdentifier: JsonField = JsonMissing.of()
private var website: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(corporation: Corporation) = apply {
this.address = corporation.address
this.beneficialOwners = corporation.beneficialOwners
this.incorporationState = corporation.incorporationState
this.industryCode = corporation.industryCode
this.name = corporation.name
this.taxIdentifier = corporation.taxIdentifier
this.website = corporation.website
additionalProperties(corporation.additionalProperties)
}
/** The corporation's address. */
fun address(address: Address) = address(JsonField.of(address))
/** The corporation's address. */
@JsonProperty("address")
@ExcludeMissing
fun address(address: JsonField) = apply { this.address = address }
/**
* The identifying details of anyone controlling or owning 25% or more of the
* corporation.
*/
fun beneficialOwners(beneficialOwners: List) =
beneficialOwners(JsonField.of(beneficialOwners))
/**
* The identifying details of anyone controlling or owning 25% or more of the
* corporation.
*/
@JsonProperty("beneficial_owners")
@ExcludeMissing
fun beneficialOwners(beneficialOwners: JsonField>) = apply {
this.beneficialOwners = beneficialOwners
}
/**
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
* state of incorporation.
*/
fun incorporationState(incorporationState: String) =
incorporationState(JsonField.of(incorporationState))
/**
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
* state of incorporation.
*/
@JsonProperty("incorporation_state")
@ExcludeMissing
fun incorporationState(incorporationState: JsonField) = apply {
this.incorporationState = incorporationState
}
/**
* The numeric North American Industry Classification System (NAICS) code submitted for
* the corporation.
*/
fun industryCode(industryCode: String) = industryCode(JsonField.of(industryCode))
/**
* The numeric North American Industry Classification System (NAICS) code submitted for
* the corporation.
*/
@JsonProperty("industry_code")
@ExcludeMissing
fun industryCode(industryCode: JsonField) = apply {
this.industryCode = industryCode
}
/** The legal name of the corporation. */
fun name(name: String) = name(JsonField.of(name))
/** The legal name of the corporation. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
/** The Employer Identification Number (EIN) for the corporation. */
fun taxIdentifier(taxIdentifier: String) = taxIdentifier(JsonField.of(taxIdentifier))
/** The Employer Identification Number (EIN) for the corporation. */
@JsonProperty("tax_identifier")
@ExcludeMissing
fun taxIdentifier(taxIdentifier: JsonField) = apply {
this.taxIdentifier = taxIdentifier
}
/** The website of the corporation. */
fun website(website: String) = website(JsonField.of(website))
/** The website of the corporation. */
@JsonProperty("website")
@ExcludeMissing
fun website(website: JsonField) = apply { this.website = website }
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(): Corporation =
Corporation(
address,
beneficialOwners.map { it.toUnmodifiable() },
incorporationState,
industryCode,
name,
taxIdentifier,
website,
additionalProperties.toUnmodifiable(),
)
}
/** The corporation's address. */
@JsonDeserialize(builder = Address.Builder::class)
@NoAutoDetect
class Address
private constructor(
private val city: JsonField,
private val line1: JsonField,
private val line2: JsonField,
private val state: JsonField,
private val zip: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The city of the address. */
fun city(): String = city.getRequired("city")
/** The first line of the address. */
fun line1(): String = line1.getRequired("line1")
/** The second line of the address. */
fun line2(): String? = line2.getNullable("line2")
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
fun state(): String = state.getRequired("state")
/** The ZIP code of the address. */
fun zip(): String = zip.getRequired("zip")
/** The city of the address. */
@JsonProperty("city") @ExcludeMissing fun _city() = city
/** The first line of the address. */
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
/** The second line of the address. */
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
@JsonProperty("state") @ExcludeMissing fun _state() = state
/** The ZIP code of the address. */
@JsonProperty("zip") @ExcludeMissing fun _zip() = zip
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Address = apply {
if (!validated) {
city()
line1()
line2()
state()
zip()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
city,
line1,
line2,
state,
zip,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var city: JsonField = JsonMissing.of()
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var zip: JsonField = JsonMissing.of()
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. */
fun city(city: String) = city(JsonField.of(city))
/** The city of the address. */
@JsonProperty("city")
@ExcludeMissing
fun city(city: JsonField) = apply { this.city = city }
/** The first line of the address. */
fun line1(line1: String) = line1(JsonField.of(line1))
/** The first line of the address. */
@JsonProperty("line1")
@ExcludeMissing
fun line1(line1: JsonField) = apply { this.line1 = line1 }
/** The second line of the address. */
fun line2(line2: String) = line2(JsonField.of(line2))
/** The second line of the address. */
@JsonProperty("line2")
@ExcludeMissing
fun line2(line2: JsonField) = apply { this.line2 = line2 }
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of
* the address.
*/
fun state(state: String) = state(JsonField.of(state))
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of
* the address.
*/
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
/** The ZIP code of the address. */
fun zip(zip: String) = zip(JsonField.of(zip))
/** The ZIP code of the address. */
@JsonProperty("zip")
@ExcludeMissing
fun zip(zip: JsonField) = 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(
city,
line1,
line2,
state,
zip,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = BeneficialOwner.Builder::class)
@NoAutoDetect
class BeneficialOwner
private constructor(
private val beneficialOwnerId: JsonField,
private val companyTitle: JsonField,
private val individual: JsonField,
private val prong: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The identifier of this beneficial owner. */
fun beneficialOwnerId(): String = beneficialOwnerId.getRequired("beneficial_owner_id")
/** This person's role or title within the entity. */
fun companyTitle(): String? = companyTitle.getNullable("company_title")
/** Personal details for the beneficial owner. */
fun individual(): Individual = individual.getRequired("individual")
/** Why this person is considered a beneficial owner of the entity. */
fun prong(): Prong = prong.getRequired("prong")
/** The identifier of this beneficial owner. */
@JsonProperty("beneficial_owner_id")
@ExcludeMissing
fun _beneficialOwnerId() = beneficialOwnerId
/** This person's role or title within the entity. */
@JsonProperty("company_title") @ExcludeMissing fun _companyTitle() = companyTitle
/** Personal details for the beneficial owner. */
@JsonProperty("individual") @ExcludeMissing fun _individual() = individual
/** Why this person is considered a beneficial owner of the entity. */
@JsonProperty("prong") @ExcludeMissing fun _prong() = prong
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): BeneficialOwner = apply {
if (!validated) {
beneficialOwnerId()
companyTitle()
individual().validate()
prong()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is BeneficialOwner &&
this.beneficialOwnerId == other.beneficialOwnerId &&
this.companyTitle == other.companyTitle &&
this.individual == other.individual &&
this.prong == other.prong &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
beneficialOwnerId,
companyTitle,
individual,
prong,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"BeneficialOwner{beneficialOwnerId=$beneficialOwnerId, companyTitle=$companyTitle, individual=$individual, prong=$prong, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var beneficialOwnerId: JsonField = JsonMissing.of()
private var companyTitle: JsonField = JsonMissing.of()
private var individual: JsonField = JsonMissing.of()
private var prong: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(beneficialOwner: BeneficialOwner) = apply {
this.beneficialOwnerId = beneficialOwner.beneficialOwnerId
this.companyTitle = beneficialOwner.companyTitle
this.individual = beneficialOwner.individual
this.prong = beneficialOwner.prong
additionalProperties(beneficialOwner.additionalProperties)
}
/** The identifier of this beneficial owner. */
fun beneficialOwnerId(beneficialOwnerId: String) =
beneficialOwnerId(JsonField.of(beneficialOwnerId))
/** The identifier of this beneficial owner. */
@JsonProperty("beneficial_owner_id")
@ExcludeMissing
fun beneficialOwnerId(beneficialOwnerId: JsonField) = apply {
this.beneficialOwnerId = beneficialOwnerId
}
/** This person's role or title within the entity. */
fun companyTitle(companyTitle: String) = companyTitle(JsonField.of(companyTitle))
/** This person's role or title within the entity. */
@JsonProperty("company_title")
@ExcludeMissing
fun companyTitle(companyTitle: JsonField) = apply {
this.companyTitle = companyTitle
}
/** Personal details for the beneficial owner. */
fun individual(individual: Individual) = individual(JsonField.of(individual))
/** Personal details for the beneficial owner. */
@JsonProperty("individual")
@ExcludeMissing
fun individual(individual: JsonField) = apply {
this.individual = individual
}
/** Why this person is considered a beneficial owner of the entity. */
fun prong(prong: Prong) = prong(JsonField.of(prong))
/** Why this person is considered a beneficial owner of the entity. */
@JsonProperty("prong")
@ExcludeMissing
fun prong(prong: JsonField) = apply { this.prong = prong }
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(): BeneficialOwner =
BeneficialOwner(
beneficialOwnerId,
companyTitle,
individual,
prong,
additionalProperties.toUnmodifiable(),
)
}
/** Personal details for the beneficial owner. */
@JsonDeserialize(builder = Individual.Builder::class)
@NoAutoDetect
class Individual
private constructor(
private val address: JsonField,
private val dateOfBirth: JsonField,
private val identification: JsonField,
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The person's address. */
fun address(): Address = address.getRequired("address")
/** The person's date of birth in YYYY-MM-DD format. */
fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth")
/** A means of verifying the person's identity. */
fun identification(): Identification = identification.getRequired("identification")
/** The person's legal name. */
fun name(): String = name.getRequired("name")
/** The person's address. */
@JsonProperty("address") @ExcludeMissing fun _address() = address
/** The person's date of birth in YYYY-MM-DD format. */
@JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth
/** A means of verifying the person's identity. */
@JsonProperty("identification")
@ExcludeMissing
fun _identification() = identification
/** The person's legal name. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Individual = apply {
if (!validated) {
address().validate()
dateOfBirth()
identification().validate()
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Individual &&
this.address == other.address &&
this.dateOfBirth == other.dateOfBirth &&
this.identification == other.identification &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
address,
dateOfBirth,
identification,
name,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var address: JsonField = JsonMissing.of()
private var dateOfBirth: JsonField = JsonMissing.of()
private var identification: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(individual: Individual) = apply {
this.address = individual.address
this.dateOfBirth = individual.dateOfBirth
this.identification = individual.identification
this.name = individual.name
additionalProperties(individual.additionalProperties)
}
/** The person's address. */
fun address(address: Address) = address(JsonField.of(address))
/** The person's address. */
@JsonProperty("address")
@ExcludeMissing
fun address(address: JsonField) = apply { this.address = address }
/** The person's date of birth in YYYY-MM-DD format. */
fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth))
/** The person's date of birth in YYYY-MM-DD format. */
@JsonProperty("date_of_birth")
@ExcludeMissing
fun dateOfBirth(dateOfBirth: JsonField) = apply {
this.dateOfBirth = dateOfBirth
}
/** A means of verifying the person's identity. */
fun identification(identification: Identification) =
identification(JsonField.of(identification))
/** A means of verifying the person's identity. */
@JsonProperty("identification")
@ExcludeMissing
fun identification(identification: JsonField) = apply {
this.identification = identification
}
/** The person's legal name. */
fun name(name: String) = name(JsonField.of(name))
/** The person's legal name. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
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(): Individual =
Individual(
address,
dateOfBirth,
identification,
name,
additionalProperties.toUnmodifiable(),
)
}
/** The person's address. */
@JsonDeserialize(builder = Address.Builder::class)
@NoAutoDetect
class Address
private constructor(
private val city: JsonField,
private val line1: JsonField,
private val line2: JsonField,
private val state: JsonField,
private val zip: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The city of the address. */
fun city(): String = city.getRequired("city")
/** The first line of the address. */
fun line1(): String = line1.getRequired("line1")
/** The second line of the address. */
fun line2(): String? = line2.getNullable("line2")
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state
* of the address.
*/
fun state(): String = state.getRequired("state")
/** The ZIP code of the address. */
fun zip(): String = zip.getRequired("zip")
/** The city of the address. */
@JsonProperty("city") @ExcludeMissing fun _city() = city
/** The first line of the address. */
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
/** The second line of the address. */
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state
* of the address.
*/
@JsonProperty("state") @ExcludeMissing fun _state() = state
/** The ZIP code of the address. */
@JsonProperty("zip") @ExcludeMissing fun _zip() = zip
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Address = apply {
if (!validated) {
city()
line1()
line2()
state()
zip()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
city,
line1,
line2,
state,
zip,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var city: JsonField = JsonMissing.of()
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var zip: JsonField = JsonMissing.of()
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. */
fun city(city: String) = city(JsonField.of(city))
/** The city of the address. */
@JsonProperty("city")
@ExcludeMissing
fun city(city: JsonField) = apply { this.city = city }
/** The first line of the address. */
fun line1(line1: String) = line1(JsonField.of(line1))
/** The first line of the address. */
@JsonProperty("line1")
@ExcludeMissing
fun line1(line1: JsonField) = apply { this.line1 = line1 }
/** The second line of the address. */
fun line2(line2: String) = line2(JsonField.of(line2))
/** The second line of the address. */
@JsonProperty("line2")
@ExcludeMissing
fun line2(line2: JsonField) = apply { this.line2 = line2 }
/**
* The two-letter United States Postal Service (USPS) abbreviation for the
* state of the address.
*/
fun state(state: String) = state(JsonField.of(state))
/**
* The two-letter United States Postal Service (USPS) abbreviation for the
* state of the address.
*/
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
/** The ZIP code of the address. */
fun zip(zip: String) = zip(JsonField.of(zip))
/** The ZIP code of the address. */
@JsonProperty("zip")
@ExcludeMissing
fun zip(zip: JsonField) = 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(
city,
line1,
line2,
state,
zip,
additionalProperties.toUnmodifiable(),
)
}
}
/** A means of verifying the person's identity. */
@JsonDeserialize(builder = Identification.Builder::class)
@NoAutoDetect
class Identification
private constructor(
private val method: JsonField,
private val numberLast4: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** A method that can be used to verify the individual's identity. */
fun method(): Method = method.getRequired("method")
/**
* The last 4 digits of the identification number that can be used to verify the
* individual's identity.
*/
fun numberLast4(): String = numberLast4.getRequired("number_last4")
/** A method that can be used to verify the individual's identity. */
@JsonProperty("method") @ExcludeMissing fun _method() = method
/**
* The last 4 digits of the identification number that can be used to verify the
* individual's identity.
*/
@JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Identification = apply {
if (!validated) {
method()
numberLast4()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Identification &&
this.method == other.method &&
this.numberLast4 == other.numberLast4 &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
method,
numberLast4,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var method: JsonField = JsonMissing.of()
private var numberLast4: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(identification: Identification) = apply {
this.method = identification.method
this.numberLast4 = identification.numberLast4
additionalProperties(identification.additionalProperties)
}
/** A method that can be used to verify the individual's identity. */
fun method(method: Method) = method(JsonField.of(method))
/** A method that can be used to verify the individual's identity. */
@JsonProperty("method")
@ExcludeMissing
fun method(method: JsonField) = apply { this.method = method }
/**
* The last 4 digits of the identification number that can be used to verify
* the individual's identity.
*/
fun numberLast4(numberLast4: String) =
numberLast4(JsonField.of(numberLast4))
/**
* The last 4 digits of the identification number that can be used to verify
* the individual's identity.
*/
@JsonProperty("number_last4")
@ExcludeMissing
fun numberLast4(numberLast4: JsonField) = apply {
this.numberLast4 = numberLast4
}
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(): Identification =
Identification(
method,
numberLast4,
additionalProperties.toUnmodifiable(),
)
}
class Method
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Method && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val SOCIAL_SECURITY_NUMBER =
Method(JsonField.of("social_security_number"))
val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER =
Method(JsonField.of("individual_taxpayer_identification_number"))
val PASSPORT = Method(JsonField.of("passport"))
val DRIVERS_LICENSE = Method(JsonField.of("drivers_license"))
val OTHER = Method(JsonField.of("other"))
fun of(value: String) = Method(JsonField.of(value))
}
enum class Known {
SOCIAL_SECURITY_NUMBER,
INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER,
PASSPORT,
DRIVERS_LICENSE,
OTHER,
}
enum class Value {
SOCIAL_SECURITY_NUMBER,
INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER,
PASSPORT,
DRIVERS_LICENSE,
OTHER,
_UNKNOWN,
}
fun value(): Value =
when (this) {
SOCIAL_SECURITY_NUMBER -> Value.SOCIAL_SECURITY_NUMBER
INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER ->
Value.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER
PASSPORT -> Value.PASSPORT
DRIVERS_LICENSE -> Value.DRIVERS_LICENSE
OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
SOCIAL_SECURITY_NUMBER -> Known.SOCIAL_SECURITY_NUMBER
INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER ->
Known.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER
PASSPORT -> Known.PASSPORT
DRIVERS_LICENSE -> Known.DRIVERS_LICENSE
OTHER -> Known.OTHER
else -> throw IncreaseInvalidDataException("Unknown Method: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
}
class Prong
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Prong && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val OWNERSHIP = Prong(JsonField.of("ownership"))
val CONTROL = Prong(JsonField.of("control"))
fun of(value: String) = Prong(JsonField.of(value))
}
enum class Known {
OWNERSHIP,
CONTROL,
}
enum class Value {
OWNERSHIP,
CONTROL,
_UNKNOWN,
}
fun value(): Value =
when (this) {
OWNERSHIP -> Value.OWNERSHIP
CONTROL -> Value.CONTROL
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
OWNERSHIP -> Known.OWNERSHIP
CONTROL -> Known.CONTROL
else -> throw IncreaseInvalidDataException("Unknown Prong: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
}
/**
* Details of the government authority entity. Will be present if `structure` is equal to
* `government_authority`.
*/
@JsonDeserialize(builder = GovernmentAuthority.Builder::class)
@NoAutoDetect
class GovernmentAuthority
private constructor(
private val address: JsonField,
private val authorizedPersons: JsonField>,
private val category: JsonField,
private val name: JsonField,
private val taxIdentifier: JsonField,
private val website: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The government authority's address. */
fun address(): Address = address.getRequired("address")
/** The identifying details of authorized persons of the government authority. */
fun authorizedPersons(): List =
authorizedPersons.getRequired("authorized_persons")
/** The category of the government authority. */
fun category(): Category = category.getRequired("category")
/** The government authority's name. */
fun name(): String = name.getRequired("name")
/** The Employer Identification Number (EIN) of the government authority. */
fun taxIdentifier(): String? = taxIdentifier.getNullable("tax_identifier")
/** The government authority's website. */
fun website(): String? = website.getNullable("website")
/** The government authority's address. */
@JsonProperty("address") @ExcludeMissing fun _address() = address
/** The identifying details of authorized persons of the government authority. */
@JsonProperty("authorized_persons")
@ExcludeMissing
fun _authorizedPersons() = authorizedPersons
/** The category of the government authority. */
@JsonProperty("category") @ExcludeMissing fun _category() = category
/** The government authority's name. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
/** The Employer Identification Number (EIN) of the government authority. */
@JsonProperty("tax_identifier") @ExcludeMissing fun _taxIdentifier() = taxIdentifier
/** The government authority's website. */
@JsonProperty("website") @ExcludeMissing fun _website() = website
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): GovernmentAuthority = apply {
if (!validated) {
address().validate()
authorizedPersons().forEach { it.validate() }
category()
name()
taxIdentifier()
website()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is GovernmentAuthority &&
this.address == other.address &&
this.authorizedPersons == other.authorizedPersons &&
this.category == other.category &&
this.name == other.name &&
this.taxIdentifier == other.taxIdentifier &&
this.website == other.website &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
address,
authorizedPersons,
category,
name,
taxIdentifier,
website,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"GovernmentAuthority{address=$address, authorizedPersons=$authorizedPersons, category=$category, name=$name, taxIdentifier=$taxIdentifier, website=$website, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var address: JsonField = JsonMissing.of()
private var authorizedPersons: JsonField> = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var taxIdentifier: JsonField = JsonMissing.of()
private var website: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(governmentAuthority: GovernmentAuthority) = apply {
this.address = governmentAuthority.address
this.authorizedPersons = governmentAuthority.authorizedPersons
this.category = governmentAuthority.category
this.name = governmentAuthority.name
this.taxIdentifier = governmentAuthority.taxIdentifier
this.website = governmentAuthority.website
additionalProperties(governmentAuthority.additionalProperties)
}
/** The government authority's address. */
fun address(address: Address) = address(JsonField.of(address))
/** The government authority's address. */
@JsonProperty("address")
@ExcludeMissing
fun address(address: JsonField) = apply { this.address = address }
/** The identifying details of authorized persons of the government authority. */
fun authorizedPersons(authorizedPersons: List) =
authorizedPersons(JsonField.of(authorizedPersons))
/** The identifying details of authorized persons of the government authority. */
@JsonProperty("authorized_persons")
@ExcludeMissing
fun authorizedPersons(authorizedPersons: JsonField>) = apply {
this.authorizedPersons = authorizedPersons
}
/** The category of the government authority. */
fun category(category: Category) = category(JsonField.of(category))
/** The category of the government authority. */
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/** The government authority's name. */
fun name(name: String) = name(JsonField.of(name))
/** The government authority's name. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
/** The Employer Identification Number (EIN) of the government authority. */
fun taxIdentifier(taxIdentifier: String) = taxIdentifier(JsonField.of(taxIdentifier))
/** The Employer Identification Number (EIN) of the government authority. */
@JsonProperty("tax_identifier")
@ExcludeMissing
fun taxIdentifier(taxIdentifier: JsonField) = apply {
this.taxIdentifier = taxIdentifier
}
/** The government authority's website. */
fun website(website: String) = website(JsonField.of(website))
/** The government authority's website. */
@JsonProperty("website")
@ExcludeMissing
fun website(website: JsonField) = apply { this.website = website }
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(): GovernmentAuthority =
GovernmentAuthority(
address,
authorizedPersons.map { it.toUnmodifiable() },
category,
name,
taxIdentifier,
website,
additionalProperties.toUnmodifiable(),
)
}
/** The government authority's address. */
@JsonDeserialize(builder = Address.Builder::class)
@NoAutoDetect
class Address
private constructor(
private val city: JsonField,
private val line1: JsonField,
private val line2: JsonField,
private val state: JsonField,
private val zip: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The city of the address. */
fun city(): String = city.getRequired("city")
/** The first line of the address. */
fun line1(): String = line1.getRequired("line1")
/** The second line of the address. */
fun line2(): String? = line2.getNullable("line2")
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
fun state(): String = state.getRequired("state")
/** The ZIP code of the address. */
fun zip(): String = zip.getRequired("zip")
/** The city of the address. */
@JsonProperty("city") @ExcludeMissing fun _city() = city
/** The first line of the address. */
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
/** The second line of the address. */
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of the
* address.
*/
@JsonProperty("state") @ExcludeMissing fun _state() = state
/** The ZIP code of the address. */
@JsonProperty("zip") @ExcludeMissing fun _zip() = zip
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Address = apply {
if (!validated) {
city()
line1()
line2()
state()
zip()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
city,
line1,
line2,
state,
zip,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var city: JsonField = JsonMissing.of()
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var zip: JsonField = JsonMissing.of()
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. */
fun city(city: String) = city(JsonField.of(city))
/** The city of the address. */
@JsonProperty("city")
@ExcludeMissing
fun city(city: JsonField) = apply { this.city = city }
/** The first line of the address. */
fun line1(line1: String) = line1(JsonField.of(line1))
/** The first line of the address. */
@JsonProperty("line1")
@ExcludeMissing
fun line1(line1: JsonField) = apply { this.line1 = line1 }
/** The second line of the address. */
fun line2(line2: String) = line2(JsonField.of(line2))
/** The second line of the address. */
@JsonProperty("line2")
@ExcludeMissing
fun line2(line2: JsonField) = apply { this.line2 = line2 }
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of
* the address.
*/
fun state(state: String) = state(JsonField.of(state))
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of
* the address.
*/
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
/** The ZIP code of the address. */
fun zip(zip: String) = zip(JsonField.of(zip))
/** The ZIP code of the address. */
@JsonProperty("zip")
@ExcludeMissing
fun zip(zip: JsonField) = 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(
city,
line1,
line2,
state,
zip,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = AuthorizedPerson.Builder::class)
@NoAutoDetect
class AuthorizedPerson
private constructor(
private val authorizedPersonId: JsonField,
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The identifier of this authorized person. */
fun authorizedPersonId(): String =
authorizedPersonId.getRequired("authorized_person_id")
/** The person's legal name. */
fun name(): String = name.getRequired("name")
/** The identifier of this authorized person. */
@JsonProperty("authorized_person_id")
@ExcludeMissing
fun _authorizedPersonId() = authorizedPersonId
/** The person's legal name. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AuthorizedPerson = apply {
if (!validated) {
authorizedPersonId()
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AuthorizedPerson &&
this.authorizedPersonId == other.authorizedPersonId &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
authorizedPersonId,
name,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AuthorizedPerson{authorizedPersonId=$authorizedPersonId, name=$name, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var authorizedPersonId: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(authorizedPerson: AuthorizedPerson) = apply {
this.authorizedPersonId = authorizedPerson.authorizedPersonId
this.name = authorizedPerson.name
additionalProperties(authorizedPerson.additionalProperties)
}
/** The identifier of this authorized person. */
fun authorizedPersonId(authorizedPersonId: String) =
authorizedPersonId(JsonField.of(authorizedPersonId))
/** The identifier of this authorized person. */
@JsonProperty("authorized_person_id")
@ExcludeMissing
fun authorizedPersonId(authorizedPersonId: JsonField) = apply {
this.authorizedPersonId = authorizedPersonId
}
/** The person's legal name. */
fun name(name: String) = name(JsonField.of(name))
/** The person's legal name. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
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(): AuthorizedPerson =
AuthorizedPerson(
authorizedPersonId,
name,
additionalProperties.toUnmodifiable(),
)
}
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Category && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val MUNICIPALITY = Category(JsonField.of("municipality"))
fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
MUNICIPALITY,
}
enum class Value {
MUNICIPALITY,
_UNKNOWN,
}
fun value(): Value =
when (this) {
MUNICIPALITY -> Value.MUNICIPALITY
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
MUNICIPALITY -> Known.MUNICIPALITY
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
/** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
@JsonDeserialize(builder = Joint.Builder::class)
@NoAutoDetect
class Joint
private constructor(
private val individuals: JsonField>,
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The two individuals that share control of the entity. */
fun individuals(): List = individuals.getRequired("individuals")
/** The entity's name. */
fun name(): String = name.getRequired("name")
/** The two individuals that share control of the entity. */
@JsonProperty("individuals") @ExcludeMissing fun _individuals() = individuals
/** The entity's name. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Joint = apply {
if (!validated) {
individuals().forEach { it.validate() }
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Joint &&
this.individuals == other.individuals &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
individuals,
name,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Joint{individuals=$individuals, name=$name, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var individuals: JsonField> = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(joint: Joint) = apply {
this.individuals = joint.individuals
this.name = joint.name
additionalProperties(joint.additionalProperties)
}
/** The two individuals that share control of the entity. */
fun individuals(individuals: List) = individuals(JsonField.of(individuals))
/** The two individuals that share control of the entity. */
@JsonProperty("individuals")
@ExcludeMissing
fun individuals(individuals: JsonField>) = apply {
this.individuals = individuals
}
/** The entity's name. */
fun name(name: String) = name(JsonField.of(name))
/** The entity's name. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
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(): Joint =
Joint(
individuals.map { it.toUnmodifiable() },
name,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Individual.Builder::class)
@NoAutoDetect
class Individual
private constructor(
private val address: JsonField,
private val dateOfBirth: JsonField,
private val identification: JsonField,
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The person's address. */
fun address(): Address = address.getRequired("address")
/** The person's date of birth in YYYY-MM-DD format. */
fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth")
/** A means of verifying the person's identity. */
fun identification(): Identification = identification.getRequired("identification")
/** The person's legal name. */
fun name(): String = name.getRequired("name")
/** The person's address. */
@JsonProperty("address") @ExcludeMissing fun _address() = address
/** The person's date of birth in YYYY-MM-DD format. */
@JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth
/** A means of verifying the person's identity. */
@JsonProperty("identification") @ExcludeMissing fun _identification() = identification
/** The person's legal name. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Individual = apply {
if (!validated) {
address().validate()
dateOfBirth()
identification().validate()
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Individual &&
this.address == other.address &&
this.dateOfBirth == other.dateOfBirth &&
this.identification == other.identification &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
address,
dateOfBirth,
identification,
name,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var address: JsonField = JsonMissing.of()
private var dateOfBirth: JsonField = JsonMissing.of()
private var identification: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(individual: Individual) = apply {
this.address = individual.address
this.dateOfBirth = individual.dateOfBirth
this.identification = individual.identification
this.name = individual.name
additionalProperties(individual.additionalProperties)
}
/** The person's address. */
fun address(address: Address) = address(JsonField.of(address))
/** The person's address. */
@JsonProperty("address")
@ExcludeMissing
fun address(address: JsonField) = apply { this.address = address }
/** The person's date of birth in YYYY-MM-DD format. */
fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth))
/** The person's date of birth in YYYY-MM-DD format. */
@JsonProperty("date_of_birth")
@ExcludeMissing
fun dateOfBirth(dateOfBirth: JsonField) = apply {
this.dateOfBirth = dateOfBirth
}
/** A means of verifying the person's identity. */
fun identification(identification: Identification) =
identification(JsonField.of(identification))
/** A means of verifying the person's identity. */
@JsonProperty("identification")
@ExcludeMissing
fun identification(identification: JsonField) = apply {
this.identification = identification
}
/** The person's legal name. */
fun name(name: String) = name(JsonField.of(name))
/** The person's legal name. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField