com.tryfinch.api.models.AccountUpdateEvent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of finch-java-core Show documentation
Show all versions of finch-java-core Show documentation
The Finch HRIS API provides a unified way to connect to a multitide of HRIS
systems. The API requires an access token issued by Finch.
By default, Organization and Payroll requests use Finch's
[Data Syncs](/developer-resources/Data-Syncs). If a request is made before the
initial sync has completed, Finch will request data live from the provider. The
latency on live requests may range from seconds to minutes depending on the
provider and batch size. For automated integrations, Deductions requests (both
read and write) are always made live to the provider. Latencies may range from
seconds to minutes depending on the provider and batch size.
Employer products are specified by the product parameter, a space-separated list
of products that your application requests from an employer authenticating
through Finch Connect. Valid product names are—
- `company`: Read basic company data
- `directory`: Read company directory and organization structure
- `individual`: Read individual data, excluding income and employment data
- `employment`: Read individual employment and income data
- `payment`: Read payroll and contractor related payments by the company
- `pay_statement`: Read detailed pay statements for each individual
- `benefits`: Create and manage deductions and contributions and enrollment for
an employer
[![Open in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)
// File generated from our OpenAPI spec by Stainless.
package com.tryfinch.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.tryfinch.api.core.Enum
import com.tryfinch.api.core.ExcludeMissing
import com.tryfinch.api.core.JsonField
import com.tryfinch.api.core.JsonMissing
import com.tryfinch.api.core.JsonValue
import com.tryfinch.api.core.NoAutoDetect
import com.tryfinch.api.core.toUnmodifiable
import com.tryfinch.api.errors.FinchInvalidDataException
import java.util.Objects
import java.util.Optional
@JsonDeserialize(builder = AccountUpdateEvent.Builder::class)
@NoAutoDetect
class AccountUpdateEvent
private constructor(
private val connectionId: JsonField,
private val companyId: JsonField,
private val accountId: JsonField,
private val eventType: JsonField,
private val data: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Unique Finch ID of the connection associated with the webhook event. */
fun connectionId(): Optional =
Optional.ofNullable(connectionId.getNullable("connection_id"))
/**
* [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use
* `connection_id` instead to identify the connection associated with this event.
*/
fun companyId(): String = companyId.getRequired("company_id")
/**
* [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use
* `connection_id` instead to identify the connection associated with this event.
*/
fun accountId(): String = accountId.getRequired("account_id")
fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type"))
fun data(): Optional = Optional.ofNullable(data.getNullable("data"))
fun toBaseWebhookEvent(): BaseWebhookEvent =
BaseWebhookEvent.builder()
.connectionId(connectionId)
.companyId(companyId)
.accountId(accountId)
.build()
/** Unique Finch ID of the connection associated with the webhook event. */
@JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId
/**
* [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use
* `connection_id` instead to identify the connection associated with this event.
*/
@JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId
/**
* [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use
* `connection_id` instead to identify the connection associated with this event.
*/
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
@JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType
@JsonProperty("data") @ExcludeMissing fun _data() = data
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AccountUpdateEvent = apply {
if (!validated) {
connectionId()
companyId()
accountId()
eventType()
data().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AccountUpdateEvent &&
this.connectionId == other.connectionId &&
this.companyId == other.companyId &&
this.accountId == other.accountId &&
this.eventType == other.eventType &&
this.data == other.data &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
connectionId,
companyId,
accountId,
eventType,
data,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AccountUpdateEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var connectionId: JsonField = JsonMissing.of()
private var companyId: JsonField = JsonMissing.of()
private var accountId: JsonField = JsonMissing.of()
private var eventType: JsonField = JsonMissing.of()
private var data: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(accountUpdateEvent: AccountUpdateEvent) = apply {
this.connectionId = accountUpdateEvent.connectionId
this.companyId = accountUpdateEvent.companyId
this.accountId = accountUpdateEvent.accountId
this.eventType = accountUpdateEvent.eventType
this.data = accountUpdateEvent.data
additionalProperties(accountUpdateEvent.additionalProperties)
}
/** Unique Finch ID of the connection associated with the webhook event. */
fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId))
/** Unique Finch ID of the connection associated with the webhook event. */
@JsonProperty("connection_id")
@ExcludeMissing
fun connectionId(connectionId: JsonField) = apply {
this.connectionId = connectionId
}
/**
* [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use
* `connection_id` instead to identify the connection associated with this event.
*/
fun companyId(companyId: String) = companyId(JsonField.of(companyId))
/**
* [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use
* `connection_id` instead to identify the connection associated with this event.
*/
@JsonProperty("company_id")
@ExcludeMissing
fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
/**
* [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use
* `connection_id` instead to identify the connection associated with this event.
*/
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/**
* [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use
* `connection_id` instead to identify the connection associated with this event.
*/
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
fun eventType(eventType: EventType) = eventType(JsonField.of(eventType))
@JsonProperty("event_type")
@ExcludeMissing
fun eventType(eventType: JsonField) = apply { this.eventType = eventType }
fun data(data: Data) = data(JsonField.of(data))
@JsonProperty("data")
@ExcludeMissing
fun data(data: JsonField) = apply { this.data = data }
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(): AccountUpdateEvent =
AccountUpdateEvent(
connectionId,
companyId,
accountId,
eventType,
data,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Data.Builder::class)
@NoAutoDetect
class Data
private constructor(
private val status: JsonField,
private val authenticationMethod: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun status(): ConnectionStatusType = status.getRequired("status")
fun authenticationMethod(): AuthenticationMethod =
authenticationMethod.getRequired("authentication_method")
@JsonProperty("status") @ExcludeMissing fun _status() = status
@JsonProperty("authentication_method")
@ExcludeMissing
fun _authenticationMethod() = authenticationMethod
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Data = apply {
if (!validated) {
status()
authenticationMethod().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Data &&
this.status == other.status &&
this.authenticationMethod == other.authenticationMethod &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
status,
authenticationMethod,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Data{status=$status, authenticationMethod=$authenticationMethod, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var status: JsonField = JsonMissing.of()
private var authenticationMethod: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(data: Data) = apply {
this.status = data.status
this.authenticationMethod = data.authenticationMethod
additionalProperties(data.additionalProperties)
}
fun status(status: ConnectionStatusType) = status(JsonField.of(status))
@JsonProperty("status")
@ExcludeMissing
fun status(status: JsonField) = apply { this.status = status }
fun authenticationMethod(authenticationMethod: AuthenticationMethod) =
authenticationMethod(JsonField.of(authenticationMethod))
@JsonProperty("authentication_method")
@ExcludeMissing
fun authenticationMethod(authenticationMethod: JsonField) =
apply {
this.authenticationMethod = authenticationMethod
}
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(): Data =
Data(
status,
authenticationMethod,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = AuthenticationMethod.Builder::class)
@NoAutoDetect
class AuthenticationMethod
private constructor(
private val type: JsonField,
private val benefitsSupport: JsonField,
private val supportedFields: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The type of authentication method. */
fun type(): Optional = Optional.ofNullable(type.getNullable("type"))
/**
* Each benefit type and their supported features. If the benefit type is not supported,
* the property will be null
*/
fun benefitsSupport(): Optional =
Optional.ofNullable(benefitsSupport.getNullable("benefits_support"))
/** The supported data fields returned by our HR and payroll endpoints */
fun supportedFields(): Optional =
Optional.ofNullable(supportedFields.getNullable("supported_fields"))
/** The type of authentication method. */
@JsonProperty("type") @ExcludeMissing fun _type() = type
/**
* Each benefit type and their supported features. If the benefit type is not supported,
* the property will be null
*/
@JsonProperty("benefits_support")
@ExcludeMissing
fun _benefitsSupport() = benefitsSupport
/** The supported data fields returned by our HR and payroll endpoints */
@JsonProperty("supported_fields")
@ExcludeMissing
fun _supportedFields() = supportedFields
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AuthenticationMethod = apply {
if (!validated) {
type()
benefitsSupport().map { it.validate() }
supportedFields().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AuthenticationMethod &&
this.type == other.type &&
this.benefitsSupport == other.benefitsSupport &&
this.supportedFields == other.supportedFields &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
type,
benefitsSupport,
supportedFields,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AuthenticationMethod{type=$type, benefitsSupport=$benefitsSupport, supportedFields=$supportedFields, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var type: JsonField = JsonMissing.of()
private var benefitsSupport: JsonField = JsonMissing.of()
private var supportedFields: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(authenticationMethod: AuthenticationMethod) = apply {
this.type = authenticationMethod.type
this.benefitsSupport = authenticationMethod.benefitsSupport
this.supportedFields = authenticationMethod.supportedFields
additionalProperties(authenticationMethod.additionalProperties)
}
/** The type of authentication method. */
fun type(type: Type) = type(JsonField.of(type))
/** The type of authentication method. */
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
/**
* Each benefit type and their supported features. If the benefit type is not
* supported, the property will be null
*/
fun benefitsSupport(benefitsSupport: BenefitsSupport) =
benefitsSupport(JsonField.of(benefitsSupport))
/**
* Each benefit type and their supported features. If the benefit type is not
* supported, the property will be null
*/
@JsonProperty("benefits_support")
@ExcludeMissing
fun benefitsSupport(benefitsSupport: JsonField) = apply {
this.benefitsSupport = benefitsSupport
}
/** The supported data fields returned by our HR and payroll endpoints */
fun supportedFields(supportedFields: SupportedFields) =
supportedFields(JsonField.of(supportedFields))
/** The supported data fields returned by our HR and payroll endpoints */
@JsonProperty("supported_fields")
@ExcludeMissing
fun supportedFields(supportedFields: JsonField) = apply {
this.supportedFields = supportedFields
}
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(): AuthenticationMethod =
AuthenticationMethod(
type,
benefitsSupport,
supportedFields,
additionalProperties.toUnmodifiable(),
)
}
/** The supported data fields returned by our HR and payroll endpoints */
@JsonDeserialize(builder = SupportedFields.Builder::class)
@NoAutoDetect
class SupportedFields
private constructor(
private val company: JsonField,
private val directory: JsonField,
private val individual: JsonField,
private val employment: JsonField,
private val payment: JsonField,
private val payStatement: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun company(): Optional =
Optional.ofNullable(company.getNullable("company"))
fun directory(): Optional =
Optional.ofNullable(directory.getNullable("directory"))
fun individual(): Optional =
Optional.ofNullable(individual.getNullable("individual"))
fun employment(): Optional =
Optional.ofNullable(employment.getNullable("employment"))
fun payment(): Optional =
Optional.ofNullable(payment.getNullable("payment"))
fun payStatement(): Optional =
Optional.ofNullable(payStatement.getNullable("pay_statement"))
@JsonProperty("company") @ExcludeMissing fun _company() = company
@JsonProperty("directory") @ExcludeMissing fun _directory() = directory
@JsonProperty("individual") @ExcludeMissing fun _individual() = individual
@JsonProperty("employment") @ExcludeMissing fun _employment() = employment
@JsonProperty("payment") @ExcludeMissing fun _payment() = payment
@JsonProperty("pay_statement") @ExcludeMissing fun _payStatement() = payStatement
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): SupportedFields = apply {
if (!validated) {
company().map { it.validate() }
directory().map { it.validate() }
individual().map { it.validate() }
employment().map { it.validate() }
payment().map { it.validate() }
payStatement().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is SupportedFields &&
this.company == other.company &&
this.directory == other.directory &&
this.individual == other.individual &&
this.employment == other.employment &&
this.payment == other.payment &&
this.payStatement == other.payStatement &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
company,
directory,
individual,
employment,
payment,
payStatement,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"SupportedFields{company=$company, directory=$directory, individual=$individual, employment=$employment, payment=$payment, payStatement=$payStatement, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var company: JsonField = JsonMissing.of()
private var directory: JsonField = JsonMissing.of()
private var individual: JsonField = JsonMissing.of()
private var employment: JsonField = JsonMissing.of()
private var payment: JsonField = JsonMissing.of()
private var payStatement: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(supportedFields: SupportedFields) = apply {
this.company = supportedFields.company
this.directory = supportedFields.directory
this.individual = supportedFields.individual
this.employment = supportedFields.employment
this.payment = supportedFields.payment
this.payStatement = supportedFields.payStatement
additionalProperties(supportedFields.additionalProperties)
}
fun company(company: SupportedCompanyFields) = company(JsonField.of(company))
@JsonProperty("company")
@ExcludeMissing
fun company(company: JsonField) = apply {
this.company = company
}
fun directory(directory: SupportedDirectoryFields) =
directory(JsonField.of(directory))
@JsonProperty("directory")
@ExcludeMissing
fun directory(directory: JsonField) = apply {
this.directory = directory
}
fun individual(individual: SupportedIndividualFields) =
individual(JsonField.of(individual))
@JsonProperty("individual")
@ExcludeMissing
fun individual(individual: JsonField) = apply {
this.individual = individual
}
fun employment(employment: SupportedEmploymentFields) =
employment(JsonField.of(employment))
@JsonProperty("employment")
@ExcludeMissing
fun employment(employment: JsonField) = apply {
this.employment = employment
}
fun payment(payment: SupportedPaymentFields) = payment(JsonField.of(payment))
@JsonProperty("payment")
@ExcludeMissing
fun payment(payment: JsonField) = apply {
this.payment = payment
}
fun payStatement(payStatement: SupportedPayStatementFields) =
payStatement(JsonField.of(payStatement))
@JsonProperty("pay_statement")
@ExcludeMissing
fun payStatement(payStatement: JsonField) = apply {
this.payStatement = payStatement
}
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(): SupportedFields =
SupportedFields(
company,
directory,
individual,
employment,
payment,
payStatement,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = SupportedCompanyFields.Builder::class)
@NoAutoDetect
class SupportedCompanyFields
private constructor(
private val id: JsonField,
private val legalName: JsonField,
private val entity: JsonField,
private val primaryEmail: JsonField,
private val primaryPhoneNumber: JsonField,
private val ein: JsonField,
private val accounts: JsonField,
private val departments: JsonField,
private val locations: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun id(): Optional = Optional.ofNullable(id.getNullable("id"))
fun legalName(): Optional =
Optional.ofNullable(legalName.getNullable("legal_name"))
fun entity(): Optional =
Optional.ofNullable(entity.getNullable("entity"))
fun primaryEmail(): Optional =
Optional.ofNullable(primaryEmail.getNullable("primary_email"))
fun primaryPhoneNumber(): Optional =
Optional.ofNullable(primaryPhoneNumber.getNullable("primary_phone_number"))
fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein"))
fun accounts(): Optional =
Optional.ofNullable(accounts.getNullable("accounts"))
fun departments(): Optional =
Optional.ofNullable(departments.getNullable("departments"))
fun locations(): Optional =
Optional.ofNullable(locations.getNullable("locations"))
@JsonProperty("id") @ExcludeMissing fun _id() = id
@JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName
@JsonProperty("entity") @ExcludeMissing fun _entity() = entity
@JsonProperty("primary_email")
@ExcludeMissing
fun _primaryEmail() = primaryEmail
@JsonProperty("primary_phone_number")
@ExcludeMissing
fun _primaryPhoneNumber() = primaryPhoneNumber
@JsonProperty("ein") @ExcludeMissing fun _ein() = ein
@JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts
@JsonProperty("departments") @ExcludeMissing fun _departments() = departments
@JsonProperty("locations") @ExcludeMissing fun _locations() = locations
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): SupportedCompanyFields = apply {
if (!validated) {
id()
legalName()
entity().map { it.validate() }
primaryEmail()
primaryPhoneNumber()
ein()
accounts().map { it.validate() }
departments().map { it.validate() }
locations().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is SupportedCompanyFields &&
this.id == other.id &&
this.legalName == other.legalName &&
this.entity == other.entity &&
this.primaryEmail == other.primaryEmail &&
this.primaryPhoneNumber == other.primaryPhoneNumber &&
this.ein == other.ein &&
this.accounts == other.accounts &&
this.departments == other.departments &&
this.locations == other.locations &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
id,
legalName,
entity,
primaryEmail,
primaryPhoneNumber,
ein,
accounts,
departments,
locations,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"SupportedCompanyFields{id=$id, legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, ein=$ein, accounts=$accounts, departments=$departments, locations=$locations, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var id: JsonField = JsonMissing.of()
private var legalName: JsonField = JsonMissing.of()
private var entity: JsonField = JsonMissing.of()
private var primaryEmail: JsonField = JsonMissing.of()
private var primaryPhoneNumber: JsonField = JsonMissing.of()
private var ein: JsonField = JsonMissing.of()
private var accounts: JsonField = JsonMissing.of()
private var departments: JsonField = JsonMissing.of()
private var locations: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(supportedCompanyFields: SupportedCompanyFields) = apply {
this.id = supportedCompanyFields.id
this.legalName = supportedCompanyFields.legalName
this.entity = supportedCompanyFields.entity
this.primaryEmail = supportedCompanyFields.primaryEmail
this.primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber
this.ein = supportedCompanyFields.ein
this.accounts = supportedCompanyFields.accounts
this.departments = supportedCompanyFields.departments
this.locations = supportedCompanyFields.locations
additionalProperties(supportedCompanyFields.additionalProperties)
}
fun id(id: Boolean) = id(JsonField.of(id))
@JsonProperty("id")
@ExcludeMissing
fun id(id: JsonField) = apply { this.id = id }
fun legalName(legalName: Boolean) = legalName(JsonField.of(legalName))
@JsonProperty("legal_name")
@ExcludeMissing
fun legalName(legalName: JsonField) = apply {
this.legalName = legalName
}
fun entity(entity: Entity) = entity(JsonField.of(entity))
@JsonProperty("entity")
@ExcludeMissing
fun entity(entity: JsonField) = apply { this.entity = entity }
fun primaryEmail(primaryEmail: Boolean) =
primaryEmail(JsonField.of(primaryEmail))
@JsonProperty("primary_email")
@ExcludeMissing
fun primaryEmail(primaryEmail: JsonField) = apply {
this.primaryEmail = primaryEmail
}
fun primaryPhoneNumber(primaryPhoneNumber: Boolean) =
primaryPhoneNumber(JsonField.of(primaryPhoneNumber))
@JsonProperty("primary_phone_number")
@ExcludeMissing
fun primaryPhoneNumber(primaryPhoneNumber: JsonField) = apply {
this.primaryPhoneNumber = primaryPhoneNumber
}
fun ein(ein: Boolean) = ein(JsonField.of(ein))
@JsonProperty("ein")
@ExcludeMissing
fun ein(ein: JsonField) = apply { this.ein = ein }
fun accounts(accounts: Accounts) = accounts(JsonField.of(accounts))
@JsonProperty("accounts")
@ExcludeMissing
fun accounts(accounts: JsonField) = apply {
this.accounts = accounts
}
fun departments(departments: Departments) =
departments(JsonField.of(departments))
@JsonProperty("departments")
@ExcludeMissing
fun departments(departments: JsonField) = apply {
this.departments = departments
}
fun locations(locations: Locations) = locations(JsonField.of(locations))
@JsonProperty("locations")
@ExcludeMissing
fun locations(locations: JsonField) = apply {
this.locations = locations
}
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(): SupportedCompanyFields =
SupportedCompanyFields(
id,
legalName,
entity,
primaryEmail,
primaryPhoneNumber,
ein,
accounts,
departments,
locations,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Accounts.Builder::class)
@NoAutoDetect
class Accounts
private constructor(
private val routingNumber: JsonField,
private val accountName: JsonField,
private val institutionName: JsonField,
private val accountType: JsonField,
private val accountNumber: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun routingNumber(): Optional =
Optional.ofNullable(routingNumber.getNullable("routing_number"))
fun accountName(): Optional =
Optional.ofNullable(accountName.getNullable("account_name"))
fun institutionName(): Optional =
Optional.ofNullable(institutionName.getNullable("institution_name"))
fun accountType(): Optional =
Optional.ofNullable(accountType.getNullable("account_type"))
fun accountNumber(): Optional =
Optional.ofNullable(accountNumber.getNullable("account_number"))
@JsonProperty("routing_number")
@ExcludeMissing
fun _routingNumber() = routingNumber
@JsonProperty("account_name")
@ExcludeMissing
fun _accountName() = accountName
@JsonProperty("institution_name")
@ExcludeMissing
fun _institutionName() = institutionName
@JsonProperty("account_type")
@ExcludeMissing
fun _accountType() = accountType
@JsonProperty("account_number")
@ExcludeMissing
fun _accountNumber() = accountNumber
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Accounts = apply {
if (!validated) {
routingNumber()
accountName()
institutionName()
accountType()
accountNumber()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Accounts &&
this.routingNumber == other.routingNumber &&
this.accountName == other.accountName &&
this.institutionName == other.institutionName &&
this.accountType == other.accountType &&
this.accountNumber == other.accountNumber &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
routingNumber,
accountName,
institutionName,
accountType,
accountNumber,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Accounts{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var routingNumber: JsonField = JsonMissing.of()
private var accountName: JsonField = JsonMissing.of()
private var institutionName: JsonField = JsonMissing.of()
private var accountType: JsonField = JsonMissing.of()
private var accountNumber: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(accounts: Accounts) = apply {
this.routingNumber = accounts.routingNumber
this.accountName = accounts.accountName
this.institutionName = accounts.institutionName
this.accountType = accounts.accountType
this.accountNumber = accounts.accountNumber
additionalProperties(accounts.additionalProperties)
}
fun routingNumber(routingNumber: Boolean) =
routingNumber(JsonField.of(routingNumber))
@JsonProperty("routing_number")
@ExcludeMissing
fun routingNumber(routingNumber: JsonField) = apply {
this.routingNumber = routingNumber
}
fun accountName(accountName: Boolean) =
accountName(JsonField.of(accountName))
@JsonProperty("account_name")
@ExcludeMissing
fun accountName(accountName: JsonField) = apply {
this.accountName = accountName
}
fun institutionName(institutionName: Boolean) =
institutionName(JsonField.of(institutionName))
@JsonProperty("institution_name")
@ExcludeMissing
fun institutionName(institutionName: JsonField) = apply {
this.institutionName = institutionName
}
fun accountType(accountType: Boolean) =
accountType(JsonField.of(accountType))
@JsonProperty("account_type")
@ExcludeMissing
fun accountType(accountType: JsonField) = apply {
this.accountType = accountType
}
fun accountNumber(accountNumber: Boolean) =
accountNumber(JsonField.of(accountNumber))
@JsonProperty("account_number")
@ExcludeMissing
fun accountNumber(accountNumber: JsonField) = apply {
this.accountNumber = accountNumber
}
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(): Accounts =
Accounts(
routingNumber,
accountName,
institutionName,
accountType,
accountNumber,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = Departments.Builder::class)
@NoAutoDetect
class Departments
private constructor(
private val name: JsonField,
private val parent: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun name(): Optional =
Optional.ofNullable(name.getNullable("name"))
fun parent(): Optional =
Optional.ofNullable(parent.getNullable("parent"))
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonProperty("parent") @ExcludeMissing fun _parent() = parent
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Departments = apply {
if (!validated) {
name()
parent().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Departments &&
this.name == other.name &&
this.parent == other.parent &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
name,
parent,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Departments{name=$name, parent=$parent, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var name: JsonField = JsonMissing.of()
private var parent: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(departments: Departments) = apply {
this.name = departments.name
this.parent = departments.parent
additionalProperties(departments.additionalProperties)
}
fun name(name: Boolean) = name(JsonField.of(name))
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
fun parent(parent: Parent) = parent(JsonField.of(parent))
@JsonProperty("parent")
@ExcludeMissing
fun parent(parent: JsonField) = apply { this.parent = parent }
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(): Departments =
Departments(
name,
parent,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Parent.Builder::class)
@NoAutoDetect
class Parent
private constructor(
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun name(): Optional =
Optional.ofNullable(name.getNullable("name"))
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map =
additionalProperties
fun validate(): Parent = apply {
if (!validated) {
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Parent &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(name, additionalProperties)
}
return hashCode
}
override fun toString() =
"Parent{name=$name, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(parent: Parent) = apply {
this.name = parent.name
additionalProperties(parent.additionalProperties)
}
fun name(name: Boolean) = name(JsonField.of(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(): Parent =
Parent(name, additionalProperties.toUnmodifiable())
}
}
}
@JsonDeserialize(builder = Entity.Builder::class)
@NoAutoDetect
class Entity
private constructor(
private val type: JsonField,
private val subtype: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun type(): Optional =
Optional.ofNullable(type.getNullable("type"))
fun subtype(): Optional =
Optional.ofNullable(subtype.getNullable("subtype"))
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Entity = apply {
if (!validated) {
type()
subtype()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Entity &&
this.type == other.type &&
this.subtype == other.subtype &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
type,
subtype,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var type: JsonField = JsonMissing.of()
private var subtype: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(entity: Entity) = apply {
this.type = entity.type
this.subtype = entity.subtype
additionalProperties(entity.additionalProperties)
}
fun type(type: Boolean) = type(JsonField.of(type))
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
fun subtype(subtype: Boolean) = subtype(JsonField.of(subtype))
@JsonProperty("subtype")
@ExcludeMissing
fun subtype(subtype: JsonField) = apply {
this.subtype = subtype
}
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(
type,
subtype,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = Locations.Builder::class)
@NoAutoDetect
class Locations
private constructor(
private val line1: JsonField,
private val line2: JsonField,
private val city: JsonField,
private val state: JsonField,
private val postalCode: JsonField,
private val country: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun line1(): Optional =
Optional.ofNullable(line1.getNullable("line1"))
fun line2(): Optional =
Optional.ofNullable(line2.getNullable("line2"))
fun city(): Optional =
Optional.ofNullable(city.getNullable("city"))
fun state(): Optional =
Optional.ofNullable(state.getNullable("state"))
fun postalCode(): Optional =
Optional.ofNullable(postalCode.getNullable("postal_code"))
fun country(): Optional =
Optional.ofNullable(country.getNullable("country"))
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
@JsonProperty("city") @ExcludeMissing fun _city() = city
@JsonProperty("state") @ExcludeMissing fun _state() = state
@JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode
@JsonProperty("country") @ExcludeMissing fun _country() = country
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Locations = apply {
if (!validated) {
line1()
line2()
city()
state()
postalCode()
country()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Locations &&
this.line1 == other.line1 &&
this.line2 == other.line2 &&
this.city == other.city &&
this.state == other.state &&
this.postalCode == other.postalCode &&
this.country == other.country &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
line1,
line2,
city,
state,
postalCode,
country,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Locations{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var city: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var postalCode: JsonField = JsonMissing.of()
private var country: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(locations: Locations) = apply {
this.line1 = locations.line1
this.line2 = locations.line2
this.city = locations.city
this.state = locations.state
this.postalCode = locations.postalCode
this.country = locations.country
additionalProperties(locations.additionalProperties)
}
fun line1(line1: Boolean) = line1(JsonField.of(line1))
@JsonProperty("line1")
@ExcludeMissing
fun line1(line1: JsonField) = apply { this.line1 = line1 }
fun line2(line2: Boolean) = line2(JsonField.of(line2))
@JsonProperty("line2")
@ExcludeMissing
fun line2(line2: JsonField) = apply { this.line2 = line2 }
fun city(city: Boolean) = city(JsonField.of(city))
@JsonProperty("city")
@ExcludeMissing
fun city(city: JsonField) = apply { this.city = city }
fun state(state: Boolean) = state(JsonField.of(state))
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
fun postalCode(postalCode: Boolean) =
postalCode(JsonField.of(postalCode))
@JsonProperty("postal_code")
@ExcludeMissing
fun postalCode(postalCode: JsonField) = apply {
this.postalCode = postalCode
}
fun country(country: Boolean) = country(JsonField.of(country))
@JsonProperty("country")
@ExcludeMissing
fun country(country: JsonField) = apply {
this.country = country
}
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(): Locations =
Locations(
line1,
line2,
city,
state,
postalCode,
country,
additionalProperties.toUnmodifiable(),
)
}
}
}
@JsonDeserialize(builder = SupportedDirectoryFields.Builder::class)
@NoAutoDetect
class SupportedDirectoryFields
private constructor(
private val paging: JsonField,
private val individuals: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun paging(): Optional =
Optional.ofNullable(paging.getNullable("paging"))
fun individuals(): Optional =
Optional.ofNullable(individuals.getNullable("individuals"))
@JsonProperty("paging") @ExcludeMissing fun _paging() = paging
@JsonProperty("individuals") @ExcludeMissing fun _individuals() = individuals
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): SupportedDirectoryFields = apply {
if (!validated) {
paging().map { it.validate() }
individuals().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is SupportedDirectoryFields &&
this.paging == other.paging &&
this.individuals == other.individuals &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
paging,
individuals,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"SupportedDirectoryFields{paging=$paging, individuals=$individuals, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var paging: JsonField = JsonMissing.of()
private var individuals: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(supportedDirectoryFields: SupportedDirectoryFields) =
apply {
this.paging = supportedDirectoryFields.paging
this.individuals = supportedDirectoryFields.individuals
additionalProperties(supportedDirectoryFields.additionalProperties)
}
fun paging(paging: Paging) = paging(JsonField.of(paging))
@JsonProperty("paging")
@ExcludeMissing
fun paging(paging: JsonField) = apply { this.paging = paging }
fun individuals(individuals: Individuals) =
individuals(JsonField.of(individuals))
@JsonProperty("individuals")
@ExcludeMissing
fun individuals(individuals: JsonField) = apply {
this.individuals = individuals
}
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(): SupportedDirectoryFields =
SupportedDirectoryFields(
paging,
individuals,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Individuals.Builder::class)
@NoAutoDetect
class Individuals
private constructor(
private val id: JsonField,
private val firstName: JsonField,
private val middleName: JsonField,
private val lastName: JsonField,
private val isActive: JsonField,
private val department: JsonField,
private val manager: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun id(): Optional = Optional.ofNullable(id.getNullable("id"))
fun firstName(): Optional =
Optional.ofNullable(firstName.getNullable("first_name"))
fun middleName(): Optional =
Optional.ofNullable(middleName.getNullable("middle_name"))
fun lastName(): Optional =
Optional.ofNullable(lastName.getNullable("last_name"))
fun isActive(): Optional =
Optional.ofNullable(isActive.getNullable("is_active"))
fun department(): Optional =
Optional.ofNullable(department.getNullable("department"))
fun manager(): Optional =
Optional.ofNullable(manager.getNullable("manager"))
@JsonProperty("id") @ExcludeMissing fun _id() = id
@JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName
@JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName
@JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName
@JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive
@JsonProperty("department") @ExcludeMissing fun _department() = department
@JsonProperty("manager") @ExcludeMissing fun _manager() = manager
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Individuals = apply {
if (!validated) {
id()
firstName()
middleName()
lastName()
isActive()
department()
manager().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Individuals &&
this.id == other.id &&
this.firstName == other.firstName &&
this.middleName == other.middleName &&
this.lastName == other.lastName &&
this.isActive == other.isActive &&
this.department == other.department &&
this.manager == other.manager &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
id,
firstName,
middleName,
lastName,
isActive,
department,
manager,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Individuals{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, isActive=$isActive, department=$department, manager=$manager, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var id: JsonField = JsonMissing.of()
private var firstName: JsonField = JsonMissing.of()
private var middleName: JsonField = JsonMissing.of()
private var lastName: JsonField = JsonMissing.of()
private var isActive: JsonField = JsonMissing.of()
private var department: JsonField = JsonMissing.of()
private var manager: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(individuals: Individuals) = apply {
this.id = individuals.id
this.firstName = individuals.firstName
this.middleName = individuals.middleName
this.lastName = individuals.lastName
this.isActive = individuals.isActive
this.department = individuals.department
this.manager = individuals.manager
additionalProperties(individuals.additionalProperties)
}
fun id(id: Boolean) = id(JsonField.of(id))
@JsonProperty("id")
@ExcludeMissing
fun id(id: JsonField) = apply { this.id = id }
fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName))
@JsonProperty("first_name")
@ExcludeMissing
fun firstName(firstName: JsonField) = apply {
this.firstName = firstName
}
fun middleName(middleName: Boolean) =
middleName(JsonField.of(middleName))
@JsonProperty("middle_name")
@ExcludeMissing
fun middleName(middleName: JsonField) = apply {
this.middleName = middleName
}
fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName))
@JsonProperty("last_name")
@ExcludeMissing
fun lastName(lastName: JsonField) = apply {
this.lastName = lastName
}
fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive))
@JsonProperty("is_active")
@ExcludeMissing
fun isActive(isActive: JsonField