From af3c693140281966f4162675c137b93bdcbf0014 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:36:59 +0000 Subject: [PATCH 1/7] refactor(client)!: switch query params objects to use `QueryParams` (#369) feat(client): add methods for removing additional properties chore(internal): remove unnecessary validation methods chore(internal): swap params body getters to use optionals chore(internal): remove unnecessary nullable annotations style(internal): minor changes to code ordering and syntax # Migration If you were accessing `_additionalProperties()` on a query params object, then previously it returned `Map>`. Now it returns a dedicated `QueryParams` object. The `QueryParams` class is better suited for mapping a key to multiple values and has similar methods to `Map`. --- .../api/client/okhttp/FinchOkHttpClient.kt | 8 +- .../client/okhttp/FinchOkHttpClientAsync.kt | 8 +- .../api/client/FinchClientAsyncImpl.kt | 6 +- .../tryfinch/api/client/FinchClientImpl.kt | 6 +- .../com/tryfinch/api/core/ClientOptions.kt | 8 +- .../com/tryfinch/api/errors/FinchError.kt | 2 + .../api/models/AccessTokenCreateParams.kt | 32 +- .../api/models/AccountCreateResponse.kt | 30 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 953 ++++++++++++------ .../api/models/AccountUpdateResponse.kt | 28 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 32 +- .../api/models/AutomatedCreateResponse.kt | 24 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 22 +- .../api/models/BenefitContribution.kt | 20 +- .../models/BenefitFeaturesAndOperations.kt | 50 +- .../tryfinch/api/models/BenefitsSupport.kt | 40 +- .../kotlin/com/tryfinch/api/models/Company.kt | 120 ++- .../com/tryfinch/api/models/CompanyBenefit.kt | 24 +- .../com/tryfinch/api/models/CompanyEvent.kt | 56 +- .../api/models/CompanyUpdateResponse.kt | 118 ++- .../api/models/ConnectSessionNewParams.kt | 79 +- .../ConnectSessionReauthenticateParams.kt | 34 +- .../api/models/ConnectionCreateResponse.kt | 32 +- .../api/models/CreateAccessTokenResponse.kt | 36 +- .../models/CreateCompanyBenefitsResponse.kt | 18 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 58 +- .../tryfinch/api/models/DisconnectResponse.kt | 18 +- .../com/tryfinch/api/models/EmploymentData.kt | 132 ++- .../api/models/EmploymentDataResponse.kt | 22 +- .../tryfinch/api/models/EmploymentEvent.kt | 58 +- .../api/models/EmploymentUpdateResponse.kt | 130 ++- .../tryfinch/api/models/EnrolledIndividual.kt | 44 +- .../api/models/HrisBenefitCreateParams.kt | 26 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 18 +- .../api/models/HrisBenefitUpdateParams.kt | 17 +- .../HrisEmploymentRetrieveManyParams.kt | 37 +- .../HrisIndividualRetrieveManyParams.kt | 56 +- .../HrisPayStatementRetrieveManyParams.kt | 46 +- .../kotlin/com/tryfinch/api/models/Income.kt | 24 +- .../com/tryfinch/api/models/Individual.kt | 82 +- .../tryfinch/api/models/IndividualBenefit.kt | 48 +- .../models/IndividualEnrolledIdsResponse.kt | 20 +- .../tryfinch/api/models/IndividualEvent.kt | 58 +- .../api/models/IndividualInDirectory.kt | 66 +- .../tryfinch/api/models/IndividualResponse.kt | 22 +- .../api/models/IndividualUpdateResponse.kt | 82 +- .../com/tryfinch/api/models/Introspection.kt | 112 +- .../api/models/JobAutomatedCreateParams.kt | 42 +- .../tryfinch/api/models/JobCompletionEvent.kt | 60 +- .../tryfinch/api/models/JobCreateResponse.kt | 24 +- .../com/tryfinch/api/models/Location.kt | 32 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 22 +- .../kotlin/com/tryfinch/api/models/Money.kt | 20 +- .../api/models/OperationSupportMatrix.kt | 24 +- .../kotlin/com/tryfinch/api/models/Paging.kt | 20 +- .../api/models/PayGroupListResponse.kt | 22 +- .../api/models/PayGroupRetrieveResponse.kt | 24 +- .../com/tryfinch/api/models/PayStatement.kt | 138 ++- .../tryfinch/api/models/PayStatementEvent.kt | 60 +- .../api/models/PayStatementResponse.kt | 22 +- .../api/models/PayStatementResponseBody.kt | 20 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 60 +- .../api/models/PaymentCreateResponse.kt | 20 +- .../com/tryfinch/api/models/PaymentEvent.kt | 60 +- .../com/tryfinch/api/models/Provider.kt | 917 +++++++++++------ .../models/RequestForwardingForwardParams.kt | 37 +- .../RequestForwardingForwardResponse.kt | 51 +- .../api/models/SandboxCompanyUpdateParams.kt | 145 ++- .../SandboxConnectionAccountCreateParams.kt | 35 +- .../SandboxConnectionAccountUpdateParams.kt | 18 +- .../models/SandboxConnectionCreateParams.kt | 34 +- .../models/SandboxDirectoryCreateParams.kt | 270 +++-- .../models/SandboxEmploymentUpdateParams.kt | 166 +-- .../models/SandboxIndividualUpdateParams.kt | 108 +- .../api/models/SandboxJobConfiguration.kt | 20 +- .../SandboxJobConfigurationUpdateParams.kt | 25 +- .../api/models/SandboxJobCreateParams.kt | 18 +- .../api/models/SandboxPaymentCreateParams.kt | 221 ++-- .../tryfinch/api/models/SessionNewResponse.kt | 20 +- .../models/SessionReauthenticateResponse.kt | 20 +- .../api/models/SupportPerBenefitType.kt | 20 +- .../tryfinch/api/models/SupportedBenefit.kt | 32 +- .../api/models/UnenrolledIndividual.kt | 44 +- .../models/UpdateCompanyBenefitResponse.kt | 18 +- .../api/models/AccessTokenCreateParamsTest.kt | 6 +- .../api/models/ConnectSessionNewParamsTest.kt | 12 +- .../ConnectSessionReauthenticateParamsTest.kt | 6 +- .../api/models/HrisBenefitCreateParamsTest.kt | 6 +- ...BenefitIndividualUnenrollManyParamsTest.kt | 2 +- .../api/models/HrisBenefitUpdateParamsTest.kt | 2 +- .../HrisIndividualRetrieveManyParamsTest.kt | 4 +- .../RequestForwardingForwardParamsTest.kt | 4 +- .../models/SandboxCompanyUpdateParamsTest.kt | 16 +- ...andboxConnectionAccountCreateParamsTest.kt | 4 +- ...andboxConnectionAccountUpdateParamsTest.kt | 2 +- .../SandboxConnectionCreateParamsTest.kt | 6 +- .../SandboxEmploymentUpdateParamsTest.kt | 36 +- .../SandboxIndividualUpdateParamsTest.kt | 24 +- .../models/SandboxPaymentCreateParamsTest.kt | 6 +- 99 files changed, 3769 insertions(+), 2218 deletions(-) diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt index 6796f03a..2aaeb055 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt @@ -128,13 +128,13 @@ class FinchOkHttpClient private constructor() { clientOptions.responseValidation(responseValidation) } - fun accessToken(accessToken: String?) = apply { clientOptions.accessToken(accessToken) } + fun accessToken(accessToken: String) = apply { clientOptions.accessToken(accessToken) } - fun clientId(clientId: String?) = apply { clientOptions.clientId(clientId) } + fun clientId(clientId: String) = apply { clientOptions.clientId(clientId) } - fun clientSecret(clientSecret: String?) = apply { clientOptions.clientSecret(clientSecret) } + fun clientSecret(clientSecret: String) = apply { clientOptions.clientSecret(clientSecret) } - fun webhookSecret(webhookSecret: String?) = apply { + fun webhookSecret(webhookSecret: String) = apply { clientOptions.webhookSecret(webhookSecret) } diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt index 469c64c2..e5f243c8 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt @@ -128,13 +128,13 @@ class FinchOkHttpClientAsync private constructor() { clientOptions.responseValidation(responseValidation) } - fun accessToken(accessToken: String?) = apply { clientOptions.accessToken(accessToken) } + fun accessToken(accessToken: String) = apply { clientOptions.accessToken(accessToken) } - fun clientId(clientId: String?) = apply { clientOptions.clientId(clientId) } + fun clientId(clientId: String) = apply { clientOptions.clientId(clientId) } - fun clientSecret(clientSecret: String?) = apply { clientOptions.clientSecret(clientSecret) } + fun clientSecret(clientSecret: String) = apply { clientOptions.clientSecret(clientSecret) } - fun webhookSecret(webhookSecret: String?) = apply { + fun webhookSecret(webhookSecret: String) = apply { clientOptions.webhookSecret(webhookSecret) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt index ecf0193b..0bfac953 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt @@ -170,9 +170,9 @@ constructor( .clock(clientOptions.clock) .baseUrl(clientOptions.baseUrl) .accessToken(accessToken) - .clientId(clientOptions.clientId) - .clientSecret(clientOptions.clientSecret) - .webhookSecret(clientOptions.webhookSecret) + .apply { clientOptions.clientId?.let(::clientId) } + .apply { clientOptions.clientSecret?.let(::clientSecret) } + .apply { clientOptions.webhookSecret?.let(::webhookSecret) } .headers(clientOptions.headers) .responseValidation(clientOptions.responseValidation) .build() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt index bb24b79b..e8cbf482 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt @@ -159,9 +159,9 @@ constructor( .clock(clientOptions.clock) .baseUrl(clientOptions.baseUrl) .accessToken(accessToken) - .clientId(clientOptions.clientId) - .clientSecret(clientOptions.clientSecret) - .webhookSecret(clientOptions.webhookSecret) + .apply { clientOptions.clientId?.let(::clientId) } + .apply { clientOptions.clientSecret?.let(::clientSecret) } + .apply { clientOptions.webhookSecret?.let(::webhookSecret) } .headers(clientOptions.headers) .responseValidation(clientOptions.responseValidation) .build() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt index 99539e08..8b56f29f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt @@ -164,13 +164,13 @@ private constructor( fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } - fun accessToken(accessToken: String?) = apply { this.accessToken = accessToken } + fun accessToken(accessToken: String) = apply { this.accessToken = accessToken } - fun clientId(clientId: String?) = apply { this.clientId = clientId } + fun clientId(clientId: String) = apply { this.clientId = clientId } - fun clientSecret(clientSecret: String?) = apply { this.clientSecret = clientSecret } + fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret } - fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret } + fun webhookSecret(webhookSecret: String) = apply { this.webhookSecret = webhookSecret } fun fromEnv() = apply { System.getenv("FINCH_CLIENT_ID")?.let { clientId(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt index 14aabb06..3897a476 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt @@ -5,6 +5,7 @@ package com.tryfinch.api.errors import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.tryfinch.api.core.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.toImmutable @@ -15,6 +16,7 @@ import java.util.Objects class FinchError private constructor( @JsonAnyGetter + @ExcludeMissing @get:JvmName("additionalProperties") val additionalProperties: Map, ) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt index 876f7a57..61e4e4cf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt @@ -59,20 +59,22 @@ constructor( @NoAutoDetect class AccessTokenCreateBody internal constructor( - private val code: String?, + private val code: String, private val clientId: String?, private val clientSecret: String?, private val redirectUri: String?, private val additionalProperties: Map, ) { - @JsonProperty("code") fun code(): String? = code + @JsonProperty("code") fun code(): String = code - @JsonProperty("client_id") fun clientId(): String? = clientId + @JsonProperty("client_id") fun clientId(): Optional = Optional.ofNullable(clientId) - @JsonProperty("client_secret") fun clientSecret(): String? = clientSecret + @JsonProperty("client_secret") + fun clientSecret(): Optional = Optional.ofNullable(clientSecret) - @JsonProperty("redirect_uri") fun redirectUri(): String? = redirectUri + @JsonProperty("redirect_uri") + fun redirectUri(): Optional = Optional.ofNullable(redirectUri) @JsonAnyGetter @ExcludeMissing @@ -95,11 +97,11 @@ constructor( @JvmSynthetic internal fun from(accessTokenCreateBody: AccessTokenCreateBody) = apply { - this.code = accessTokenCreateBody.code - this.clientId = accessTokenCreateBody.clientId - this.clientSecret = accessTokenCreateBody.clientSecret - this.redirectUri = accessTokenCreateBody.redirectUri - additionalProperties(accessTokenCreateBody.additionalProperties) + code = accessTokenCreateBody.code + clientId = accessTokenCreateBody.clientId + clientSecret = accessTokenCreateBody.clientSecret + redirectUri = accessTokenCreateBody.redirectUri + additionalProperties = accessTokenCreateBody.additionalProperties.toMutableMap() } @JsonProperty("code") fun code(code: String) = apply { this.code = code } @@ -115,18 +117,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AccessTokenCreateBody = AccessTokenCreateBody( checkNotNull(code) { "`code` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt index 0b5b001e..474d3a2b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt @@ -31,8 +31,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the new connection */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -76,6 +74,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AccountCreateResponse = apply { if (!validated) { connectionId() @@ -109,14 +109,14 @@ private constructor( @JvmSynthetic internal fun from(accountCreateResponse: AccountCreateResponse) = apply { - this.connectionId = accountCreateResponse.connectionId - this.companyId = accountCreateResponse.companyId - this.providerId = accountCreateResponse.providerId - this.accountId = accountCreateResponse.accountId - this.authenticationType = accountCreateResponse.authenticationType - this.products = accountCreateResponse.products - this.accessToken = accountCreateResponse.accessToken - additionalProperties(accountCreateResponse.additionalProperties) + connectionId = accountCreateResponse.connectionId + companyId = accountCreateResponse.companyId + providerId = accountCreateResponse.providerId + accountId = accountCreateResponse.accountId + authenticationType = accountCreateResponse.authenticationType + products = accountCreateResponse.products + accessToken = accountCreateResponse.accessToken + additionalProperties = accountCreateResponse.additionalProperties.toMutableMap() } /** The ID of the new connection */ @@ -176,18 +176,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AccountCreateResponse = AccountCreateResponse( connectionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt index 7ae91c5d..dd4b4361 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): AccountUpdateEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @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) + connectionId = accountUpdateEvent.connectionId + companyId = accountUpdateEvent.companyId + accountId = accountUpdateEvent.accountId + eventType = accountUpdateEvent.eventType + data = accountUpdateEvent.data + additionalProperties = accountUpdateEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AccountUpdateEvent = AccountUpdateEvent( connectionId, @@ -203,8 +209,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun status(): ConnectionStatusType = status.getRequired("status") fun authenticationMethod(): AuthenticationMethod = @@ -220,6 +224,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { status() @@ -243,9 +249,9 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.status = data.status - this.authenticationMethod = data.authenticationMethod - additionalProperties(data.additionalProperties) + status = data.status + authenticationMethod = data.authenticationMethod + additionalProperties = data.additionalProperties.toMutableMap() } fun status(status: ConnectionStatusType) = status(JsonField.of(status)) @@ -266,18 +272,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data( status, @@ -296,8 +308,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The type of authentication method. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -332,6 +342,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AuthenticationMethod = apply { if (!validated) { type() @@ -357,10 +369,10 @@ private constructor( @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - this.type = authenticationMethod.type - this.benefitsSupport = authenticationMethod.benefitsSupport - this.supportedFields = authenticationMethod.supportedFields - additionalProperties(authenticationMethod.additionalProperties) + type = authenticationMethod.type + benefitsSupport = authenticationMethod.benefitsSupport + supportedFields = authenticationMethod.supportedFields + additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } /** The type of authentication method. */ @@ -401,12 +413,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -414,6 +426,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AuthenticationMethod = AuthenticationMethod( type, @@ -438,8 +458,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun company(): Optional = Optional.ofNullable(company.getNullable("company")) @@ -479,6 +497,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedFields = apply { if (!validated) { company().map { it.validate() } @@ -513,14 +533,14 @@ private constructor( @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 - this.payGroup = supportedFields.payGroup - additionalProperties(supportedFields.additionalProperties) + company = supportedFields.company + directory = supportedFields.directory + individual = supportedFields.individual + employment = supportedFields.employment + payment = supportedFields.payment + payStatement = supportedFields.payStatement + payGroup = supportedFields.payGroup + additionalProperties = supportedFields.additionalProperties.toMutableMap() } fun company(company: SupportedCompanyFields) = company(JsonField.of(company)) @@ -586,12 +606,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -599,6 +619,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedFields = SupportedFields( company, @@ -628,8 +656,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun legalName(): Optional = @@ -681,6 +707,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedCompanyFields = apply { if (!validated) { id() @@ -719,16 +747,17 @@ private constructor( @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) + id = supportedCompanyFields.id + legalName = supportedCompanyFields.legalName + entity = supportedCompanyFields.entity + primaryEmail = supportedCompanyFields.primaryEmail + primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber + ein = supportedCompanyFields.ein + accounts = supportedCompanyFields.accounts + departments = supportedCompanyFields.departments + locations = supportedCompanyFields.locations + additionalProperties = + supportedCompanyFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -803,18 +832,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedCompanyFields = SupportedCompanyFields( id, @@ -842,8 +879,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun routingNumber(): Optional = Optional.ofNullable(routingNumber.getNullable("routing_number")) @@ -883,6 +918,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Accounts = apply { if (!validated) { routingNumber() @@ -913,12 +950,12 @@ private constructor( @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) + routingNumber = accounts.routingNumber + accountName = accounts.accountName + institutionName = accounts.institutionName + accountType = accounts.accountType + accountNumber = accounts.accountNumber + additionalProperties = accounts.additionalProperties.toMutableMap() } fun routingNumber(routingNumber: Boolean) = @@ -969,18 +1006,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Accounts = Accounts( routingNumber, @@ -1019,8 +1064,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1035,6 +1078,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Departments = apply { if (!validated) { name() @@ -1059,9 +1104,10 @@ private constructor( @JvmSynthetic internal fun from(departments: Departments) = apply { - this.name = departments.name - this.parent = departments.parent - additionalProperties(departments.additionalProperties) + name = departments.name + parent = departments.parent + additionalProperties = + departments.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -1079,18 +1125,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Departments = Departments( name, @@ -1107,8 +1161,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1119,6 +1171,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Parent = apply { if (!validated) { name() @@ -1141,8 +1195,9 @@ private constructor( @JvmSynthetic internal fun from(parent: Parent) = apply { - this.name = parent.name - additionalProperties(parent.additionalProperties) + name = parent.name + additionalProperties = + parent.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -1155,18 +1210,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Parent = Parent(name, additionalProperties.toImmutable()) } @@ -1216,8 +1279,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -1232,6 +1293,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Entity = apply { if (!validated) { type() @@ -1256,9 +1319,9 @@ private constructor( @JvmSynthetic internal fun from(entity: Entity) = apply { - this.type = entity.type - this.subtype = entity.subtype - additionalProperties(entity.additionalProperties) + type = entity.type + subtype = entity.subtype + additionalProperties = entity.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -1278,18 +1341,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Entity = Entity( type, @@ -1329,8 +1400,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) @@ -1365,6 +1434,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Locations = apply { if (!validated) { line1() @@ -1397,13 +1468,13 @@ private constructor( @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) + line1 = locations.line1 + line2 = locations.line2 + city = locations.city + state = locations.state + postalCode = locations.postalCode + country = locations.country + additionalProperties = locations.additionalProperties.toMutableMap() } fun line1(line1: Boolean) = line1(JsonField.of(line1)) @@ -1450,18 +1521,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Locations = Locations( line1, @@ -1519,8 +1598,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @@ -1535,6 +1612,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedDirectoryFields = apply { if (!validated) { paging().map { it.validate() } @@ -1560,9 +1639,10 @@ private constructor( @JvmSynthetic internal fun from(supportedDirectoryFields: SupportedDirectoryFields) = apply { - this.paging = supportedDirectoryFields.paging - this.individuals = supportedDirectoryFields.individuals - additionalProperties(supportedDirectoryFields.additionalProperties) + paging = supportedDirectoryFields.paging + individuals = supportedDirectoryFields.individuals + additionalProperties = + supportedDirectoryFields.additionalProperties.toMutableMap() } fun paging(paging: Paging) = paging(JsonField.of(paging)) @@ -1583,18 +1663,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedDirectoryFields = SupportedDirectoryFields( paging, @@ -1617,8 +1705,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -1657,6 +1743,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Individuals = apply { if (!validated) { id() @@ -1691,14 +1779,15 @@ private constructor( @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) + id = individuals.id + firstName = individuals.firstName + middleName = individuals.middleName + lastName = individuals.lastName + isActive = individuals.isActive + department = individuals.department + manager = individuals.manager + additionalProperties = + individuals.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -1760,18 +1849,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Individuals = Individuals( id, @@ -1793,8 +1890,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @JsonProperty("id") @ExcludeMissing fun _id() = id @@ -1804,6 +1899,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -1826,8 +1923,9 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = + manager.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -1840,18 +1938,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } @@ -1901,8 +2007,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun count(): Optional = Optional.ofNullable(count.getNullable("count")) @@ -1917,6 +2021,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Paging = apply { if (!validated) { count() @@ -1941,9 +2047,9 @@ private constructor( @JvmSynthetic internal fun from(paging: Paging) = apply { - this.count = paging.count - this.offset = paging.offset - additionalProperties(paging.additionalProperties) + count = paging.count + offset = paging.offset + additionalProperties = paging.additionalProperties.toMutableMap() } fun count(count: Boolean) = count(JsonField.of(count)) @@ -1961,18 +2067,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Paging = Paging( count, @@ -2041,8 +2155,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -2136,6 +2248,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedEmploymentFields = apply { if (!validated) { id() @@ -2191,24 +2305,25 @@ private constructor( @JvmSynthetic internal fun from(supportedEmploymentFields: SupportedEmploymentFields) = apply { - this.id = supportedEmploymentFields.id - this.firstName = supportedEmploymentFields.firstName - this.middleName = supportedEmploymentFields.middleName - this.lastName = supportedEmploymentFields.lastName - this.title = supportedEmploymentFields.title - this.startDate = supportedEmploymentFields.startDate - this.endDate = supportedEmploymentFields.endDate - this.isActive = supportedEmploymentFields.isActive - this.employmentStatus = supportedEmploymentFields.employmentStatus - this.incomeHistory = supportedEmploymentFields.incomeHistory - this.classCode = supportedEmploymentFields.classCode - this.customFields = supportedEmploymentFields.customFields - this.department = supportedEmploymentFields.department - this.employment = supportedEmploymentFields.employment - this.income = supportedEmploymentFields.income - this.location = supportedEmploymentFields.location - this.manager = supportedEmploymentFields.manager - additionalProperties(supportedEmploymentFields.additionalProperties) + id = supportedEmploymentFields.id + firstName = supportedEmploymentFields.firstName + middleName = supportedEmploymentFields.middleName + lastName = supportedEmploymentFields.lastName + title = supportedEmploymentFields.title + startDate = supportedEmploymentFields.startDate + endDate = supportedEmploymentFields.endDate + isActive = supportedEmploymentFields.isActive + employmentStatus = supportedEmploymentFields.employmentStatus + incomeHistory = supportedEmploymentFields.incomeHistory + classCode = supportedEmploymentFields.classCode + customFields = supportedEmploymentFields.customFields + department = supportedEmploymentFields.department + employment = supportedEmploymentFields.employment + income = supportedEmploymentFields.income + location = supportedEmploymentFields.location + manager = supportedEmploymentFields.manager + additionalProperties = + supportedEmploymentFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -2345,18 +2460,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedEmploymentFields = SupportedEmploymentFields( id, @@ -2388,8 +2511,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -2399,6 +2520,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -2421,8 +2544,9 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = + department.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -2434,18 +2558,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -2477,8 +2609,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -2493,6 +2623,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Employment = apply { if (!validated) { type() @@ -2517,9 +2649,10 @@ private constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = + employment.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -2539,18 +2672,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -2587,8 +2728,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) @@ -2608,6 +2747,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Income = apply { if (!validated) { amount() @@ -2634,10 +2775,10 @@ private constructor( @JvmSynthetic internal fun from(income: Income) = apply { - this.amount = income.amount - this.currency = income.currency - this.unit = income.unit - additionalProperties(income.additionalProperties) + amount = income.amount + currency = income.currency + unit = income.unit + additionalProperties = income.additionalProperties.toMutableMap() } fun amount(amount: Boolean) = amount(JsonField.of(amount)) @@ -2663,18 +2804,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Income = Income( amount, @@ -2715,8 +2864,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) @@ -2751,6 +2898,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Location = apply { if (!validated) { line1() @@ -2783,13 +2932,13 @@ private constructor( @JvmSynthetic internal fun from(location: Location) = apply { - this.line1 = location.line1 - this.line2 = location.line2 - this.city = location.city - this.state = location.state - this.postalCode = location.postalCode - this.country = location.country - additionalProperties(location.additionalProperties) + line1 = location.line1 + line2 = location.line2 + city = location.city + state = location.state + postalCode = location.postalCode + country = location.country + additionalProperties = location.additionalProperties.toMutableMap() } fun line1(line1: Boolean) = line1(JsonField.of(line1)) @@ -2836,18 +2985,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Location = Location( line1, @@ -2886,8 +3043,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @JsonProperty("id") @ExcludeMissing fun _id() = id @@ -2896,6 +3051,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -2918,8 +3075,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -2931,18 +3088,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } @@ -3002,8 +3167,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -3076,6 +3239,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedIndividualFields = apply { if (!validated) { id() @@ -3123,20 +3288,21 @@ private constructor( @JvmSynthetic internal fun from(supportedIndividualFields: SupportedIndividualFields) = apply { - this.id = supportedIndividualFields.id - this.firstName = supportedIndividualFields.firstName - this.middleName = supportedIndividualFields.middleName - this.lastName = supportedIndividualFields.lastName - this.preferredName = supportedIndividualFields.preferredName - this.dob = supportedIndividualFields.dob - this.gender = supportedIndividualFields.gender - this.ethnicity = supportedIndividualFields.ethnicity - this.ssn = supportedIndividualFields.ssn - this.encryptedSsn = supportedIndividualFields.encryptedSsn - this.emails = supportedIndividualFields.emails - this.phoneNumbers = supportedIndividualFields.phoneNumbers - this.residence = supportedIndividualFields.residence - additionalProperties(supportedIndividualFields.additionalProperties) + id = supportedIndividualFields.id + firstName = supportedIndividualFields.firstName + middleName = supportedIndividualFields.middleName + lastName = supportedIndividualFields.lastName + preferredName = supportedIndividualFields.preferredName + dob = supportedIndividualFields.dob + gender = supportedIndividualFields.gender + ethnicity = supportedIndividualFields.ethnicity + ssn = supportedIndividualFields.ssn + encryptedSsn = supportedIndividualFields.encryptedSsn + emails = supportedIndividualFields.emails + phoneNumbers = supportedIndividualFields.phoneNumbers + residence = supportedIndividualFields.residence + additionalProperties = + supportedIndividualFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -3239,18 +3405,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedIndividualFields = SupportedIndividualFields( id, @@ -3279,8 +3453,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -3295,6 +3467,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Emails = apply { if (!validated) { data() @@ -3319,9 +3493,9 @@ private constructor( @JvmSynthetic internal fun from(emails: Emails) = apply { - this.data = emails.data - this.type = emails.type - additionalProperties(emails.additionalProperties) + data = emails.data + type = emails.type + additionalProperties = emails.additionalProperties.toMutableMap() } fun data(data: Boolean) = data(JsonField.of(data)) @@ -3339,18 +3513,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Emails = Emails( data, @@ -3386,8 +3568,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -3402,6 +3582,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PhoneNumbers = apply { if (!validated) { data() @@ -3426,9 +3608,10 @@ private constructor( @JvmSynthetic internal fun from(phoneNumbers: PhoneNumbers) = apply { - this.data = phoneNumbers.data - this.type = phoneNumbers.type - additionalProperties(phoneNumbers.additionalProperties) + data = phoneNumbers.data + type = phoneNumbers.type + additionalProperties = + phoneNumbers.additionalProperties.toMutableMap() } fun data(data: Boolean) = data(JsonField.of(data)) @@ -3446,18 +3629,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumbers = PhoneNumbers( data, @@ -3497,8 +3688,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun city(): Optional = Optional.ofNullable(city.getNullable("city")) @@ -3533,6 +3722,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Residence = apply { if (!validated) { city() @@ -3565,13 +3756,13 @@ private constructor( @JvmSynthetic internal fun from(residence: Residence) = apply { - this.city = residence.city - this.country = residence.country - this.line1 = residence.line1 - this.line2 = residence.line2 - this.postalCode = residence.postalCode - this.state = residence.state - additionalProperties(residence.additionalProperties) + city = residence.city + country = residence.country + line1 = residence.line1 + line2 = residence.line2 + postalCode = residence.postalCode + state = residence.state + additionalProperties = residence.additionalProperties.toMutableMap() } fun city(city: Boolean) = city(JsonField.of(city)) @@ -3618,18 +3809,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Residence = Residence( city, @@ -3689,8 +3888,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -3717,6 +3914,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPayGroupFields = apply { if (!validated) { id() @@ -3746,11 +3945,12 @@ private constructor( @JvmSynthetic internal fun from(supportedPayGroupFields: SupportedPayGroupFields) = apply { - this.id = supportedPayGroupFields.id - this.name = supportedPayGroupFields.name - this.payFrequencies = supportedPayGroupFields.payFrequencies - this.individualIds = supportedPayGroupFields.individualIds - additionalProperties(supportedPayGroupFields.additionalProperties) + id = supportedPayGroupFields.id + name = supportedPayGroupFields.name + payFrequencies = supportedPayGroupFields.payFrequencies + individualIds = supportedPayGroupFields.individualIds + additionalProperties = + supportedPayGroupFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -3786,18 +3986,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPayGroupFields = SupportedPayGroupFields( id, @@ -3835,8 +4043,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @@ -3853,6 +4059,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPayStatementFields = apply { if (!validated) { paging().map { it.validate() } @@ -3879,9 +4087,10 @@ private constructor( internal fun from( supportedPayStatementFields: SupportedPayStatementFields ) = apply { - this.paging = supportedPayStatementFields.paging - this.payStatements = supportedPayStatementFields.payStatements - additionalProperties(supportedPayStatementFields.additionalProperties) + paging = supportedPayStatementFields.paging + payStatements = supportedPayStatementFields.payStatements + additionalProperties = + supportedPayStatementFields.additionalProperties.toMutableMap() } fun paging(paging: Paging) = paging(JsonField.of(paging)) @@ -3902,18 +4111,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPayStatementFields = SupportedPayStatementFields( paging, @@ -3931,8 +4148,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun count(): Boolean = count.getRequired("count") fun offset(): Boolean = offset.getRequired("offset") @@ -3945,6 +4160,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Paging = apply { if (!validated) { count() @@ -3969,9 +4186,9 @@ private constructor( @JvmSynthetic internal fun from(paging: Paging) = apply { - this.count = paging.count - this.offset = paging.offset - additionalProperties(paging.additionalProperties) + count = paging.count + offset = paging.offset + additionalProperties = paging.additionalProperties.toMutableMap() } fun count(count: Boolean) = count(JsonField.of(count)) @@ -3989,18 +4206,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Paging = Paging( count, @@ -4044,8 +4269,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -4112,6 +4335,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayStatements = apply { if (!validated) { individualId() @@ -4154,17 +4379,18 @@ private constructor( @JvmSynthetic internal fun from(payStatements: PayStatements) = apply { - this.individualId = payStatements.individualId - this.type = payStatements.type - this.paymentMethod = payStatements.paymentMethod - this.totalHours = payStatements.totalHours - this.grossPay = payStatements.grossPay - this.netPay = payStatements.netPay - this.earnings = payStatements.earnings - this.employeeDeductions = payStatements.employeeDeductions - this.employerContributions = payStatements.employerContributions - this.taxes = payStatements.taxes - additionalProperties(payStatements.additionalProperties) + individualId = payStatements.individualId + type = payStatements.type + paymentMethod = payStatements.paymentMethod + totalHours = payStatements.totalHours + grossPay = payStatements.grossPay + netPay = payStatements.netPay + earnings = payStatements.earnings + employeeDeductions = payStatements.employeeDeductions + employerContributions = payStatements.employerContributions + taxes = payStatements.taxes + additionalProperties = + payStatements.additionalProperties.toMutableMap() } fun individualId(individualId: Boolean) = @@ -4250,18 +4476,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatements = PayStatements( individualId, @@ -4289,8 +4523,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -4316,6 +4548,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Earnings = apply { if (!validated) { type() @@ -4344,11 +4578,12 @@ private constructor( @JvmSynthetic internal fun from(earnings: Earnings) = apply { - this.type = earnings.type - this.name = earnings.name - this.amount = earnings.amount - this.currency = earnings.currency - additionalProperties(earnings.additionalProperties) + type = earnings.type + name = earnings.name + amount = earnings.amount + currency = earnings.currency + additionalProperties = + earnings.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -4383,18 +4618,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Earnings = Earnings( type, @@ -4435,8 +4678,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -4467,6 +4708,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployeeDeductions = apply { if (!validated) { name() @@ -4497,12 +4740,13 @@ private constructor( @JvmSynthetic internal fun from(employeeDeductions: EmployeeDeductions) = apply { - this.name = employeeDeductions.name - this.amount = employeeDeductions.amount - this.type = employeeDeductions.type - this.preTax = employeeDeductions.preTax - this.currency = employeeDeductions.currency - additionalProperties(employeeDeductions.additionalProperties) + name = employeeDeductions.name + amount = employeeDeductions.amount + type = employeeDeductions.type + preTax = employeeDeductions.preTax + currency = employeeDeductions.currency + additionalProperties = + employeeDeductions.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -4545,18 +4789,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployeeDeductions = EmployeeDeductions( name, @@ -4596,8 +4848,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -4618,6 +4868,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployerContributions = apply { if (!validated) { name() @@ -4645,12 +4897,12 @@ private constructor( @JvmSynthetic internal fun from(employerContributions: EmployerContributions) = apply { - this.name = employerContributions.name - this.amount = employerContributions.amount - this.currency = employerContributions.currency - additionalProperties( + name = employerContributions.name + amount = employerContributions.amount + currency = employerContributions.currency + additionalProperties = employerContributions.additionalProperties - ) + .toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -4679,18 +4931,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployerContributions = EmployerContributions( name, @@ -4730,8 +4990,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -4762,6 +5020,8 @@ private constructor( fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Taxes = apply { if (!validated) { type() @@ -4792,12 +5052,12 @@ private constructor( @JvmSynthetic internal fun from(taxes: Taxes) = apply { - this.type = taxes.type - this.name = taxes.name - this.employer = taxes.employer - this.amount = taxes.amount - this.currency = taxes.currency - additionalProperties(taxes.additionalProperties) + type = taxes.type + name = taxes.name + employer = taxes.employer + amount = taxes.amount + currency = taxes.currency + additionalProperties = taxes.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -4840,18 +5100,26 @@ private constructor( additionalProperties: Map ) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Taxes = Taxes( type, @@ -4936,8 +5204,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun payDate(): Optional = @@ -5011,6 +5277,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPaymentFields = apply { if (!validated) { id() @@ -5055,19 +5323,20 @@ private constructor( @JvmSynthetic internal fun from(supportedPaymentFields: SupportedPaymentFields) = apply { - this.id = supportedPaymentFields.id - this.payDate = supportedPaymentFields.payDate - this.debitDate = supportedPaymentFields.debitDate - this.companyDebit = supportedPaymentFields.companyDebit - this.grossPay = supportedPaymentFields.grossPay - this.netPay = supportedPaymentFields.netPay - this.employerTaxes = supportedPaymentFields.employerTaxes - this.employeeTaxes = supportedPaymentFields.employeeTaxes - this.individualIds = supportedPaymentFields.individualIds - this.payPeriod = supportedPaymentFields.payPeriod - this.payGroupIds = supportedPaymentFields.payGroupIds - this.payFrequencies = supportedPaymentFields.payFrequencies - additionalProperties(supportedPaymentFields.additionalProperties) + id = supportedPaymentFields.id + payDate = supportedPaymentFields.payDate + debitDate = supportedPaymentFields.debitDate + companyDebit = supportedPaymentFields.companyDebit + grossPay = supportedPaymentFields.grossPay + netPay = supportedPaymentFields.netPay + employerTaxes = supportedPaymentFields.employerTaxes + employeeTaxes = supportedPaymentFields.employeeTaxes + individualIds = supportedPaymentFields.individualIds + payPeriod = supportedPaymentFields.payPeriod + payGroupIds = supportedPaymentFields.payGroupIds + payFrequencies = supportedPaymentFields.payFrequencies + additionalProperties = + supportedPaymentFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -5169,18 +5438,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPaymentFields = SupportedPaymentFields( id, @@ -5208,8 +5485,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) @@ -5224,6 +5499,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayPeriod = apply { if (!validated) { startDate() @@ -5248,9 +5525,9 @@ private constructor( @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - this.startDate = payPeriod.startDate - this.endDate = payPeriod.endDate - additionalProperties(payPeriod.additionalProperties) + startDate = payPeriod.startDate + endDate = payPeriod.endDate + additionalProperties = payPeriod.additionalProperties.toMutableMap() } fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) @@ -5272,18 +5549,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayPeriod = PayPeriod( startDate, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt index f3003216..df37633a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt @@ -31,8 +31,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the new connection */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -73,6 +71,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AccountUpdateResponse = apply { if (!validated) { connectionId() @@ -104,13 +104,13 @@ private constructor( @JvmSynthetic internal fun from(accountUpdateResponse: AccountUpdateResponse) = apply { - this.connectionId = accountUpdateResponse.connectionId - this.accountId = accountUpdateResponse.accountId - this.authenticationType = accountUpdateResponse.authenticationType - this.companyId = accountUpdateResponse.companyId - this.providerId = accountUpdateResponse.providerId - this.products = accountUpdateResponse.products - additionalProperties(accountUpdateResponse.additionalProperties) + connectionId = accountUpdateResponse.connectionId + accountId = accountUpdateResponse.accountId + authenticationType = accountUpdateResponse.authenticationType + companyId = accountUpdateResponse.companyId + providerId = accountUpdateResponse.providerId + products = accountUpdateResponse.products + additionalProperties = accountUpdateResponse.additionalProperties.toMutableMap() } /** The ID of the new connection */ @@ -164,18 +164,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AccountUpdateResponse = AccountUpdateResponse( connectionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt index 384f7e45..577f2be2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt @@ -34,8 +34,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The id of the job that has been created. */ fun jobId(): String = jobId.getRequired("job_id") @@ -101,6 +99,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AutomatedAsyncJob = apply { if (!validated) { jobId() @@ -136,15 +136,15 @@ private constructor( @JvmSynthetic internal fun from(automatedAsyncJob: AutomatedAsyncJob) = apply { - this.jobId = automatedAsyncJob.jobId - this.jobUrl = automatedAsyncJob.jobUrl - this.type = automatedAsyncJob.type - this.status = automatedAsyncJob.status - this.createdAt = automatedAsyncJob.createdAt - this.scheduledAt = automatedAsyncJob.scheduledAt - this.startedAt = automatedAsyncJob.startedAt - this.completedAt = automatedAsyncJob.completedAt - additionalProperties(automatedAsyncJob.additionalProperties) + jobId = automatedAsyncJob.jobId + jobUrl = automatedAsyncJob.jobUrl + type = automatedAsyncJob.type + status = automatedAsyncJob.status + createdAt = automatedAsyncJob.createdAt + scheduledAt = automatedAsyncJob.scheduledAt + startedAt = automatedAsyncJob.startedAt + completedAt = automatedAsyncJob.completedAt + additionalProperties = automatedAsyncJob.additionalProperties.toMutableMap() } /** The id of the job that has been created. */ @@ -231,18 +231,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AutomatedAsyncJob = AutomatedAsyncJob( jobId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt index e4409676..8f32dd2c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The id of the job that has been created. */ fun jobId(): String = jobId.getRequired("job_id") @@ -57,6 +55,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AutomatedCreateResponse = apply { if (!validated) { jobId() @@ -84,11 +84,11 @@ private constructor( @JvmSynthetic internal fun from(automatedCreateResponse: AutomatedCreateResponse) = apply { - this.jobId = automatedCreateResponse.jobId - this.jobUrl = automatedCreateResponse.jobUrl - this.allowedRefreshes = automatedCreateResponse.allowedRefreshes - this.remainingRefreshes = automatedCreateResponse.remainingRefreshes - additionalProperties(automatedCreateResponse.additionalProperties) + jobId = automatedCreateResponse.jobId + jobUrl = automatedCreateResponse.jobUrl + allowedRefreshes = automatedCreateResponse.allowedRefreshes + remainingRefreshes = automatedCreateResponse.remainingRefreshes + additionalProperties = automatedCreateResponse.additionalProperties.toMutableMap() } /** The id of the job that has been created. */ @@ -131,18 +131,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AutomatedCreateResponse = AutomatedCreateResponse( jobId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt index 58eb9c67..3f274c79 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -62,6 +60,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): BaseWebhookEvent = apply { if (!validated) { connectionId() @@ -87,10 +87,10 @@ private constructor( @JvmSynthetic internal fun from(baseWebhookEvent: BaseWebhookEvent) = apply { - this.connectionId = baseWebhookEvent.connectionId - this.companyId = baseWebhookEvent.companyId - this.accountId = baseWebhookEvent.accountId - additionalProperties(baseWebhookEvent.additionalProperties) + connectionId = baseWebhookEvent.connectionId + companyId = baseWebhookEvent.companyId + accountId = baseWebhookEvent.accountId + additionalProperties = baseWebhookEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -133,18 +133,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): BaseWebhookEvent = BaseWebhookEvent( connectionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt index 7bdc455e..0d8a3e62 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt @@ -27,8 +27,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Contribution type. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -45,6 +43,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): BenefitContribution = apply { if (!validated) { type() @@ -68,9 +68,9 @@ private constructor( @JvmSynthetic internal fun from(benefitContribution: BenefitContribution) = apply { - this.type = benefitContribution.type - this.amount = benefitContribution.amount - additionalProperties(benefitContribution.additionalProperties) + type = benefitContribution.type + amount = benefitContribution.amount + additionalProperties = benefitContribution.additionalProperties.toMutableMap() } /** Contribution type. */ @@ -91,18 +91,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): BenefitContribution = BenefitContribution( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt index 7a05587b..4639972c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt @@ -27,8 +27,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun supportedFeatures(): Optional = Optional.ofNullable(supportedFeatures.getNullable("supported_features")) @@ -45,6 +43,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): BenefitFeaturesAndOperations = apply { if (!validated) { supportedFeatures().map { it.validate() } @@ -68,9 +68,9 @@ private constructor( @JvmSynthetic internal fun from(benefitFeaturesAndOperations: BenefitFeaturesAndOperations) = apply { - this.supportedFeatures = benefitFeaturesAndOperations.supportedFeatures - this.supportedOperations = benefitFeaturesAndOperations.supportedOperations - additionalProperties(benefitFeaturesAndOperations.additionalProperties) + supportedFeatures = benefitFeaturesAndOperations.supportedFeatures + supportedOperations = benefitFeaturesAndOperations.supportedOperations + additionalProperties = benefitFeaturesAndOperations.additionalProperties.toMutableMap() } fun supportedFeatures(supportedFeatures: BenefitFeature) = @@ -93,18 +93,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): BenefitFeaturesAndOperations = BenefitFeaturesAndOperations( supportedFeatures, @@ -127,8 +133,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun description(): Optional = Optional.ofNullable(description.getNullable("description")) @@ -201,6 +205,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): BenefitFeature = apply { if (!validated) { description() @@ -236,14 +242,14 @@ private constructor( @JvmSynthetic internal fun from(benefitFeature: BenefitFeature) = apply { - this.description = benefitFeature.description - this.frequencies = benefitFeature.frequencies - this.employeeDeduction = benefitFeature.employeeDeduction - this.companyContribution = benefitFeature.companyContribution - this.annualMaximum = benefitFeature.annualMaximum - this.catchUp = benefitFeature.catchUp - this.hsaContributionLimit = benefitFeature.hsaContributionLimit - additionalProperties(benefitFeature.additionalProperties) + description = benefitFeature.description + frequencies = benefitFeature.frequencies + employeeDeduction = benefitFeature.employeeDeduction + companyContribution = benefitFeature.companyContribution + annualMaximum = benefitFeature.annualMaximum + catchUp = benefitFeature.catchUp + hsaContributionLimit = benefitFeature.hsaContributionLimit + additionalProperties = benefitFeature.additionalProperties.toMutableMap() } fun description(description: String) = description(JsonField.of(description)) @@ -338,18 +344,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): BenefitFeature = BenefitFeature( description, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt index 2645c5d0..0722c301 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt @@ -38,8 +38,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun s125Medical(): Optional = Optional.ofNullable(s125Medical.getNullable("s125_medical")) @@ -104,6 +102,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): BenefitsSupport = apply { if (!validated) { s125Medical().map { it.validate() } @@ -147,19 +147,19 @@ private constructor( @JvmSynthetic internal fun from(benefitsSupport: BenefitsSupport) = apply { - this.s125Medical = benefitsSupport.s125Medical - this.s125Dental = benefitsSupport.s125Dental - this.s125Vision = benefitsSupport.s125Vision - this.hsaPre = benefitsSupport.hsaPre - this.hsaPost = benefitsSupport.hsaPost - this.fsaMedical = benefitsSupport.fsaMedical - this.fsaDependentCare = benefitsSupport.fsaDependentCare - this.simpleIra = benefitsSupport.simpleIra - this.simple = benefitsSupport.simple - this.commuter = benefitsSupport.commuter - this.customPostTax = benefitsSupport.customPostTax - this.customPreTax = benefitsSupport.customPreTax - additionalProperties(benefitsSupport.additionalProperties) + s125Medical = benefitsSupport.s125Medical + s125Dental = benefitsSupport.s125Dental + s125Vision = benefitsSupport.s125Vision + hsaPre = benefitsSupport.hsaPre + hsaPost = benefitsSupport.hsaPost + fsaMedical = benefitsSupport.fsaMedical + fsaDependentCare = benefitsSupport.fsaDependentCare + simpleIra = benefitsSupport.simpleIra + simple = benefitsSupport.simple + commuter = benefitsSupport.commuter + customPostTax = benefitsSupport.customPostTax + customPreTax = benefitsSupport.customPreTax + additionalProperties = benefitsSupport.additionalProperties.toMutableMap() } fun s125Medical(s125Medical: BenefitFeaturesAndOperations) = @@ -263,18 +263,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): BenefitsSupport = BenefitsSupport( s125Medical, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt index 03b210ac..f2e9ed53 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt @@ -34,8 +34,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for the company. */ fun id(): String = id.getRequired("id") @@ -98,6 +96,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Company = apply { if (!validated) { id() @@ -135,16 +135,16 @@ private constructor( @JvmSynthetic internal fun from(company: Company) = apply { - this.id = company.id - this.legalName = company.legalName - this.entity = company.entity - this.primaryEmail = company.primaryEmail - this.primaryPhoneNumber = company.primaryPhoneNumber - this.departments = company.departments - this.ein = company.ein - this.locations = company.locations - this.accounts = company.accounts - additionalProperties(company.additionalProperties) + id = company.id + legalName = company.legalName + entity = company.entity + primaryEmail = company.primaryEmail + primaryPhoneNumber = company.primaryPhoneNumber + departments = company.departments + ein = company.ein + locations = company.locations + accounts = company.accounts + additionalProperties = company.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for the company. */ @@ -224,18 +224,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Company = Company( id, @@ -263,8 +269,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * A nine-digit code that's based on the U.S. Bank location where your account was opened. */ @@ -308,6 +312,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Account = apply { if (!validated) { routingNumber() @@ -337,12 +343,12 @@ private constructor( @JvmSynthetic internal fun from(account: Account) = apply { - this.routingNumber = account.routingNumber - this.accountName = account.accountName - this.institutionName = account.institutionName - this.accountType = account.accountType - this.accountNumber = account.accountNumber - additionalProperties(account.additionalProperties) + routingNumber = account.routingNumber + accountName = account.accountName + institutionName = account.institutionName + accountType = account.accountType + accountNumber = account.accountNumber + additionalProperties = account.additionalProperties.toMutableMap() } /** @@ -404,18 +410,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Account = Account( routingNumber, @@ -511,8 +523,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The department name. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -529,6 +539,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -552,9 +564,9 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - this.parent = department.parent - additionalProperties(department.additionalProperties) + name = department.name + parent = department.parent + additionalProperties = department.additionalProperties.toMutableMap() } /** The department name. */ @@ -575,18 +587,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department( name, @@ -604,8 +622,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The parent department's name. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -616,6 +632,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Parent = apply { if (!validated) { name() @@ -637,8 +655,8 @@ private constructor( @JvmSynthetic internal fun from(parent: Parent) = apply { - this.name = parent.name - additionalProperties(parent.additionalProperties) + name = parent.name + additionalProperties = parent.additionalProperties.toMutableMap() } /** The parent department's name. */ @@ -651,12 +669,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -664,6 +682,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Parent = Parent(name, additionalProperties.toImmutable()) } @@ -713,8 +739,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The tax payer type of the company. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -731,6 +755,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Entity = apply { if (!validated) { type() @@ -754,9 +780,9 @@ private constructor( @JvmSynthetic internal fun from(entity: Entity) = apply { - this.type = entity.type - this.subtype = entity.subtype - additionalProperties(entity.additionalProperties) + type = entity.type + subtype = entity.subtype + additionalProperties = entity.additionalProperties.toMutableMap() } /** The tax payer type of the company. */ @@ -777,18 +803,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Entity = Entity( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt index 3986bf3b..1017debf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt @@ -26,8 +26,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun benefitId(): String = benefitId.getRequired("benefit_id") /** Type of benefit. */ @@ -52,6 +50,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CompanyBenefit = apply { if (!validated) { benefitId() @@ -79,11 +79,11 @@ private constructor( @JvmSynthetic internal fun from(companyBenefit: CompanyBenefit) = apply { - this.benefitId = companyBenefit.benefitId - this.type = companyBenefit.type - this.description = companyBenefit.description - this.frequency = companyBenefit.frequency - additionalProperties(companyBenefit.additionalProperties) + benefitId = companyBenefit.benefitId + type = companyBenefit.type + description = companyBenefit.description + frequency = companyBenefit.frequency + additionalProperties = companyBenefit.additionalProperties.toMutableMap() } fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) @@ -114,18 +114,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CompanyBenefit = CompanyBenefit( benefitId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt index 513dfd54..c2581d50 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): CompanyEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(companyEvent: CompanyEvent) = apply { - this.connectionId = companyEvent.connectionId - this.companyId = companyEvent.companyId - this.accountId = companyEvent.accountId - this.eventType = companyEvent.eventType - this.data = companyEvent.data - additionalProperties(companyEvent.additionalProperties) + connectionId = companyEvent.connectionId + companyId = companyEvent.companyId + accountId = companyEvent.accountId + eventType = companyEvent.eventType + data = companyEvent.data + additionalProperties = companyEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CompanyEvent = CompanyEvent( connectionId, @@ -201,12 +207,12 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { validated = true @@ -226,23 +232,29 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - additionalProperties(data.additionalProperties) + additionalProperties = data.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data(additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt index 0883a88f..d4e40ab2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt @@ -33,8 +33,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The legal name of the company. */ fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) @@ -91,6 +89,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CompanyUpdateResponse = apply { if (!validated) { legalName() @@ -126,15 +126,15 @@ private constructor( @JvmSynthetic internal fun from(companyUpdateResponse: CompanyUpdateResponse) = apply { - this.legalName = companyUpdateResponse.legalName - this.entity = companyUpdateResponse.entity - this.primaryEmail = companyUpdateResponse.primaryEmail - this.primaryPhoneNumber = companyUpdateResponse.primaryPhoneNumber - this.departments = companyUpdateResponse.departments - this.ein = companyUpdateResponse.ein - this.locations = companyUpdateResponse.locations - this.accounts = companyUpdateResponse.accounts - additionalProperties(companyUpdateResponse.additionalProperties) + legalName = companyUpdateResponse.legalName + entity = companyUpdateResponse.entity + primaryEmail = companyUpdateResponse.primaryEmail + primaryPhoneNumber = companyUpdateResponse.primaryPhoneNumber + departments = companyUpdateResponse.departments + ein = companyUpdateResponse.ein + locations = companyUpdateResponse.locations + accounts = companyUpdateResponse.accounts + additionalProperties = companyUpdateResponse.additionalProperties.toMutableMap() } /** The legal name of the company. */ @@ -208,18 +208,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CompanyUpdateResponse = CompanyUpdateResponse( legalName, @@ -246,8 +252,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * A nine-digit code that's based on the U.S. Bank location where your account was opened. */ @@ -291,6 +295,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Account = apply { if (!validated) { routingNumber() @@ -320,12 +326,12 @@ private constructor( @JvmSynthetic internal fun from(account: Account) = apply { - this.routingNumber = account.routingNumber - this.accountName = account.accountName - this.institutionName = account.institutionName - this.accountType = account.accountType - this.accountNumber = account.accountNumber - additionalProperties(account.additionalProperties) + routingNumber = account.routingNumber + accountName = account.accountName + institutionName = account.institutionName + accountType = account.accountType + accountNumber = account.accountNumber + additionalProperties = account.additionalProperties.toMutableMap() } /** @@ -387,18 +393,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Account = Account( routingNumber, @@ -494,8 +506,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The department name. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -512,6 +522,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -535,9 +547,9 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - this.parent = department.parent - additionalProperties(department.additionalProperties) + name = department.name + parent = department.parent + additionalProperties = department.additionalProperties.toMutableMap() } /** The department name. */ @@ -558,18 +570,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department( name, @@ -587,8 +605,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The parent department's name. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -599,6 +615,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Parent = apply { if (!validated) { name() @@ -620,8 +638,8 @@ private constructor( @JvmSynthetic internal fun from(parent: Parent) = apply { - this.name = parent.name - additionalProperties(parent.additionalProperties) + name = parent.name + additionalProperties = parent.additionalProperties.toMutableMap() } /** The parent department's name. */ @@ -634,12 +652,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -647,6 +665,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Parent = Parent(name, additionalProperties.toImmutable()) } @@ -696,8 +722,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The tax payer type of the company. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -714,6 +738,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Entity = apply { if (!validated) { type() @@ -737,9 +763,9 @@ private constructor( @JvmSynthetic internal fun from(entity: Entity) = apply { - this.type = entity.type - this.subtype = entity.subtype - additionalProperties(entity.additionalProperties) + type = entity.type + subtype = entity.subtype + additionalProperties = entity.additionalProperties.toMutableMap() } /** The tax payer type of the company. */ @@ -760,18 +786,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Entity = Entity( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index 7b723f01..8d0473ed 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt @@ -83,9 +83,9 @@ constructor( @NoAutoDetect class ConnectSessionNewBody internal constructor( - private val customerId: String?, - private val customerName: String?, - private val products: List?, + private val customerId: String, + private val customerName: String, + private val products: List, private val customerEmail: String?, private val integration: Integration?, private val manual: Boolean?, @@ -95,26 +95,30 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("customer_id") fun customerId(): String? = customerId + @JsonProperty("customer_id") fun customerId(): String = customerId - @JsonProperty("customer_name") fun customerName(): String? = customerName + @JsonProperty("customer_name") fun customerName(): String = customerName - @JsonProperty("products") fun products(): List? = products + @JsonProperty("products") fun products(): List = products - @JsonProperty("customer_email") fun customerEmail(): String? = customerEmail + @JsonProperty("customer_email") + fun customerEmail(): Optional = Optional.ofNullable(customerEmail) - @JsonProperty("integration") fun integration(): Integration? = integration + @JsonProperty("integration") + fun integration(): Optional = Optional.ofNullable(integration) - @JsonProperty("manual") fun manual(): Boolean? = manual + @JsonProperty("manual") fun manual(): Optional = Optional.ofNullable(manual) /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ - @JsonProperty("minutes_to_expire") fun minutesToExpire(): Double? = minutesToExpire + @JsonProperty("minutes_to_expire") + fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire) - @JsonProperty("redirect_uri") fun redirectUri(): String? = redirectUri + @JsonProperty("redirect_uri") + fun redirectUri(): Optional = Optional.ofNullable(redirectUri) - @JsonProperty("sandbox") fun sandbox(): Sandbox? = sandbox + @JsonProperty("sandbox") fun sandbox(): Optional = Optional.ofNullable(sandbox) @JsonAnyGetter @ExcludeMissing @@ -142,16 +146,16 @@ constructor( @JvmSynthetic internal fun from(connectSessionNewBody: ConnectSessionNewBody) = apply { - this.customerId = connectSessionNewBody.customerId - this.customerName = connectSessionNewBody.customerName - this.products = connectSessionNewBody.products - this.customerEmail = connectSessionNewBody.customerEmail - this.integration = connectSessionNewBody.integration - this.manual = connectSessionNewBody.manual - this.minutesToExpire = connectSessionNewBody.minutesToExpire - this.redirectUri = connectSessionNewBody.redirectUri - this.sandbox = connectSessionNewBody.sandbox - additionalProperties(connectSessionNewBody.additionalProperties) + customerId = connectSessionNewBody.customerId + customerName = connectSessionNewBody.customerName + products = connectSessionNewBody.products.toMutableList() + customerEmail = connectSessionNewBody.customerEmail + integration = connectSessionNewBody.integration + manual = connectSessionNewBody.manual + minutesToExpire = connectSessionNewBody.minutesToExpire + redirectUri = connectSessionNewBody.redirectUri + sandbox = connectSessionNewBody.sandbox + additionalProperties = connectSessionNewBody.additionalProperties.toMutableMap() } @JsonProperty("customer_id") @@ -188,18 +192,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ConnectSessionNewBody = ConnectSessionNewBody( checkNotNull(customerId) { "`customerId` is required but was not set" }, @@ -541,9 +551,10 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("provider") fun provider(): String? = provider + @JsonProperty("provider") fun provider(): Optional = Optional.ofNullable(provider) - @JsonProperty("auth_method") fun authMethod(): AuthMethod? = authMethod + @JsonProperty("auth_method") + fun authMethod(): Optional = Optional.ofNullable(authMethod) @JsonAnyGetter @ExcludeMissing @@ -564,9 +575,9 @@ constructor( @JvmSynthetic internal fun from(integration: Integration) = apply { - this.provider = integration.provider - this.authMethod = integration.authMethod - additionalProperties(integration.additionalProperties) + provider = integration.provider + authMethod = integration.authMethod + additionalProperties = integration.additionalProperties.toMutableMap() } @JsonProperty("provider") @@ -577,18 +588,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Integration = Integration( provider, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index 60a3ba1a..c1fec0f0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt @@ -63,7 +63,7 @@ constructor( @NoAutoDetect class ConnectSessionReauthenticateBody internal constructor( - private val connectionId: String?, + private val connectionId: String, private val minutesToExpire: Long?, private val products: List?, private val redirectUri: String?, @@ -71,18 +71,21 @@ constructor( ) { /** The ID of the existing connection to reauthenticate */ - @JsonProperty("connection_id") fun connectionId(): String? = connectionId + @JsonProperty("connection_id") fun connectionId(): String = connectionId /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ - @JsonProperty("minutes_to_expire") fun minutesToExpire(): Long? = minutesToExpire + @JsonProperty("minutes_to_expire") + fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire) /** The products to request access to (optional for reauthentication) */ - @JsonProperty("products") fun products(): List? = products + @JsonProperty("products") + fun products(): Optional> = Optional.ofNullable(products) /** The URI to redirect to after the Connect flow is completed */ - @JsonProperty("redirect_uri") fun redirectUri(): String? = redirectUri + @JsonProperty("redirect_uri") + fun redirectUri(): Optional = Optional.ofNullable(redirectUri) @JsonAnyGetter @ExcludeMissing @@ -106,11 +109,12 @@ constructor( @JvmSynthetic internal fun from(connectSessionReauthenticateBody: ConnectSessionReauthenticateBody) = apply { - this.connectionId = connectSessionReauthenticateBody.connectionId - this.minutesToExpire = connectSessionReauthenticateBody.minutesToExpire - this.products = connectSessionReauthenticateBody.products - this.redirectUri = connectSessionReauthenticateBody.redirectUri - additionalProperties(connectSessionReauthenticateBody.additionalProperties) + connectionId = connectSessionReauthenticateBody.connectionId + minutesToExpire = connectSessionReauthenticateBody.minutesToExpire + products = connectSessionReauthenticateBody.products?.toMutableList() + redirectUri = connectSessionReauthenticateBody.redirectUri + additionalProperties = + connectSessionReauthenticateBody.additionalProperties.toMutableMap() } /** The ID of the existing connection to reauthenticate */ @@ -136,18 +140,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ConnectSessionReauthenticateBody = ConnectSessionReauthenticateBody( checkNotNull(connectionId) { "`connectionId` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt index 0cf71949..8523e49d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt @@ -33,8 +33,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the new connection */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -82,6 +80,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): ConnectionCreateResponse = apply { if (!validated) { connectionId() @@ -117,15 +117,15 @@ private constructor( @JvmSynthetic internal fun from(connectionCreateResponse: ConnectionCreateResponse) = apply { - this.connectionId = connectionCreateResponse.connectionId - this.companyId = connectionCreateResponse.companyId - this.providerId = connectionCreateResponse.providerId - this.accountId = connectionCreateResponse.accountId - this.authenticationType = connectionCreateResponse.authenticationType - this.products = connectionCreateResponse.products - this.accessToken = connectionCreateResponse.accessToken - this.tokenType = connectionCreateResponse.tokenType - additionalProperties(connectionCreateResponse.additionalProperties) + connectionId = connectionCreateResponse.connectionId + companyId = connectionCreateResponse.companyId + providerId = connectionCreateResponse.providerId + accountId = connectionCreateResponse.accountId + authenticationType = connectionCreateResponse.authenticationType + products = connectionCreateResponse.products + accessToken = connectionCreateResponse.accessToken + tokenType = connectionCreateResponse.tokenType + additionalProperties = connectionCreateResponse.additionalProperties.toMutableMap() } /** The ID of the new connection */ @@ -191,18 +191,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ConnectionCreateResponse = ConnectionCreateResponse( connectionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt index e9d348c3..5cdea3b8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt @@ -35,8 +35,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The access token for the connection. */ fun accessToken(): String = accessToken.getRequired("access_token") @@ -115,6 +113,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CreateAccessTokenResponse = apply { if (!validated) { accessToken() @@ -154,17 +154,17 @@ private constructor( @JvmSynthetic internal fun from(createAccessTokenResponse: CreateAccessTokenResponse) = apply { - this.accessToken = createAccessTokenResponse.accessToken - this.tokenType = createAccessTokenResponse.tokenType - this.connectionId = createAccessTokenResponse.connectionId - this.customerId = createAccessTokenResponse.customerId - this.accountId = createAccessTokenResponse.accountId - this.clientType = createAccessTokenResponse.clientType - this.companyId = createAccessTokenResponse.companyId - this.connectionType = createAccessTokenResponse.connectionType - this.products = createAccessTokenResponse.products - this.providerId = createAccessTokenResponse.providerId - additionalProperties(createAccessTokenResponse.additionalProperties) + accessToken = createAccessTokenResponse.accessToken + tokenType = createAccessTokenResponse.tokenType + connectionId = createAccessTokenResponse.connectionId + customerId = createAccessTokenResponse.customerId + accountId = createAccessTokenResponse.accountId + clientType = createAccessTokenResponse.clientType + companyId = createAccessTokenResponse.companyId + connectionType = createAccessTokenResponse.connectionType + products = createAccessTokenResponse.products + providerId = createAccessTokenResponse.providerId + additionalProperties = createAccessTokenResponse.additionalProperties.toMutableMap() } /** The access token for the connection. */ @@ -276,18 +276,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CreateAccessTokenResponse = CreateAccessTokenResponse( accessToken, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt index 9358a950..ab8ff4cf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt @@ -22,8 +22,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun benefitId(): String = benefitId.getRequired("benefit_id") @JsonProperty("benefit_id") @ExcludeMissing fun _benefitId() = benefitId @@ -32,6 +30,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CreateCompanyBenefitsResponse = apply { if (!validated) { benefitId() @@ -53,8 +53,8 @@ private constructor( @JvmSynthetic internal fun from(createCompanyBenefitsResponse: CreateCompanyBenefitsResponse) = apply { - this.benefitId = createCompanyBenefitsResponse.benefitId - additionalProperties(createCompanyBenefitsResponse.additionalProperties) + benefitId = createCompanyBenefitsResponse.benefitId + additionalProperties = createCompanyBenefitsResponse.additionalProperties.toMutableMap() } fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) @@ -65,18 +65,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CreateCompanyBenefitsResponse = CreateCompanyBenefitsResponse(benefitId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt index 910a494f..49f98097 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): DirectoryEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(directoryEvent: DirectoryEvent) = apply { - this.connectionId = directoryEvent.connectionId - this.companyId = directoryEvent.companyId - this.accountId = directoryEvent.accountId - this.eventType = directoryEvent.eventType - this.data = directoryEvent.data - additionalProperties(directoryEvent.additionalProperties) + connectionId = directoryEvent.connectionId + companyId = directoryEvent.companyId + accountId = directoryEvent.accountId + eventType = directoryEvent.eventType + data = directoryEvent.data + additionalProperties = directoryEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): DirectoryEvent = DirectoryEvent( connectionId, @@ -202,8 +208,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the individual related to the event. */ fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -215,6 +219,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { individualId() @@ -236,8 +242,8 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.individualId = data.individualId - additionalProperties(data.additionalProperties) + individualId = data.individualId + additionalProperties = data.additionalProperties.toMutableMap() } /** The ID of the individual related to the event. */ @@ -252,18 +258,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data(individualId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt index 7485b444..96cf72de 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt @@ -22,8 +22,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** If the request is successful, Finch will return “success” (HTTP 200 status). */ fun status(): String = status.getRequired("status") @@ -34,6 +32,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): DisconnectResponse = apply { if (!validated) { status() @@ -55,8 +55,8 @@ private constructor( @JvmSynthetic internal fun from(disconnectResponse: DisconnectResponse) = apply { - this.status = disconnectResponse.status - additionalProperties(disconnectResponse.additionalProperties) + status = disconnectResponse.status + additionalProperties = disconnectResponse.additionalProperties.toMutableMap() } /** If the request is successful, Finch will return “success” (HTTP 200 status). */ @@ -69,18 +69,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): DisconnectResponse = DisconnectResponse(status, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index 13b45119..04077abe 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt @@ -45,8 +45,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** string A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -189,6 +187,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmploymentData = apply { if (!validated) { id() @@ -248,27 +248,27 @@ private constructor( @JvmSynthetic internal fun from(employmentData: EmploymentData) = apply { - this.id = employmentData.id - this.firstName = employmentData.firstName - this.middleName = employmentData.middleName - this.lastName = employmentData.lastName - this.title = employmentData.title - this.manager = employmentData.manager - this.department = employmentData.department - this.employment = employmentData.employment - this.startDate = employmentData.startDate - this.endDate = employmentData.endDate - this.latestRehireDate = employmentData.latestRehireDate - this.isActive = employmentData.isActive - this.employmentStatus = employmentData.employmentStatus - this.classCode = employmentData.classCode - this.location = employmentData.location - this.income = employmentData.income - this.incomeHistory = employmentData.incomeHistory - this.customFields = employmentData.customFields - this.sourceId = employmentData.sourceId - this.workId = employmentData.workId - additionalProperties(employmentData.additionalProperties) + id = employmentData.id + firstName = employmentData.firstName + middleName = employmentData.middleName + lastName = employmentData.lastName + title = employmentData.title + manager = employmentData.manager + department = employmentData.department + employment = employmentData.employment + startDate = employmentData.startDate + endDate = employmentData.endDate + latestRehireDate = employmentData.latestRehireDate + isActive = employmentData.isActive + employmentStatus = employmentData.employmentStatus + classCode = employmentData.classCode + location = employmentData.location + income = employmentData.income + incomeHistory = employmentData.incomeHistory + customFields = employmentData.customFields + sourceId = employmentData.sourceId + workId = employmentData.workId + additionalProperties = employmentData.additionalProperties.toMutableMap() } /** string A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -453,18 +453,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmploymentData = EmploymentData( id, @@ -500,8 +506,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -512,6 +516,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CustomField = apply { if (!validated) { name() @@ -534,9 +540,9 @@ private constructor( @JvmSynthetic internal fun from(customField: CustomField) = apply { - this.name = customField.name - this.value = customField.value - additionalProperties(customField.additionalProperties) + name = customField.name + value = customField.value + additionalProperties = customField.additionalProperties.toMutableMap() } fun name(name: String) = name(JsonField.of(name)) @@ -551,18 +557,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CustomField = CustomField( name, @@ -598,8 +610,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The name of the department associated with the individual. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -610,6 +620,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -631,8 +643,8 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } /** The name of the department associated with the individual. */ @@ -645,18 +657,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -688,8 +706,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The main employment type of the individual. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -712,6 +728,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Employment = apply { if (!validated) { type() @@ -735,9 +753,9 @@ private constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = employment.additionalProperties.toMutableMap() } /** The main employment type of the individual. */ @@ -764,18 +782,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -1036,8 +1060,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1048,6 +1070,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -1069,8 +1093,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1083,18 +1107,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt index 9b7bbd53..17785823 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -44,6 +42,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmploymentDataResponse = apply { if (!validated) { individualId() @@ -69,10 +69,10 @@ private constructor( @JvmSynthetic internal fun from(employmentDataResponse: EmploymentDataResponse) = apply { - this.individualId = employmentDataResponse.individualId - this.code = employmentDataResponse.code - this.body = employmentDataResponse.body - additionalProperties(employmentDataResponse.additionalProperties) + individualId = employmentDataResponse.individualId + code = employmentDataResponse.code + body = employmentDataResponse.body + additionalProperties = employmentDataResponse.additionalProperties.toMutableMap() } fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -97,18 +97,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmploymentDataResponse = EmploymentDataResponse( individualId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt index b81081b9..79a8bed2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): EmploymentEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(employmentEvent: EmploymentEvent) = apply { - this.connectionId = employmentEvent.connectionId - this.companyId = employmentEvent.companyId - this.accountId = employmentEvent.accountId - this.eventType = employmentEvent.eventType - this.data = employmentEvent.data - additionalProperties(employmentEvent.additionalProperties) + connectionId = employmentEvent.connectionId + companyId = employmentEvent.companyId + accountId = employmentEvent.accountId + eventType = employmentEvent.eventType + data = employmentEvent.data + additionalProperties = employmentEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmploymentEvent = EmploymentEvent( connectionId, @@ -202,8 +208,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the individual related to the event. */ fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -215,6 +219,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { individualId() @@ -236,8 +242,8 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.individualId = data.individualId - additionalProperties(data.additionalProperties) + individualId = data.individualId + additionalProperties = data.additionalProperties.toMutableMap() } /** The ID of the individual related to the event. */ @@ -252,18 +258,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data(individualId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 35be88e0..51041e59 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt @@ -44,8 +44,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The legal first name of the individual. */ fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) @@ -176,6 +174,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmploymentUpdateResponse = apply { if (!validated) { firstName() @@ -233,26 +233,26 @@ private constructor( @JvmSynthetic internal fun from(employmentUpdateResponse: EmploymentUpdateResponse) = apply { - this.firstName = employmentUpdateResponse.firstName - this.middleName = employmentUpdateResponse.middleName - this.lastName = employmentUpdateResponse.lastName - this.title = employmentUpdateResponse.title - this.manager = employmentUpdateResponse.manager - this.department = employmentUpdateResponse.department - this.employment = employmentUpdateResponse.employment - this.startDate = employmentUpdateResponse.startDate - this.endDate = employmentUpdateResponse.endDate - this.latestRehireDate = employmentUpdateResponse.latestRehireDate - this.isActive = employmentUpdateResponse.isActive - this.employmentStatus = employmentUpdateResponse.employmentStatus - this.classCode = employmentUpdateResponse.classCode - this.location = employmentUpdateResponse.location - this.income = employmentUpdateResponse.income - this.incomeHistory = employmentUpdateResponse.incomeHistory - this.customFields = employmentUpdateResponse.customFields - this.sourceId = employmentUpdateResponse.sourceId - this.id = employmentUpdateResponse.id - additionalProperties(employmentUpdateResponse.additionalProperties) + firstName = employmentUpdateResponse.firstName + middleName = employmentUpdateResponse.middleName + lastName = employmentUpdateResponse.lastName + title = employmentUpdateResponse.title + manager = employmentUpdateResponse.manager + department = employmentUpdateResponse.department + employment = employmentUpdateResponse.employment + startDate = employmentUpdateResponse.startDate + endDate = employmentUpdateResponse.endDate + latestRehireDate = employmentUpdateResponse.latestRehireDate + isActive = employmentUpdateResponse.isActive + employmentStatus = employmentUpdateResponse.employmentStatus + classCode = employmentUpdateResponse.classCode + location = employmentUpdateResponse.location + income = employmentUpdateResponse.income + incomeHistory = employmentUpdateResponse.incomeHistory + customFields = employmentUpdateResponse.customFields + sourceId = employmentUpdateResponse.sourceId + id = employmentUpdateResponse.id + additionalProperties = employmentUpdateResponse.additionalProperties.toMutableMap() } /** The legal first name of the individual. */ @@ -423,18 +423,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmploymentUpdateResponse = EmploymentUpdateResponse( firstName, @@ -469,8 +475,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -481,6 +485,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): CustomField = apply { if (!validated) { name() @@ -503,9 +509,9 @@ private constructor( @JvmSynthetic internal fun from(customField: CustomField) = apply { - this.name = customField.name - this.value = customField.value - additionalProperties(customField.additionalProperties) + name = customField.name + value = customField.value + additionalProperties = customField.additionalProperties.toMutableMap() } fun name(name: String) = name(JsonField.of(name)) @@ -520,18 +526,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CustomField = CustomField( name, @@ -567,8 +579,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The name of the department associated with the individual. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -579,6 +589,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -600,8 +612,8 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } /** The name of the department associated with the individual. */ @@ -614,18 +626,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -657,8 +675,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The main employment type of the individual. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -681,6 +697,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Employment = apply { if (!validated) { type() @@ -704,9 +722,9 @@ private constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = employment.additionalProperties.toMutableMap() } /** The main employment type of the individual. */ @@ -733,18 +751,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -1005,8 +1029,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1017,6 +1039,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -1038,8 +1062,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1052,18 +1076,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt index 9b8a7819..8d9c562b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt @@ -28,8 +28,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -49,6 +47,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EnrolledIndividual = apply { if (!validated) { individualId() @@ -74,10 +74,10 @@ private constructor( @JvmSynthetic internal fun from(enrolledIndividual: EnrolledIndividual) = apply { - this.individualId = enrolledIndividual.individualId - this.code = enrolledIndividual.code - this.body = enrolledIndividual.body - additionalProperties(enrolledIndividual.additionalProperties) + individualId = enrolledIndividual.individualId + code = enrolledIndividual.code + body = enrolledIndividual.body + additionalProperties = enrolledIndividual.additionalProperties.toMutableMap() } fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -104,18 +104,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EnrolledIndividual = EnrolledIndividual( individualId, @@ -135,8 +141,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Identifier indicating whether the benefit was newly enrolled or updated. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -159,6 +163,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Body = apply { if (!validated) { name() @@ -184,10 +190,10 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { - this.name = body.name - this.finchCode = body.finchCode - this.message = body.message - additionalProperties(body.additionalProperties) + name = body.name + finchCode = body.finchCode + message = body.message + additionalProperties = body.additionalProperties.toMutableMap() } /** Identifier indicating whether the benefit was newly enrolled or updated. */ @@ -216,18 +222,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Body = Body( name, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt index d8c1576e..9c940b04 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt @@ -65,12 +65,14 @@ constructor( * Name of the benefit as it appears in the provider and pay statements. Recommend limiting * this to <30 characters due to limitations in specific providers (e.g. Justworks). */ - @JsonProperty("description") fun description(): String? = description + @JsonProperty("description") + fun description(): Optional = Optional.ofNullable(description) - @JsonProperty("frequency") fun frequency(): BenefitFrequency? = frequency + @JsonProperty("frequency") + fun frequency(): Optional = Optional.ofNullable(frequency) /** Type of benefit. */ - @JsonProperty("type") fun type(): BenefitType? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -92,10 +94,10 @@ constructor( @JvmSynthetic internal fun from(hrisBenefitCreateBody: HrisBenefitCreateBody) = apply { - this.description = hrisBenefitCreateBody.description - this.frequency = hrisBenefitCreateBody.frequency - this.type = hrisBenefitCreateBody.type - additionalProperties(hrisBenefitCreateBody.additionalProperties) + description = hrisBenefitCreateBody.description + frequency = hrisBenefitCreateBody.frequency + type = hrisBenefitCreateBody.type + additionalProperties = hrisBenefitCreateBody.additionalProperties.toMutableMap() } /** @@ -114,18 +116,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisBenefitCreateBody = HrisBenefitCreateBody( description, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt index b88ad19a..59bd9ac3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt @@ -59,7 +59,8 @@ constructor( ) { /** Array of individual_ids to unenroll. */ - @JsonProperty("individual_ids") fun individualIds(): List? = individualIds + @JsonProperty("individual_ids") + fun individualIds(): Optional> = Optional.ofNullable(individualIds) @JsonAnyGetter @ExcludeMissing @@ -81,8 +82,9 @@ constructor( internal fun from( hrisBenefitIndividualUnenrollManyBody: HrisBenefitIndividualUnenrollManyBody ) = apply { - this.individualIds = hrisBenefitIndividualUnenrollManyBody.individualIds - additionalProperties(hrisBenefitIndividualUnenrollManyBody.additionalProperties) + individualIds = hrisBenefitIndividualUnenrollManyBody.individualIds?.toMutableList() + additionalProperties = + hrisBenefitIndividualUnenrollManyBody.additionalProperties.toMutableMap() } /** Array of individual_ids to unenroll. */ @@ -93,18 +95,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisBenefitIndividualUnenrollManyBody = HrisBenefitIndividualUnenrollManyBody( individualIds?.toImmutable(), diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt index 34ef135d..06bfa50e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt @@ -59,7 +59,8 @@ constructor( ) { /** Updated name or description. */ - @JsonProperty("description") fun description(): String? = description + @JsonProperty("description") + fun description(): Optional = Optional.ofNullable(description) @JsonAnyGetter @ExcludeMissing @@ -79,8 +80,8 @@ constructor( @JvmSynthetic internal fun from(hrisBenefitUpdateBody: HrisBenefitUpdateBody) = apply { - this.description = hrisBenefitUpdateBody.description - additionalProperties(hrisBenefitUpdateBody.additionalProperties) + description = hrisBenefitUpdateBody.description + additionalProperties = hrisBenefitUpdateBody.additionalProperties.toMutableMap() } /** Updated name or description. */ @@ -89,18 +90,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisBenefitUpdateBody = HrisBenefitUpdateBody(description, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt index 191b1fd6..637188a9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt @@ -44,12 +44,12 @@ constructor( @NoAutoDetect class HrisEmploymentRetrieveManyBody internal constructor( - private val requests: List?, + private val requests: List, private val additionalProperties: Map, ) { /** The array of batch requests. */ - @JsonProperty("requests") fun requests(): List? = requests + @JsonProperty("requests") fun requests(): List = requests @JsonAnyGetter @ExcludeMissing @@ -70,8 +70,9 @@ constructor( @JvmSynthetic internal fun from(hrisEmploymentRetrieveManyBody: HrisEmploymentRetrieveManyBody) = apply { - this.requests = hrisEmploymentRetrieveManyBody.requests - additionalProperties(hrisEmploymentRetrieveManyBody.additionalProperties) + requests = hrisEmploymentRetrieveManyBody.requests.toMutableList() + additionalProperties = + hrisEmploymentRetrieveManyBody.additionalProperties.toMutableMap() } /** The array of batch requests. */ @@ -80,18 +81,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisEmploymentRetrieveManyBody = HrisEmploymentRetrieveManyBody( checkNotNull(requests) { "`requests` is required but was not set" } @@ -286,7 +293,7 @@ constructor( @NoAutoDetect class Request private constructor( - private val individualId: String?, + private val individualId: String, private val additionalProperties: Map, ) { @@ -295,7 +302,7 @@ constructor( * number of `individual_id` to send per request. It is preferantial to send all ids in a * single request for Finch to optimize provider rate-limits. */ - @JsonProperty("individual_id") fun individualId(): String? = individualId + @JsonProperty("individual_id") fun individualId(): String = individualId @JsonAnyGetter @ExcludeMissing @@ -315,8 +322,8 @@ constructor( @JvmSynthetic internal fun from(request: Request) = apply { - this.individualId = request.individualId - additionalProperties(request.additionalProperties) + individualId = request.individualId + additionalProperties = request.additionalProperties.toMutableMap() } /** @@ -329,18 +336,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Request = Request( checkNotNull(individualId) { "`individualId` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt index 1d9659f6..17fc7b29 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt @@ -56,9 +56,10 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("options") fun options(): Options? = options + @JsonProperty("options") fun options(): Optional = Optional.ofNullable(options) - @JsonProperty("requests") fun requests(): List? = requests + @JsonProperty("requests") + fun requests(): Optional> = Optional.ofNullable(requests) @JsonAnyGetter @ExcludeMissing @@ -80,9 +81,10 @@ constructor( @JvmSynthetic internal fun from(hrisIndividualRetrieveManyBody: HrisIndividualRetrieveManyBody) = apply { - this.options = hrisIndividualRetrieveManyBody.options - this.requests = hrisIndividualRetrieveManyBody.requests - additionalProperties(hrisIndividualRetrieveManyBody.additionalProperties) + options = hrisIndividualRetrieveManyBody.options + requests = hrisIndividualRetrieveManyBody.requests?.toMutableList() + additionalProperties = + hrisIndividualRetrieveManyBody.additionalProperties.toMutableMap() } @JsonProperty("options") @@ -93,18 +95,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisIndividualRetrieveManyBody = HrisIndividualRetrieveManyBody( options, @@ -307,7 +315,8 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("include") fun include(): List? = include + @JsonProperty("include") + fun include(): Optional> = Optional.ofNullable(include) @JsonAnyGetter @ExcludeMissing @@ -327,8 +336,8 @@ constructor( @JvmSynthetic internal fun from(options: Options) = apply { - this.include = options.include - additionalProperties(options.additionalProperties) + include = options.include?.toMutableList() + additionalProperties = options.additionalProperties.toMutableMap() } @JsonProperty("include") @@ -336,18 +345,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Options = Options(include?.toImmutable(), additionalProperties.toImmutable()) } @@ -378,7 +393,8 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("individual_id") fun individualId(): String? = individualId + @JsonProperty("individual_id") + fun individualId(): Optional = Optional.ofNullable(individualId) @JsonAnyGetter @ExcludeMissing @@ -398,8 +414,8 @@ constructor( @JvmSynthetic internal fun from(request: Request) = apply { - this.individualId = request.individualId - additionalProperties(request.additionalProperties) + individualId = request.individualId + additionalProperties = request.additionalProperties.toMutableMap() } @JsonProperty("individual_id") @@ -407,18 +423,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Request = Request(individualId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt index bb509264..fd76312c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt @@ -13,6 +13,7 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import java.util.Objects +import java.util.Optional class HrisPayStatementRetrieveManyParams constructor( @@ -43,12 +44,12 @@ constructor( @NoAutoDetect class HrisPayStatementRetrieveManyBody internal constructor( - private val requests: List?, + private val requests: List, private val additionalProperties: Map, ) { /** The array of batch requests. */ - @JsonProperty("requests") fun requests(): List? = requests + @JsonProperty("requests") fun requests(): List = requests @JsonAnyGetter @ExcludeMissing @@ -69,8 +70,9 @@ constructor( @JvmSynthetic internal fun from(hrisPayStatementRetrieveManyBody: HrisPayStatementRetrieveManyBody) = apply { - this.requests = hrisPayStatementRetrieveManyBody.requests - additionalProperties(hrisPayStatementRetrieveManyBody.additionalProperties) + requests = hrisPayStatementRetrieveManyBody.requests.toMutableList() + additionalProperties = + hrisPayStatementRetrieveManyBody.additionalProperties.toMutableMap() } /** The array of batch requests. */ @@ -79,18 +81,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): HrisPayStatementRetrieveManyBody = HrisPayStatementRetrieveManyBody( checkNotNull(requests) { "`requests` is required but was not set" } @@ -285,20 +293,20 @@ constructor( @NoAutoDetect class Request private constructor( - private val paymentId: String?, + private val paymentId: String, private val limit: Long?, private val offset: Long?, private val additionalProperties: Map, ) { /** A stable Finch `id` (UUID v4) for a payment. */ - @JsonProperty("payment_id") fun paymentId(): String? = paymentId + @JsonProperty("payment_id") fun paymentId(): String = paymentId /** Number of pay statements to return (defaults to all). */ - @JsonProperty("limit") fun limit(): Long? = limit + @JsonProperty("limit") fun limit(): Optional = Optional.ofNullable(limit) /** Index to start from. */ - @JsonProperty("offset") fun offset(): Long? = offset + @JsonProperty("offset") fun offset(): Optional = Optional.ofNullable(offset) @JsonAnyGetter @ExcludeMissing @@ -320,10 +328,10 @@ constructor( @JvmSynthetic internal fun from(request: Request) = apply { - this.paymentId = request.paymentId - this.limit = request.limit - this.offset = request.offset - additionalProperties(request.additionalProperties) + paymentId = request.paymentId + limit = request.limit + offset = request.offset + additionalProperties = request.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for a payment. */ @@ -338,18 +346,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Request = Request( checkNotNull(paymentId) { "`paymentId` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt index bff3cbf8..e8e34210 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt @@ -34,8 +34,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. @@ -71,6 +69,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Income = apply { if (!validated) { unit() @@ -98,11 +98,11 @@ private constructor( @JvmSynthetic internal fun from(income: Income) = apply { - this.unit = income.unit - this.amount = income.amount - this.currency = income.currency - this.effectiveDate = income.effectiveDate - additionalProperties(income.additionalProperties) + unit = income.unit + amount = income.amount + currency = income.currency + effectiveDate = income.effectiveDate + additionalProperties = income.additionalProperties.toMutableMap() } /** @@ -147,18 +147,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Income = Income( unit, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index 13788acc..b2369be5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt @@ -38,8 +38,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -133,6 +131,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Individual = apply { if (!validated) { id() @@ -178,20 +178,20 @@ private constructor( @JvmSynthetic internal fun from(individual: Individual) = apply { - this.id = individual.id - this.firstName = individual.firstName - this.middleName = individual.middleName - this.lastName = individual.lastName - this.preferredName = individual.preferredName - this.emails = individual.emails - this.phoneNumbers = individual.phoneNumbers - this.gender = individual.gender - this.ethnicity = individual.ethnicity - this.dob = individual.dob - this.residence = individual.residence - this.ssn = individual.ssn - this.encryptedSsn = individual.encryptedSsn - additionalProperties(individual.additionalProperties) + id = individual.id + firstName = individual.firstName + middleName = individual.middleName + lastName = individual.lastName + preferredName = individual.preferredName + emails = individual.emails + phoneNumbers = individual.phoneNumbers + gender = individual.gender + ethnicity = individual.ethnicity + dob = individual.dob + residence = individual.residence + ssn = individual.ssn + encryptedSsn = individual.encryptedSsn + additionalProperties = individual.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -313,18 +313,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Individual = Individual( id, @@ -353,8 +359,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -367,6 +371,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Email = apply { if (!validated) { data() @@ -390,9 +396,9 @@ private constructor( @JvmSynthetic internal fun from(email: Email) = apply { - this.data = email.data - this.type = email.type - additionalProperties(email.additionalProperties) + data = email.data + type = email.type + additionalProperties = email.additionalProperties.toMutableMap() } fun data(data: String) = data(JsonField.of(data)) @@ -409,18 +415,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Email = Email( data, @@ -676,8 +688,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -690,6 +700,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PhoneNumber = apply { if (!validated) { data() @@ -713,9 +725,9 @@ private constructor( @JvmSynthetic internal fun from(phoneNumber: PhoneNumber) = apply { - this.data = phoneNumber.data - this.type = phoneNumber.type - additionalProperties(phoneNumber.additionalProperties) + data = phoneNumber.data + type = phoneNumber.type + additionalProperties = phoneNumber.additionalProperties.toMutableMap() } fun data(data: String) = data(JsonField.of(data)) @@ -732,18 +744,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumber = PhoneNumber( data, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt index 00e6373e..510bbc63 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt @@ -28,8 +28,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -47,6 +45,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): IndividualBenefit = apply { if (!validated) { individualId() @@ -72,10 +72,10 @@ private constructor( @JvmSynthetic internal fun from(individualBenefit: IndividualBenefit) = apply { - this.individualId = individualBenefit.individualId - this.code = individualBenefit.code - this.body = individualBenefit.body - additionalProperties(individualBenefit.additionalProperties) + individualId = individualBenefit.individualId + code = individualBenefit.code + body = individualBenefit.body + additionalProperties = individualBenefit.additionalProperties.toMutableMap() } fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -100,18 +100,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualBenefit = IndividualBenefit( individualId, @@ -133,8 +139,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun employeeDeduction(): Optional = Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) @@ -181,6 +185,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Body = apply { if (!validated) { employeeDeduction().map { it.validate() } @@ -210,12 +216,12 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { - this.employeeDeduction = body.employeeDeduction - this.companyContribution = body.companyContribution - this.annualMaximum = body.annualMaximum - this.catchUp = body.catchUp - this.hsaContributionLimit = body.hsaContributionLimit - additionalProperties(body.additionalProperties) + employeeDeduction = body.employeeDeduction + companyContribution = body.companyContribution + annualMaximum = body.annualMaximum + catchUp = body.catchUp + hsaContributionLimit = body.hsaContributionLimit + additionalProperties = body.additionalProperties.toMutableMap() } fun employeeDeduction(employeeDeduction: BenefitContribution) = @@ -274,18 +280,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Body = Body( employeeDeduction, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt index 15f09839..be83dda0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt @@ -23,8 +23,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun benefitId(): String = benefitId.getRequired("benefit_id") fun individualIds(): List = individualIds.getRequired("individual_ids") @@ -37,6 +35,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): IndividualEnrolledIdsResponse = apply { if (!validated) { benefitId() @@ -60,9 +60,9 @@ private constructor( @JvmSynthetic internal fun from(individualEnrolledIdsResponse: IndividualEnrolledIdsResponse) = apply { - this.benefitId = individualEnrolledIdsResponse.benefitId - this.individualIds = individualEnrolledIdsResponse.individualIds - additionalProperties(individualEnrolledIdsResponse.additionalProperties) + benefitId = individualEnrolledIdsResponse.benefitId + individualIds = individualEnrolledIdsResponse.individualIds + additionalProperties = individualEnrolledIdsResponse.additionalProperties.toMutableMap() } fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) @@ -81,18 +81,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualEnrolledIdsResponse = IndividualEnrolledIdsResponse( benefitId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt index f2bb419c..0d0e8282 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): IndividualEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(individualEvent: IndividualEvent) = apply { - this.connectionId = individualEvent.connectionId - this.companyId = individualEvent.companyId - this.accountId = individualEvent.accountId - this.eventType = individualEvent.eventType - this.data = individualEvent.data - additionalProperties(individualEvent.additionalProperties) + connectionId = individualEvent.connectionId + companyId = individualEvent.companyId + accountId = individualEvent.accountId + eventType = individualEvent.eventType + data = individualEvent.data + additionalProperties = individualEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualEvent = IndividualEvent( connectionId, @@ -202,8 +208,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the individual related to the event. */ fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -215,6 +219,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { individualId() @@ -236,8 +242,8 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.individualId = data.individualId - additionalProperties(data.additionalProperties) + individualId = data.individualId + additionalProperties = data.additionalProperties.toMutableMap() } /** The ID of the individual related to the event. */ @@ -252,18 +258,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data(individualId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt index ab6cf71f..e6b1146d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt @@ -29,8 +29,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch id (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -78,6 +76,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): IndividualInDirectory = apply { if (!validated) { id() @@ -111,14 +111,14 @@ private constructor( @JvmSynthetic internal fun from(individualInDirectory: IndividualInDirectory) = apply { - this.id = individualInDirectory.id - this.firstName = individualInDirectory.firstName - this.middleName = individualInDirectory.middleName - this.lastName = individualInDirectory.lastName - this.manager = individualInDirectory.manager - this.department = individualInDirectory.department - this.isActive = individualInDirectory.isActive - additionalProperties(individualInDirectory.additionalProperties) + id = individualInDirectory.id + firstName = individualInDirectory.firstName + middleName = individualInDirectory.middleName + lastName = individualInDirectory.lastName + manager = individualInDirectory.manager + department = individualInDirectory.department + isActive = individualInDirectory.isActive + additionalProperties = individualInDirectory.additionalProperties.toMutableMap() } /** A stable Finch id (UUID v4) for an individual in the company. */ @@ -177,18 +177,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualInDirectory = IndividualInDirectory( id, @@ -211,8 +217,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The name of the department. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -223,6 +227,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -244,8 +250,8 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } /** The name of the department. */ @@ -258,18 +264,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -300,8 +312,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -312,6 +322,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -333,8 +345,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -347,18 +359,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt index 6c842ba5..3810edc3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -44,6 +42,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): IndividualResponse = apply { if (!validated) { individualId() @@ -69,10 +69,10 @@ private constructor( @JvmSynthetic internal fun from(individualResponse: IndividualResponse) = apply { - this.individualId = individualResponse.individualId - this.code = individualResponse.code - this.body = individualResponse.body - additionalProperties(individualResponse.additionalProperties) + individualId = individualResponse.individualId + code = individualResponse.code + body = individualResponse.body + additionalProperties = individualResponse.additionalProperties.toMutableMap() } fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -97,18 +97,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualResponse = IndividualResponse( individualId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt index 84d086e5..f97014f2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt @@ -38,8 +38,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The legal first name of the individual. */ fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) @@ -133,6 +131,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): IndividualUpdateResponse = apply { if (!validated) { firstName() @@ -178,20 +178,20 @@ private constructor( @JvmSynthetic internal fun from(individualUpdateResponse: IndividualUpdateResponse) = apply { - this.firstName = individualUpdateResponse.firstName - this.middleName = individualUpdateResponse.middleName - this.lastName = individualUpdateResponse.lastName - this.preferredName = individualUpdateResponse.preferredName - this.emails = individualUpdateResponse.emails - this.phoneNumbers = individualUpdateResponse.phoneNumbers - this.gender = individualUpdateResponse.gender - this.ethnicity = individualUpdateResponse.ethnicity - this.dob = individualUpdateResponse.dob - this.ssn = individualUpdateResponse.ssn - this.encryptedSsn = individualUpdateResponse.encryptedSsn - this.residence = individualUpdateResponse.residence - this.id = individualUpdateResponse.id - additionalProperties(individualUpdateResponse.additionalProperties) + firstName = individualUpdateResponse.firstName + middleName = individualUpdateResponse.middleName + lastName = individualUpdateResponse.lastName + preferredName = individualUpdateResponse.preferredName + emails = individualUpdateResponse.emails + phoneNumbers = individualUpdateResponse.phoneNumbers + gender = individualUpdateResponse.gender + ethnicity = individualUpdateResponse.ethnicity + dob = individualUpdateResponse.dob + ssn = individualUpdateResponse.ssn + encryptedSsn = individualUpdateResponse.encryptedSsn + residence = individualUpdateResponse.residence + id = individualUpdateResponse.id + additionalProperties = individualUpdateResponse.additionalProperties.toMutableMap() } /** The legal first name of the individual. */ @@ -313,18 +313,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualUpdateResponse = IndividualUpdateResponse( firstName, @@ -353,8 +359,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -367,6 +371,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Email = apply { if (!validated) { data() @@ -390,9 +396,9 @@ private constructor( @JvmSynthetic internal fun from(email: Email) = apply { - this.data = email.data - this.type = email.type - additionalProperties(email.additionalProperties) + data = email.data + type = email.type + additionalProperties = email.additionalProperties.toMutableMap() } fun data(data: String) = data(JsonField.of(data)) @@ -409,18 +415,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Email = Email( data, @@ -676,8 +688,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -690,6 +700,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PhoneNumber = apply { if (!validated) { data() @@ -713,9 +725,9 @@ private constructor( @JvmSynthetic internal fun from(phoneNumber: PhoneNumber) = apply { - this.data = phoneNumber.data - this.type = phoneNumber.type - additionalProperties(phoneNumber.additionalProperties) + data = phoneNumber.data + type = phoneNumber.type + additionalProperties = phoneNumber.additionalProperties.toMutableMap() } fun data(data: String) = data(JsonField.of(data)) @@ -732,18 +744,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumber = PhoneNumber( data, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt index e4203f0b..d9e38e02 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt @@ -41,8 +41,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The Finch UUID of the connection associated with the `access_token`. */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -194,6 +192,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Introspection = apply { if (!validated) { connectionId() @@ -245,23 +245,23 @@ private constructor( @JvmSynthetic internal fun from(introspection: Introspection) = apply { - this.connectionId = introspection.connectionId - this.connectionStatus = introspection.connectionStatus - this.clientId = introspection.clientId - this.clientType = introspection.clientType - this.connectionType = introspection.connectionType - this.companyId = introspection.companyId - this.accountId = introspection.accountId - this.customerId = introspection.customerId - this.customerName = introspection.customerName - this.customerEmail = introspection.customerEmail - this.authenticationMethods = introspection.authenticationMethods - this.products = introspection.products - this.username = introspection.username - this.providerId = introspection.providerId - this.payrollProviderId = introspection.payrollProviderId - this.manual = introspection.manual - additionalProperties(introspection.additionalProperties) + connectionId = introspection.connectionId + connectionStatus = introspection.connectionStatus + clientId = introspection.clientId + clientType = introspection.clientType + connectionType = introspection.connectionType + companyId = introspection.companyId + accountId = introspection.accountId + customerId = introspection.customerId + customerName = introspection.customerName + customerEmail = introspection.customerEmail + authenticationMethods = introspection.authenticationMethods + products = introspection.products + username = introspection.username + providerId = introspection.providerId + payrollProviderId = introspection.payrollProviderId + manual = introspection.manual + additionalProperties = introspection.additionalProperties.toMutableMap() } /** The Finch UUID of the connection associated with the `access_token`. */ @@ -459,18 +459,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Introspection = Introspection( connectionId, @@ -503,8 +509,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The type of authentication method. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -529,6 +533,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AuthenticationMethod = apply { if (!validated) { type() @@ -554,10 +560,10 @@ private constructor( @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - this.type = authenticationMethod.type - this.connectionStatus = authenticationMethod.connectionStatus - this.products = authenticationMethod.products - additionalProperties(authenticationMethod.additionalProperties) + type = authenticationMethod.type + connectionStatus = authenticationMethod.connectionStatus + products = authenticationMethod.products + additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } /** The type of authentication method. */ @@ -587,18 +593,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AuthenticationMethod = AuthenticationMethod( type, @@ -617,8 +629,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun status(): Optional = Optional.ofNullable(status.getNullable("status")) @@ -632,6 +642,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): ConnectionStatus = apply { if (!validated) { status() @@ -655,9 +667,9 @@ private constructor( @JvmSynthetic internal fun from(connectionStatus: ConnectionStatus) = apply { - this.status = connectionStatus.status - this.message = connectionStatus.message - additionalProperties(connectionStatus.additionalProperties) + status = connectionStatus.status + message = connectionStatus.message + additionalProperties = connectionStatus.additionalProperties.toMutableMap() } fun status(status: ConnectionStatusType) = status(JsonField.of(status)) @@ -674,12 +686,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -687,6 +699,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ConnectionStatus = ConnectionStatus( status, @@ -878,8 +898,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun status(): Optional = Optional.ofNullable(status.getNullable("status")) @@ -893,6 +911,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): ConnectionStatus = apply { if (!validated) { status() @@ -916,9 +936,9 @@ private constructor( @JvmSynthetic internal fun from(connectionStatus: ConnectionStatus) = apply { - this.status = connectionStatus.status - this.message = connectionStatus.message - additionalProperties(connectionStatus.additionalProperties) + status = connectionStatus.status + message = connectionStatus.message + additionalProperties = connectionStatus.additionalProperties.toMutableMap() } fun status(status: ConnectionStatusType) = status(JsonField.of(status)) @@ -935,18 +955,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ConnectionStatus = ConnectionStatus( status, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index fc7ae8b8..125a85c0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt @@ -314,12 +314,12 @@ constructor( @NoAutoDetect class DataSyncAll private constructor( - private val type: Type?, + private val type: Type, private val additionalProperties: Map, ) { /** The type of job to start. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Type = type @JsonAnyGetter @ExcludeMissing @@ -339,8 +339,8 @@ constructor( @JvmSynthetic internal fun from(dataSyncAll: DataSyncAll) = apply { - this.type = dataSyncAll.type - additionalProperties(dataSyncAll.additionalProperties) + type = dataSyncAll.type + additionalProperties = dataSyncAll.additionalProperties.toMutableMap() } /** The type of job to start. */ @@ -348,18 +348,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): DataSyncAll = DataSyncAll( checkNotNull(type) { "`type` is required but was not set" }, @@ -440,16 +446,16 @@ constructor( @NoAutoDetect class W4FormEmployeeSync private constructor( - private val type: Type?, - private val individualId: String?, + private val type: Type, + private val individualId: String, private val additionalProperties: Map, ) { /** The type of job to start. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Type = type /** The unique ID of the individual for W-4 data sync. */ - @JsonProperty("individual_id") fun individualId(): String? = individualId + @JsonProperty("individual_id") fun individualId(): String = individualId @JsonAnyGetter @ExcludeMissing @@ -470,9 +476,9 @@ constructor( @JvmSynthetic internal fun from(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - this.type = w4FormEmployeeSync.type - this.individualId = w4FormEmployeeSync.individualId - additionalProperties(w4FormEmployeeSync.additionalProperties) + type = w4FormEmployeeSync.type + individualId = w4FormEmployeeSync.individualId + additionalProperties = w4FormEmployeeSync.additionalProperties.toMutableMap() } /** The type of job to start. */ @@ -484,18 +490,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): W4FormEmployeeSync = W4FormEmployeeSync( checkNotNull(type) { "`type` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt index ffc7fa45..30ce2a27 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): JobCompletionEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(jobCompletionEvent: JobCompletionEvent) = apply { - this.connectionId = jobCompletionEvent.connectionId - this.companyId = jobCompletionEvent.companyId - this.accountId = jobCompletionEvent.accountId - this.eventType = jobCompletionEvent.eventType - this.data = jobCompletionEvent.data - additionalProperties(jobCompletionEvent.additionalProperties) + connectionId = jobCompletionEvent.connectionId + companyId = jobCompletionEvent.companyId + accountId = jobCompletionEvent.accountId + eventType = jobCompletionEvent.eventType + data = jobCompletionEvent.data + additionalProperties = jobCompletionEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): JobCompletionEvent = JobCompletionEvent( connectionId, @@ -203,8 +209,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The id of the job which has completed. */ fun jobId(): String = jobId.getRequired("job_id") @@ -221,6 +225,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { jobId() @@ -244,9 +250,9 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.jobId = data.jobId - this.jobUrl = data.jobUrl - additionalProperties(data.additionalProperties) + jobId = data.jobId + jobUrl = data.jobUrl + additionalProperties = data.additionalProperties.toMutableMap() } /** The id of the job which has completed. */ @@ -267,18 +273,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data( jobId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt index 6376d9e4..60077873 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The id of the job that has been created. */ fun jobId(): String = jobId.getRequired("job_id") @@ -57,6 +55,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): JobCreateResponse = apply { if (!validated) { jobId() @@ -84,11 +84,11 @@ private constructor( @JvmSynthetic internal fun from(jobCreateResponse: JobCreateResponse) = apply { - this.jobId = jobCreateResponse.jobId - this.jobUrl = jobCreateResponse.jobUrl - this.allowedRefreshes = jobCreateResponse.allowedRefreshes - this.remainingRefreshes = jobCreateResponse.remainingRefreshes - additionalProperties(jobCreateResponse.additionalProperties) + jobId = jobCreateResponse.jobId + jobUrl = jobCreateResponse.jobUrl + allowedRefreshes = jobCreateResponse.allowedRefreshes + remainingRefreshes = jobCreateResponse.remainingRefreshes + additionalProperties = jobCreateResponse.additionalProperties.toMutableMap() } /** The id of the job that has been created. */ @@ -131,18 +131,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): JobCreateResponse = JobCreateResponse( jobId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt index 893f1856..03776466 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Street address or PO box. */ fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) @@ -80,6 +78,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Location = apply { if (!validated) { line1() @@ -115,15 +115,15 @@ private constructor( @JvmSynthetic internal fun from(location: Location) = apply { - this.line1 = location.line1 - this.line2 = location.line2 - this.city = location.city - this.state = location.state - this.postalCode = location.postalCode - this.country = location.country - this.name = location.name - this.sourceId = location.sourceId - additionalProperties(location.additionalProperties) + line1 = location.line1 + line2 = location.line2 + city = location.city + state = location.state + postalCode = location.postalCode + country = location.country + name = location.name + sourceId = location.sourceId + additionalProperties = location.additionalProperties.toMutableMap() } /** Street address or PO box. */ @@ -188,18 +188,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Location = Location( line1, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt index 9ff5e5f5..505a365c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt @@ -28,8 +28,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun jobId(): String = jobId.getRequired("job_id") fun status(): Status = status.getRequired("status") @@ -48,6 +46,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): ManualAsyncJob = apply { if (!validated) { jobId() @@ -73,10 +73,10 @@ private constructor( @JvmSynthetic internal fun from(manualAsyncJob: ManualAsyncJob) = apply { - this.jobId = manualAsyncJob.jobId - this.status = manualAsyncJob.status - this.body = manualAsyncJob.body - additionalProperties(manualAsyncJob.additionalProperties) + jobId = manualAsyncJob.jobId + status = manualAsyncJob.status + body = manualAsyncJob.body + additionalProperties = manualAsyncJob.additionalProperties.toMutableMap() } fun jobId(jobId: String) = jobId(JsonField.of(jobId)) @@ -101,18 +101,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): ManualAsyncJob = ManualAsyncJob( jobId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt index 056c6aa6..0de04653 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt @@ -24,8 +24,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Amount for money object (in cents) */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) @@ -40,6 +38,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Money = apply { if (!validated) { amount() @@ -63,9 +63,9 @@ private constructor( @JvmSynthetic internal fun from(money: Money) = apply { - this.amount = money.amount - this.currency = money.currency - additionalProperties(money.additionalProperties) + amount = money.amount + currency = money.currency + additionalProperties = money.additionalProperties.toMutableMap() } /** Amount for money object (in cents) */ @@ -84,18 +84,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Money = Money( amount, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt index 38670699..ecf878b2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt @@ -26,8 +26,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * - `supported`: This operation is supported by both the provider and Finch * - `not_supported_by_finch`: This operation is not supported by Finch but supported by the @@ -120,6 +118,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): OperationSupportMatrix = apply { if (!validated) { create() @@ -147,11 +147,11 @@ private constructor( @JvmSynthetic internal fun from(operationSupportMatrix: OperationSupportMatrix) = apply { - this.create = operationSupportMatrix.create - this.update = operationSupportMatrix.update - this.delete = operationSupportMatrix.delete - this.read = operationSupportMatrix.read - additionalProperties(operationSupportMatrix.additionalProperties) + create = operationSupportMatrix.create + update = operationSupportMatrix.update + delete = operationSupportMatrix.delete + read = operationSupportMatrix.read + additionalProperties = operationSupportMatrix.additionalProperties.toMutableMap() } /** @@ -252,18 +252,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): OperationSupportMatrix = OperationSupportMatrix( create, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt index 37449a7b..bd3dc813 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt @@ -24,8 +24,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The total number of elements for the entire query (not just the given page) */ fun count(): Optional = Optional.ofNullable(count.getNullable("count")) @@ -42,6 +40,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Paging = apply { if (!validated) { count() @@ -65,9 +65,9 @@ private constructor( @JvmSynthetic internal fun from(paging: Paging) = apply { - this.count = paging.count - this.offset = paging.offset - additionalProperties(paging.additionalProperties) + count = paging.count + offset = paging.offset + additionalProperties = paging.additionalProperties.toMutableMap() } /** The total number of elements for the entire query (not just the given page) */ @@ -88,18 +88,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Paging = Paging( count, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt index f58c2517..53bddd69 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt @@ -28,8 +28,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Finch id (uuidv4) for the pay group */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -53,6 +51,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayGroupListResponse = apply { if (!validated) { id() @@ -78,10 +78,10 @@ private constructor( @JvmSynthetic internal fun from(payGroupListResponse: PayGroupListResponse) = apply { - this.id = payGroupListResponse.id - this.name = payGroupListResponse.name - this.payFrequencies = payGroupListResponse.payFrequencies - additionalProperties(payGroupListResponse.additionalProperties) + id = payGroupListResponse.id + name = payGroupListResponse.name + payFrequencies = payGroupListResponse.payFrequencies + additionalProperties = payGroupListResponse.additionalProperties.toMutableMap() } /** Finch id (uuidv4) for the pay group */ @@ -111,18 +111,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayGroupListResponse = PayGroupListResponse( id, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt index c96f9aee..a501f108 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt @@ -28,8 +28,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Finch id (uuidv4) for the pay group */ fun id(): String = id.getRequired("id") @@ -56,6 +54,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayGroupRetrieveResponse = apply { if (!validated) { id() @@ -83,11 +83,11 @@ private constructor( @JvmSynthetic internal fun from(payGroupRetrieveResponse: PayGroupRetrieveResponse) = apply { - this.id = payGroupRetrieveResponse.id - this.name = payGroupRetrieveResponse.name - this.payFrequencies = payGroupRetrieveResponse.payFrequencies - this.individualIds = payGroupRetrieveResponse.individualIds - additionalProperties(payGroupRetrieveResponse.additionalProperties) + id = payGroupRetrieveResponse.id + name = payGroupRetrieveResponse.name + payFrequencies = payGroupRetrieveResponse.payFrequencies + individualIds = payGroupRetrieveResponse.individualIds + additionalProperties = payGroupRetrieveResponse.additionalProperties.toMutableMap() } /** Finch id (uuidv4) for the pay group */ @@ -125,18 +125,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayGroupRetrieveResponse = PayGroupRetrieveResponse( id, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt index 38a7fe1a..9f475c1c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt @@ -35,8 +35,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** A stable Finch `id` (UUID v4) for an individual in the company */ fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -103,6 +101,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayStatement = apply { if (!validated) { individualId() @@ -142,17 +142,17 @@ private constructor( @JvmSynthetic internal fun from(payStatement: PayStatement) = apply { - this.individualId = payStatement.individualId - this.type = payStatement.type - this.paymentMethod = payStatement.paymentMethod - this.totalHours = payStatement.totalHours - this.grossPay = payStatement.grossPay - this.netPay = payStatement.netPay - this.earnings = payStatement.earnings - this.taxes = payStatement.taxes - this.employeeDeductions = payStatement.employeeDeductions - this.employerContributions = payStatement.employerContributions - additionalProperties(payStatement.additionalProperties) + individualId = payStatement.individualId + type = payStatement.type + paymentMethod = payStatement.paymentMethod + totalHours = payStatement.totalHours + grossPay = payStatement.grossPay + netPay = payStatement.netPay + earnings = payStatement.earnings + taxes = payStatement.taxes + employeeDeductions = payStatement.employeeDeductions + employerContributions = payStatement.employerContributions + additionalProperties = payStatement.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company */ @@ -242,18 +242,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatement = PayStatement( individualId, @@ -282,8 +288,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The type of earning. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -324,6 +328,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Earning = apply { if (!validated) { type() @@ -353,12 +359,12 @@ private constructor( @JvmSynthetic internal fun from(earning: Earning) = apply { - this.type = earning.type - this.name = earning.name - this.amount = earning.amount - this.currency = earning.currency - this.hours = earning.hours - additionalProperties(earning.additionalProperties) + type = earning.type + name = earning.name + amount = earning.amount + currency = earning.currency + hours = earning.hours + additionalProperties = earning.additionalProperties.toMutableMap() } /** The type of earning. */ @@ -409,18 +415,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Earning = Earning( type, @@ -585,8 +597,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The deduction name from the pay statement. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -621,6 +631,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployeeDeduction = apply { if (!validated) { name() @@ -650,12 +662,12 @@ private constructor( @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { - this.name = employeeDeduction.name - this.amount = employeeDeduction.amount - this.currency = employeeDeduction.currency - this.preTax = employeeDeduction.preTax - this.type = employeeDeduction.type - additionalProperties(employeeDeduction.additionalProperties) + name = employeeDeduction.name + amount = employeeDeduction.amount + currency = employeeDeduction.currency + preTax = employeeDeduction.preTax + type = employeeDeduction.type + additionalProperties = employeeDeduction.additionalProperties.toMutableMap() } /** The deduction name from the pay statement. */ @@ -700,18 +712,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployeeDeduction = EmployeeDeduction( name, @@ -752,8 +770,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The contribution name from the pay statement. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -782,6 +798,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployerContribution = apply { if (!validated) { name() @@ -809,11 +827,11 @@ private constructor( @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { - this.name = employerContribution.name - this.amount = employerContribution.amount - this.currency = employerContribution.currency - this.type = employerContribution.type - additionalProperties(employerContribution.additionalProperties) + name = employerContribution.name + amount = employerContribution.amount + currency = employerContribution.currency + type = employerContribution.type + additionalProperties = employerContribution.additionalProperties.toMutableMap() } /** The contribution name from the pay statement. */ @@ -850,18 +868,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployerContribution = EmployerContribution( name, @@ -959,8 +983,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The type of taxes. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -995,6 +1017,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Tax = apply { if (!validated) { type() @@ -1024,12 +1048,12 @@ private constructor( @JvmSynthetic internal fun from(tax: Tax) = apply { - this.type = tax.type - this.name = tax.name - this.employer = tax.employer - this.amount = tax.amount - this.currency = tax.currency - additionalProperties(tax.additionalProperties) + type = tax.type + name = tax.name + employer = tax.employer + amount = tax.amount + currency = tax.currency + additionalProperties = tax.additionalProperties.toMutableMap() } /** The type of taxes. */ @@ -1074,18 +1098,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Tax = Tax( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt index 031b2f99..2017f627 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): PayStatementEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(payStatementEvent: PayStatementEvent) = apply { - this.connectionId = payStatementEvent.connectionId - this.companyId = payStatementEvent.companyId - this.accountId = payStatementEvent.accountId - this.eventType = payStatementEvent.eventType - this.data = payStatementEvent.data - additionalProperties(payStatementEvent.additionalProperties) + connectionId = payStatementEvent.connectionId + companyId = payStatementEvent.companyId + accountId = payStatementEvent.accountId + eventType = payStatementEvent.eventType + data = payStatementEvent.data + additionalProperties = payStatementEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatementEvent = PayStatementEvent( connectionId, @@ -203,8 +209,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the payment associated with the pay statement. */ fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) @@ -222,6 +226,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Data = apply { if (!validated) { paymentId() @@ -245,9 +251,9 @@ private constructor( @JvmSynthetic internal fun from(data: Data) = apply { - this.paymentId = data.paymentId - this.individualId = data.individualId - additionalProperties(data.additionalProperties) + paymentId = data.paymentId + individualId = data.individualId + additionalProperties = data.additionalProperties.toMutableMap() } /** The ID of the payment associated with the pay statement. */ @@ -270,18 +276,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Data = Data( paymentId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt index c2f2b6fa..b30ed22c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) fun code(): Optional = Optional.ofNullable(code.getNullable("code")) @@ -43,6 +41,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayStatementResponse = apply { if (!validated) { paymentId() @@ -68,10 +68,10 @@ private constructor( @JvmSynthetic internal fun from(payStatementResponse: PayStatementResponse) = apply { - this.paymentId = payStatementResponse.paymentId - this.code = payStatementResponse.code - this.body = payStatementResponse.body - additionalProperties(payStatementResponse.additionalProperties) + paymentId = payStatementResponse.paymentId + code = payStatementResponse.code + body = payStatementResponse.body + additionalProperties = payStatementResponse.additionalProperties.toMutableMap() } fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) @@ -94,18 +94,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatementResponse = PayStatementResponse( paymentId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt index fb09f3f4..aace50d9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt @@ -24,8 +24,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) /** The array of pay statements for the current payment. */ @@ -41,6 +39,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayStatementResponseBody = apply { if (!validated) { paging().map { it.validate() } @@ -64,9 +64,9 @@ private constructor( @JvmSynthetic internal fun from(payStatementResponseBody: PayStatementResponseBody) = apply { - this.paging = payStatementResponseBody.paging - this.payStatements = payStatementResponseBody.payStatements - additionalProperties(payStatementResponseBody.additionalProperties) + paging = payStatementResponseBody.paging + payStatements = payStatementResponseBody.payStatements + additionalProperties = payStatementResponseBody.additionalProperties.toMutableMap() } fun paging(paging: Paging) = paging(JsonField.of(paging)) @@ -88,18 +88,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatementResponseBody = PayStatementResponseBody( paging, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt index 3d3fab02..dc4f6b31 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt @@ -37,8 +37,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The unique id for the payment. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -107,6 +105,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Payment = apply { if (!validated) { id() @@ -150,19 +150,19 @@ private constructor( @JvmSynthetic internal fun from(payment: Payment) = apply { - this.id = payment.id - this.payPeriod = payment.payPeriod - this.payDate = payment.payDate - this.debitDate = payment.debitDate - this.companyDebit = payment.companyDebit - this.grossPay = payment.grossPay - this.netPay = payment.netPay - this.employerTaxes = payment.employerTaxes - this.employeeTaxes = payment.employeeTaxes - this.individualIds = payment.individualIds - this.payGroupIds = payment.payGroupIds - this.payFrequencies = payment.payFrequencies - additionalProperties(payment.additionalProperties) + id = payment.id + payPeriod = payment.payPeriod + payDate = payment.payDate + debitDate = payment.debitDate + companyDebit = payment.companyDebit + grossPay = payment.grossPay + netPay = payment.netPay + employerTaxes = payment.employerTaxes + employeeTaxes = payment.employeeTaxes + individualIds = payment.individualIds + payGroupIds = payment.payGroupIds + payFrequencies = payment.payFrequencies + additionalProperties = payment.additionalProperties.toMutableMap() } /** The unique id for the payment. */ @@ -260,18 +260,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Payment = Payment( id, @@ -399,8 +405,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) @@ -413,6 +417,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayPeriod = apply { if (!validated) { startDate() @@ -436,9 +442,9 @@ private constructor( @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - this.startDate = payPeriod.startDate - this.endDate = payPeriod.endDate - additionalProperties(payPeriod.additionalProperties) + startDate = payPeriod.startDate + endDate = payPeriod.endDate + additionalProperties = payPeriod.additionalProperties.toMutableMap() } fun startDate(startDate: String) = startDate(JsonField.of(startDate)) @@ -455,18 +461,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayPeriod = PayPeriod( startDate, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt index 37c061f6..8cee7c1d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt @@ -23,8 +23,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the payment. */ fun paymentId(): String = paymentId.getRequired("payment_id") @@ -41,6 +39,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PaymentCreateResponse = apply { if (!validated) { paymentId() @@ -64,9 +64,9 @@ private constructor( @JvmSynthetic internal fun from(paymentCreateResponse: PaymentCreateResponse) = apply { - this.paymentId = paymentCreateResponse.paymentId - this.payDate = paymentCreateResponse.payDate - additionalProperties(paymentCreateResponse.additionalProperties) + paymentId = paymentCreateResponse.paymentId + payDate = paymentCreateResponse.payDate + additionalProperties = paymentCreateResponse.additionalProperties.toMutableMap() } /** The ID of the payment. */ @@ -87,18 +87,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PaymentCreateResponse = PaymentCreateResponse( paymentId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt index 1be91fee..d7b7825f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt @@ -30,8 +30,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = Optional.ofNullable(connectionId.getNullable("connection_id")) @@ -52,13 +50,6 @@ private constructor( 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 @@ -82,6 +73,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + fun toBaseWebhookEvent(): BaseWebhookEvent = + BaseWebhookEvent.builder() + .connectionId(connectionId) + .companyId(companyId) + .accountId(accountId) + .build() + + private var validated: Boolean = false + fun validate(): PaymentEvent = apply { if (!validated) { connectionId() @@ -111,12 +111,12 @@ private constructor( @JvmSynthetic internal fun from(paymentEvent: PaymentEvent) = apply { - this.connectionId = paymentEvent.connectionId - this.companyId = paymentEvent.companyId - this.accountId = paymentEvent.accountId - this.eventType = paymentEvent.eventType - this.data = paymentEvent.data - additionalProperties(paymentEvent.additionalProperties) + connectionId = paymentEvent.connectionId + companyId = paymentEvent.companyId + accountId = paymentEvent.accountId + eventType = paymentEvent.eventType + data = paymentEvent.data + additionalProperties = paymentEvent.additionalProperties.toMutableMap() } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -171,18 +171,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PaymentEvent = PaymentEvent( connectionId, @@ -203,8 +209,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The ID of the payment. */ fun paymentId(): String = paymentId.getRequired("payment_id") @@ -221,6 +225,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PaymentIdentifiers = apply { if (!validated) { paymentId() @@ -244,9 +250,9 @@ private constructor( @JvmSynthetic internal fun from(paymentIdentifiers: PaymentIdentifiers) = apply { - this.paymentId = paymentIdentifiers.paymentId - this.payDate = paymentIdentifiers.payDate - additionalProperties(paymentIdentifiers.additionalProperties) + paymentId = paymentIdentifiers.paymentId + payDate = paymentIdentifiers.payDate + additionalProperties = paymentIdentifiers.additionalProperties.toMutableMap() } /** The ID of the payment. */ @@ -267,18 +273,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PaymentIdentifiers = PaymentIdentifiers( paymentId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt index d42d4889..cfd981f0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt @@ -35,8 +35,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The id of the payroll provider used in Connect. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -115,6 +113,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Provider = apply { if (!validated) { id() @@ -154,17 +154,17 @@ private constructor( @JvmSynthetic internal fun from(provider: Provider) = apply { - this.id = provider.id - this.displayName = provider.displayName - this.products = provider.products - this.icon = provider.icon - this.logo = provider.logo - this.mfaRequired = provider.mfaRequired - this.primaryColor = provider.primaryColor - this.manual = provider.manual - this.beta = provider.beta - this.authenticationMethods = provider.authenticationMethods - additionalProperties(provider.additionalProperties) + id = provider.id + displayName = provider.displayName + products = provider.products + icon = provider.icon + logo = provider.logo + mfaRequired = provider.mfaRequired + primaryColor = provider.primaryColor + manual = provider.manual + beta = provider.beta + authenticationMethods = provider.authenticationMethods + additionalProperties = provider.additionalProperties.toMutableMap() } /** The id of the payroll provider used in Connect. */ @@ -261,18 +261,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Provider = Provider( id, @@ -299,8 +305,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The type of authentication method. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -331,6 +335,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): AuthenticationMethod = apply { if (!validated) { type() @@ -356,10 +362,10 @@ private constructor( @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - this.type = authenticationMethod.type - this.benefitsSupport = authenticationMethod.benefitsSupport - this.supportedFields = authenticationMethod.supportedFields - additionalProperties(authenticationMethod.additionalProperties) + type = authenticationMethod.type + benefitsSupport = authenticationMethod.benefitsSupport + supportedFields = authenticationMethod.supportedFields + additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } /** The type of authentication method. */ @@ -400,18 +406,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): AuthenticationMethod = AuthenticationMethod( type, @@ -436,8 +448,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun company(): Optional = Optional.ofNullable(company.getNullable("company")) @@ -477,6 +487,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedFields = apply { if (!validated) { company().map { it.validate() } @@ -510,14 +522,14 @@ private constructor( @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 - this.payGroup = supportedFields.payGroup - additionalProperties(supportedFields.additionalProperties) + company = supportedFields.company + directory = supportedFields.directory + individual = supportedFields.individual + employment = supportedFields.employment + payment = supportedFields.payment + payStatement = supportedFields.payStatement + payGroup = supportedFields.payGroup + additionalProperties = supportedFields.additionalProperties.toMutableMap() } fun company(company: SupportedCompanyFields) = company(JsonField.of(company)) @@ -582,12 +594,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -595,6 +607,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedFields = SupportedFields( company, @@ -624,8 +644,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun legalName(): Optional = @@ -674,6 +692,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedCompanyFields = apply { if (!validated) { id() @@ -711,16 +731,17 @@ private constructor( @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) + id = supportedCompanyFields.id + legalName = supportedCompanyFields.legalName + entity = supportedCompanyFields.entity + primaryEmail = supportedCompanyFields.primaryEmail + primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber + ein = supportedCompanyFields.ein + accounts = supportedCompanyFields.accounts + departments = supportedCompanyFields.departments + locations = supportedCompanyFields.locations + additionalProperties = + supportedCompanyFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -792,12 +813,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -805,6 +826,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedCompanyFields = SupportedCompanyFields( id, @@ -832,8 +861,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun routingNumber(): Optional = Optional.ofNullable(routingNumber.getNullable("routing_number")) @@ -869,6 +896,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Accounts = apply { if (!validated) { routingNumber() @@ -899,12 +928,12 @@ private constructor( @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) + routingNumber = accounts.routingNumber + accountName = accounts.accountName + institutionName = accounts.institutionName + accountType = accounts.accountType + accountNumber = accounts.accountNumber + additionalProperties = accounts.additionalProperties.toMutableMap() } fun routingNumber(routingNumber: Boolean) = @@ -955,18 +984,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Accounts = Accounts( routingNumber, @@ -1005,8 +1042,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) fun parent(): Optional = @@ -1020,6 +1055,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Departments = apply { if (!validated) { name() @@ -1044,9 +1081,9 @@ private constructor( @JvmSynthetic internal fun from(departments: Departments) = apply { - this.name = departments.name - this.parent = departments.parent - additionalProperties(departments.additionalProperties) + name = departments.name + parent = departments.parent + additionalProperties = departments.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -1064,18 +1101,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Departments = Departments( name, @@ -1092,8 +1137,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1103,6 +1146,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Parent = apply { if (!validated) { name() @@ -1125,8 +1170,8 @@ private constructor( @JvmSynthetic internal fun from(parent: Parent) = apply { - this.name = parent.name - additionalProperties(parent.additionalProperties) + name = parent.name + additionalProperties = parent.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -1138,18 +1183,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Parent = Parent(name, additionalProperties.toImmutable()) } @@ -1198,8 +1251,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) fun subtype(): Optional = @@ -1213,6 +1264,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Entity = apply { if (!validated) { type() @@ -1237,9 +1290,9 @@ private constructor( @JvmSynthetic internal fun from(entity: Entity) = apply { - this.type = entity.type - this.subtype = entity.subtype - additionalProperties(entity.additionalProperties) + type = entity.type + subtype = entity.subtype + additionalProperties = entity.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -1257,18 +1310,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Entity = Entity( type, @@ -1308,8 +1369,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2")) @@ -1340,6 +1399,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Locations = apply { if (!validated) { line1() @@ -1372,13 +1433,13 @@ private constructor( @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) + line1 = locations.line1 + line2 = locations.line2 + city = locations.city + state = locations.state + postalCode = locations.postalCode + country = locations.country + additionalProperties = locations.additionalProperties.toMutableMap() } fun line1(line1: Boolean) = line1(JsonField.of(line1)) @@ -1422,18 +1483,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Locations = Locations( line1, @@ -1491,8 +1560,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) fun individuals(): Optional = @@ -1506,6 +1573,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedDirectoryFields = apply { if (!validated) { paging().map { it.validate() } @@ -1529,9 +1598,10 @@ private constructor( @JvmSynthetic internal fun from(supportedDirectoryFields: SupportedDirectoryFields) = apply { - this.paging = supportedDirectoryFields.paging - this.individuals = supportedDirectoryFields.individuals - additionalProperties(supportedDirectoryFields.additionalProperties) + paging = supportedDirectoryFields.paging + individuals = supportedDirectoryFields.individuals + additionalProperties = + supportedDirectoryFields.additionalProperties.toMutableMap() } fun paging(paging: Paging) = paging(JsonField.of(paging)) @@ -1551,12 +1621,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -1564,6 +1634,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedDirectoryFields = SupportedDirectoryFields( paging, @@ -1586,8 +1664,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -1626,6 +1702,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Individuals = apply { if (!validated) { id() @@ -1660,14 +1738,14 @@ private constructor( @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) + id = individuals.id + firstName = individuals.firstName + middleName = individuals.middleName + lastName = individuals.lastName + isActive = individuals.isActive + department = individuals.department + manager = individuals.manager + additionalProperties = individuals.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -1725,18 +1803,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Individuals = Individuals( id, @@ -1758,8 +1844,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @JsonProperty("id") @ExcludeMissing fun _id() = id @@ -1768,6 +1852,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -1790,8 +1876,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -1803,18 +1889,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } @@ -1863,8 +1957,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun count(): Optional = Optional.ofNullable(count.getNullable("count")) fun offset(): Optional = @@ -1878,6 +1970,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Paging = apply { if (!validated) { count() @@ -1902,9 +1996,9 @@ private constructor( @JvmSynthetic internal fun from(paging: Paging) = apply { - this.count = paging.count - this.offset = paging.offset - additionalProperties(paging.additionalProperties) + count = paging.count + offset = paging.offset + additionalProperties = paging.additionalProperties.toMutableMap() } fun count(count: Boolean) = count(JsonField.of(count)) @@ -1922,18 +2016,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Paging = Paging( count, @@ -2002,8 +2104,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -2092,6 +2192,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedEmploymentFields = apply { if (!validated) { id() @@ -2146,24 +2248,25 @@ private constructor( @JvmSynthetic internal fun from(supportedEmploymentFields: SupportedEmploymentFields) = apply { - this.id = supportedEmploymentFields.id - this.firstName = supportedEmploymentFields.firstName - this.middleName = supportedEmploymentFields.middleName - this.lastName = supportedEmploymentFields.lastName - this.title = supportedEmploymentFields.title - this.startDate = supportedEmploymentFields.startDate - this.endDate = supportedEmploymentFields.endDate - this.isActive = supportedEmploymentFields.isActive - this.employmentStatus = supportedEmploymentFields.employmentStatus - this.incomeHistory = supportedEmploymentFields.incomeHistory - this.classCode = supportedEmploymentFields.classCode - this.customFields = supportedEmploymentFields.customFields - this.department = supportedEmploymentFields.department - this.employment = supportedEmploymentFields.employment - this.income = supportedEmploymentFields.income - this.location = supportedEmploymentFields.location - this.manager = supportedEmploymentFields.manager - additionalProperties(supportedEmploymentFields.additionalProperties) + id = supportedEmploymentFields.id + firstName = supportedEmploymentFields.firstName + middleName = supportedEmploymentFields.middleName + lastName = supportedEmploymentFields.lastName + title = supportedEmploymentFields.title + startDate = supportedEmploymentFields.startDate + endDate = supportedEmploymentFields.endDate + isActive = supportedEmploymentFields.isActive + employmentStatus = supportedEmploymentFields.employmentStatus + incomeHistory = supportedEmploymentFields.incomeHistory + classCode = supportedEmploymentFields.classCode + customFields = supportedEmploymentFields.customFields + department = supportedEmploymentFields.department + employment = supportedEmploymentFields.employment + income = supportedEmploymentFields.income + location = supportedEmploymentFields.location + manager = supportedEmploymentFields.manager + additionalProperties = + supportedEmploymentFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -2291,12 +2394,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -2304,6 +2407,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedEmploymentFields = SupportedEmploymentFields( id, @@ -2335,8 +2446,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -2345,6 +2454,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Department = apply { if (!validated) { name() @@ -2367,8 +2478,8 @@ private constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -2380,18 +2491,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -2423,8 +2542,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) fun subtype(): Optional = @@ -2438,6 +2555,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Employment = apply { if (!validated) { type() @@ -2462,9 +2581,9 @@ private constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = employment.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -2482,18 +2601,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -2530,8 +2657,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) @@ -2550,6 +2675,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Income = apply { if (!validated) { amount() @@ -2576,10 +2703,10 @@ private constructor( @JvmSynthetic internal fun from(income: Income) = apply { - this.amount = income.amount - this.currency = income.currency - this.unit = income.unit - additionalProperties(income.additionalProperties) + amount = income.amount + currency = income.currency + unit = income.unit + additionalProperties = income.additionalProperties.toMutableMap() } fun amount(amount: Boolean) = amount(JsonField.of(amount)) @@ -2605,18 +2732,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Income = Income( amount, @@ -2657,8 +2792,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2")) @@ -2689,6 +2822,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Location = apply { if (!validated) { line1() @@ -2721,13 +2856,13 @@ private constructor( @JvmSynthetic internal fun from(location: Location) = apply { - this.line1 = location.line1 - this.line2 = location.line2 - this.city = location.city - this.state = location.state - this.postalCode = location.postalCode - this.country = location.country - additionalProperties(location.additionalProperties) + line1 = location.line1 + line2 = location.line2 + city = location.city + state = location.state + postalCode = location.postalCode + country = location.country + additionalProperties = location.additionalProperties.toMutableMap() } fun line1(line1: Boolean) = line1(JsonField.of(line1)) @@ -2771,18 +2906,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Location = Location( line1, @@ -2821,8 +2964,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @JsonProperty("id") @ExcludeMissing fun _id() = id @@ -2831,6 +2972,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Manager = apply { if (!validated) { id() @@ -2853,8 +2996,8 @@ private constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -2866,18 +3009,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } @@ -2937,8 +3088,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun firstName(): Optional = @@ -3003,6 +3152,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedIndividualFields = apply { if (!validated) { id() @@ -3049,20 +3200,21 @@ private constructor( @JvmSynthetic internal fun from(supportedIndividualFields: SupportedIndividualFields) = apply { - this.id = supportedIndividualFields.id - this.firstName = supportedIndividualFields.firstName - this.middleName = supportedIndividualFields.middleName - this.lastName = supportedIndividualFields.lastName - this.preferredName = supportedIndividualFields.preferredName - this.dob = supportedIndividualFields.dob - this.gender = supportedIndividualFields.gender - this.ethnicity = supportedIndividualFields.ethnicity - this.ssn = supportedIndividualFields.ssn - this.encryptedSsn = supportedIndividualFields.encryptedSsn - this.emails = supportedIndividualFields.emails - this.phoneNumbers = supportedIndividualFields.phoneNumbers - this.residence = supportedIndividualFields.residence - additionalProperties(supportedIndividualFields.additionalProperties) + id = supportedIndividualFields.id + firstName = supportedIndividualFields.firstName + middleName = supportedIndividualFields.middleName + lastName = supportedIndividualFields.lastName + preferredName = supportedIndividualFields.preferredName + dob = supportedIndividualFields.dob + gender = supportedIndividualFields.gender + ethnicity = supportedIndividualFields.ethnicity + ssn = supportedIndividualFields.ssn + encryptedSsn = supportedIndividualFields.encryptedSsn + emails = supportedIndividualFields.emails + phoneNumbers = supportedIndividualFields.phoneNumbers + residence = supportedIndividualFields.residence + additionalProperties = + supportedIndividualFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -3162,12 +3314,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -3175,6 +3327,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedIndividualFields = SupportedIndividualFields( id, @@ -3203,8 +3363,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -3217,6 +3375,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Emails = apply { if (!validated) { data() @@ -3241,9 +3401,9 @@ private constructor( @JvmSynthetic internal fun from(emails: Emails) = apply { - this.data = emails.data - this.type = emails.type - additionalProperties(emails.additionalProperties) + data = emails.data + type = emails.type + additionalProperties = emails.additionalProperties.toMutableMap() } fun data(data: Boolean) = data(JsonField.of(data)) @@ -3261,18 +3421,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Emails = Emails( data, @@ -3308,8 +3476,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -3322,6 +3488,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PhoneNumbers = apply { if (!validated) { data() @@ -3346,9 +3514,9 @@ private constructor( @JvmSynthetic internal fun from(phoneNumbers: PhoneNumbers) = apply { - this.data = phoneNumbers.data - this.type = phoneNumbers.type - additionalProperties(phoneNumbers.additionalProperties) + data = phoneNumbers.data + type = phoneNumbers.type + additionalProperties = phoneNumbers.additionalProperties.toMutableMap() } fun data(data: Boolean) = data(JsonField.of(data)) @@ -3366,18 +3534,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumbers = PhoneNumbers( data, @@ -3417,8 +3593,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun city(): Optional = Optional.ofNullable(city.getNullable("city")) fun country(): Optional = @@ -3449,6 +3623,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Residence = apply { if (!validated) { city() @@ -3481,13 +3657,13 @@ private constructor( @JvmSynthetic internal fun from(residence: Residence) = apply { - this.city = residence.city - this.country = residence.country - this.line1 = residence.line1 - this.line2 = residence.line2 - this.postalCode = residence.postalCode - this.state = residence.state - additionalProperties(residence.additionalProperties) + city = residence.city + country = residence.country + line1 = residence.line1 + line2 = residence.line2 + postalCode = residence.postalCode + state = residence.state + additionalProperties = residence.additionalProperties.toMutableMap() } fun city(city: Boolean) = city(JsonField.of(city)) @@ -3531,18 +3707,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Residence = Residence( city, @@ -3602,8 +3786,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -3628,6 +3810,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPayGroupFields = apply { if (!validated) { id() @@ -3655,11 +3839,12 @@ private constructor( @JvmSynthetic internal fun from(supportedPayGroupFields: SupportedPayGroupFields) = apply { - this.id = supportedPayGroupFields.id - this.name = supportedPayGroupFields.name - this.payFrequencies = supportedPayGroupFields.payFrequencies - this.individualIds = supportedPayGroupFields.individualIds - additionalProperties(supportedPayGroupFields.additionalProperties) + id = supportedPayGroupFields.id + name = supportedPayGroupFields.name + payFrequencies = supportedPayGroupFields.payFrequencies + individualIds = supportedPayGroupFields.individualIds + additionalProperties = + supportedPayGroupFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -3694,12 +3879,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -3707,6 +3892,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPayGroupFields = SupportedPayGroupFields( id, @@ -3744,8 +3937,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) fun payStatements(): Optional = @@ -3759,6 +3950,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPayStatementFields = apply { if (!validated) { paging().map { it.validate() } @@ -3783,9 +3976,10 @@ private constructor( @JvmSynthetic internal fun from(supportedPayStatementFields: SupportedPayStatementFields) = apply { - this.paging = supportedPayStatementFields.paging - this.payStatements = supportedPayStatementFields.payStatements - additionalProperties(supportedPayStatementFields.additionalProperties) + paging = supportedPayStatementFields.paging + payStatements = supportedPayStatementFields.payStatements + additionalProperties = + supportedPayStatementFields.additionalProperties.toMutableMap() } fun paging(paging: Paging) = paging(JsonField.of(paging)) @@ -3805,12 +3999,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -3818,6 +4012,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPayStatementFields = SupportedPayStatementFields( paging, @@ -3835,8 +4037,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun count(): Boolean = count.getRequired("count") fun offset(): Boolean = offset.getRequired("offset") @@ -3849,6 +4049,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Paging = apply { if (!validated) { count() @@ -3873,9 +4075,9 @@ private constructor( @JvmSynthetic internal fun from(paging: Paging) = apply { - this.count = paging.count - this.offset = paging.offset - additionalProperties(paging.additionalProperties) + count = paging.count + offset = paging.offset + additionalProperties = paging.additionalProperties.toMutableMap() } fun count(count: Boolean) = count(JsonField.of(count)) @@ -3893,18 +4095,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Paging = Paging( count, @@ -3948,8 +4158,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -4012,6 +4220,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayStatements = apply { if (!validated) { individualId() @@ -4054,17 +4264,17 @@ private constructor( @JvmSynthetic internal fun from(payStatements: PayStatements) = apply { - this.individualId = payStatements.individualId - this.type = payStatements.type - this.paymentMethod = payStatements.paymentMethod - this.totalHours = payStatements.totalHours - this.grossPay = payStatements.grossPay - this.netPay = payStatements.netPay - this.earnings = payStatements.earnings - this.employeeDeductions = payStatements.employeeDeductions - this.employerContributions = payStatements.employerContributions - this.taxes = payStatements.taxes - additionalProperties(payStatements.additionalProperties) + individualId = payStatements.individualId + type = payStatements.type + paymentMethod = payStatements.paymentMethod + totalHours = payStatements.totalHours + grossPay = payStatements.grossPay + netPay = payStatements.netPay + earnings = payStatements.earnings + employeeDeductions = payStatements.employeeDeductions + employerContributions = payStatements.employerContributions + taxes = payStatements.taxes + additionalProperties = payStatements.additionalProperties.toMutableMap() } fun individualId(individualId: Boolean) = @@ -4149,18 +4359,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatements = PayStatements( individualId, @@ -4188,8 +4406,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -4214,6 +4430,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Earnings = apply { if (!validated) { type() @@ -4242,11 +4460,11 @@ private constructor( @JvmSynthetic internal fun from(earnings: Earnings) = apply { - this.type = earnings.type - this.name = earnings.name - this.amount = earnings.amount - this.currency = earnings.currency - additionalProperties(earnings.additionalProperties) + type = earnings.type + name = earnings.name + amount = earnings.amount + currency = earnings.currency + additionalProperties = earnings.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -4278,18 +4496,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Earnings = Earnings( type, @@ -4330,8 +4556,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -4361,6 +4585,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployeeDeductions = apply { if (!validated) { name() @@ -4391,12 +4617,13 @@ private constructor( @JvmSynthetic internal fun from(employeeDeductions: EmployeeDeductions) = apply { - this.name = employeeDeductions.name - this.amount = employeeDeductions.amount - this.type = employeeDeductions.type - this.preTax = employeeDeductions.preTax - this.currency = employeeDeductions.currency - additionalProperties(employeeDeductions.additionalProperties) + name = employeeDeductions.name + amount = employeeDeductions.amount + type = employeeDeductions.type + preTax = employeeDeductions.preTax + currency = employeeDeductions.currency + additionalProperties = + employeeDeductions.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -4434,18 +4661,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployeeDeductions = EmployeeDeductions( name, @@ -4485,8 +4720,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -4506,6 +4739,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): EmployerContributions = apply { if (!validated) { name() @@ -4533,10 +4768,11 @@ private constructor( @JvmSynthetic internal fun from(employerContributions: EmployerContributions) = apply { - this.name = employerContributions.name - this.amount = employerContributions.amount - this.currency = employerContributions.currency - additionalProperties(employerContributions.additionalProperties) + name = employerContributions.name + amount = employerContributions.amount + currency = employerContributions.currency + additionalProperties = + employerContributions.additionalProperties.toMutableMap() } fun name(name: Boolean) = name(JsonField.of(name)) @@ -4562,18 +4798,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployerContributions = EmployerContributions( name, @@ -4613,8 +4857,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -4644,6 +4886,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Taxes = apply { if (!validated) { type() @@ -4674,12 +4918,12 @@ private constructor( @JvmSynthetic internal fun from(taxes: Taxes) = apply { - this.type = taxes.type - this.name = taxes.name - this.employer = taxes.employer - this.amount = taxes.amount - this.currency = taxes.currency - additionalProperties(taxes.additionalProperties) + type = taxes.type + name = taxes.name + employer = taxes.employer + amount = taxes.amount + currency = taxes.currency + additionalProperties = taxes.additionalProperties.toMutableMap() } fun type(type: Boolean) = type(JsonField.of(type)) @@ -4719,18 +4963,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Taxes = Taxes( type, @@ -4815,8 +5067,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun payDate(): Optional = @@ -4881,6 +5131,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedPaymentFields = apply { if (!validated) { id() @@ -4924,19 +5176,20 @@ private constructor( @JvmSynthetic internal fun from(supportedPaymentFields: SupportedPaymentFields) = apply { - this.id = supportedPaymentFields.id - this.payDate = supportedPaymentFields.payDate - this.debitDate = supportedPaymentFields.debitDate - this.companyDebit = supportedPaymentFields.companyDebit - this.grossPay = supportedPaymentFields.grossPay - this.netPay = supportedPaymentFields.netPay - this.employerTaxes = supportedPaymentFields.employerTaxes - this.employeeTaxes = supportedPaymentFields.employeeTaxes - this.individualIds = supportedPaymentFields.individualIds - this.payPeriod = supportedPaymentFields.payPeriod - this.payGroupIds = supportedPaymentFields.payGroupIds - this.payFrequencies = supportedPaymentFields.payFrequencies - additionalProperties(supportedPaymentFields.additionalProperties) + id = supportedPaymentFields.id + payDate = supportedPaymentFields.payDate + debitDate = supportedPaymentFields.debitDate + companyDebit = supportedPaymentFields.companyDebit + grossPay = supportedPaymentFields.grossPay + netPay = supportedPaymentFields.netPay + employerTaxes = supportedPaymentFields.employerTaxes + employeeTaxes = supportedPaymentFields.employeeTaxes + individualIds = supportedPaymentFields.individualIds + payPeriod = supportedPaymentFields.payPeriod + payGroupIds = supportedPaymentFields.payGroupIds + payFrequencies = supportedPaymentFields.payFrequencies + additionalProperties = + supportedPaymentFields.additionalProperties.toMutableMap() } fun id(id: Boolean) = id(JsonField.of(id)) @@ -5034,12 +5287,12 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -5047,6 +5300,14 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedPaymentFields = SupportedPaymentFields( id, @@ -5074,8 +5335,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) @@ -5090,6 +5349,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): PayPeriod = apply { if (!validated) { startDate() @@ -5114,9 +5375,9 @@ private constructor( @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - this.startDate = payPeriod.startDate - this.endDate = payPeriod.endDate - additionalProperties(payPeriod.additionalProperties) + startDate = payPeriod.startDate + endDate = payPeriod.endDate + additionalProperties = payPeriod.additionalProperties.toMutableMap() } fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) @@ -5136,18 +5397,26 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayPeriod = PayPeriod( startDate, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt index 674264ae..09a47d7c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt @@ -64,8 +64,8 @@ constructor( @NoAutoDetect class RequestForwardingForwardBody internal constructor( - private val method: String?, - private val route: String?, + private val method: String, + private val route: String, private val data: String?, private val headers: JsonValue?, private val params: JsonValue?, @@ -76,32 +76,32 @@ constructor( * The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , * `DELETE` , and `PATCH`. */ - @JsonProperty("method") fun method(): String? = method + @JsonProperty("method") fun method(): String = method /** * The URL route path for the forwarded request. This value must begin with a forward-slash * ( / ) and may only contain alphanumeric characters, hyphens, and underscores. */ - @JsonProperty("route") fun route(): String? = route + @JsonProperty("route") fun route(): String = route /** * The body for the forwarded request. This value must be specified as either a string or a * valid JSON object. */ - @JsonProperty("data") fun data(): String? = data + @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) /** * The HTTP headers to include on the forwarded request. This value must be specified as an * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": * "v1" }` */ - @JsonProperty("headers") fun headers(): JsonValue? = headers + @JsonProperty("headers") fun headers(): Optional = Optional.ofNullable(headers) /** * The query parameters for the forwarded request. This value must be specified as a valid * JSON object rather than a query string. */ - @JsonProperty("params") fun params(): JsonValue? = params + @JsonProperty("params") fun params(): Optional = Optional.ofNullable(params) @JsonAnyGetter @ExcludeMissing @@ -125,12 +125,13 @@ constructor( @JvmSynthetic internal fun from(requestForwardingForwardBody: RequestForwardingForwardBody) = apply { - this.method = requestForwardingForwardBody.method - this.route = requestForwardingForwardBody.route - this.data = requestForwardingForwardBody.data - this.headers = requestForwardingForwardBody.headers - this.params = requestForwardingForwardBody.params - additionalProperties(requestForwardingForwardBody.additionalProperties) + method = requestForwardingForwardBody.method + route = requestForwardingForwardBody.route + data = requestForwardingForwardBody.data + headers = requestForwardingForwardBody.headers + params = requestForwardingForwardBody.params + additionalProperties = + requestForwardingForwardBody.additionalProperties.toMutableMap() } /** @@ -168,18 +169,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): RequestForwardingForwardBody = RequestForwardingForwardBody( checkNotNull(method) { "`method` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt index ab743f7e..45a1cdde 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt @@ -26,8 +26,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * The HTTP status code of the forwarded request’s response, exactly received from the * underlying integration’s API. This value will be returned as an integer. @@ -74,6 +72,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): RequestForwardingForwardResponse = apply { if (!validated) { statusCode() @@ -101,11 +101,12 @@ private constructor( @JvmSynthetic internal fun from(requestForwardingForwardResponse: RequestForwardingForwardResponse) = apply { - this.headers = requestForwardingForwardResponse.headers - this.statusCode = requestForwardingForwardResponse.statusCode - this.data = requestForwardingForwardResponse.data - this.request = requestForwardingForwardResponse.request - additionalProperties(requestForwardingForwardResponse.additionalProperties) + headers = requestForwardingForwardResponse.headers + statusCode = requestForwardingForwardResponse.statusCode + data = requestForwardingForwardResponse.data + request = requestForwardingForwardResponse.request + additionalProperties = + requestForwardingForwardResponse.additionalProperties.toMutableMap() } /** @@ -162,18 +163,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): RequestForwardingForwardResponse = RequestForwardingForwardResponse( headers, @@ -199,8 +206,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** * The HTTP method that was specified for the forwarded request. Valid values include: `GET` * , `POST` , `PUT` , `DELETE` , and `PATCH`. @@ -249,6 +254,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Request = apply { if (!validated) { method() @@ -276,12 +283,12 @@ private constructor( @JvmSynthetic internal fun from(request: Request) = apply { - this.method = request.method - this.route = request.route - this.headers = request.headers - this.params = request.params - this.data = request.data - additionalProperties(request.additionalProperties) + method = request.method + route = request.route + headers = request.headers + params = request.params + data = request.data + additionalProperties = request.additionalProperties.toMutableMap() } /** @@ -340,18 +347,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Request = Request( method, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index 6b1ffd95..5a0954e1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt @@ -91,27 +91,33 @@ constructor( ) { /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") fun accounts(): List? = accounts + @JsonProperty("accounts") + fun accounts(): Optional> = Optional.ofNullable(accounts) /** The array of company departments. */ - @JsonProperty("departments") fun departments(): List? = departments + @JsonProperty("departments") + fun departments(): Optional> = Optional.ofNullable(departments) /** The employer identification number. */ - @JsonProperty("ein") fun ein(): String? = ein + @JsonProperty("ein") fun ein(): Optional = Optional.ofNullable(ein) /** The entity type object. */ - @JsonProperty("entity") fun entity(): Entity? = entity + @JsonProperty("entity") fun entity(): Optional = Optional.ofNullable(entity) /** The legal name of the company. */ - @JsonProperty("legal_name") fun legalName(): String? = legalName + @JsonProperty("legal_name") + fun legalName(): Optional = Optional.ofNullable(legalName) - @JsonProperty("locations") fun locations(): List? = locations + @JsonProperty("locations") + fun locations(): Optional> = Optional.ofNullable(locations) /** The email of the main administrator on the account. */ - @JsonProperty("primary_email") fun primaryEmail(): String? = primaryEmail + @JsonProperty("primary_email") + fun primaryEmail(): Optional = Optional.ofNullable(primaryEmail) /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - @JsonProperty("primary_phone_number") fun primaryPhoneNumber(): String? = primaryPhoneNumber + @JsonProperty("primary_phone_number") + fun primaryPhoneNumber(): Optional = Optional.ofNullable(primaryPhoneNumber) @JsonAnyGetter @ExcludeMissing @@ -138,15 +144,15 @@ constructor( @JvmSynthetic internal fun from(sandboxCompanyUpdateBody: SandboxCompanyUpdateBody) = apply { - this.accounts = sandboxCompanyUpdateBody.accounts - this.departments = sandboxCompanyUpdateBody.departments - this.ein = sandboxCompanyUpdateBody.ein - this.entity = sandboxCompanyUpdateBody.entity - this.legalName = sandboxCompanyUpdateBody.legalName - this.locations = sandboxCompanyUpdateBody.locations - this.primaryEmail = sandboxCompanyUpdateBody.primaryEmail - this.primaryPhoneNumber = sandboxCompanyUpdateBody.primaryPhoneNumber - additionalProperties(sandboxCompanyUpdateBody.additionalProperties) + accounts = sandboxCompanyUpdateBody.accounts?.toMutableList() + departments = sandboxCompanyUpdateBody.departments?.toMutableList() + ein = sandboxCompanyUpdateBody.ein + entity = sandboxCompanyUpdateBody.entity + legalName = sandboxCompanyUpdateBody.legalName + locations = sandboxCompanyUpdateBody.locations?.toMutableList() + primaryEmail = sandboxCompanyUpdateBody.primaryEmail + primaryPhoneNumber = sandboxCompanyUpdateBody.primaryPhoneNumber + additionalProperties = sandboxCompanyUpdateBody.additionalProperties.toMutableMap() } /** An array of bank account objects associated with the payroll/HRIS system. */ @@ -184,18 +190,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxCompanyUpdateBody = SandboxCompanyUpdateBody( accounts?.toImmutable(), @@ -459,19 +471,24 @@ constructor( /** * A nine-digit code that's based on the U.S. Bank location where your account was opened. */ - @JsonProperty("routing_number") fun routingNumber(): String? = routingNumber + @JsonProperty("routing_number") + fun routingNumber(): Optional = Optional.ofNullable(routingNumber) /** The name of the bank associated in the payroll/HRIS system. */ - @JsonProperty("account_name") fun accountName(): String? = accountName + @JsonProperty("account_name") + fun accountName(): Optional = Optional.ofNullable(accountName) /** Name of the banking institution. */ - @JsonProperty("institution_name") fun institutionName(): String? = institutionName + @JsonProperty("institution_name") + fun institutionName(): Optional = Optional.ofNullable(institutionName) /** The type of bank account. */ - @JsonProperty("account_type") fun accountType(): AccountType? = accountType + @JsonProperty("account_type") + fun accountType(): Optional = Optional.ofNullable(accountType) /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") fun accountNumber(): String? = accountNumber + @JsonProperty("account_number") + fun accountNumber(): Optional = Optional.ofNullable(accountNumber) @JsonAnyGetter @ExcludeMissing @@ -495,12 +512,12 @@ constructor( @JvmSynthetic internal fun from(account: Account) = apply { - this.routingNumber = account.routingNumber - this.accountName = account.accountName - this.institutionName = account.institutionName - this.accountType = account.accountType - this.accountNumber = account.accountNumber - additionalProperties(account.additionalProperties) + routingNumber = account.routingNumber + accountName = account.accountName + institutionName = account.institutionName + accountType = account.accountType + accountNumber = account.accountNumber + additionalProperties = account.additionalProperties.toMutableMap() } /** @@ -530,18 +547,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Account = Account( routingNumber, @@ -638,10 +661,10 @@ constructor( ) { /** The department name. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) /** The parent department, if present. */ - @JsonProperty("parent") fun parent(): Parent? = parent + @JsonProperty("parent") fun parent(): Optional = Optional.ofNullable(parent) @JsonAnyGetter @ExcludeMissing @@ -662,9 +685,9 @@ constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - this.parent = department.parent - additionalProperties(department.additionalProperties) + name = department.name + parent = department.parent + additionalProperties = department.additionalProperties.toMutableMap() } /** The department name. */ @@ -675,18 +698,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department( name, @@ -705,7 +734,7 @@ constructor( ) { /** The parent department's name. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) @JsonAnyGetter @ExcludeMissing @@ -725,8 +754,8 @@ constructor( @JvmSynthetic internal fun from(parent: Parent) = apply { - this.name = parent.name - additionalProperties(parent.additionalProperties) + name = parent.name + additionalProperties = parent.additionalProperties.toMutableMap() } /** The parent department's name. */ @@ -734,12 +763,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -747,6 +776,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Parent = Parent(name, additionalProperties.toImmutable()) } @@ -797,10 +834,10 @@ constructor( ) { /** The tax payer type of the company. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** The tax payer subtype of the company. */ - @JsonProperty("subtype") fun subtype(): Subtype? = subtype + @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) @JsonAnyGetter @ExcludeMissing @@ -821,9 +858,9 @@ constructor( @JvmSynthetic internal fun from(entity: Entity) = apply { - this.type = entity.type - this.subtype = entity.subtype - additionalProperties(entity.additionalProperties) + type = entity.type + subtype = entity.subtype + additionalProperties = entity.additionalProperties.toMutableMap() } /** The tax payer type of the company. */ @@ -835,18 +872,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Entity = Entity( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index 67ef1401..1455dab3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt @@ -63,26 +63,28 @@ constructor( @NoAutoDetect class SandboxConnectionAccountCreateBody internal constructor( - private val companyId: String?, - private val providerId: String?, + private val companyId: String, + private val providerId: String, private val authenticationType: AuthenticationType?, private val products: List?, private val additionalProperties: Map, ) { - @JsonProperty("company_id") fun companyId(): String? = companyId + @JsonProperty("company_id") fun companyId(): String = companyId /** The provider associated with the `access_token` */ - @JsonProperty("provider_id") fun providerId(): String? = providerId + @JsonProperty("provider_id") fun providerId(): String = providerId @JsonProperty("authentication_type") - fun authenticationType(): AuthenticationType? = authenticationType + fun authenticationType(): Optional = + Optional.ofNullable(authenticationType) /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - @JsonProperty("products") fun products(): List? = products + @JsonProperty("products") + fun products(): Optional> = Optional.ofNullable(products) @JsonAnyGetter @ExcludeMissing @@ -107,11 +109,12 @@ constructor( internal fun from( sandboxConnectionAccountCreateBody: SandboxConnectionAccountCreateBody ) = apply { - this.companyId = sandboxConnectionAccountCreateBody.companyId - this.providerId = sandboxConnectionAccountCreateBody.providerId - this.authenticationType = sandboxConnectionAccountCreateBody.authenticationType - this.products = sandboxConnectionAccountCreateBody.products - additionalProperties(sandboxConnectionAccountCreateBody.additionalProperties) + companyId = sandboxConnectionAccountCreateBody.companyId + providerId = sandboxConnectionAccountCreateBody.providerId + authenticationType = sandboxConnectionAccountCreateBody.authenticationType + products = sandboxConnectionAccountCreateBody.products?.toMutableList() + additionalProperties = + sandboxConnectionAccountCreateBody.additionalProperties.toMutableMap() } @JsonProperty("company_id") @@ -135,18 +138,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxConnectionAccountCreateBody = SandboxConnectionAccountCreateBody( checkNotNull(companyId) { "`companyId` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index 0d332a03..f77f0094 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt @@ -49,7 +49,8 @@ constructor( ) { @JsonProperty("connection_status") - fun connectionStatus(): ConnectionStatusType? = connectionStatus + fun connectionStatus(): Optional = + Optional.ofNullable(connectionStatus) @JsonAnyGetter @ExcludeMissing @@ -71,8 +72,9 @@ constructor( internal fun from( sandboxConnectionAccountUpdateBody: SandboxConnectionAccountUpdateBody ) = apply { - this.connectionStatus = sandboxConnectionAccountUpdateBody.connectionStatus - additionalProperties(sandboxConnectionAccountUpdateBody.additionalProperties) + connectionStatus = sandboxConnectionAccountUpdateBody.connectionStatus + additionalProperties = + sandboxConnectionAccountUpdateBody.additionalProperties.toMutableMap() } @JsonProperty("connection_status") @@ -82,18 +84,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxConnectionAccountUpdateBody = SandboxConnectionAccountUpdateBody( connectionStatus, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt index 21767bea..3a5df09e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt @@ -63,7 +63,7 @@ constructor( @NoAutoDetect class SandboxConnectionCreateBody internal constructor( - private val providerId: String?, + private val providerId: String, private val authenticationType: AuthenticationType?, private val employeeSize: Long?, private val products: List?, @@ -71,19 +71,22 @@ constructor( ) { /** The provider associated with the connection */ - @JsonProperty("provider_id") fun providerId(): String? = providerId + @JsonProperty("provider_id") fun providerId(): String = providerId @JsonProperty("authentication_type") - fun authenticationType(): AuthenticationType? = authenticationType + fun authenticationType(): Optional = + Optional.ofNullable(authenticationType) /** * Optional: the size of the employer to be created with this connection. Defaults to 20. * Note that if this is higher than 100, historical payroll data will not be generated, and * instead only one pay period will be created. */ - @JsonProperty("employee_size") fun employeeSize(): Long? = employeeSize + @JsonProperty("employee_size") + fun employeeSize(): Optional = Optional.ofNullable(employeeSize) - @JsonProperty("products") fun products(): List? = products + @JsonProperty("products") + fun products(): Optional> = Optional.ofNullable(products) @JsonAnyGetter @ExcludeMissing @@ -106,11 +109,12 @@ constructor( @JvmSynthetic internal fun from(sandboxConnectionCreateBody: SandboxConnectionCreateBody) = apply { - this.providerId = sandboxConnectionCreateBody.providerId - this.authenticationType = sandboxConnectionCreateBody.authenticationType - this.employeeSize = sandboxConnectionCreateBody.employeeSize - this.products = sandboxConnectionCreateBody.products - additionalProperties(sandboxConnectionCreateBody.additionalProperties) + providerId = sandboxConnectionCreateBody.providerId + authenticationType = sandboxConnectionCreateBody.authenticationType + employeeSize = sandboxConnectionCreateBody.employeeSize + products = sandboxConnectionCreateBody.products?.toMutableList() + additionalProperties = + sandboxConnectionCreateBody.additionalProperties.toMutableMap() } /** The provider associated with the connection */ @@ -135,18 +139,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxConnectionCreateBody = SandboxConnectionCreateBody( checkNotNull(providerId) { "`providerId` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index ad31e5b4..af23ac91 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -17,6 +17,7 @@ import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects +import java.util.Optional class SandboxDirectoryCreateParams constructor( @@ -48,14 +49,14 @@ constructor( @NoAutoDetect class SandboxDirectoryCreateBody internal constructor( - private val body: List?, + private val body: List, ) { /** * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - @JsonProperty("body") fun body(): List? = body + @JsonProperty("body") fun body(): List = body fun toBuilder() = Builder().from(this) @@ -70,7 +71,7 @@ constructor( @JvmSynthetic internal fun from(sandboxDirectoryCreateBody: SandboxDirectoryCreateBody) = apply { - this.body = sandboxDirectoryCreateBody.body + body = sandboxDirectoryCreateBody.body.toMutableList() } /** @@ -79,6 +80,11 @@ constructor( */ @JsonProperty("body") fun body(body: List) = apply { this.body = body } + + fun build(): SandboxDirectoryCreateBody = + SandboxDirectoryCreateBody( + checkNotNull(body) { "`body` is required but was not set" }.toImmutable() + ) } override fun equals(other: Any?): Boolean { @@ -275,93 +281,107 @@ constructor( ) { /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(): String? = firstName + @JsonProperty("first_name") + fun firstName(): Optional = Optional.ofNullable(firstName) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(): String? = middleName + @JsonProperty("middle_name") + fun middleName(): Optional = Optional.ofNullable(middleName) /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(): String? = lastName + @JsonProperty("last_name") fun lastName(): Optional = Optional.ofNullable(lastName) /** The preferred name of the individual. */ - @JsonProperty("preferred_name") fun preferredName(): String? = preferredName + @JsonProperty("preferred_name") + fun preferredName(): Optional = Optional.ofNullable(preferredName) - @JsonProperty("emails") fun emails(): List? = emails + @JsonProperty("emails") fun emails(): Optional> = Optional.ofNullable(emails) - @JsonProperty("phone_numbers") fun phoneNumbers(): List? = phoneNumbers + @JsonProperty("phone_numbers") + fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers) /** The gender of the individual. */ - @JsonProperty("gender") fun gender(): Gender? = gender + @JsonProperty("gender") fun gender(): Optional = Optional.ofNullable(gender) /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") fun ethnicity(): Ethnicity? = ethnicity + @JsonProperty("ethnicity") + fun ethnicity(): Optional = Optional.ofNullable(ethnicity) - @JsonProperty("dob") fun dob(): String? = dob + @JsonProperty("dob") fun dob(): Optional = Optional.ofNullable(dob) /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") fun ssn(): String? = ssn + @JsonProperty("ssn") fun ssn(): Optional = Optional.ofNullable(ssn) /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - @JsonProperty("encrypted_ssn") fun encryptedSsn(): String? = encryptedSsn + @JsonProperty("encrypted_ssn") + fun encryptedSsn(): Optional = Optional.ofNullable(encryptedSsn) - @JsonProperty("residence") fun residence(): Location? = residence + @JsonProperty("residence") + fun residence(): Optional = Optional.ofNullable(residence) /** The current title of the individual. */ - @JsonProperty("title") fun title(): String? = title + @JsonProperty("title") fun title(): Optional = Optional.ofNullable(title) /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") fun manager(): Manager? = manager + @JsonProperty("manager") fun manager(): Optional = Optional.ofNullable(manager) /** The department object. */ - @JsonProperty("department") fun department(): Department? = department + @JsonProperty("department") + fun department(): Optional = Optional.ofNullable(department) /** The employment object. */ - @JsonProperty("employment") fun employment(): Employment? = employment + @JsonProperty("employment") + fun employment(): Optional = Optional.ofNullable(employment) - @JsonProperty("start_date") fun startDate(): String? = startDate + @JsonProperty("start_date") + fun startDate(): Optional = Optional.ofNullable(startDate) - @JsonProperty("end_date") fun endDate(): String? = endDate + @JsonProperty("end_date") fun endDate(): Optional = Optional.ofNullable(endDate) - @JsonProperty("latest_rehire_date") fun latestRehireDate(): String? = latestRehireDate + @JsonProperty("latest_rehire_date") + fun latestRehireDate(): Optional = Optional.ofNullable(latestRehireDate) /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") fun isActive(): Boolean? = isActive + @JsonProperty("is_active") fun isActive(): Optional = Optional.ofNullable(isActive) /** The detailed employment status of the individual. */ @JsonProperty("employment_status") - fun employmentStatus(): EmploymentStatus? = employmentStatus + fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") fun classCode(): String? = classCode + @JsonProperty("class_code") + fun classCode(): Optional = Optional.ofNullable(classCode) - @JsonProperty("location") fun location(): Location? = location + @JsonProperty("location") fun location(): Optional = Optional.ofNullable(location) /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") fun income(): Income? = income + @JsonProperty("income") fun income(): Optional = Optional.ofNullable(income) /** The array of income history. */ - @JsonProperty("income_history") fun incomeHistory(): List? = incomeHistory + @JsonProperty("income_history") + fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory) /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ - @JsonProperty("custom_fields") fun customFields(): List? = customFields + @JsonProperty("custom_fields") + fun customFields(): Optional> = Optional.ofNullable(customFields) /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") fun sourceId(): String? = sourceId + @JsonProperty("source_id") fun sourceId(): Optional = Optional.ofNullable(sourceId) @JsonAnyGetter @ExcludeMissing @@ -407,34 +427,34 @@ constructor( @JvmSynthetic internal fun from(individualOrEmployment: IndividualOrEmployment) = apply { - this.firstName = individualOrEmployment.firstName - this.middleName = individualOrEmployment.middleName - this.lastName = individualOrEmployment.lastName - this.preferredName = individualOrEmployment.preferredName - this.emails = individualOrEmployment.emails - this.phoneNumbers = individualOrEmployment.phoneNumbers - this.gender = individualOrEmployment.gender - this.ethnicity = individualOrEmployment.ethnicity - this.dob = individualOrEmployment.dob - this.ssn = individualOrEmployment.ssn - this.encryptedSsn = individualOrEmployment.encryptedSsn - this.residence = individualOrEmployment.residence - this.title = individualOrEmployment.title - this.manager = individualOrEmployment.manager - this.department = individualOrEmployment.department - this.employment = individualOrEmployment.employment - this.startDate = individualOrEmployment.startDate - this.endDate = individualOrEmployment.endDate - this.latestRehireDate = individualOrEmployment.latestRehireDate - this.isActive = individualOrEmployment.isActive - this.employmentStatus = individualOrEmployment.employmentStatus - this.classCode = individualOrEmployment.classCode - this.location = individualOrEmployment.location - this.income = individualOrEmployment.income - this.incomeHistory = individualOrEmployment.incomeHistory - this.customFields = individualOrEmployment.customFields - this.sourceId = individualOrEmployment.sourceId - additionalProperties(individualOrEmployment.additionalProperties) + firstName = individualOrEmployment.firstName + middleName = individualOrEmployment.middleName + lastName = individualOrEmployment.lastName + preferredName = individualOrEmployment.preferredName + emails = individualOrEmployment.emails?.toMutableList() + phoneNumbers = individualOrEmployment.phoneNumbers?.toMutableList() + gender = individualOrEmployment.gender + ethnicity = individualOrEmployment.ethnicity + dob = individualOrEmployment.dob + ssn = individualOrEmployment.ssn + encryptedSsn = individualOrEmployment.encryptedSsn + residence = individualOrEmployment.residence + title = individualOrEmployment.title + manager = individualOrEmployment.manager + department = individualOrEmployment.department + employment = individualOrEmployment.employment + startDate = individualOrEmployment.startDate + endDate = individualOrEmployment.endDate + latestRehireDate = individualOrEmployment.latestRehireDate + isActive = individualOrEmployment.isActive + employmentStatus = individualOrEmployment.employmentStatus + classCode = individualOrEmployment.classCode + location = individualOrEmployment.location + income = individualOrEmployment.income + incomeHistory = individualOrEmployment.incomeHistory?.toMutableList() + customFields = individualOrEmployment.customFields?.toMutableList() + sourceId = individualOrEmployment.sourceId + additionalProperties = individualOrEmployment.additionalProperties.toMutableMap() } /** The legal first name of the individual. */ @@ -558,18 +578,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): IndividualOrEmployment = IndividualOrEmployment( firstName, @@ -612,9 +638,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - @JsonProperty("value") fun value(): JsonValue? = value + @JsonProperty("value") fun value(): Optional = Optional.ofNullable(value) @JsonAnyGetter @ExcludeMissing @@ -635,9 +661,9 @@ constructor( @JvmSynthetic internal fun from(customField: CustomField) = apply { - this.name = customField.name - this.value = customField.value - additionalProperties(customField.additionalProperties) + name = customField.name + value = customField.value + additionalProperties = customField.additionalProperties.toMutableMap() } @JsonProperty("name") fun name(name: String) = apply { this.name = name } @@ -646,12 +672,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -659,6 +685,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CustomField = CustomField( name, @@ -695,7 +729,7 @@ constructor( ) { /** The name of the department associated with the individual. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) @JsonAnyGetter @ExcludeMissing @@ -715,8 +749,8 @@ constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } /** The name of the department associated with the individual. */ @@ -724,12 +758,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -737,6 +771,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -767,9 +809,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("data") fun data(): String? = data + @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -790,9 +832,9 @@ constructor( @JvmSynthetic internal fun from(email: Email) = apply { - this.data = email.data - this.type = email.type - additionalProperties(email.additionalProperties) + data = email.data + type = email.type + additionalProperties = email.additionalProperties.toMutableMap() } @JsonProperty("data") fun data(data: String) = apply { this.data = data } @@ -801,12 +843,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -814,6 +856,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Email = Email( data, @@ -908,13 +958,13 @@ constructor( ) { /** The main employment type of the individual. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") fun subtype(): Subtype? = subtype + @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) @JsonAnyGetter @ExcludeMissing @@ -935,9 +985,9 @@ constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = employment.additionalProperties.toMutableMap() } /** The main employment type of the individual. */ @@ -952,12 +1002,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -965,6 +1015,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -1390,7 +1448,7 @@ constructor( ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") fun id(): String? = id + @JsonProperty("id") fun id(): Optional = Optional.ofNullable(id) @JsonAnyGetter @ExcludeMissing @@ -1410,8 +1468,8 @@ constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1419,12 +1477,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -1432,6 +1490,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } @@ -1461,9 +1527,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("data") fun data(): String? = data + @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -1484,9 +1550,9 @@ constructor( @JvmSynthetic internal fun from(phoneNumber: PhoneNumber) = apply { - this.data = phoneNumber.data - this.type = phoneNumber.type - additionalProperties(phoneNumber.additionalProperties) + data = phoneNumber.data + type = phoneNumber.type + additionalProperties = phoneNumber.additionalProperties.toMutableMap() } @JsonProperty("data") fun data(data: String) = apply { this.data = data } @@ -1495,12 +1561,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -1508,6 +1574,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumber = PhoneNumber( data, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 475f1af2..0b480a53 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -151,62 +151,71 @@ constructor( ) { /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") fun classCode(): String? = classCode + @JsonProperty("class_code") + fun classCode(): Optional = Optional.ofNullable(classCode) /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ - @JsonProperty("custom_fields") fun customFields(): List? = customFields + @JsonProperty("custom_fields") + fun customFields(): Optional> = Optional.ofNullable(customFields) /** The department object. */ - @JsonProperty("department") fun department(): Department? = department + @JsonProperty("department") + fun department(): Optional = Optional.ofNullable(department) /** The employment object. */ - @JsonProperty("employment") fun employment(): Employment? = employment + @JsonProperty("employment") + fun employment(): Optional = Optional.ofNullable(employment) /** The detailed employment status of the individual. */ @JsonProperty("employment_status") - fun employmentStatus(): EmploymentStatus? = employmentStatus + fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) - @JsonProperty("end_date") fun endDate(): String? = endDate + @JsonProperty("end_date") fun endDate(): Optional = Optional.ofNullable(endDate) /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(): String? = firstName + @JsonProperty("first_name") + fun firstName(): Optional = Optional.ofNullable(firstName) /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") fun income(): Income? = income + @JsonProperty("income") fun income(): Optional = Optional.ofNullable(income) /** The array of income history. */ - @JsonProperty("income_history") fun incomeHistory(): List? = incomeHistory + @JsonProperty("income_history") + fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory) /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") fun isActive(): Boolean? = isActive + @JsonProperty("is_active") fun isActive(): Optional = Optional.ofNullable(isActive) /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(): String? = lastName + @JsonProperty("last_name") fun lastName(): Optional = Optional.ofNullable(lastName) - @JsonProperty("latest_rehire_date") fun latestRehireDate(): String? = latestRehireDate + @JsonProperty("latest_rehire_date") + fun latestRehireDate(): Optional = Optional.ofNullable(latestRehireDate) - @JsonProperty("location") fun location(): Location? = location + @JsonProperty("location") fun location(): Optional = Optional.ofNullable(location) /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") fun manager(): Manager? = manager + @JsonProperty("manager") fun manager(): Optional = Optional.ofNullable(manager) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(): String? = middleName + @JsonProperty("middle_name") + fun middleName(): Optional = Optional.ofNullable(middleName) /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") fun sourceId(): String? = sourceId + @JsonProperty("source_id") fun sourceId(): Optional = Optional.ofNullable(sourceId) - @JsonProperty("start_date") fun startDate(): String? = startDate + @JsonProperty("start_date") + fun startDate(): Optional = Optional.ofNullable(startDate) /** The current title of the individual. */ - @JsonProperty("title") fun title(): String? = title + @JsonProperty("title") fun title(): Optional = Optional.ofNullable(title) @JsonAnyGetter @ExcludeMissing @@ -243,25 +252,26 @@ constructor( @JvmSynthetic internal fun from(sandboxEmploymentUpdateBody: SandboxEmploymentUpdateBody) = apply { - this.classCode = sandboxEmploymentUpdateBody.classCode - this.customFields = sandboxEmploymentUpdateBody.customFields - this.department = sandboxEmploymentUpdateBody.department - this.employment = sandboxEmploymentUpdateBody.employment - this.employmentStatus = sandboxEmploymentUpdateBody.employmentStatus - this.endDate = sandboxEmploymentUpdateBody.endDate - this.firstName = sandboxEmploymentUpdateBody.firstName - this.income = sandboxEmploymentUpdateBody.income - this.incomeHistory = sandboxEmploymentUpdateBody.incomeHistory - this.isActive = sandboxEmploymentUpdateBody.isActive - this.lastName = sandboxEmploymentUpdateBody.lastName - this.latestRehireDate = sandboxEmploymentUpdateBody.latestRehireDate - this.location = sandboxEmploymentUpdateBody.location - this.manager = sandboxEmploymentUpdateBody.manager - this.middleName = sandboxEmploymentUpdateBody.middleName - this.sourceId = sandboxEmploymentUpdateBody.sourceId - this.startDate = sandboxEmploymentUpdateBody.startDate - this.title = sandboxEmploymentUpdateBody.title - additionalProperties(sandboxEmploymentUpdateBody.additionalProperties) + classCode = sandboxEmploymentUpdateBody.classCode + customFields = sandboxEmploymentUpdateBody.customFields?.toMutableList() + department = sandboxEmploymentUpdateBody.department + employment = sandboxEmploymentUpdateBody.employment + employmentStatus = sandboxEmploymentUpdateBody.employmentStatus + endDate = sandboxEmploymentUpdateBody.endDate + firstName = sandboxEmploymentUpdateBody.firstName + income = sandboxEmploymentUpdateBody.income + incomeHistory = sandboxEmploymentUpdateBody.incomeHistory?.toMutableList() + isActive = sandboxEmploymentUpdateBody.isActive + lastName = sandboxEmploymentUpdateBody.lastName + latestRehireDate = sandboxEmploymentUpdateBody.latestRehireDate + location = sandboxEmploymentUpdateBody.location + manager = sandboxEmploymentUpdateBody.manager + middleName = sandboxEmploymentUpdateBody.middleName + sourceId = sandboxEmploymentUpdateBody.sourceId + startDate = sandboxEmploymentUpdateBody.startDate + title = sandboxEmploymentUpdateBody.title + additionalProperties = + sandboxEmploymentUpdateBody.additionalProperties.toMutableMap() } /** Worker's compensation classification code for this employee */ @@ -347,18 +357,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxEmploymentUpdateBody = SandboxEmploymentUpdateBody( classCode, @@ -699,9 +715,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - @JsonProperty("value") fun value(): JsonValue? = value + @JsonProperty("value") fun value(): Optional = Optional.ofNullable(value) @JsonAnyGetter @ExcludeMissing @@ -722,9 +738,9 @@ constructor( @JvmSynthetic internal fun from(customField: CustomField) = apply { - this.name = customField.name - this.value = customField.value - additionalProperties(customField.additionalProperties) + name = customField.name + value = customField.value + additionalProperties = customField.additionalProperties.toMutableMap() } @JsonProperty("name") fun name(name: String) = apply { this.name = name } @@ -733,18 +749,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): CustomField = CustomField( name, @@ -781,7 +803,7 @@ constructor( ) { /** The name of the department associated with the individual. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) @JsonAnyGetter @ExcludeMissing @@ -801,8 +823,8 @@ constructor( @JvmSynthetic internal fun from(department: Department) = apply { - this.name = department.name - additionalProperties(department.additionalProperties) + name = department.name + additionalProperties = department.additionalProperties.toMutableMap() } /** The name of the department associated with the individual. */ @@ -810,18 +832,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Department = Department(name, additionalProperties.toImmutable()) } @@ -854,13 +882,13 @@ constructor( ) { /** The main employment type of the individual. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") fun subtype(): Subtype? = subtype + @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) @JsonAnyGetter @ExcludeMissing @@ -881,9 +909,9 @@ constructor( @JvmSynthetic internal fun from(employment: Employment) = apply { - this.type = employment.type - this.subtype = employment.subtype - additionalProperties(employment.additionalProperties) + type = employment.type + subtype = employment.subtype + additionalProperties = employment.additionalProperties.toMutableMap() } /** The main employment type of the individual. */ @@ -898,18 +926,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Employment = Employment( type, @@ -1171,7 +1205,7 @@ constructor( ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") fun id(): String? = id + @JsonProperty("id") fun id(): Optional = Optional.ofNullable(id) @JsonAnyGetter @ExcludeMissing @@ -1191,8 +1225,8 @@ constructor( @JvmSynthetic internal fun from(manager: Manager) = apply { - this.id = manager.id - additionalProperties(manager.additionalProperties) + id = manager.id + additionalProperties = manager.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1200,18 +1234,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Manager = Manager(id, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 983accde..6bf67b85 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -120,45 +120,52 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("dob") fun dob(): String? = dob + @JsonProperty("dob") fun dob(): Optional = Optional.ofNullable(dob) - @JsonProperty("emails") fun emails(): List? = emails + @JsonProperty("emails") fun emails(): Optional> = Optional.ofNullable(emails) /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - @JsonProperty("encrypted_ssn") fun encryptedSsn(): String? = encryptedSsn + @JsonProperty("encrypted_ssn") + fun encryptedSsn(): Optional = Optional.ofNullable(encryptedSsn) /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") fun ethnicity(): Ethnicity? = ethnicity + @JsonProperty("ethnicity") + fun ethnicity(): Optional = Optional.ofNullable(ethnicity) /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(): String? = firstName + @JsonProperty("first_name") + fun firstName(): Optional = Optional.ofNullable(firstName) /** The gender of the individual. */ - @JsonProperty("gender") fun gender(): Gender? = gender + @JsonProperty("gender") fun gender(): Optional = Optional.ofNullable(gender) /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(): String? = lastName + @JsonProperty("last_name") fun lastName(): Optional = Optional.ofNullable(lastName) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(): String? = middleName + @JsonProperty("middle_name") + fun middleName(): Optional = Optional.ofNullable(middleName) - @JsonProperty("phone_numbers") fun phoneNumbers(): List? = phoneNumbers + @JsonProperty("phone_numbers") + fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers) /** The preferred name of the individual. */ - @JsonProperty("preferred_name") fun preferredName(): String? = preferredName + @JsonProperty("preferred_name") + fun preferredName(): Optional = Optional.ofNullable(preferredName) - @JsonProperty("residence") fun residence(): Location? = residence + @JsonProperty("residence") + fun residence(): Optional = Optional.ofNullable(residence) /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") fun ssn(): String? = ssn + @JsonProperty("ssn") fun ssn(): Optional = Optional.ofNullable(ssn) @JsonAnyGetter @ExcludeMissing @@ -189,19 +196,20 @@ constructor( @JvmSynthetic internal fun from(sandboxIndividualUpdateBody: SandboxIndividualUpdateBody) = apply { - this.dob = sandboxIndividualUpdateBody.dob - this.emails = sandboxIndividualUpdateBody.emails - this.encryptedSsn = sandboxIndividualUpdateBody.encryptedSsn - this.ethnicity = sandboxIndividualUpdateBody.ethnicity - this.firstName = sandboxIndividualUpdateBody.firstName - this.gender = sandboxIndividualUpdateBody.gender - this.lastName = sandboxIndividualUpdateBody.lastName - this.middleName = sandboxIndividualUpdateBody.middleName - this.phoneNumbers = sandboxIndividualUpdateBody.phoneNumbers - this.preferredName = sandboxIndividualUpdateBody.preferredName - this.residence = sandboxIndividualUpdateBody.residence - this.ssn = sandboxIndividualUpdateBody.ssn - additionalProperties(sandboxIndividualUpdateBody.additionalProperties) + dob = sandboxIndividualUpdateBody.dob + emails = sandboxIndividualUpdateBody.emails?.toMutableList() + encryptedSsn = sandboxIndividualUpdateBody.encryptedSsn + ethnicity = sandboxIndividualUpdateBody.ethnicity + firstName = sandboxIndividualUpdateBody.firstName + gender = sandboxIndividualUpdateBody.gender + lastName = sandboxIndividualUpdateBody.lastName + middleName = sandboxIndividualUpdateBody.middleName + phoneNumbers = sandboxIndividualUpdateBody.phoneNumbers?.toMutableList() + preferredName = sandboxIndividualUpdateBody.preferredName + residence = sandboxIndividualUpdateBody.residence + ssn = sandboxIndividualUpdateBody.ssn + additionalProperties = + sandboxIndividualUpdateBody.additionalProperties.toMutableMap() } @JsonProperty("dob") fun dob(dob: String) = apply { this.dob = dob } @@ -256,18 +264,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxIndividualUpdateBody = SandboxIndividualUpdateBody( dob, @@ -555,9 +569,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("data") fun data(): String? = data + @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -578,9 +592,9 @@ constructor( @JvmSynthetic internal fun from(email: Email) = apply { - this.data = email.data - this.type = email.type - additionalProperties(email.additionalProperties) + data = email.data + type = email.type + additionalProperties = email.additionalProperties.toMutableMap() } @JsonProperty("data") fun data(data: String) = apply { this.data = data } @@ -589,18 +603,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Email = Email( data, @@ -856,9 +876,9 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("data") fun data(): String? = data + @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -879,9 +899,9 @@ constructor( @JvmSynthetic internal fun from(phoneNumber: PhoneNumber) = apply { - this.data = phoneNumber.data - this.type = phoneNumber.type - additionalProperties(phoneNumber.additionalProperties) + data = phoneNumber.data + type = phoneNumber.type + additionalProperties = phoneNumber.additionalProperties.toMutableMap() } @JsonProperty("data") fun data(data: String) = apply { this.data = data } @@ -890,18 +910,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PhoneNumber = PhoneNumber( data, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt index 1412fc7a..a76b6864 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt @@ -26,8 +26,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun type(): Type = type.getRequired("type") fun completionStatus(): CompletionStatus = completionStatus.getRequired("completion_status") @@ -40,6 +38,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SandboxJobConfiguration = apply { if (!validated) { type() @@ -63,9 +63,9 @@ private constructor( @JvmSynthetic internal fun from(sandboxJobConfiguration: SandboxJobConfiguration) = apply { - this.type = sandboxJobConfiguration.type - this.completionStatus = sandboxJobConfiguration.completionStatus - additionalProperties(sandboxJobConfiguration.additionalProperties) + type = sandboxJobConfiguration.type + completionStatus = sandboxJobConfiguration.completionStatus + additionalProperties = sandboxJobConfiguration.additionalProperties.toMutableMap() } fun type(type: Type) = type(JsonField.of(type)) @@ -85,18 +85,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxJobConfiguration = SandboxJobConfiguration( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt index cca375a1..48695183 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt @@ -54,15 +54,15 @@ constructor( @NoAutoDetect class SandboxJobConfigurationUpdateBody internal constructor( - private val completionStatus: CompletionStatus?, - private val type: Type?, + private val completionStatus: CompletionStatus, + private val type: Type, private val additionalProperties: Map, ) { @JsonProperty("completion_status") - fun completionStatus(): CompletionStatus? = completionStatus + fun completionStatus(): CompletionStatus = completionStatus - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Type = type @JsonAnyGetter @ExcludeMissing @@ -85,9 +85,10 @@ constructor( internal fun from( sandboxJobConfigurationUpdateBody: SandboxJobConfigurationUpdateBody ) = apply { - this.completionStatus = sandboxJobConfigurationUpdateBody.completionStatus - this.type = sandboxJobConfigurationUpdateBody.type - additionalProperties(sandboxJobConfigurationUpdateBody.additionalProperties) + completionStatus = sandboxJobConfigurationUpdateBody.completionStatus + type = sandboxJobConfigurationUpdateBody.type + additionalProperties = + sandboxJobConfigurationUpdateBody.additionalProperties.toMutableMap() } @JsonProperty("completion_status") @@ -99,18 +100,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxJobConfigurationUpdateBody = SandboxJobConfigurationUpdateBody( checkNotNull(completionStatus) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt index 5cbc45ea..86aa0c18 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt @@ -47,12 +47,12 @@ constructor( @NoAutoDetect class SandboxJobCreateBody internal constructor( - private val type: Type?, + private val type: Type, private val additionalProperties: Map, ) { /** The type of job to start. Currently the only supported type is `data_sync_all` */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Type = type @JsonAnyGetter @ExcludeMissing @@ -72,8 +72,8 @@ constructor( @JvmSynthetic internal fun from(sandboxJobCreateBody: SandboxJobCreateBody) = apply { - this.type = sandboxJobCreateBody.type - additionalProperties(sandboxJobCreateBody.additionalProperties) + type = sandboxJobCreateBody.type + additionalProperties = sandboxJobCreateBody.additionalProperties.toMutableMap() } /** The type of job to start. Currently the only supported type is `data_sync_all` */ @@ -81,18 +81,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxJobCreateBody = SandboxJobCreateBody( checkNotNull(type) { "`type` is required but was not set" }, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index fedfbba1..78442c4b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt @@ -69,11 +69,13 @@ constructor( private val additionalProperties: Map, ) { - @JsonProperty("end_date") fun endDate(): String? = endDate + @JsonProperty("end_date") fun endDate(): Optional = Optional.ofNullable(endDate) - @JsonProperty("pay_statements") fun payStatements(): List? = payStatements + @JsonProperty("pay_statements") + fun payStatements(): Optional> = Optional.ofNullable(payStatements) - @JsonProperty("start_date") fun startDate(): String? = startDate + @JsonProperty("start_date") + fun startDate(): Optional = Optional.ofNullable(startDate) @JsonAnyGetter @ExcludeMissing @@ -95,10 +97,10 @@ constructor( @JvmSynthetic internal fun from(sandboxPaymentCreateBody: SandboxPaymentCreateBody) = apply { - this.endDate = sandboxPaymentCreateBody.endDate - this.payStatements = sandboxPaymentCreateBody.payStatements - this.startDate = sandboxPaymentCreateBody.startDate - additionalProperties(sandboxPaymentCreateBody.additionalProperties) + endDate = sandboxPaymentCreateBody.endDate + payStatements = sandboxPaymentCreateBody.payStatements?.toMutableList() + startDate = sandboxPaymentCreateBody.startDate + additionalProperties = sandboxPaymentCreateBody.additionalProperties.toMutableMap() } @JsonProperty("end_date") @@ -114,18 +116,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SandboxPaymentCreateBody = SandboxPaymentCreateBody( endDate, @@ -344,33 +352,39 @@ constructor( ) { /** A stable Finch `id` (UUID v4) for an individual in the company */ - @JsonProperty("individual_id") fun individualId(): String? = individualId + @JsonProperty("individual_id") + fun individualId(): Optional = Optional.ofNullable(individualId) /** The type of the payment associated with the pay statement. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** The payment method. */ - @JsonProperty("payment_method") fun paymentMethod(): PaymentMethod? = paymentMethod + @JsonProperty("payment_method") + fun paymentMethod(): Optional = Optional.ofNullable(paymentMethod) /** The number of hours worked for this pay period */ - @JsonProperty("total_hours") fun totalHours(): Double? = totalHours + @JsonProperty("total_hours") + fun totalHours(): Optional = Optional.ofNullable(totalHours) - @JsonProperty("gross_pay") fun grossPay(): Money? = grossPay + @JsonProperty("gross_pay") fun grossPay(): Optional = Optional.ofNullable(grossPay) - @JsonProperty("net_pay") fun netPay(): Money? = netPay + @JsonProperty("net_pay") fun netPay(): Optional = Optional.ofNullable(netPay) /** The array of earnings objects associated with this pay statement */ - @JsonProperty("earnings") fun earnings(): List? = earnings + @JsonProperty("earnings") + fun earnings(): Optional> = Optional.ofNullable(earnings) /** The array of taxes objects associated with this pay statement. */ - @JsonProperty("taxes") fun taxes(): List? = taxes + @JsonProperty("taxes") fun taxes(): Optional> = Optional.ofNullable(taxes) /** The array of deductions objects associated with this pay statement. */ @JsonProperty("employee_deductions") - fun employeeDeductions(): List? = employeeDeductions + fun employeeDeductions(): Optional> = + Optional.ofNullable(employeeDeductions) @JsonProperty("employer_contributions") - fun employerContributions(): List? = employerContributions + fun employerContributions(): Optional> = + Optional.ofNullable(employerContributions) @JsonAnyGetter @ExcludeMissing @@ -399,17 +413,17 @@ constructor( @JvmSynthetic internal fun from(payStatement: PayStatement) = apply { - this.individualId = payStatement.individualId - this.type = payStatement.type - this.paymentMethod = payStatement.paymentMethod - this.totalHours = payStatement.totalHours - this.grossPay = payStatement.grossPay - this.netPay = payStatement.netPay - this.earnings = payStatement.earnings - this.taxes = payStatement.taxes - this.employeeDeductions = payStatement.employeeDeductions - this.employerContributions = payStatement.employerContributions - additionalProperties(payStatement.additionalProperties) + individualId = payStatement.individualId + type = payStatement.type + paymentMethod = payStatement.paymentMethod + totalHours = payStatement.totalHours + grossPay = payStatement.grossPay + netPay = payStatement.netPay + earnings = payStatement.earnings?.toMutableList() + taxes = payStatement.taxes?.toMutableList() + employeeDeductions = payStatement.employeeDeductions?.toMutableList() + employerContributions = payStatement.employerContributions?.toMutableList() + additionalProperties = payStatement.additionalProperties.toMutableMap() } /** A stable Finch `id` (UUID v4) for an individual in the company */ @@ -454,18 +468,24 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): PayStatement = PayStatement( individualId, @@ -495,22 +515,23 @@ constructor( ) { /** The type of earning. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** The exact name of the deduction from the pay statement. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) /** The earnings amount in cents. */ - @JsonProperty("amount") fun amount(): Long? = amount + @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) /** The earnings currency code. */ - @JsonProperty("currency") fun currency(): String? = currency + @JsonProperty("currency") + fun currency(): Optional = Optional.ofNullable(currency) /** * The number of hours associated with this earning. (For salaried employees, this could * be hours per pay period, `0` or `null`, depending on the provider). */ - @JsonProperty("hours") fun hours(): Double? = hours + @JsonProperty("hours") fun hours(): Optional = Optional.ofNullable(hours) @JsonAnyGetter @ExcludeMissing @@ -534,12 +555,12 @@ constructor( @JvmSynthetic internal fun from(earning: Earning) = apply { - this.type = earning.type - this.name = earning.name - this.amount = earning.amount - this.currency = earning.currency - this.hours = earning.hours - additionalProperties(earning.additionalProperties) + type = earning.type + name = earning.name + amount = earning.amount + currency = earning.currency + hours = earning.hours + additionalProperties = earning.additionalProperties.toMutableMap() } /** The type of earning. */ @@ -563,12 +584,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -576,6 +597,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Earning = Earning( type, @@ -741,19 +770,20 @@ constructor( ) { /** The deduction name from the pay statement. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) /** The deduction amount in cents. */ - @JsonProperty("amount") fun amount(): Long? = amount + @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) /** The deduction currency. */ - @JsonProperty("currency") fun currency(): String? = currency + @JsonProperty("currency") + fun currency(): Optional = Optional.ofNullable(currency) /** Boolean indicating if the deduction is pre-tax. */ - @JsonProperty("pre_tax") fun preTax(): Boolean? = preTax + @JsonProperty("pre_tax") fun preTax(): Optional = Optional.ofNullable(preTax) /** Type of benefit. */ - @JsonProperty("type") fun type(): BenefitType? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -777,12 +807,12 @@ constructor( @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { - this.name = employeeDeduction.name - this.amount = employeeDeduction.amount - this.currency = employeeDeduction.currency - this.preTax = employeeDeduction.preTax - this.type = employeeDeduction.type - additionalProperties(employeeDeduction.additionalProperties) + name = employeeDeduction.name + amount = employeeDeduction.amount + currency = employeeDeduction.currency + preTax = employeeDeduction.preTax + type = employeeDeduction.type + additionalProperties = employeeDeduction.additionalProperties.toMutableMap() } /** The deduction name from the pay statement. */ @@ -804,12 +834,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -817,6 +847,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployeeDeduction = EmployeeDeduction( name, @@ -858,16 +896,17 @@ constructor( ) { /** The contribution name from the pay statement. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) /** The contribution amount in cents. */ - @JsonProperty("amount") fun amount(): Long? = amount + @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) /** The contribution currency. */ - @JsonProperty("currency") fun currency(): String? = currency + @JsonProperty("currency") + fun currency(): Optional = Optional.ofNullable(currency) /** Type of benefit. */ - @JsonProperty("type") fun type(): BenefitType? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -890,11 +929,11 @@ constructor( @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { - this.name = employerContribution.name - this.amount = employerContribution.amount - this.currency = employerContribution.currency - this.type = employerContribution.type - additionalProperties(employerContribution.additionalProperties) + name = employerContribution.name + amount = employerContribution.amount + currency = employerContribution.currency + type = employerContribution.type + additionalProperties = employerContribution.additionalProperties.toMutableMap() } /** The contribution name from the pay statement. */ @@ -912,12 +951,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -925,6 +964,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): EmployerContribution = EmployerContribution( name, @@ -1023,19 +1070,21 @@ constructor( ) { /** The type of taxes. */ - @JsonProperty("type") fun type(): Type? = type + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) /** The exact name of tax from the pay statement. */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) /** `true` if the amount is paid by the employers. */ - @JsonProperty("employer") fun employer(): Boolean? = employer + @JsonProperty("employer") + fun employer(): Optional = Optional.ofNullable(employer) /** The tax amount in cents. */ - @JsonProperty("amount") fun amount(): Long? = amount + @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) /** The currency code. */ - @JsonProperty("currency") fun currency(): String? = currency + @JsonProperty("currency") + fun currency(): Optional = Optional.ofNullable(currency) @JsonAnyGetter @ExcludeMissing @@ -1059,12 +1108,12 @@ constructor( @JvmSynthetic internal fun from(tax: Tax) = apply { - this.type = tax.type - this.name = tax.name - this.employer = tax.employer - this.amount = tax.amount - this.currency = tax.currency - additionalProperties(tax.additionalProperties) + type = tax.type + name = tax.name + employer = tax.employer + amount = tax.amount + currency = tax.currency + additionalProperties = tax.additionalProperties.toMutableMap() } /** The type of taxes. */ @@ -1086,12 +1135,12 @@ constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = @@ -1099,6 +1148,14 @@ constructor( this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Tax = Tax( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt index 861f7dbc..e0592eef 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt @@ -23,8 +23,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The unique identifier for the created connect session */ fun sessionId(): String = sessionId.getRequired("session_id") @@ -41,6 +39,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SessionNewResponse = apply { if (!validated) { sessionId() @@ -64,9 +64,9 @@ private constructor( @JvmSynthetic internal fun from(sessionNewResponse: SessionNewResponse) = apply { - this.sessionId = sessionNewResponse.sessionId - this.connectUrl = sessionNewResponse.connectUrl - additionalProperties(sessionNewResponse.additionalProperties) + sessionId = sessionNewResponse.sessionId + connectUrl = sessionNewResponse.connectUrl + additionalProperties = sessionNewResponse.additionalProperties.toMutableMap() } /** The unique identifier for the created connect session */ @@ -87,18 +87,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SessionNewResponse = SessionNewResponse( sessionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt index b6d8d15e..49d2510e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt @@ -23,8 +23,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** The unique identifier for the created connect session */ fun sessionId(): String = sessionId.getRequired("session_id") @@ -41,6 +39,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SessionReauthenticateResponse = apply { if (!validated) { sessionId() @@ -64,9 +64,9 @@ private constructor( @JvmSynthetic internal fun from(sessionReauthenticateResponse: SessionReauthenticateResponse) = apply { - this.sessionId = sessionReauthenticateResponse.sessionId - this.connectUrl = sessionReauthenticateResponse.connectUrl - additionalProperties(sessionReauthenticateResponse.additionalProperties) + sessionId = sessionReauthenticateResponse.sessionId + connectUrl = sessionReauthenticateResponse.connectUrl + additionalProperties = sessionReauthenticateResponse.additionalProperties.toMutableMap() } /** The unique identifier for the created connect session */ @@ -87,18 +87,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SessionReauthenticateResponse = SessionReauthenticateResponse( sessionId, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt index 9cdada36..eb344a52 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt @@ -24,8 +24,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun companyBenefits(): Optional = Optional.ofNullable(companyBenefits.getNullable("company_benefits")) @@ -42,6 +40,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportPerBenefitType = apply { if (!validated) { companyBenefits().map { it.validate() } @@ -65,9 +65,9 @@ private constructor( @JvmSynthetic internal fun from(supportPerBenefitType: SupportPerBenefitType) = apply { - this.companyBenefits = supportPerBenefitType.companyBenefits - this.individualBenefits = supportPerBenefitType.individualBenefits - additionalProperties(supportPerBenefitType.additionalProperties) + companyBenefits = supportPerBenefitType.companyBenefits + individualBenefits = supportPerBenefitType.individualBenefits + additionalProperties = supportPerBenefitType.additionalProperties.toMutableMap() } fun companyBenefits(companyBenefits: OperationSupportMatrix) = @@ -90,18 +90,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportPerBenefitType = SupportPerBenefitType( companyBenefits, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt index 670fdc1e..9ace9456 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt @@ -33,8 +33,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Type of benefit. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -107,6 +105,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): SupportedBenefit = apply { if (!validated) { type() @@ -142,15 +142,15 @@ private constructor( @JvmSynthetic internal fun from(supportedBenefit: SupportedBenefit) = apply { - this.type = supportedBenefit.type - this.description = supportedBenefit.description - this.frequencies = supportedBenefit.frequencies - this.employeeDeduction = supportedBenefit.employeeDeduction - this.companyContribution = supportedBenefit.companyContribution - this.annualMaximum = supportedBenefit.annualMaximum - this.catchUp = supportedBenefit.catchUp - this.hsaContributionLimit = supportedBenefit.hsaContributionLimit - additionalProperties(supportedBenefit.additionalProperties) + type = supportedBenefit.type + description = supportedBenefit.description + frequencies = supportedBenefit.frequencies + employeeDeduction = supportedBenefit.employeeDeduction + companyContribution = supportedBenefit.companyContribution + annualMaximum = supportedBenefit.annualMaximum + catchUp = supportedBenefit.catchUp + hsaContributionLimit = supportedBenefit.hsaContributionLimit + additionalProperties = supportedBenefit.additionalProperties.toMutableMap() } /** Type of benefit. */ @@ -249,18 +249,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): SupportedBenefit = SupportedBenefit( type, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt index 31cd41c2..3d22a753 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt @@ -25,8 +25,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) @@ -46,6 +44,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): UnenrolledIndividual = apply { if (!validated) { individualId() @@ -71,10 +71,10 @@ private constructor( @JvmSynthetic internal fun from(unenrolledIndividual: UnenrolledIndividual) = apply { - this.individualId = unenrolledIndividual.individualId - this.code = unenrolledIndividual.code - this.body = unenrolledIndividual.body - additionalProperties(unenrolledIndividual.additionalProperties) + individualId = unenrolledIndividual.individualId + code = unenrolledIndividual.code + body = unenrolledIndividual.body + additionalProperties = unenrolledIndividual.additionalProperties.toMutableMap() } fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -101,18 +101,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): UnenrolledIndividual = UnenrolledIndividual( individualId, @@ -132,8 +138,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - /** Identifier indicating whether the benefit was newly enrolled or updated. */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -156,6 +160,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Body = apply { if (!validated) { name() @@ -181,10 +187,10 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { - this.name = body.name - this.finchCode = body.finchCode - this.message = body.message - additionalProperties(body.additionalProperties) + name = body.name + finchCode = body.finchCode + message = body.message + additionalProperties = body.additionalProperties.toMutableMap() } /** Identifier indicating whether the benefit was newly enrolled or updated. */ @@ -213,18 +219,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): Body = Body( name, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt index e28516c4..0007a4e2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt @@ -22,8 +22,6 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false - fun benefitId(): String = benefitId.getRequired("benefit_id") @JsonProperty("benefit_id") @ExcludeMissing fun _benefitId() = benefitId @@ -32,6 +30,8 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): UpdateCompanyBenefitResponse = apply { if (!validated) { benefitId() @@ -53,8 +53,8 @@ private constructor( @JvmSynthetic internal fun from(updateCompanyBenefitResponse: UpdateCompanyBenefitResponse) = apply { - this.benefitId = updateCompanyBenefitResponse.benefitId - additionalProperties(updateCompanyBenefitResponse.additionalProperties) + benefitId = updateCompanyBenefitResponse.benefitId + additionalProperties = updateCompanyBenefitResponse.additionalProperties.toMutableMap() } fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) @@ -65,18 +65,24 @@ private constructor( fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) + putAllAdditionalProperties(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) + additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + fun build(): UpdateCompanyBenefitResponse = UpdateCompanyBenefitResponse(benefitId, additionalProperties.toImmutable()) } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccessTokenCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccessTokenCreateParamsTest.kt index a853a057..e4779e68 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccessTokenCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccessTokenCreateParamsTest.kt @@ -29,9 +29,9 @@ class AccessTokenCreateParamsTest { val body = params.getBody() assertThat(body).isNotNull assertThat(body.code()).isEqualTo("") - assertThat(body.clientId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(body.clientSecret()).isEqualTo("") - assertThat(body.redirectUri()).isEqualTo("https://example.com") + assertThat(body.clientId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.clientSecret()).contains("") + assertThat(body.redirectUri()).contains("https://example.com") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt index 5ab13be5..0710ca50 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt @@ -52,18 +52,18 @@ class ConnectSessionNewParamsTest { assertThat(body.customerName()).isEqualTo("x") assertThat(body.products()) .isEqualTo(listOf(ConnectSessionNewParams.ConnectProducts.COMPANY)) - assertThat(body.customerEmail()).isEqualTo("dev@stainlessapi.com") + assertThat(body.customerEmail()).contains("dev@stainlessapi.com") assertThat(body.integration()) - .isEqualTo( + .contains( ConnectSessionNewParams.Integration.builder() .authMethod(ConnectSessionNewParams.Integration.AuthMethod.ASSISTED) .provider("provider") .build() ) - assertThat(body.manual()).isEqualTo(true) - assertThat(body.minutesToExpire()).isEqualTo(1.0) - assertThat(body.redirectUri()).isEqualTo("redirect_uri") - assertThat(body.sandbox()).isEqualTo(ConnectSessionNewParams.Sandbox.FINCH) + assertThat(body.manual()).contains(true) + assertThat(body.minutesToExpire()).contains(1.0) + assertThat(body.redirectUri()).contains("redirect_uri") + assertThat(body.sandbox()).contains(ConnectSessionNewParams.Sandbox.FINCH) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt index 6e091f6c..8bcdce50 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt @@ -29,10 +29,10 @@ class ConnectSessionReauthenticateParamsTest { val body = params.getBody() assertThat(body).isNotNull assertThat(body.connectionId()).isEqualTo("connection_id") - assertThat(body.minutesToExpire()).isEqualTo(0L) + assertThat(body.minutesToExpire()).contains(0L) assertThat(body.products()) - .isEqualTo(listOf(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY)) - assertThat(body.redirectUri()).isEqualTo("https://example.com") + .contains(listOf(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY)) + assertThat(body.redirectUri()).contains("https://example.com") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitCreateParamsTest.kt index 0e43ccd7..342c46e5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitCreateParamsTest.kt @@ -26,9 +26,9 @@ class HrisBenefitCreateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.description()).isEqualTo("description") - assertThat(body.frequency()).isEqualTo(BenefitFrequency.ONE_TIME) - assertThat(body.type()).isEqualTo(BenefitType._401K) + assertThat(body.description()).contains("description") + assertThat(body.frequency()).contains(BenefitFrequency.ONE_TIME) + assertThat(body.type()).contains(BenefitType._401K) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt index 31c8d60c..74ebc36e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt @@ -24,7 +24,7 @@ class HrisBenefitIndividualUnenrollManyParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.individualIds()).isEqualTo(listOf("string")) + assertThat(body.individualIds()).contains(listOf("string")) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt index 7d964aac..cc9b6ab7 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt @@ -21,7 +21,7 @@ class HrisBenefitUpdateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.description()).isEqualTo("description") + assertThat(body.description()).contains("description") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt index b6c3d852..6cb7fdac 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt @@ -43,11 +43,11 @@ class HrisIndividualRetrieveManyParamsTest { val body = params.getBody() assertThat(body).isNotNull assertThat(body.options()) - .isEqualTo( + .contains( HrisIndividualRetrieveManyParams.Options.builder().include(listOf("string")).build() ) assertThat(body.requests()) - .isEqualTo( + .contains( listOf( HrisIndividualRetrieveManyParams.Request.builder() .individualId("individual_id") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardParamsTest.kt index ca20418f..9c384e5e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardParamsTest.kt @@ -32,9 +32,9 @@ class RequestForwardingForwardParamsTest { assertThat(body.method()).isEqualTo("POST") assertThat(body.route()).isEqualTo("/people/search") assertThat(body.headers()) - .isEqualTo(JsonValue.from(mapOf("content-type" to "application/json"))) + .contains(JsonValue.from(mapOf("content-type" to "application/json"))) assertThat(body.params()) - .isEqualTo(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) + .contains(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt index 31a66c38..78f95dbe 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt @@ -115,7 +115,7 @@ class SandboxCompanyUpdateParamsTest { val body = params.getBody() assertThat(body).isNotNull assertThat(body.accounts()) - .isEqualTo( + .contains( listOf( SandboxCompanyUpdateParams.Account.builder() .accountName("account_name") @@ -127,7 +127,7 @@ class SandboxCompanyUpdateParamsTest { ) ) assertThat(body.departments()) - .isEqualTo( + .contains( listOf( SandboxCompanyUpdateParams.Department.builder() .name("name") @@ -139,17 +139,17 @@ class SandboxCompanyUpdateParamsTest { .build() ) ) - assertThat(body.ein()).isEqualTo("ein") + assertThat(body.ein()).contains("ein") assertThat(body.entity()) - .isEqualTo( + .contains( SandboxCompanyUpdateParams.Entity.builder() .subtype(SandboxCompanyUpdateParams.Entity.Subtype.S_CORPORATION) .type(SandboxCompanyUpdateParams.Entity.Type.LLC) .build() ) - assertThat(body.legalName()).isEqualTo("legal_name") + assertThat(body.legalName()).contains("legal_name") assertThat(body.locations()) - .isEqualTo( + .contains( listOf( Location.builder() .city("city") @@ -163,8 +163,8 @@ class SandboxCompanyUpdateParamsTest { .build() ) ) - assertThat(body.primaryEmail()).isEqualTo("primary_email") - assertThat(body.primaryPhoneNumber()).isEqualTo("primary_phone_number") + assertThat(body.primaryEmail()).contains("primary_email") + assertThat(body.primaryPhoneNumber()).contains("primary_phone_number") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt index baae8277..e3edeb1f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt @@ -33,8 +33,8 @@ class SandboxConnectionAccountCreateParamsTest { assertThat(body.companyId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) - .isEqualTo(SandboxConnectionAccountCreateParams.AuthenticationType.CREDENTIAL) - assertThat(body.products()).isEqualTo(listOf("string")) + .contains(SandboxConnectionAccountCreateParams.AuthenticationType.CREDENTIAL) + assertThat(body.products()).contains(listOf("string")) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt index a152cf9e..1e5682f5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt @@ -22,7 +22,7 @@ class SandboxConnectionAccountUpdateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.connectionStatus()).isEqualTo(ConnectionStatusType.PENDING) + assertThat(body.connectionStatus()).contains(ConnectionStatusType.PENDING) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt index 074f1205..b1ab1137 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt @@ -30,9 +30,9 @@ class SandboxConnectionCreateParamsTest { assertThat(body).isNotNull assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) - .isEqualTo(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) - assertThat(body.employeeSize()).isEqualTo(0L) - assertThat(body.products()).isEqualTo(listOf("string")) + .contains(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) + assertThat(body.employeeSize()).contains(0L) + assertThat(body.products()).contains(listOf("string")) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt index ba6698c7..92630138 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt @@ -137,9 +137,9 @@ class SandboxEmploymentUpdateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.classCode()).isEqualTo("class_code") + assertThat(body.classCode()).contains("class_code") assertThat(body.customFields()) - .isEqualTo( + .contains( listOf( SandboxEmploymentUpdateParams.CustomField.builder() .name("name") @@ -148,20 +148,20 @@ class SandboxEmploymentUpdateParamsTest { ) ) assertThat(body.department()) - .isEqualTo(SandboxEmploymentUpdateParams.Department.builder().name("name").build()) + .contains(SandboxEmploymentUpdateParams.Department.builder().name("name").build()) assertThat(body.employment()) - .isEqualTo( + .contains( SandboxEmploymentUpdateParams.Employment.builder() .subtype(SandboxEmploymentUpdateParams.Employment.Subtype.FULL_TIME) .type(SandboxEmploymentUpdateParams.Employment.Type.EMPLOYEE) .build() ) assertThat(body.employmentStatus()) - .isEqualTo(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) - assertThat(body.endDate()).isEqualTo("end_date") - assertThat(body.firstName()).isEqualTo("first_name") + .contains(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) + assertThat(body.endDate()).contains("end_date") + assertThat(body.firstName()).contains("first_name") assertThat(body.income()) - .isEqualTo( + .contains( Income.builder() .amount(0L) .currency("currency") @@ -170,7 +170,7 @@ class SandboxEmploymentUpdateParamsTest { .build() ) assertThat(body.incomeHistory()) - .isEqualTo( + .contains( listOf( Income.builder() .amount(0L) @@ -180,11 +180,11 @@ class SandboxEmploymentUpdateParamsTest { .build() ) ) - assertThat(body.isActive()).isEqualTo(true) - assertThat(body.lastName()).isEqualTo("last_name") - assertThat(body.latestRehireDate()).isEqualTo("latest_rehire_date") + assertThat(body.isActive()).contains(true) + assertThat(body.lastName()).contains("last_name") + assertThat(body.latestRehireDate()).contains("latest_rehire_date") assertThat(body.location()) - .isEqualTo( + .contains( Location.builder() .city("city") .country("country") @@ -197,11 +197,11 @@ class SandboxEmploymentUpdateParamsTest { .build() ) assertThat(body.manager()) - .isEqualTo(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) - assertThat(body.middleName()).isEqualTo("middle_name") - assertThat(body.sourceId()).isEqualTo("source_id") - assertThat(body.startDate()).isEqualTo("3/4/2020") - assertThat(body.title()).isEqualTo("title") + .contains(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) + assertThat(body.middleName()).contains("middle_name") + assertThat(body.sourceId()).contains("source_id") + assertThat(body.startDate()).contains("3/4/2020") + assertThat(body.title()).contains("title") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt index 35fa8848..464cec4e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt @@ -96,9 +96,9 @@ class SandboxIndividualUpdateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.dob()).isEqualTo("12/20/1989") + assertThat(body.dob()).contains("12/20/1989") assertThat(body.emails()) - .isEqualTo( + .contains( listOf( SandboxIndividualUpdateParams.Email.builder() .data("data") @@ -106,14 +106,14 @@ class SandboxIndividualUpdateParamsTest { .build() ) ) - assertThat(body.encryptedSsn()).isEqualTo("encrypted_ssn") - assertThat(body.ethnicity()).isEqualTo(SandboxIndividualUpdateParams.Ethnicity.ASIAN) - assertThat(body.firstName()).isEqualTo("first_name") - assertThat(body.gender()).isEqualTo(SandboxIndividualUpdateParams.Gender.FEMALE) - assertThat(body.lastName()).isEqualTo("last_name") - assertThat(body.middleName()).isEqualTo("middle_name") + assertThat(body.encryptedSsn()).contains("encrypted_ssn") + assertThat(body.ethnicity()).contains(SandboxIndividualUpdateParams.Ethnicity.ASIAN) + assertThat(body.firstName()).contains("first_name") + assertThat(body.gender()).contains(SandboxIndividualUpdateParams.Gender.FEMALE) + assertThat(body.lastName()).contains("last_name") + assertThat(body.middleName()).contains("middle_name") assertThat(body.phoneNumbers()) - .isEqualTo( + .contains( listOf( SandboxIndividualUpdateParams.PhoneNumber.builder() .data("data") @@ -121,9 +121,9 @@ class SandboxIndividualUpdateParamsTest { .build() ) ) - assertThat(body.preferredName()).isEqualTo("preferred_name") + assertThat(body.preferredName()).contains("preferred_name") assertThat(body.residence()) - .isEqualTo( + .contains( Location.builder() .city("city") .country("country") @@ -135,7 +135,7 @@ class SandboxIndividualUpdateParamsTest { .state("state") .build() ) - assertThat(body.ssn()).isEqualTo("ssn") + assertThat(body.ssn()).contains("ssn") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt index c5af6b03..85c3dc8c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt @@ -146,9 +146,9 @@ class SandboxPaymentCreateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.endDate()).isEqualTo("end_date") + assertThat(body.endDate()).contains("end_date") assertThat(body.payStatements()) - .isEqualTo( + .contains( listOf( SandboxPaymentCreateParams.PayStatement.builder() .earnings( @@ -206,7 +206,7 @@ class SandboxPaymentCreateParamsTest { .build() ) ) - assertThat(body.startDate()).isEqualTo("start_date") + assertThat(body.startDate()).contains("start_date") } @Test From 418c911946742d49875c927b53dd86ddd750d59a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:54:04 +0000 Subject: [PATCH 2/7] refactor(internal): use constructor to deserialize json (#371) --- .../kotlin/com/tryfinch/api/core/Utils.kt | 4 +- .../com/tryfinch/api/errors/FinchError.kt | 9 +- .../api/models/AccessTokenCreateParams.kt | 22 +- .../api/models/AccountCreateResponse.kt | 49 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 1164 +++++++++-------- .../api/models/AccountUpdateResponse.kt | 43 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 51 +- .../api/models/AutomatedCreateResponse.kt | 30 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 26 +- .../api/models/BenefitContribution.kt | 15 +- .../models/BenefitFeaturesAndOperations.kt | 67 +- .../tryfinch/api/models/BenefitsSupport.kt | 80 +- .../kotlin/com/tryfinch/api/models/Company.kt | 139 +- .../com/tryfinch/api/models/CompanyBenefit.kt | 32 +- .../com/tryfinch/api/models/CompanyEvent.kt | 41 +- .../api/models/CompanyUpdateResponse.kt | 135 +- .../api/models/ConnectSessionNewParams.kt | 48 +- .../ConnectSessionReauthenticateParams.kt | 20 +- .../api/models/ConnectionCreateResponse.kt | 55 +- .../api/models/CreateAccessTokenResponse.kt | 67 +- .../models/CreateCompanyBenefitsResponse.kt | 14 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 47 +- .../tryfinch/api/models/DisconnectResponse.kt | 14 +- .../com/tryfinch/api/models/EmploymentData.kt | 177 ++- .../api/models/EmploymentDataResponse.kt | 24 +- .../tryfinch/api/models/EmploymentEvent.kt | 47 +- .../api/models/EmploymentUpdateResponse.kt | 171 ++- .../tryfinch/api/models/EnrolledIndividual.kt | 45 +- .../api/models/HrisBenefitCreateParams.kt | 19 +- ...nefitIndividualRetrieveManyBenefitsPage.kt | 13 +- ...IndividualRetrieveManyBenefitsPageAsync.kt | 13 +- .../HrisBenefitIndividualUnenrollManyPage.kt | 13 +- ...sBenefitIndividualUnenrollManyPageAsync.kt | 13 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 12 +- .../api/models/HrisBenefitListPage.kt | 13 +- .../api/models/HrisBenefitListPageAsync.kt | 13 +- .../HrisBenefitListSupportedBenefitsPage.kt | 13 +- ...isBenefitListSupportedBenefitsPageAsync.kt | 13 +- .../api/models/HrisBenefitUpdateParams.kt | 12 +- .../HrisDirectoryListIndividualsPage.kt | 16 +- .../HrisDirectoryListIndividualsPageAsync.kt | 16 +- .../api/models/HrisDirectoryListPage.kt | 16 +- .../api/models/HrisDirectoryListPageAsync.kt | 16 +- .../models/HrisEmploymentRetrieveManyPage.kt | 13 +- .../HrisEmploymentRetrieveManyPageAsync.kt | 13 +- .../HrisEmploymentRetrieveManyParams.kt | 21 +- .../models/HrisIndividualRetrieveManyPage.kt | 13 +- .../HrisIndividualRetrieveManyPageAsync.kt | 13 +- .../HrisIndividualRetrieveManyParams.kt | 33 +- .../HrisPayStatementRetrieveManyPage.kt | 13 +- .../HrisPayStatementRetrieveManyPageAsync.kt | 13 +- .../HrisPayStatementRetrieveManyParams.kt | 29 +- .../api/models/HrisPaymentListPage.kt | 12 +- .../api/models/HrisPaymentListPageAsync.kt | 12 +- .../kotlin/com/tryfinch/api/models/Income.kt | 27 +- .../com/tryfinch/api/models/Individual.kt | 111 +- .../tryfinch/api/models/IndividualBenefit.kt | 57 +- .../models/IndividualEnrolledIdsResponse.kt | 20 +- .../tryfinch/api/models/IndividualEvent.kt | 47 +- .../api/models/IndividualInDirectory.kt | 70 +- .../tryfinch/api/models/IndividualResponse.kt | 24 +- .../api/models/IndividualUpdateResponse.kt | 111 +- .../com/tryfinch/api/models/Introspection.kt | 161 ++- .../api/models/JobAutomatedCreateParams.kt | 24 +- .../api/models/JobAutomatedListPage.kt | 16 +- .../api/models/JobAutomatedListPageAsync.kt | 16 +- .../tryfinch/api/models/JobCompletionEvent.kt | 53 +- .../tryfinch/api/models/JobCreateResponse.kt | 30 +- .../com/tryfinch/api/models/Location.kt | 46 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 23 +- .../kotlin/com/tryfinch/api/models/Money.kt | 18 +- .../api/models/OperationSupportMatrix.kt | 32 +- .../kotlin/com/tryfinch/api/models/Paging.kt | 16 +- .../api/models/PayGroupListResponse.kt | 21 +- .../api/models/PayGroupRetrieveResponse.kt | 27 +- .../com/tryfinch/api/models/PayStatement.kt | 199 ++- .../tryfinch/api/models/PayStatementEvent.kt | 53 +- .../api/models/PayStatementResponse.kt | 24 +- .../api/models/PayStatementResponseBody.kt | 20 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 95 +- .../api/models/PaymentCreateResponse.kt | 20 +- .../com/tryfinch/api/models/PaymentEvent.kt | 55 +- .../api/models/PayrollPayGroupListPage.kt | 13 +- .../models/PayrollPayGroupListPageAsync.kt | 13 +- .../com/tryfinch/api/models/Provider.kt | 1151 ++++++++-------- .../tryfinch/api/models/ProviderListPage.kt | 12 +- .../api/models/ProviderListPageAsync.kt | 12 +- .../models/RequestForwardingForwardParams.kt | 28 +- .../RequestForwardingForwardResponse.kt | 60 +- .../api/models/SandboxCompanyUpdateParams.kt | 92 +- .../SandboxConnectionAccountCreateParams.kt | 20 +- .../SandboxConnectionAccountUpdateParams.kt | 12 +- .../models/SandboxConnectionCreateParams.kt | 20 +- .../models/SandboxDirectoryCreateParams.kt | 175 ++- .../models/SandboxEmploymentUpdateParams.kt | 111 +- .../models/SandboxIndividualUpdateParams.kt | 76 +- .../api/models/SandboxJobConfiguration.kt | 17 +- .../SandboxJobConfigurationUpdateParams.kt | 15 +- .../api/models/SandboxJobCreateParams.kt | 12 +- .../api/models/SandboxPaymentCreateParams.kt | 148 +-- .../tryfinch/api/models/SessionNewResponse.kt | 20 +- .../models/SessionReauthenticateResponse.kt | 20 +- .../api/models/SupportPerBenefitType.kt | 20 +- .../tryfinch/api/models/SupportedBenefit.kt | 55 +- .../api/models/UnenrolledIndividual.kt | 46 +- .../models/UpdateCompanyBenefitResponse.kt | 14 +- 106 files changed, 3193 insertions(+), 3417 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt index 602e77c6..c2f32509 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt @@ -17,7 +17,9 @@ internal fun List.toImmutable(): List = @JvmSynthetic internal fun Map.toImmutable(): Map = - if (isEmpty()) Collections.emptyMap() else Collections.unmodifiableMap(toMap()) + if (isEmpty()) immutableEmptyMap() else Collections.unmodifiableMap(toMap()) + +@JvmSynthetic internal fun immutableEmptyMap(): Map = Collections.emptyMap() @JvmSynthetic internal fun , V> SortedMap.toImmutable(): SortedMap = diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt index 3897a476..da8d7b2e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt @@ -4,21 +4,23 @@ package com.tryfinch.api.errors import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = FinchError.Builder::class) @NoAutoDetect class FinchError +@JsonCreator private constructor( @JsonAnyGetter @ExcludeMissing + @JsonAnySetter @get:JvmName("additionalProperties") - val additionalProperties: Map, + val additionalProperties: Map = immutableEmptyMap(), ) { fun toBuilder() = Builder().from(this) @@ -42,7 +44,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt index 61e4e4cf..7053a2db 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -55,15 +56,16 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = AccessTokenCreateBody.Builder::class) @NoAutoDetect class AccessTokenCreateBody + @JsonCreator internal constructor( - private val code: String, - private val clientId: String?, - private val clientSecret: String?, - private val redirectUri: String?, - private val additionalProperties: Map, + @JsonProperty("code") private val code: String, + @JsonProperty("client_id") private val clientId: String?, + @JsonProperty("client_secret") private val clientSecret: String?, + @JsonProperty("redirect_uri") private val redirectUri: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("code") fun code(): String = code @@ -104,15 +106,12 @@ constructor( additionalProperties = accessTokenCreateBody.additionalProperties.toMutableMap() } - @JsonProperty("code") fun code(code: String) = apply { this.code = code } + fun code(code: String) = apply { this.code = code } - @JsonProperty("client_id") fun clientId(clientId: String) = apply { this.clientId = clientId } - @JsonProperty("client_secret") fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret } - @JsonProperty("redirect_uri") fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } fun additionalProperties(additionalProperties: Map) = apply { @@ -120,7 +119,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt index 474d3a2b..e8bf4cca 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt @@ -6,29 +6,43 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects -@JsonDeserialize(builder = AccountCreateResponse.Builder::class) @NoAutoDetect class AccountCreateResponse +@JsonCreator private constructor( - private val connectionId: JsonField, - private val companyId: JsonField, - private val providerId: JsonField, - private val accountId: JsonField, - private val authenticationType: JsonField, - private val products: JsonField>, - private val accessToken: JsonField, - private val additionalProperties: Map, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("provider_id") + @ExcludeMissing + private val providerId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("authentication_type") + @ExcludeMissing + private val authenticationType: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonProperty("access_token") + @ExcludeMissing + private val accessToken: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the new connection */ @@ -123,8 +137,6 @@ private constructor( fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) /** The ID of the new connection */ - @JsonProperty("connection_id") - @ExcludeMissing fun connectionId(connectionId: JsonField) = apply { this.connectionId = connectionId } @@ -133,45 +145,33 @@ private constructor( fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") - @ExcludeMissing fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The ID of the provider associated with the `access_token` */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token` */ - @JsonProperty("provider_id") - @ExcludeMissing fun providerId(providerId: JsonField) = apply { this.providerId = providerId } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") - @ExcludeMissing fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = authenticationType(JsonField.of(authenticationType)) - @JsonProperty("authentication_type") - @ExcludeMissing fun authenticationType(authenticationType: JsonField) = apply { this.authenticationType = authenticationType } fun products(products: List) = products(JsonField.of(products)) - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) - @JsonProperty("access_token") - @ExcludeMissing fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } fun additionalProperties(additionalProperties: Map) = apply { @@ -179,7 +179,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt index dd4b4361..5feb948b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = AccountUpdateEvent.Builder::class) @NoAutoDetect class AccountUpdateEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,13 +197,18 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val status: JsonField, - private val authenticationMethod: JsonField, - private val additionalProperties: Map, + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonProperty("authentication_method") + @ExcludeMissing + private val authenticationMethod: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun status(): ConnectionStatusType = status.getRequired("status") @@ -256,15 +258,11 @@ private constructor( 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 @@ -275,7 +273,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -298,14 +295,21 @@ private constructor( ) } - @JsonDeserialize(builder = AuthenticationMethod.Builder::class) @NoAutoDetect class AuthenticationMethod + @JsonCreator private constructor( - private val type: JsonField, - private val benefitsSupport: JsonField, - private val supportedFields: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("benefits_support") + @ExcludeMissing + private val benefitsSupport: JsonField = JsonMissing.of(), + @JsonProperty("supported_fields") + @ExcludeMissing + private val supportedFields: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of authentication method. */ @@ -379,8 +383,6 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of authentication method. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** @@ -394,8 +396,6 @@ private constructor( * 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 } @@ -405,8 +405,6 @@ private constructor( 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 } @@ -416,7 +414,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -444,18 +441,33 @@ private constructor( } /** The supported data fields returned by our HR and payroll endpoints */ - @JsonDeserialize(builder = SupportedFields.Builder::class) @NoAutoDetect class SupportedFields + @JsonCreator 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 payGroup: JsonField, - private val additionalProperties: Map, + @JsonProperty("company") + @ExcludeMissing + private val company: JsonField = JsonMissing.of(), + @JsonProperty("directory") + @ExcludeMissing + private val directory: JsonField = JsonMissing.of(), + @JsonProperty("individual") + @ExcludeMissing + private val individual: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("payment") + @ExcludeMissing + private val payment: JsonField = JsonMissing.of(), + @JsonProperty("pay_statement") + @ExcludeMissing + private val payStatement: JsonField = JsonMissing.of(), + @JsonProperty("pay_group") + @ExcludeMissing + private val payGroup: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun company(): Optional = @@ -545,8 +557,6 @@ private constructor( fun company(company: SupportedCompanyFields) = company(JsonField.of(company)) - @JsonProperty("company") - @ExcludeMissing fun company(company: JsonField) = apply { this.company = company } @@ -554,8 +564,6 @@ private constructor( fun directory(directory: SupportedDirectoryFields) = directory(JsonField.of(directory)) - @JsonProperty("directory") - @ExcludeMissing fun directory(directory: JsonField) = apply { this.directory = directory } @@ -563,8 +571,6 @@ private constructor( fun individual(individual: SupportedIndividualFields) = individual(JsonField.of(individual)) - @JsonProperty("individual") - @ExcludeMissing fun individual(individual: JsonField) = apply { this.individual = individual } @@ -572,16 +578,12 @@ private constructor( 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 } @@ -589,8 +591,6 @@ private constructor( fun payStatement(payStatement: SupportedPayStatementFields) = payStatement(JsonField.of(payStatement)) - @JsonProperty("pay_statement") - @ExcludeMissing fun payStatement(payStatement: JsonField) = apply { this.payStatement = payStatement } @@ -598,8 +598,6 @@ private constructor( fun payGroup(payGroup: SupportedPayGroupFields) = payGroup(JsonField.of(payGroup)) - @JsonProperty("pay_group") - @ExcludeMissing fun payGroup(payGroup: JsonField) = apply { this.payGroup = payGroup } @@ -609,7 +607,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -640,20 +637,39 @@ private constructor( ) } - @JsonDeserialize(builder = SupportedCompanyFields.Builder::class) @NoAutoDetect class SupportedCompanyFields + @JsonCreator 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, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("entity") + @ExcludeMissing + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("ein") + @ExcludeMissing + private val ein: JsonField = JsonMissing.of(), + @JsonProperty("accounts") + @ExcludeMissing + private val accounts: JsonField = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -762,29 +778,21 @@ private constructor( 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 } @@ -792,22 +800,16 @@ private constructor( 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 } @@ -815,16 +817,12 @@ private constructor( 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 } @@ -835,7 +833,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -867,16 +864,28 @@ private constructor( ) } - @JsonDeserialize(builder = Accounts.Builder::class) @NoAutoDetect class Accounts + @JsonCreator 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, + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("account_name") + @ExcludeMissing + private val accountName: JsonField = JsonMissing.of(), + @JsonProperty("institution_name") + @ExcludeMissing + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("account_type") + @ExcludeMissing + private val accountType: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + private val accountNumber: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun routingNumber(): Optional = @@ -961,8 +970,6 @@ private constructor( fun routingNumber(routingNumber: Boolean) = routingNumber(JsonField.of(routingNumber)) - @JsonProperty("routing_number") - @ExcludeMissing fun routingNumber(routingNumber: JsonField) = apply { this.routingNumber = routingNumber } @@ -970,8 +977,6 @@ private constructor( fun accountName(accountName: Boolean) = accountName(JsonField.of(accountName)) - @JsonProperty("account_name") - @ExcludeMissing fun accountName(accountName: JsonField) = apply { this.accountName = accountName } @@ -979,8 +984,6 @@ private constructor( fun institutionName(institutionName: Boolean) = institutionName(JsonField.of(institutionName)) - @JsonProperty("institution_name") - @ExcludeMissing fun institutionName(institutionName: JsonField) = apply { this.institutionName = institutionName } @@ -988,8 +991,6 @@ private constructor( fun accountType(accountType: Boolean) = accountType(JsonField.of(accountType)) - @JsonProperty("account_type") - @ExcludeMissing fun accountType(accountType: JsonField) = apply { this.accountType = accountType } @@ -997,8 +998,6 @@ private constructor( fun accountNumber(accountNumber: Boolean) = accountNumber(JsonField.of(accountNumber)) - @JsonProperty("account_number") - @ExcludeMissing fun accountNumber(accountNumber: JsonField) = apply { this.accountNumber = accountNumber } @@ -1009,7 +1008,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1055,13 +1053,19 @@ private constructor( "Accounts{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Departments.Builder::class) @NoAutoDetect class Departments + @JsonCreator private constructor( - private val name: JsonField, - private val parent: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("parent") + @ExcludeMissing + private val parent: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -1112,14 +1116,10 @@ private constructor( 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) = @@ -1128,7 +1128,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1153,12 +1152,16 @@ private constructor( ) } - @JsonDeserialize(builder = Parent.Builder::class) @NoAutoDetect class Parent + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -1202,8 +1205,6 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties( @@ -1213,7 +1214,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1270,13 +1270,19 @@ private constructor( "Departments{name=$name, parent=$parent, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Entity.Builder::class) @NoAutoDetect class Entity + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -1326,14 +1332,10 @@ private constructor( 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 } @@ -1344,7 +1346,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1387,17 +1388,31 @@ private constructor( "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Locations.Builder::class) @NoAutoDetect class Locations + @JsonCreator 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, + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun line1(): Optional = @@ -1479,41 +1494,29 @@ private constructor( 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 } @@ -1524,7 +1527,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1589,13 +1591,18 @@ private constructor( "SupportedCompanyFields{id=$id, legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, ein=$ein, accounts=$accounts, departments=$departments, locations=$locations, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedDirectoryFields.Builder::class) @NoAutoDetect class SupportedDirectoryFields + @JsonCreator private constructor( - private val paging: JsonField, - private val individuals: JsonField, - private val additionalProperties: Map, + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), + @JsonProperty("individuals") + @ExcludeMissing + private val individuals: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun paging(): Optional = @@ -1647,15 +1654,11 @@ private constructor( 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 } @@ -1666,7 +1669,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1691,18 +1693,34 @@ private constructor( ) } - @JsonDeserialize(builder = Individuals.Builder::class) @NoAutoDetect class Individuals + @JsonCreator 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, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1792,14 +1810,10 @@ private constructor( 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 } @@ -1807,24 +1821,18 @@ private constructor( 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) = apply { this.isActive = isActive } @@ -1832,16 +1840,12 @@ private constructor( fun department(department: Boolean) = department(JsonField.of(department)) - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } fun manager(manager: Manager) = manager(JsonField.of(manager)) - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } @@ -1852,7 +1856,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1882,12 +1885,16 @@ private constructor( ) } - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1930,8 +1937,6 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties( @@ -1941,7 +1946,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1998,13 +2002,19 @@ private constructor( "Individuals{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, isActive=$isActive, department=$department, manager=$manager, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Paging.Builder::class) @NoAutoDetect class Paging + @JsonCreator private constructor( - private val count: JsonField, - private val offset: JsonField, - private val additionalProperties: Map, + @JsonProperty("count") + @ExcludeMissing + private val count: JsonField = JsonMissing.of(), + @JsonProperty("offset") + @ExcludeMissing + private val offset: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun count(): Optional = @@ -2054,14 +2064,10 @@ private constructor( fun count(count: Boolean) = count(JsonField.of(count)) - @JsonProperty("count") - @ExcludeMissing fun count(count: JsonField) = apply { this.count = count } fun offset(offset: Boolean) = offset(JsonField.of(offset)) - @JsonProperty("offset") - @ExcludeMissing fun offset(offset: JsonField) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = @@ -2070,7 +2076,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2131,28 +2136,63 @@ private constructor( "SupportedDirectoryFields{paging=$paging, individuals=$individuals, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedEmploymentFields.Builder::class) @NoAutoDetect class SupportedEmploymentFields + @JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val title: JsonField, - private val startDate: JsonField, - private val endDate: JsonField, - private val isActive: JsonField, - private val employmentStatus: JsonField, - private val incomeHistory: JsonField, - private val classCode: JsonField, - private val customFields: JsonField, - private val department: JsonField, - private val employment: JsonField, - private val income: JsonField, - private val location: JsonField, - private val manager: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("title") + @ExcludeMissing + private val title: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") + @ExcludeMissing + private val employmentStatus: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField = JsonMissing.of(), + @JsonProperty("class_code") + @ExcludeMissing + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("custom_fields") + @ExcludeMissing + private val customFields: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("location") + @ExcludeMissing + private val location: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -2328,58 +2368,42 @@ private constructor( 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 title(title: Boolean) = title(JsonField.of(title)) - @JsonProperty("title") - @ExcludeMissing fun title(title: JsonField) = apply { this.title = title } fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - @JsonProperty("is_active") - @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } @@ -2387,8 +2411,6 @@ private constructor( fun employmentStatus(employmentStatus: Boolean) = employmentStatus(JsonField.of(employmentStatus)) - @JsonProperty("employment_status") - @ExcludeMissing fun employmentStatus(employmentStatus: JsonField) = apply { this.employmentStatus = employmentStatus } @@ -2396,16 +2418,12 @@ private constructor( fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) - @JsonProperty("income_history") - @ExcludeMissing fun incomeHistory(incomeHistory: JsonField) = apply { this.incomeHistory = incomeHistory } fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) - @JsonProperty("class_code") - @ExcludeMissing fun classCode(classCode: JsonField) = apply { this.classCode = classCode } @@ -2413,8 +2431,6 @@ private constructor( fun customFields(customFields: Boolean) = customFields(JsonField.of(customFields)) - @JsonProperty("custom_fields") - @ExcludeMissing fun customFields(customFields: JsonField) = apply { this.customFields = customFields } @@ -2422,8 +2438,6 @@ private constructor( fun department(department: Department) = department(JsonField.of(department)) - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } @@ -2431,30 +2445,22 @@ private constructor( fun employment(employment: Employment) = employment(JsonField.of(employment)) - @JsonProperty("employment") - @ExcludeMissing fun employment(employment: JsonField) = apply { this.employment = employment } fun income(income: Income) = income(JsonField.of(income)) - @JsonProperty("income") - @ExcludeMissing fun income(income: JsonField) = apply { this.income = income } fun location(location: Location) = location(JsonField.of(location)) - @JsonProperty("location") - @ExcludeMissing fun location(location: JsonField) = apply { this.location = location } fun manager(manager: Manager) = manager(JsonField.of(manager)) - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } fun additionalProperties(additionalProperties: Map) = @@ -2463,7 +2469,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2503,12 +2508,16 @@ private constructor( ) } - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -2551,8 +2560,6 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = @@ -2561,7 +2568,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2600,13 +2606,19 @@ private constructor( "Department{name=$name, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -2657,14 +2669,10 @@ private constructor( 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 } @@ -2675,7 +2683,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2718,14 +2725,22 @@ private constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Income.Builder::class) @NoAutoDetect class Income + @JsonCreator private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val unit: JsonField, - private val additionalProperties: Map, + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("unit") + @ExcludeMissing + private val unit: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun amount(): Optional = @@ -2783,22 +2798,16 @@ private constructor( fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } fun unit(unit: Boolean) = unit(JsonField.of(unit)) - @JsonProperty("unit") - @ExcludeMissing fun unit(unit: JsonField) = apply { this.unit = unit } fun additionalProperties(additionalProperties: Map) = @@ -2807,7 +2816,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2851,17 +2859,31 @@ private constructor( "Income{amount=$amount, currency=$currency, unit=$unit, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Location.Builder::class) @NoAutoDetect class Location + @JsonCreator 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, + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun line1(): Optional = @@ -2943,41 +2965,29 @@ private constructor( 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 } @@ -2988,7 +2998,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3035,12 +3044,16 @@ private constructor( "Location{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3081,8 +3094,6 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = @@ -3091,7 +3102,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3147,24 +3157,51 @@ private constructor( "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedIndividualFields.Builder::class) @NoAutoDetect class SupportedIndividualFields + @JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val preferredName: JsonField, - private val dob: JsonField, - private val gender: JsonField, - private val ethnicity: JsonField, - private val ssn: JsonField, - private val encryptedSsn: JsonField, - private val emails: JsonField, - private val phoneNumbers: JsonField, - private val residence: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), + @JsonProperty("dob") + @ExcludeMissing + private val dob: JsonField = JsonMissing.of(), + @JsonProperty("gender") + @ExcludeMissing + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), + @JsonProperty("ssn") + @ExcludeMissing + private val ssn: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField = JsonMissing.of(), + @JsonProperty("phone_numbers") + @ExcludeMissing + private val phoneNumbers: JsonField = JsonMissing.of(), + @JsonProperty("residence") + @ExcludeMissing + private val residence: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3307,30 +3344,22 @@ private constructor( 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 } @@ -3338,66 +3367,48 @@ private constructor( fun preferredName(preferredName: Boolean) = preferredName(JsonField.of(preferredName)) - @JsonProperty("preferred_name") - @ExcludeMissing fun preferredName(preferredName: JsonField) = apply { this.preferredName = preferredName } fun dob(dob: Boolean) = dob(JsonField.of(dob)) - @JsonProperty("dob") - @ExcludeMissing fun dob(dob: JsonField) = apply { this.dob = dob } fun gender(gender: Boolean) = gender(JsonField.of(gender)) - @JsonProperty("gender") - @ExcludeMissing fun gender(gender: JsonField) = apply { this.gender = gender } fun ethnicity(ethnicity: Boolean) = ethnicity(JsonField.of(ethnicity)) - @JsonProperty("ethnicity") - @ExcludeMissing fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) - @JsonProperty("ssn") - @ExcludeMissing fun ssn(ssn: JsonField) = apply { this.ssn = ssn } fun encryptedSsn(encryptedSsn: Boolean) = encryptedSsn(JsonField.of(encryptedSsn)) - @JsonProperty("encrypted_ssn") - @ExcludeMissing fun encryptedSsn(encryptedSsn: JsonField) = apply { this.encryptedSsn = encryptedSsn } fun emails(emails: Emails) = emails(JsonField.of(emails)) - @JsonProperty("emails") - @ExcludeMissing fun emails(emails: JsonField) = apply { this.emails = emails } fun phoneNumbers(phoneNumbers: PhoneNumbers) = phoneNumbers(JsonField.of(phoneNumbers)) - @JsonProperty("phone_numbers") - @ExcludeMissing fun phoneNumbers(phoneNumbers: JsonField) = apply { this.phoneNumbers = phoneNumbers } fun residence(residence: Residence) = residence(JsonField.of(residence)) - @JsonProperty("residence") - @ExcludeMissing fun residence(residence: JsonField) = apply { this.residence = residence } @@ -3408,7 +3419,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3444,13 +3454,19 @@ private constructor( ) } - @JsonDeserialize(builder = Emails.Builder::class) @NoAutoDetect class Emails + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun data(): Optional = @@ -3500,14 +3516,10 @@ private constructor( fun data(data: Boolean) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = @@ -3516,7 +3528,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3559,13 +3570,19 @@ private constructor( "Emails{data=$data, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = PhoneNumbers.Builder::class) @NoAutoDetect class PhoneNumbers + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun data(): Optional = @@ -3616,14 +3633,10 @@ private constructor( fun data(data: Boolean) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = @@ -3632,7 +3645,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3675,17 +3687,31 @@ private constructor( "PhoneNumbers{data=$data, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Residence.Builder::class) @NoAutoDetect class Residence + @JsonCreator private constructor( - private val city: JsonField, - private val country: JsonField, - private val line1: JsonField, - private val line2: JsonField, - private val postalCode: JsonField, - private val state: JsonField, - private val additionalProperties: Map, + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun city(): Optional = @@ -3767,43 +3793,31 @@ private constructor( fun city(city: Boolean) = city(JsonField.of(city)) - @JsonProperty("city") - @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } fun country(country: Boolean) = country(JsonField.of(country)) - @JsonProperty("country") - @ExcludeMissing fun country(country: JsonField) = apply { this.country = country } 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 postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) - @JsonProperty("postal_code") - @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: Boolean) = state(JsonField.of(state)) - @JsonProperty("state") - @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = @@ -3812,7 +3826,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3877,15 +3890,24 @@ private constructor( "SupportedIndividualFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, dob=$dob, gender=$gender, ethnicity=$ethnicity, ssn=$ssn, encryptedSsn=$encryptedSsn, emails=$emails, phoneNumbers=$phoneNumbers, residence=$residence, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPayGroupFields.Builder::class) @NoAutoDetect class SupportedPayGroupFields + @JsonCreator private constructor( - private val id: JsonField, - private val name: JsonField, - private val payFrequencies: JsonField, - private val individualIds: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3955,21 +3977,15 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun payFrequencies(payFrequencies: Boolean) = payFrequencies(JsonField.of(payFrequencies)) - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField) = apply { this.payFrequencies = payFrequencies } @@ -3977,8 +3993,6 @@ private constructor( fun individualIds(individualIds: Boolean) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField) = apply { this.individualIds = individualIds } @@ -3989,7 +4003,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4034,13 +4047,18 @@ private constructor( "SupportedPayGroupFields{id=$id, name=$name, payFrequencies=$payFrequencies, individualIds=$individualIds, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPayStatementFields.Builder::class) @NoAutoDetect class SupportedPayStatementFields + @JsonCreator private constructor( - private val paging: JsonField, - private val payStatements: JsonField, - private val additionalProperties: Map, + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), + @JsonProperty("pay_statements") + @ExcludeMissing + private val payStatements: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun paging(): Optional = @@ -4095,15 +4113,11 @@ private constructor( fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") - @ExcludeMissing fun paging(paging: JsonField) = apply { this.paging = paging } fun payStatements(payStatements: PayStatements) = payStatements(JsonField.of(payStatements)) - @JsonProperty("pay_statements") - @ExcludeMissing fun payStatements(payStatements: JsonField) = apply { this.payStatements = payStatements } @@ -4114,7 +4128,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4139,13 +4152,19 @@ private constructor( ) } - @JsonDeserialize(builder = Paging.Builder::class) @NoAutoDetect class Paging + @JsonCreator private constructor( - private val count: JsonField, - private val offset: JsonField, - private val additionalProperties: Map, + @JsonProperty("count") + @ExcludeMissing + private val count: JsonField = JsonMissing.of(), + @JsonProperty("offset") + @ExcludeMissing + private val offset: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun count(): Boolean = count.getRequired("count") @@ -4193,14 +4212,10 @@ private constructor( fun count(count: Boolean) = count(JsonField.of(count)) - @JsonProperty("count") - @ExcludeMissing fun count(count: JsonField) = apply { this.count = count } fun offset(offset: Boolean) = offset(JsonField.of(offset)) - @JsonProperty("offset") - @ExcludeMissing fun offset(offset: JsonField) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = @@ -4209,7 +4224,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4252,21 +4266,45 @@ private constructor( "Paging{count=$count, offset=$offset, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = PayStatements.Builder::class) @NoAutoDetect class PayStatements + @JsonCreator private constructor( - private val individualId: JsonField, - private val type: JsonField, - private val paymentMethod: JsonField, - private val totalHours: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val earnings: JsonField, - private val employeeDeductions: JsonField, - private val employerContributions: JsonField, - private val taxes: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("payment_method") + @ExcludeMissing + private val paymentMethod: JsonField = JsonMissing.of(), + @JsonProperty("total_hours") + @ExcludeMissing + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("earnings") + @ExcludeMissing + private val earnings: JsonField = JsonMissing.of(), + @JsonProperty("employee_deductions") + @ExcludeMissing + private val employeeDeductions: JsonField = + JsonMissing.of(), + @JsonProperty("employer_contributions") + @ExcludeMissing + private val employerContributions: JsonField = + JsonMissing.of(), + @JsonProperty("taxes") + @ExcludeMissing + private val taxes: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun individualId(): Optional = @@ -4396,23 +4434,17 @@ private constructor( fun individualId(individualId: Boolean) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun paymentMethod(paymentMethod: Boolean) = paymentMethod(JsonField.of(paymentMethod)) - @JsonProperty("payment_method") - @ExcludeMissing fun paymentMethod(paymentMethod: JsonField) = apply { this.paymentMethod = paymentMethod } @@ -4420,30 +4452,22 @@ private constructor( fun totalHours(totalHours: Boolean) = totalHours(JsonField.of(totalHours)) - @JsonProperty("total_hours") - @ExcludeMissing fun totalHours(totalHours: JsonField) = apply { this.totalHours = totalHours } fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } fun earnings(earnings: Earnings) = earnings(JsonField.of(earnings)) - @JsonProperty("earnings") - @ExcludeMissing fun earnings(earnings: JsonField) = apply { this.earnings = earnings } @@ -4451,8 +4475,6 @@ private constructor( fun employeeDeductions(employeeDeductions: EmployeeDeductions) = employeeDeductions(JsonField.of(employeeDeductions)) - @JsonProperty("employee_deductions") - @ExcludeMissing fun employeeDeductions( employeeDeductions: JsonField ) = apply { this.employeeDeductions = employeeDeductions } @@ -4461,16 +4483,12 @@ private constructor( employerContributions: EmployerContributions ) = employerContributions(JsonField.of(employerContributions)) - @JsonProperty("employer_contributions") - @ExcludeMissing fun employerContributions( employerContributions: JsonField ) = apply { this.employerContributions = employerContributions } fun taxes(taxes: Taxes) = taxes(JsonField.of(taxes)) - @JsonProperty("taxes") - @ExcludeMissing fun taxes(taxes: JsonField) = apply { this.taxes = taxes } fun additionalProperties(additionalProperties: Map) = @@ -4479,7 +4497,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4512,15 +4529,25 @@ private constructor( ) } - @JsonDeserialize(builder = Earnings.Builder::class) @NoAutoDetect class Earnings + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -4588,28 +4615,20 @@ private constructor( fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4621,7 +4640,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4666,16 +4684,28 @@ private constructor( "Earnings{type=$type, name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployeeDeductions.Builder::class) @NoAutoDetect class EmployeeDeductions + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val type: JsonField, - private val preTax: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("pre_tax") + @ExcludeMissing + private val preTax: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -4751,36 +4781,26 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) - @JsonProperty("pre_tax") - @ExcludeMissing fun preTax(preTax: JsonField) = apply { this.preTax = preTax } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4792,7 +4812,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4838,14 +4857,22 @@ private constructor( "EmployeeDeductions{name=$name, amount=$amount, type=$type, preTax=$preTax, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployerContributions.Builder::class) @NoAutoDetect class EmployerContributions + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -4907,22 +4934,16 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4934,7 +4955,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4978,16 +4998,28 @@ private constructor( "EmployerContributions{name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Taxes.Builder::class) @NoAutoDetect class Taxes + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val employer: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("employer") + @ExcludeMissing + private val employer: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -5062,36 +5094,26 @@ private constructor( fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun employer(employer: Boolean) = employer(JsonField.of(employer)) - @JsonProperty("employer") - @ExcludeMissing fun employer(employer: JsonField) = apply { this.employer = employer } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -5103,7 +5125,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -5185,23 +5206,48 @@ private constructor( "SupportedPayStatementFields{paging=$paging, payStatements=$payStatements, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPaymentFields.Builder::class) @NoAutoDetect class SupportedPaymentFields + @JsonCreator private constructor( - private val id: JsonField, - private val payDate: JsonField, - private val debitDate: JsonField, - private val companyDebit: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val employerTaxes: JsonField, - private val employeeTaxes: JsonField, - private val individualIds: JsonField, - private val payPeriod: JsonField, - private val payGroupIds: JsonField, - private val payFrequencies: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") + @ExcludeMissing + private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("debit_date") + @ExcludeMissing + private val debitDate: JsonField = JsonMissing.of(), + @JsonProperty("company_debit") + @ExcludeMissing + private val companyDebit: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("employer_taxes") + @ExcludeMissing + private val employerTaxes: JsonField = JsonMissing.of(), + @JsonProperty("employee_taxes") + @ExcludeMissing + private val employeeTaxes: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_period") + @ExcludeMissing + private val payPeriod: JsonField = JsonMissing.of(), + @JsonProperty("pay_group_ids") + @ExcludeMissing + private val payGroupIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -5341,20 +5387,14 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) - @JsonProperty("pay_date") - @ExcludeMissing fun payDate(payDate: JsonField) = apply { this.payDate = payDate } fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - @JsonProperty("debit_date") - @ExcludeMissing fun debitDate(debitDate: JsonField) = apply { this.debitDate = debitDate } @@ -5362,31 +5402,23 @@ private constructor( fun companyDebit(companyDebit: Boolean) = companyDebit(JsonField.of(companyDebit)) - @JsonProperty("company_debit") - @ExcludeMissing fun companyDebit(companyDebit: JsonField) = apply { this.companyDebit = companyDebit } fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } fun employerTaxes(employerTaxes: Boolean) = employerTaxes(JsonField.of(employerTaxes)) - @JsonProperty("employer_taxes") - @ExcludeMissing fun employerTaxes(employerTaxes: JsonField) = apply { this.employerTaxes = employerTaxes } @@ -5394,8 +5426,6 @@ private constructor( fun employeeTaxes(employeeTaxes: Boolean) = employeeTaxes(JsonField.of(employeeTaxes)) - @JsonProperty("employee_taxes") - @ExcludeMissing fun employeeTaxes(employeeTaxes: JsonField) = apply { this.employeeTaxes = employeeTaxes } @@ -5403,16 +5433,12 @@ private constructor( fun individualIds(individualIds: Boolean) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField) = apply { this.individualIds = individualIds } fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) - @JsonProperty("pay_period") - @ExcludeMissing fun payPeriod(payPeriod: JsonField) = apply { this.payPeriod = payPeriod } @@ -5420,8 +5446,6 @@ private constructor( fun payGroupIds(payGroupIds: Boolean) = payGroupIds(JsonField.of(payGroupIds)) - @JsonProperty("pay_group_ids") - @ExcludeMissing fun payGroupIds(payGroupIds: JsonField) = apply { this.payGroupIds = payGroupIds } @@ -5429,8 +5453,6 @@ private constructor( fun payFrequencies(payFrequencies: Boolean) = payFrequencies(JsonField.of(payFrequencies)) - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField) = apply { this.payFrequencies = payFrequencies } @@ -5441,7 +5463,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -5476,13 +5497,19 @@ private constructor( ) } - @JsonDeserialize(builder = PayPeriod.Builder::class) @NoAutoDetect class PayPeriod + @JsonCreator private constructor( - private val startDate: JsonField, - private val endDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun startDate(): Optional = @@ -5532,16 +5559,12 @@ private constructor( fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5552,7 +5575,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt index df37633a..55c812b3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt @@ -6,29 +6,41 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = AccountUpdateResponse.Builder::class) @NoAutoDetect class AccountUpdateResponse +@JsonCreator private constructor( - private val connectionId: JsonField, - private val accountId: JsonField, - private val authenticationType: JsonField, - private val companyId: JsonField, - private val providerId: JsonField, - private val products: JsonField>, - private val additionalProperties: Map, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("authentication_type") + @ExcludeMissing + private val authenticationType: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("provider_id") + @ExcludeMissing + private val providerId: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the new connection */ @@ -117,8 +129,6 @@ private constructor( fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) /** The ID of the new connection */ - @JsonProperty("connection_id") - @ExcludeMissing fun connectionId(connectionId: JsonField) = apply { this.connectionId = connectionId } @@ -127,15 +137,11 @@ private constructor( fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") - @ExcludeMissing fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = authenticationType(JsonField.of(authenticationType)) - @JsonProperty("authentication_type") - @ExcludeMissing fun authenticationType(authenticationType: JsonField) = apply { this.authenticationType = authenticationType } @@ -144,22 +150,16 @@ private constructor( fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") - @ExcludeMissing fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The ID of the provider associated with the `access_token` */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token` */ - @JsonProperty("provider_id") - @ExcludeMissing fun providerId(providerId: JsonField) = apply { this.providerId = providerId } fun products(products: List) = products(JsonField.of(products)) - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } fun additionalProperties(additionalProperties: Map) = apply { @@ -167,7 +167,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt index 577f2be2..0f490e3e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt @@ -6,32 +6,44 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = AutomatedAsyncJob.Builder::class) @NoAutoDetect class AutomatedAsyncJob +@JsonCreator private constructor( - private val jobId: JsonField, - private val jobUrl: JsonField, - private val type: JsonField, - private val status: JsonField, - private val createdAt: JsonField, - private val scheduledAt: JsonField, - private val startedAt: JsonField, - private val completedAt: JsonField, - private val additionalProperties: Map, + @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("job_url") + @ExcludeMissing + private val jobUrl: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + private val createdAt: JsonField = JsonMissing.of(), + @JsonProperty("scheduled_at") + @ExcludeMissing + private val scheduledAt: JsonField = JsonMissing.of(), + @JsonProperty("started_at") + @ExcludeMissing + private val startedAt: JsonField = JsonMissing.of(), + @JsonProperty("completed_at") + @ExcludeMissing + private val completedAt: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the job that has been created. */ @@ -151,30 +163,22 @@ private constructor( fun jobId(jobId: String) = jobId(JsonField.of(jobId)) /** The id of the job that has been created. */ - @JsonProperty("job_id") - @ExcludeMissing fun jobId(jobId: JsonField) = apply { this.jobId = jobId } /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) /** The url that can be used to retrieve the job status */ - @JsonProperty("job_url") - @ExcludeMissing fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } /** Only `data_sync_all` currently supported */ fun type(type: Type) = type(JsonField.of(type)) /** Only `data_sync_all` currently supported */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun status(status: Status) = status(JsonField.of(status)) - @JsonProperty("status") - @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } /** @@ -189,8 +193,6 @@ private constructor( * connection time. For ad-hoc jobs, this will be the time the creation request was * received. */ - @JsonProperty("created_at") - @ExcludeMissing fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** @@ -205,8 +207,6 @@ private constructor( * the future if the job has not yet been enqueued. For ad-hoc jobs, this field will * be null. */ - @JsonProperty("scheduled_at") - @ExcludeMissing fun scheduledAt(scheduledAt: JsonField) = apply { this.scheduledAt = scheduledAt } @@ -215,16 +215,12 @@ private constructor( fun startedAt(startedAt: OffsetDateTime) = startedAt(JsonField.of(startedAt)) /** The datetime a job entered into the job queue. */ - @JsonProperty("started_at") - @ExcludeMissing fun startedAt(startedAt: JsonField) = apply { this.startedAt = startedAt } /** The datetime the job completed. */ fun completedAt(completedAt: OffsetDateTime) = completedAt(JsonField.of(completedAt)) /** The datetime the job completed. */ - @JsonProperty("completed_at") - @ExcludeMissing fun completedAt(completedAt: JsonField) = apply { this.completedAt = completedAt } @@ -234,7 +230,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt index 8f32dd2c..0c75bcdd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt @@ -4,25 +4,32 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = AutomatedCreateResponse.Builder::class) @NoAutoDetect class AutomatedCreateResponse +@JsonCreator private constructor( - private val jobId: JsonField, - private val jobUrl: JsonField, - private val allowedRefreshes: JsonField, - private val remainingRefreshes: JsonField, - private val additionalProperties: Map, + @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("job_url") + @ExcludeMissing + private val jobUrl: JsonField = JsonMissing.of(), + @JsonProperty("allowed_refreshes") + @ExcludeMissing + private val allowedRefreshes: JsonField = JsonMissing.of(), + @JsonProperty("remaining_refreshes") + @ExcludeMissing + private val remainingRefreshes: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the job that has been created. */ @@ -95,16 +102,12 @@ private constructor( fun jobId(jobId: String) = jobId(JsonField.of(jobId)) /** The id of the job that has been created. */ - @JsonProperty("job_id") - @ExcludeMissing fun jobId(jobId: JsonField) = apply { this.jobId = jobId } /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) /** The url that can be used to retrieve the job status */ - @JsonProperty("job_url") - @ExcludeMissing fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } /** The number of allowed refreshes per hour (per hour, fixed window) */ @@ -112,8 +115,6 @@ private constructor( allowedRefreshes(JsonField.of(allowedRefreshes)) /** The number of allowed refreshes per hour (per hour, fixed window) */ - @JsonProperty("allowed_refreshes") - @ExcludeMissing fun allowedRefreshes(allowedRefreshes: JsonField) = apply { this.allowedRefreshes = allowedRefreshes } @@ -123,8 +124,6 @@ private constructor( remainingRefreshes(JsonField.of(remainingRefreshes)) /** The number of remaining refreshes available (per hour, fixed window) */ - @JsonProperty("remaining_refreshes") - @ExcludeMissing fun remainingRefreshes(remainingRefreshes: JsonField) = apply { this.remainingRefreshes = remainingRefreshes } @@ -134,7 +133,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt index 3f274c79..860d5245 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt @@ -4,25 +4,32 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = BaseWebhookEvent.Builder::class) @NoAutoDetect class BaseWebhookEvent +@JsonCreator private constructor( - private val connectionId: JsonField, - private val companyId: JsonField, - private val accountId: JsonField, - private val additionalProperties: Map, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -97,8 +104,6 @@ private constructor( 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 } @@ -113,8 +118,6 @@ private constructor( * [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 } /** @@ -127,8 +130,6 @@ private constructor( * [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 additionalProperties(additionalProperties: Map) = apply { @@ -136,7 +137,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt index 0d8a3e62..9ef6ed82 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt @@ -6,25 +6,25 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = BenefitContribution.Builder::class) @NoAutoDetect class BenefitContribution +@JsonCreator private constructor( - private val type: JsonField, - private val amount: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Contribution type. */ @@ -77,16 +77,12 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** Contribution type. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun additionalProperties(additionalProperties: Map) = apply { @@ -94,7 +90,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt index 4639972c..dc30773d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt @@ -6,25 +6,29 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = BenefitFeaturesAndOperations.Builder::class) @NoAutoDetect class BenefitFeaturesAndOperations +@JsonCreator private constructor( - private val supportedFeatures: JsonField, - private val supportedOperations: JsonField, - private val additionalProperties: Map, + @JsonProperty("supported_features") + @ExcludeMissing + private val supportedFeatures: JsonField = JsonMissing.of(), + @JsonProperty("supported_operations") + @ExcludeMissing + private val supportedOperations: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun supportedFeatures(): Optional = @@ -76,8 +80,6 @@ private constructor( fun supportedFeatures(supportedFeatures: BenefitFeature) = supportedFeatures(JsonField.of(supportedFeatures)) - @JsonProperty("supported_features") - @ExcludeMissing fun supportedFeatures(supportedFeatures: JsonField) = apply { this.supportedFeatures = supportedFeatures } @@ -85,8 +87,6 @@ private constructor( fun supportedOperations(supportedOperations: SupportPerBenefitType) = supportedOperations(JsonField.of(supportedOperations)) - @JsonProperty("supported_operations") - @ExcludeMissing fun supportedOperations(supportedOperations: JsonField) = apply { this.supportedOperations = supportedOperations } @@ -96,7 +96,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -119,18 +118,33 @@ private constructor( ) } - @JsonDeserialize(builder = BenefitFeature.Builder::class) @NoAutoDetect class BenefitFeature + @JsonCreator private constructor( - private val description: JsonField, - private val frequencies: JsonField>, - private val employeeDeduction: JsonField>, - private val companyContribution: JsonField>, - private val annualMaximum: JsonField, - private val catchUp: JsonField, - private val hsaContributionLimit: JsonField>, - private val additionalProperties: Map, + @JsonProperty("description") + @ExcludeMissing + private val description: JsonField = JsonMissing.of(), + @JsonProperty("frequencies") + @ExcludeMissing + private val frequencies: JsonField> = JsonMissing.of(), + @JsonProperty("employee_deduction") + @ExcludeMissing + private val employeeDeduction: JsonField> = JsonMissing.of(), + @JsonProperty("company_contribution") + @ExcludeMissing + private val companyContribution: JsonField> = JsonMissing.of(), + @JsonProperty("annual_maximum") + @ExcludeMissing + private val annualMaximum: JsonField = JsonMissing.of(), + @JsonProperty("catch_up") + @ExcludeMissing + private val catchUp: JsonField = JsonMissing.of(), + @JsonProperty("hsa_contribution_limit") + @ExcludeMissing + private val hsaContributionLimit: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun description(): Optional = @@ -254,8 +268,6 @@ private constructor( fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("description") - @ExcludeMissing fun description(description: JsonField) = apply { this.description = description } @@ -265,8 +277,6 @@ private constructor( frequencies(JsonField.of(frequencies)) /** The list of frequencies supported by the provider for this benefit */ - @JsonProperty("frequencies") - @ExcludeMissing fun frequencies(frequencies: JsonField>) = apply { this.frequencies = frequencies } @@ -276,8 +286,6 @@ private constructor( employeeDeduction(JsonField.of(employeeDeduction)) /** Supported deduction types. An empty array indicates deductions are not supported. */ - @JsonProperty("employee_deduction") - @ExcludeMissing fun employeeDeduction(employeeDeduction: JsonField>) = apply { this.employeeDeduction = employeeDeduction } @@ -293,8 +301,6 @@ private constructor( * Supported contribution types. An empty array indicates contributions are not * supported. */ - @JsonProperty("company_contribution") - @ExcludeMissing fun companyContribution(companyContribution: JsonField>) = apply { this.companyContribution = companyContribution @@ -304,8 +310,6 @@ private constructor( fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) /** Whether the provider supports an annual maximum for this benefit. */ - @JsonProperty("annual_maximum") - @ExcludeMissing fun annualMaximum(annualMaximum: JsonField) = apply { this.annualMaximum = annualMaximum } @@ -320,8 +324,6 @@ private constructor( * Whether the provider supports catch up for this benefit. This field will only be true * for retirement benefits. */ - @JsonProperty("catch_up") - @ExcludeMissing fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } /** @@ -335,8 +337,6 @@ private constructor( * Whether the provider supports HSA contribution limits. Empty if this feature is not * supported for the benefit. This array only has values for HSA benefits. */ - @JsonProperty("hsa_contribution_limit") - @ExcludeMissing fun hsaContributionLimit(hsaContributionLimit: JsonField>) = apply { this.hsaContributionLimit = hsaContributionLimit @@ -347,7 +347,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt index 0722c301..c36d6219 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -19,23 +20,47 @@ import java.util.Optional * Each benefit type and their supported features. If the benefit type is not supported, the * property will be null */ -@JsonDeserialize(builder = BenefitsSupport.Builder::class) @NoAutoDetect class BenefitsSupport +@JsonCreator private constructor( - private val s125Medical: JsonField, - private val s125Dental: JsonField, - private val s125Vision: JsonField, - private val hsaPre: JsonField, - private val hsaPost: JsonField, - private val fsaMedical: JsonField, - private val fsaDependentCare: JsonField, - private val simpleIra: JsonField, - private val simple: JsonField, - private val commuter: JsonField, - private val customPostTax: JsonField, - private val customPreTax: JsonField, - private val additionalProperties: Map, + @JsonProperty("s125_medical") + @ExcludeMissing + private val s125Medical: JsonField = JsonMissing.of(), + @JsonProperty("s125_dental") + @ExcludeMissing + private val s125Dental: JsonField = JsonMissing.of(), + @JsonProperty("s125_vision") + @ExcludeMissing + private val s125Vision: JsonField = JsonMissing.of(), + @JsonProperty("hsa_pre") + @ExcludeMissing + private val hsaPre: JsonField = JsonMissing.of(), + @JsonProperty("hsa_post") + @ExcludeMissing + private val hsaPost: JsonField = JsonMissing.of(), + @JsonProperty("fsa_medical") + @ExcludeMissing + private val fsaMedical: JsonField = JsonMissing.of(), + @JsonProperty("fsa_dependent_care") + @ExcludeMissing + private val fsaDependentCare: JsonField = JsonMissing.of(), + @JsonProperty("simple_ira") + @ExcludeMissing + private val simpleIra: JsonField = JsonMissing.of(), + @JsonProperty("simple") + @ExcludeMissing + private val simple: JsonField = JsonMissing.of(), + @JsonProperty("commuter") + @ExcludeMissing + private val commuter: JsonField = JsonMissing.of(), + @JsonProperty("custom_post_tax") + @ExcludeMissing + private val customPostTax: JsonField = JsonMissing.of(), + @JsonProperty("custom_pre_tax") + @ExcludeMissing + private val customPreTax: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun s125Medical(): Optional = @@ -165,8 +190,6 @@ private constructor( fun s125Medical(s125Medical: BenefitFeaturesAndOperations) = s125Medical(JsonField.of(s125Medical)) - @JsonProperty("s125_medical") - @ExcludeMissing fun s125Medical(s125Medical: JsonField) = apply { this.s125Medical = s125Medical } @@ -174,8 +197,6 @@ private constructor( fun s125Dental(s125Dental: BenefitFeaturesAndOperations) = s125Dental(JsonField.of(s125Dental)) - @JsonProperty("s125_dental") - @ExcludeMissing fun s125Dental(s125Dental: JsonField) = apply { this.s125Dental = s125Dental } @@ -183,22 +204,16 @@ private constructor( fun s125Vision(s125Vision: BenefitFeaturesAndOperations) = s125Vision(JsonField.of(s125Vision)) - @JsonProperty("s125_vision") - @ExcludeMissing fun s125Vision(s125Vision: JsonField) = apply { this.s125Vision = s125Vision } fun hsaPre(hsaPre: BenefitFeaturesAndOperations) = hsaPre(JsonField.of(hsaPre)) - @JsonProperty("hsa_pre") - @ExcludeMissing fun hsaPre(hsaPre: JsonField) = apply { this.hsaPre = hsaPre } fun hsaPost(hsaPost: BenefitFeaturesAndOperations) = hsaPost(JsonField.of(hsaPost)) - @JsonProperty("hsa_post") - @ExcludeMissing fun hsaPost(hsaPost: JsonField) = apply { this.hsaPost = hsaPost } @@ -206,8 +221,6 @@ private constructor( fun fsaMedical(fsaMedical: BenefitFeaturesAndOperations) = fsaMedical(JsonField.of(fsaMedical)) - @JsonProperty("fsa_medical") - @ExcludeMissing fun fsaMedical(fsaMedical: JsonField) = apply { this.fsaMedical = fsaMedical } @@ -215,30 +228,22 @@ private constructor( fun fsaDependentCare(fsaDependentCare: BenefitFeaturesAndOperations) = fsaDependentCare(JsonField.of(fsaDependentCare)) - @JsonProperty("fsa_dependent_care") - @ExcludeMissing fun fsaDependentCare(fsaDependentCare: JsonField) = apply { this.fsaDependentCare = fsaDependentCare } fun simpleIra(simpleIra: BenefitFeaturesAndOperations) = simpleIra(JsonField.of(simpleIra)) - @JsonProperty("simple_ira") - @ExcludeMissing fun simpleIra(simpleIra: JsonField) = apply { this.simpleIra = simpleIra } fun simple(simple: BenefitFeaturesAndOperations) = simple(JsonField.of(simple)) - @JsonProperty("simple") - @ExcludeMissing fun simple(simple: JsonField) = apply { this.simple = simple } fun commuter(commuter: BenefitFeaturesAndOperations) = commuter(JsonField.of(commuter)) - @JsonProperty("commuter") - @ExcludeMissing fun commuter(commuter: JsonField) = apply { this.commuter = commuter } @@ -246,8 +251,6 @@ private constructor( fun customPostTax(customPostTax: BenefitFeaturesAndOperations) = customPostTax(JsonField.of(customPostTax)) - @JsonProperty("custom_post_tax") - @ExcludeMissing fun customPostTax(customPostTax: JsonField) = apply { this.customPostTax = customPostTax } @@ -255,8 +258,6 @@ private constructor( fun customPreTax(customPreTax: BenefitFeaturesAndOperations) = customPreTax(JsonField.of(customPreTax)) - @JsonProperty("custom_pre_tax") - @ExcludeMissing fun customPreTax(customPreTax: JsonField) = apply { this.customPreTax = customPreTax } @@ -266,7 +267,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt index f2e9ed53..656acc52 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt @@ -6,32 +6,46 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Company.Builder::class) @NoAutoDetect class Company +@JsonCreator private constructor( - private val id: JsonField, - private val legalName: JsonField, - private val entity: JsonField, - private val primaryEmail: JsonField, - private val primaryPhoneNumber: JsonField, - private val departments: JsonField>, - private val ein: JsonField, - private val locations: JsonField>, - private val accounts: JsonField>, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("entity") + @ExcludeMissing + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField> = JsonMissing.of(), + @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField> = JsonMissing.of(), + @JsonProperty("accounts") + @ExcludeMissing + private val accounts: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for the company. */ @@ -151,30 +165,24 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The legal name of the company. */ fun legalName(legalName: String) = legalName(JsonField.of(legalName)) /** The legal name of the company. */ - @JsonProperty("legal_name") - @ExcludeMissing fun legalName(legalName: JsonField) = apply { this.legalName = legalName } /** The entity type object. */ fun entity(entity: Entity) = entity(JsonField.of(entity)) /** The entity type object. */ - @JsonProperty("entity") - @ExcludeMissing fun entity(entity: JsonField) = apply { this.entity = entity } /** The email of the main administrator on the account. */ fun primaryEmail(primaryEmail: String) = primaryEmail(JsonField.of(primaryEmail)) /** The email of the main administrator on the account. */ - @JsonProperty("primary_email") - @ExcludeMissing fun primaryEmail(primaryEmail: JsonField) = apply { this.primaryEmail = primaryEmail } @@ -184,8 +192,6 @@ private constructor( primaryPhoneNumber(JsonField.of(primaryPhoneNumber)) /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - @JsonProperty("primary_phone_number") - @ExcludeMissing fun primaryPhoneNumber(primaryPhoneNumber: JsonField) = apply { this.primaryPhoneNumber = primaryPhoneNumber } @@ -194,8 +200,6 @@ private constructor( fun departments(departments: List) = departments(JsonField.of(departments)) /** The array of company departments. */ - @JsonProperty("departments") - @ExcludeMissing fun departments(departments: JsonField>) = apply { this.departments = departments } @@ -204,22 +208,16 @@ private constructor( fun ein(ein: String) = ein(JsonField.of(ein)) /** The employer identification number. */ - @JsonProperty("ein") - @ExcludeMissing fun ein(ein: JsonField) = apply { this.ein = ein } fun locations(locations: List) = locations(JsonField.of(locations)) - @JsonProperty("locations") - @ExcludeMissing fun locations(locations: JsonField>) = apply { this.locations = locations } /** An array of bank account objects associated with the payroll/HRIS system. */ fun accounts(accounts: List) = accounts(JsonField.of(accounts)) /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") - @ExcludeMissing fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } fun additionalProperties(additionalProperties: Map) = apply { @@ -227,7 +225,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -257,16 +254,27 @@ private constructor( ) } - @JsonDeserialize(builder = Account.Builder::class) @NoAutoDetect class Account + @JsonCreator 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, + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("account_name") + @ExcludeMissing + private val accountName: JsonField = JsonMissing.of(), + @JsonProperty("institution_name") + @ExcludeMissing + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("account_type") + @ExcludeMissing + private val accountType: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + private val accountNumber: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -361,8 +369,6 @@ private constructor( * A nine-digit code that's based on the U.S. Bank location where your account was * opened. */ - @JsonProperty("routing_number") - @ExcludeMissing fun routingNumber(routingNumber: JsonField) = apply { this.routingNumber = routingNumber } @@ -371,8 +377,6 @@ private constructor( fun accountName(accountName: String) = accountName(JsonField.of(accountName)) /** The name of the bank associated in the payroll/HRIS system. */ - @JsonProperty("account_name") - @ExcludeMissing fun accountName(accountName: JsonField) = apply { this.accountName = accountName } @@ -382,8 +386,6 @@ private constructor( institutionName(JsonField.of(institutionName)) /** Name of the banking institution. */ - @JsonProperty("institution_name") - @ExcludeMissing fun institutionName(institutionName: JsonField) = apply { this.institutionName = institutionName } @@ -392,8 +394,6 @@ private constructor( fun accountType(accountType: AccountType) = accountType(JsonField.of(accountType)) /** The type of bank account. */ - @JsonProperty("account_type") - @ExcludeMissing fun accountType(accountType: JsonField) = apply { this.accountType = accountType } @@ -402,8 +402,6 @@ private constructor( fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") - @ExcludeMissing fun accountNumber(accountNumber: JsonField) = apply { this.accountNumber = accountNumber } @@ -413,7 +411,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -514,13 +511,18 @@ private constructor( "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val parent: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("parent") + @ExcludeMissing + private val parent: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The department name. */ @@ -573,16 +575,12 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The department name. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The parent department, if present. */ fun parent(parent: Parent) = parent(JsonField.of(parent)) /** The parent department, if present. */ - @JsonProperty("parent") - @ExcludeMissing fun parent(parent: JsonField) = apply { this.parent = parent } fun additionalProperties(additionalProperties: Map) = apply { @@ -590,7 +588,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -614,12 +611,15 @@ private constructor( } /** The parent department, if present. */ - @JsonDeserialize(builder = Parent.Builder::class) @NoAutoDetect class Parent + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The parent department's name. */ @@ -663,8 +663,6 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The parent department's name. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { @@ -672,7 +670,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -730,13 +727,16 @@ private constructor( } /** The entity type object. */ - @JsonDeserialize(builder = Entity.Builder::class) @NoAutoDetect class Entity + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The tax payer type of the company. */ @@ -789,16 +789,12 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The tax payer type of the company. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** The tax payer subtype of the company. */ fun subtype(subtype: Subtype) = subtype(JsonField.of(subtype)) /** The tax payer subtype of the company. */ - @JsonProperty("subtype") - @ExcludeMissing fun subtype(subtype: JsonField) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -806,7 +802,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt index 1017debf..984afee3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt @@ -4,26 +4,35 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = CompanyBenefit.Builder::class) @NoAutoDetect class CompanyBenefit +@JsonCreator private constructor( - private val benefitId: JsonField, - private val type: JsonField, - private val description: JsonField, - private val frequency: JsonField, - private val additionalProperties: Map, + @JsonProperty("benefit_id") + @ExcludeMissing + private val benefitId: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + private val description: JsonField = JsonMissing.of(), + @JsonProperty("frequency") + @ExcludeMissing + private val frequency: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun benefitId(): String = benefitId.getRequired("benefit_id") @@ -88,28 +97,20 @@ private constructor( fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) - @JsonProperty("benefit_id") - @ExcludeMissing fun benefitId(benefitId: JsonField) = apply { this.benefitId = benefitId } /** Type of benefit. */ fun type(type: BenefitType) = type(JsonField.of(type)) /** Type of benefit. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("description") - @ExcludeMissing fun description(description: JsonField) = apply { this.description = description } fun frequency(frequency: BenefitFrequency) = frequency(JsonField.of(frequency)) - @JsonProperty("frequency") - @ExcludeMissing fun frequency(frequency: JsonField) = apply { this.frequency = frequency } fun additionalProperties(additionalProperties: Map) = apply { @@ -117,7 +118,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt index c2581d50..245cbd05 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = CompanyEvent.Builder::class) @NoAutoDetect class CompanyEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,11 +197,12 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val additionalProperties: Map, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonAnyGetter @@ -240,7 +238,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt index d4e40ab2..34c6f114 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt @@ -6,31 +6,45 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = CompanyUpdateResponse.Builder::class) @NoAutoDetect class CompanyUpdateResponse +@JsonCreator private constructor( - private val legalName: JsonField, - private val entity: JsonField, - private val primaryEmail: JsonField, - private val primaryPhoneNumber: JsonField, - private val departments: JsonField>, - private val ein: JsonField, - private val locations: JsonField>, - private val accounts: JsonField>, - private val additionalProperties: Map, + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("entity") + @ExcludeMissing + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField> = JsonMissing.of(), + @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField> = JsonMissing.of(), + @JsonProperty("accounts") + @ExcludeMissing + private val accounts: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The legal name of the company. */ @@ -141,24 +155,18 @@ private constructor( fun legalName(legalName: String) = legalName(JsonField.of(legalName)) /** The legal name of the company. */ - @JsonProperty("legal_name") - @ExcludeMissing fun legalName(legalName: JsonField) = apply { this.legalName = legalName } /** The entity type object. */ fun entity(entity: Entity) = entity(JsonField.of(entity)) /** The entity type object. */ - @JsonProperty("entity") - @ExcludeMissing fun entity(entity: JsonField) = apply { this.entity = entity } /** The email of the main administrator on the account. */ fun primaryEmail(primaryEmail: String) = primaryEmail(JsonField.of(primaryEmail)) /** The email of the main administrator on the account. */ - @JsonProperty("primary_email") - @ExcludeMissing fun primaryEmail(primaryEmail: JsonField) = apply { this.primaryEmail = primaryEmail } @@ -168,8 +176,6 @@ private constructor( primaryPhoneNumber(JsonField.of(primaryPhoneNumber)) /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - @JsonProperty("primary_phone_number") - @ExcludeMissing fun primaryPhoneNumber(primaryPhoneNumber: JsonField) = apply { this.primaryPhoneNumber = primaryPhoneNumber } @@ -178,8 +184,6 @@ private constructor( fun departments(departments: List) = departments(JsonField.of(departments)) /** The array of company departments. */ - @JsonProperty("departments") - @ExcludeMissing fun departments(departments: JsonField>) = apply { this.departments = departments } @@ -188,22 +192,16 @@ private constructor( fun ein(ein: String) = ein(JsonField.of(ein)) /** The employer identification number. */ - @JsonProperty("ein") - @ExcludeMissing fun ein(ein: JsonField) = apply { this.ein = ein } fun locations(locations: List) = locations(JsonField.of(locations)) - @JsonProperty("locations") - @ExcludeMissing fun locations(locations: JsonField>) = apply { this.locations = locations } /** An array of bank account objects associated with the payroll/HRIS system. */ fun accounts(accounts: List) = accounts(JsonField.of(accounts)) /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") - @ExcludeMissing fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } fun additionalProperties(additionalProperties: Map) = apply { @@ -211,7 +209,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -240,16 +237,27 @@ private constructor( ) } - @JsonDeserialize(builder = Account.Builder::class) @NoAutoDetect class Account + @JsonCreator 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, + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("account_name") + @ExcludeMissing + private val accountName: JsonField = JsonMissing.of(), + @JsonProperty("institution_name") + @ExcludeMissing + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("account_type") + @ExcludeMissing + private val accountType: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + private val accountNumber: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -344,8 +352,6 @@ private constructor( * A nine-digit code that's based on the U.S. Bank location where your account was * opened. */ - @JsonProperty("routing_number") - @ExcludeMissing fun routingNumber(routingNumber: JsonField) = apply { this.routingNumber = routingNumber } @@ -354,8 +360,6 @@ private constructor( fun accountName(accountName: String) = accountName(JsonField.of(accountName)) /** The name of the bank associated in the payroll/HRIS system. */ - @JsonProperty("account_name") - @ExcludeMissing fun accountName(accountName: JsonField) = apply { this.accountName = accountName } @@ -365,8 +369,6 @@ private constructor( institutionName(JsonField.of(institutionName)) /** Name of the banking institution. */ - @JsonProperty("institution_name") - @ExcludeMissing fun institutionName(institutionName: JsonField) = apply { this.institutionName = institutionName } @@ -375,8 +377,6 @@ private constructor( fun accountType(accountType: AccountType) = accountType(JsonField.of(accountType)) /** The type of bank account. */ - @JsonProperty("account_type") - @ExcludeMissing fun accountType(accountType: JsonField) = apply { this.accountType = accountType } @@ -385,8 +385,6 @@ private constructor( fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") - @ExcludeMissing fun accountNumber(accountNumber: JsonField) = apply { this.accountNumber = accountNumber } @@ -396,7 +394,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -497,13 +494,18 @@ private constructor( "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val parent: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("parent") + @ExcludeMissing + private val parent: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The department name. */ @@ -556,16 +558,12 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The department name. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The parent department, if present. */ fun parent(parent: Parent) = parent(JsonField.of(parent)) /** The parent department, if present. */ - @JsonProperty("parent") - @ExcludeMissing fun parent(parent: JsonField) = apply { this.parent = parent } fun additionalProperties(additionalProperties: Map) = apply { @@ -573,7 +571,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -597,12 +594,15 @@ private constructor( } /** The parent department, if present. */ - @JsonDeserialize(builder = Parent.Builder::class) @NoAutoDetect class Parent + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The parent department's name. */ @@ -646,8 +646,6 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The parent department's name. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { @@ -655,7 +653,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -713,13 +710,16 @@ private constructor( } /** The entity type object. */ - @JsonDeserialize(builder = Entity.Builder::class) @NoAutoDetect class Entity + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The tax payer type of the company. */ @@ -772,16 +772,12 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The tax payer type of the company. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** The tax payer subtype of the company. */ fun subtype(subtype: Subtype) = subtype(JsonField.of(subtype)) /** The tax payer subtype of the company. */ - @JsonProperty("subtype") - @ExcludeMissing fun subtype(subtype: JsonField) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -789,7 +785,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index 8d0473ed..86c342ae 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -79,20 +79,21 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = ConnectSessionNewBody.Builder::class) @NoAutoDetect class ConnectSessionNewBody + @JsonCreator internal constructor( - private val customerId: String, - private val customerName: String, - private val products: List, - private val customerEmail: String?, - private val integration: Integration?, - private val manual: Boolean?, - private val minutesToExpire: Double?, - private val redirectUri: String?, - private val sandbox: Sandbox?, - private val additionalProperties: Map, + @JsonProperty("customer_id") private val customerId: String, + @JsonProperty("customer_name") private val customerName: String, + @JsonProperty("products") private val products: List, + @JsonProperty("customer_email") private val customerEmail: String?, + @JsonProperty("integration") private val integration: Integration?, + @JsonProperty("manual") private val manual: Boolean?, + @JsonProperty("minutes_to_expire") private val minutesToExpire: Double?, + @JsonProperty("redirect_uri") private val redirectUri: String?, + @JsonProperty("sandbox") private val sandbox: Sandbox?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("customer_id") fun customerId(): String = customerId @@ -158,36 +159,28 @@ constructor( additionalProperties = connectSessionNewBody.additionalProperties.toMutableMap() } - @JsonProperty("customer_id") fun customerId(customerId: String) = apply { this.customerId = customerId } - @JsonProperty("customer_name") fun customerName(customerName: String) = apply { this.customerName = customerName } - @JsonProperty("products") fun products(products: List) = apply { this.products = products } - @JsonProperty("customer_email") fun customerEmail(customerEmail: String) = apply { this.customerEmail = customerEmail } - @JsonProperty("integration") fun integration(integration: Integration) = apply { this.integration = integration } - @JsonProperty("manual") fun manual(manual: Boolean) = apply { this.manual = manual } + fun manual(manual: Boolean) = apply { this.manual = manual } /** * The number of minutes until the session expires (defaults to 20,160, which is 14 * days) */ - @JsonProperty("minutes_to_expire") fun minutesToExpire(minutesToExpire: Double) = apply { this.minutesToExpire = minutesToExpire } - @JsonProperty("redirect_uri") fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } - @JsonProperty("sandbox") fun sandbox(sandbox: Sandbox) = apply { this.sandbox = sandbox } fun additionalProperties(additionalProperties: Map) = apply { @@ -195,7 +188,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -542,13 +534,14 @@ constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = Integration.Builder::class) @NoAutoDetect class Integration + @JsonCreator private constructor( - private val provider: String?, - private val authMethod: AuthMethod?, - private val additionalProperties: Map, + @JsonProperty("provider") private val provider: String?, + @JsonProperty("auth_method") private val authMethod: AuthMethod?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("provider") fun provider(): Optional = Optional.ofNullable(provider) @@ -580,10 +573,8 @@ constructor( additionalProperties = integration.additionalProperties.toMutableMap() } - @JsonProperty("provider") fun provider(provider: String) = apply { this.provider = provider } - @JsonProperty("auth_method") fun authMethod(authMethod: AuthMethod) = apply { this.authMethod = authMethod } fun additionalProperties(additionalProperties: Map) = apply { @@ -591,7 +582,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index c1fec0f0..f94b5f64 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -59,15 +59,16 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = ConnectSessionReauthenticateBody.Builder::class) @NoAutoDetect class ConnectSessionReauthenticateBody + @JsonCreator internal constructor( - private val connectionId: String, - private val minutesToExpire: Long?, - private val products: List?, - private val redirectUri: String?, - private val additionalProperties: Map, + @JsonProperty("connection_id") private val connectionId: String, + @JsonProperty("minutes_to_expire") private val minutesToExpire: Long?, + @JsonProperty("products") private val products: List?, + @JsonProperty("redirect_uri") private val redirectUri: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the existing connection to reauthenticate */ @@ -118,24 +119,20 @@ constructor( } /** The ID of the existing connection to reauthenticate */ - @JsonProperty("connection_id") fun connectionId(connectionId: String) = apply { this.connectionId = connectionId } /** * The number of minutes until the session expires (defaults to 20,160, which is 14 * days) */ - @JsonProperty("minutes_to_expire") fun minutesToExpire(minutesToExpire: Long) = apply { this.minutesToExpire = minutesToExpire } /** The products to request access to (optional for reauthentication) */ - @JsonProperty("products") fun products(products: List) = apply { this.products = products } /** The URI to redirect to after the Connect flow is completed */ - @JsonProperty("redirect_uri") fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } fun additionalProperties(additionalProperties: Map) = apply { @@ -143,7 +140,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt index 8523e49d..1b4fb285 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt @@ -6,31 +6,47 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = ConnectionCreateResponse.Builder::class) @NoAutoDetect class ConnectionCreateResponse +@JsonCreator private constructor( - private val connectionId: JsonField, - private val companyId: JsonField, - private val providerId: JsonField, - private val accountId: JsonField, - private val authenticationType: JsonField, - private val products: JsonField>, - private val accessToken: JsonField, - private val tokenType: JsonField, - private val additionalProperties: Map, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("provider_id") + @ExcludeMissing + private val providerId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("authentication_type") + @ExcludeMissing + private val authenticationType: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonProperty("access_token") + @ExcludeMissing + private val accessToken: JsonField = JsonMissing.of(), + @JsonProperty("token_type") + @ExcludeMissing + private val tokenType: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the new connection */ @@ -132,8 +148,6 @@ private constructor( fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) /** The ID of the new connection */ - @JsonProperty("connection_id") - @ExcludeMissing fun connectionId(connectionId: JsonField) = apply { this.connectionId = connectionId } @@ -142,51 +156,37 @@ private constructor( fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") - @ExcludeMissing fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The ID of the provider associated with the `access_token`. */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token`. */ - @JsonProperty("provider_id") - @ExcludeMissing fun providerId(providerId: JsonField) = apply { this.providerId = providerId } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") - @ExcludeMissing fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = authenticationType(JsonField.of(authenticationType)) - @JsonProperty("authentication_type") - @ExcludeMissing fun authenticationType(authenticationType: JsonField) = apply { this.authenticationType = authenticationType } fun products(products: List) = products(JsonField.of(products)) - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) - @JsonProperty("access_token") - @ExcludeMissing fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) - @JsonProperty("token_type") - @ExcludeMissing fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } fun additionalProperties(additionalProperties: Map) = apply { @@ -194,7 +194,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt index 5cdea3b8..78778ad6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt @@ -6,33 +6,53 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = CreateAccessTokenResponse.Builder::class) @NoAutoDetect class CreateAccessTokenResponse +@JsonCreator private constructor( - private val accessToken: JsonField, - private val tokenType: JsonField, - private val connectionId: JsonField, - private val customerId: JsonField, - private val accountId: JsonField, - private val clientType: JsonField, - private val companyId: JsonField, - private val connectionType: JsonField, - private val products: JsonField>, - private val providerId: JsonField, - private val additionalProperties: Map, + @JsonProperty("access_token") + @ExcludeMissing + private val accessToken: JsonField = JsonMissing.of(), + @JsonProperty("token_type") + @ExcludeMissing + private val tokenType: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("customer_id") + @ExcludeMissing + private val customerId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("client_type") + @ExcludeMissing + private val clientType: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("connection_type") + @ExcludeMissing + private val connectionType: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonProperty("provider_id") + @ExcludeMissing + private val providerId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The access token for the connection. */ @@ -171,24 +191,18 @@ private constructor( fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) /** The access token for the connection. */ - @JsonProperty("access_token") - @ExcludeMissing fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } /** The RFC 8693 token type (Finch uses `bearer` tokens) */ fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) /** The RFC 8693 token type (Finch uses `bearer` tokens) */ - @JsonProperty("token_type") - @ExcludeMissing fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } /** The Finch UUID of the connection associated with the `access_token`. */ fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) /** The Finch UUID of the connection associated with the `access_token`. */ - @JsonProperty("connection_id") - @ExcludeMissing fun connectionId(connectionId: JsonField) = apply { this.connectionId = connectionId } @@ -203,8 +217,6 @@ private constructor( * The ID of your customer you provided to Finch when a connect session was created for this * connection. */ - @JsonProperty("customer_id") - @ExcludeMissing fun customerId(customerId: JsonField) = apply { this.customerId = customerId } /** @@ -215,16 +227,12 @@ private constructor( /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ - @JsonProperty("account_id") - @ExcludeMissing fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** The type of application associated with a token. */ fun clientType(clientType: ClientType) = clientType(JsonField.of(clientType)) /** The type of application associated with a token. */ - @JsonProperty("client_type") - @ExcludeMissing fun clientType(clientType: JsonField) = apply { this.clientType = clientType } /** @@ -235,8 +243,6 @@ private constructor( /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ - @JsonProperty("company_id") - @ExcludeMissing fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** @@ -252,8 +258,6 @@ private constructor( * - `provider` - connection to an external provider * - `finch` - finch-generated data. */ - @JsonProperty("connection_type") - @ExcludeMissing fun connectionType(connectionType: JsonField) = apply { this.connectionType = connectionType } @@ -262,16 +266,12 @@ private constructor( fun products(products: List) = products(JsonField.of(products)) /** An array of the authorized products associated with the `access_token`. */ - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } /** The ID of the provider associated with the `access_token`. */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token`. */ - @JsonProperty("provider_id") - @ExcludeMissing fun providerId(providerId: JsonField) = apply { this.providerId = providerId } fun additionalProperties(additionalProperties: Map) = apply { @@ -279,7 +279,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt index ab8ff4cf..88528a19 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt @@ -4,22 +4,25 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = CreateCompanyBenefitsResponse.Builder::class) @NoAutoDetect class CreateCompanyBenefitsResponse +@JsonCreator private constructor( - private val benefitId: JsonField, - private val additionalProperties: Map, + @JsonProperty("benefit_id") + @ExcludeMissing + private val benefitId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun benefitId(): String = benefitId.getRequired("benefit_id") @@ -59,8 +62,6 @@ private constructor( fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) - @JsonProperty("benefit_id") - @ExcludeMissing fun benefitId(benefitId: JsonField) = apply { this.benefitId = benefitId } fun additionalProperties(additionalProperties: Map) = apply { @@ -68,7 +69,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt index 49f98097..2e8bfa3a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = DirectoryEvent.Builder::class) @NoAutoDetect class DirectoryEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,12 +197,15 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val individualId: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the individual related to the event. */ @@ -250,8 +250,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) /** The ID of the individual related to the event. */ - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -261,7 +259,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt index 96cf72de..17507790 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt @@ -4,22 +4,25 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = DisconnectResponse.Builder::class) @NoAutoDetect class DisconnectResponse +@JsonCreator private constructor( - private val status: JsonField, - private val additionalProperties: Map, + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** If the request is successful, Finch will return “success” (HTTP 200 status). */ @@ -63,8 +66,6 @@ private constructor( fun status(status: String) = status(JsonField.of(status)) /** If the request is successful, Finch will return “success” (HTTP 200 status). */ - @JsonProperty("status") - @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } fun additionalProperties(additionalProperties: Map) = apply { @@ -72,7 +73,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index 04077abe..39eff3b5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt @@ -6,43 +6,79 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = EmploymentData.Builder::class) @NoAutoDetect class EmploymentData +@JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val title: JsonField, - private val manager: JsonField, - private val department: JsonField, - private val employment: JsonField, - private val startDate: JsonField, - private val endDate: JsonField, - private val latestRehireDate: JsonField, - private val isActive: JsonField, - private val employmentStatus: JsonField, - private val classCode: JsonField, - private val location: JsonField, - private val income: JsonField, - private val incomeHistory: JsonField>, - private val customFields: JsonField>, - private val sourceId: JsonField, - private val workId: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("latest_rehire_date") + @ExcludeMissing + private val latestRehireDate: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") + @ExcludeMissing + private val employmentStatus: JsonField = JsonMissing.of(), + @JsonProperty("class_code") + @ExcludeMissing + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("location") + @ExcludeMissing + private val location: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField> = JsonMissing.of(), + @JsonProperty("custom_fields") + @ExcludeMissing + private val customFields: JsonField> = JsonMissing.of(), + @JsonProperty("source_id") + @ExcludeMissing + private val sourceId: JsonField = JsonMissing.of(), + @JsonProperty("work_id") + @ExcludeMissing + private val workId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** string A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -275,81 +311,61 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** string A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ - @JsonProperty("first_name") - @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ fun middleName(middleName: String) = middleName(JsonField.of(middleName)) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - @ExcludeMissing fun middleName(middleName: JsonField) = apply { this.middleName = middleName } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** The legal last name of the individual. */ - @JsonProperty("last_name") - @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** The current title of the individual. */ fun title(title: String) = title(JsonField.of(title)) /** The current title of the individual. */ - @JsonProperty("title") - @ExcludeMissing fun title(title: JsonField) = apply { this.title = title } /** The manager object representing the manager of the individual within the org. */ fun manager(manager: Manager) = manager(JsonField.of(manager)) /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } /** The department object. */ fun department(department: Department) = department(JsonField.of(department)) /** The department object. */ - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } /** The employment object. */ fun employment(employment: Employment) = employment(JsonField.of(employment)) /** The employment object. */ - @JsonProperty("employment") - @ExcludeMissing fun employment(employment: JsonField) = apply { this.employment = employment } fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun latestRehireDate(latestRehireDate: String) = latestRehireDate(JsonField.of(latestRehireDate)) - @JsonProperty("latest_rehire_date") - @ExcludeMissing fun latestRehireDate(latestRehireDate: JsonField) = apply { this.latestRehireDate = latestRehireDate } @@ -358,8 +374,6 @@ private constructor( fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") - @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } /** @@ -373,8 +387,6 @@ private constructor( * The detailed employment status of the individual. Available options: `active`, * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. */ - @JsonProperty("employment_status") - @ExcludeMissing fun employmentStatus(employmentStatus: JsonField) = apply { this.employmentStatus = employmentStatus } @@ -383,14 +395,10 @@ private constructor( fun classCode(classCode: String) = classCode(JsonField.of(classCode)) /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") - @ExcludeMissing fun classCode(classCode: JsonField) = apply { this.classCode = classCode } fun location(location: Location) = location(JsonField.of(location)) - @JsonProperty("location") - @ExcludeMissing fun location(location: JsonField) = apply { this.location = location } /** @@ -405,16 +413,12 @@ private constructor( * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") - @ExcludeMissing fun income(income: JsonField) = apply { this.income = income } /** The array of income history. */ fun incomeHistory(incomeHistory: List) = incomeHistory(JsonField.of(incomeHistory)) /** The array of income history. */ - @JsonProperty("income_history") - @ExcludeMissing fun incomeHistory(incomeHistory: JsonField>) = apply { this.incomeHistory = incomeHistory } @@ -429,8 +433,6 @@ private constructor( * Custom fields for the individual. These are fields which are defined by the employer in * the system. */ - @JsonProperty("custom_fields") - @ExcludeMissing fun customFields(customFields: JsonField>) = apply { this.customFields = customFields } @@ -439,16 +441,12 @@ private constructor( fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") - @ExcludeMissing fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } /** This field is deprecated in favour of `source_id` */ fun workId(workId: String) = workId(JsonField.of(workId)) /** This field is deprecated in favour of `source_id` */ - @JsonProperty("work_id") - @ExcludeMissing fun workId(workId: JsonField) = apply { this.workId = workId } fun additionalProperties(additionalProperties: Map) = apply { @@ -456,7 +454,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -497,13 +494,16 @@ private constructor( ) } - @JsonDeserialize(builder = CustomField.Builder::class) @NoAutoDetect class CustomField + @JsonCreator private constructor( - private val name: JsonField, - private val value: JsonValue, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing private val value: JsonValue = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -547,12 +547,8 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - @JsonProperty("value") - @ExcludeMissing fun value(value: JsonValue) = apply { this.value = value } fun additionalProperties(additionalProperties: Map) = apply { @@ -560,7 +556,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -602,12 +597,15 @@ private constructor( } /** The department object. */ - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The name of the department associated with the individual. */ @@ -651,8 +649,6 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The name of the department associated with the individual. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { @@ -660,7 +656,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -697,13 +692,16 @@ private constructor( } /** The employment object. */ - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The main employment type of the individual. */ @@ -762,8 +760,6 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The main employment type of the individual. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** @@ -776,8 +772,6 @@ private constructor( * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") - @ExcludeMissing fun subtype(subtype: JsonField) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -785,7 +779,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1052,12 +1045,13 @@ private constructor( } /** The manager object representing the manager of the individual within the org. */ - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1101,8 +1095,6 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { @@ -1110,7 +1102,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt index 17785823..03573473 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt @@ -4,25 +4,30 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = EmploymentDataResponse.Builder::class) @NoAutoDetect class EmploymentDataResponse +@JsonCreator private constructor( - private val individualId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") + @ExcludeMissing + private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -77,22 +82,16 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } fun code(code: Long) = code(JsonField.of(code)) - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: EmploymentData) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -100,7 +99,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt index 79a8bed2..8de6d0a1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = EmploymentEvent.Builder::class) @NoAutoDetect class EmploymentEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,12 +197,15 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val individualId: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the individual related to the event. */ @@ -250,8 +250,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) /** The ID of the individual related to the event. */ - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -261,7 +259,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 51041e59..12c10332 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt @@ -6,42 +6,76 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = EmploymentUpdateResponse.Builder::class) @NoAutoDetect class EmploymentUpdateResponse +@JsonCreator private constructor( - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val title: JsonField, - private val manager: JsonField, - private val department: JsonField, - private val employment: JsonField, - private val startDate: JsonField, - private val endDate: JsonField, - private val latestRehireDate: JsonField, - private val isActive: JsonField, - private val employmentStatus: JsonField, - private val classCode: JsonField, - private val location: JsonField, - private val income: JsonField, - private val incomeHistory: JsonField>, - private val customFields: JsonField>, - private val sourceId: JsonField, - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("latest_rehire_date") + @ExcludeMissing + private val latestRehireDate: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") + @ExcludeMissing + private val employmentStatus: JsonField = JsonMissing.of(), + @JsonProperty("class_code") + @ExcludeMissing + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("location") + @ExcludeMissing + private val location: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField> = JsonMissing.of(), + @JsonProperty("custom_fields") + @ExcludeMissing + private val customFields: JsonField> = JsonMissing.of(), + @JsonProperty("source_id") + @ExcludeMissing + private val sourceId: JsonField = JsonMissing.of(), + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The legal first name of the individual. */ @@ -259,75 +293,55 @@ private constructor( fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ - @JsonProperty("first_name") - @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ fun middleName(middleName: String) = middleName(JsonField.of(middleName)) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - @ExcludeMissing fun middleName(middleName: JsonField) = apply { this.middleName = middleName } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** The legal last name of the individual. */ - @JsonProperty("last_name") - @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** The current title of the individual. */ fun title(title: String) = title(JsonField.of(title)) /** The current title of the individual. */ - @JsonProperty("title") - @ExcludeMissing fun title(title: JsonField) = apply { this.title = title } /** The manager object representing the manager of the individual within the org. */ fun manager(manager: Manager) = manager(JsonField.of(manager)) /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } /** The department object. */ fun department(department: Department) = department(JsonField.of(department)) /** The department object. */ - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } /** The employment object. */ fun employment(employment: Employment) = employment(JsonField.of(employment)) /** The employment object. */ - @JsonProperty("employment") - @ExcludeMissing fun employment(employment: JsonField) = apply { this.employment = employment } fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun latestRehireDate(latestRehireDate: String) = latestRehireDate(JsonField.of(latestRehireDate)) - @JsonProperty("latest_rehire_date") - @ExcludeMissing fun latestRehireDate(latestRehireDate: JsonField) = apply { this.latestRehireDate = latestRehireDate } @@ -336,8 +350,6 @@ private constructor( fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") - @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } /** The detailed employment status of the individual. */ @@ -345,8 +357,6 @@ private constructor( employmentStatus(JsonField.of(employmentStatus)) /** The detailed employment status of the individual. */ - @JsonProperty("employment_status") - @ExcludeMissing fun employmentStatus(employmentStatus: JsonField) = apply { this.employmentStatus = employmentStatus } @@ -355,14 +365,10 @@ private constructor( fun classCode(classCode: String) = classCode(JsonField.of(classCode)) /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") - @ExcludeMissing fun classCode(classCode: JsonField) = apply { this.classCode = classCode } fun location(location: Location) = location(JsonField.of(location)) - @JsonProperty("location") - @ExcludeMissing fun location(location: JsonField) = apply { this.location = location } /** @@ -377,16 +383,12 @@ private constructor( * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") - @ExcludeMissing fun income(income: JsonField) = apply { this.income = income } /** The array of income history. */ fun incomeHistory(incomeHistory: List) = incomeHistory(JsonField.of(incomeHistory)) /** The array of income history. */ - @JsonProperty("income_history") - @ExcludeMissing fun incomeHistory(incomeHistory: JsonField>) = apply { this.incomeHistory = incomeHistory } @@ -401,8 +403,6 @@ private constructor( * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ - @JsonProperty("custom_fields") - @ExcludeMissing fun customFields(customFields: JsonField>) = apply { this.customFields = customFields } @@ -411,22 +411,19 @@ private constructor( fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") - @ExcludeMissing fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -466,13 +463,16 @@ private constructor( ) } - @JsonDeserialize(builder = CustomField.Builder::class) @NoAutoDetect class CustomField + @JsonCreator private constructor( - private val name: JsonField, - private val value: JsonValue, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing private val value: JsonValue = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -516,12 +516,8 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - @JsonProperty("value") - @ExcludeMissing fun value(value: JsonValue) = apply { this.value = value } fun additionalProperties(additionalProperties: Map) = apply { @@ -529,7 +525,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -571,12 +566,15 @@ private constructor( } /** The department object. */ - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The name of the department associated with the individual. */ @@ -620,8 +618,6 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The name of the department associated with the individual. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { @@ -629,7 +625,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -666,13 +661,16 @@ private constructor( } /** The employment object. */ - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The main employment type of the individual. */ @@ -731,8 +729,6 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The main employment type of the individual. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** @@ -745,8 +741,6 @@ private constructor( * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") - @ExcludeMissing fun subtype(subtype: JsonField) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -754,7 +748,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1021,12 +1014,13 @@ private constructor( } /** The manager object representing the manager of the individual within the org. */ - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1070,8 +1064,6 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { @@ -1079,7 +1071,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt index 8d9c562b..1c43c4d6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt @@ -6,26 +6,28 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = EnrolledIndividual.Builder::class) @NoAutoDetect class EnrolledIndividual +@JsonCreator private constructor( - private val individualId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -82,8 +84,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -92,14 +92,10 @@ private constructor( fun code(code: Code) = code(JsonField.of(code)) /** HTTP status code. Either 201 or 200 */ - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: Body) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -107,7 +103,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -131,14 +126,21 @@ private constructor( ) } - @JsonDeserialize(builder = Body.Builder::class) @NoAutoDetect class Body + @JsonCreator private constructor( - private val name: JsonField, - private val finchCode: JsonField, - private val message: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("finch_code") + @ExcludeMissing + private val finchCode: JsonField = JsonMissing.of(), + @JsonProperty("message") + @ExcludeMissing + private val message: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** Identifier indicating whether the benefit was newly enrolled or updated. */ @@ -200,24 +202,18 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** Identifier indicating whether the benefit was newly enrolled or updated. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** A descriptive identifier for the response */ fun finchCode(finchCode: String) = finchCode(JsonField.of(finchCode)) /** A descriptive identifier for the response */ - @JsonProperty("finch_code") - @ExcludeMissing fun finchCode(finchCode: JsonField) = apply { this.finchCode = finchCode } /** Short description in English that provides more information about the response. */ fun message(message: String) = message(JsonField.of(message)) /** Short description in English that provides more information about the response. */ - @JsonProperty("message") - @ExcludeMissing fun message(message: JsonField) = apply { this.message = message } fun additionalProperties(additionalProperties: Map) = apply { @@ -225,7 +221,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt index 9c940b04..d5d7a5f5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -51,14 +52,15 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = HrisBenefitCreateBody.Builder::class) @NoAutoDetect class HrisBenefitCreateBody + @JsonCreator internal constructor( - private val description: String?, - private val frequency: BenefitFrequency?, - private val type: BenefitType?, - private val additionalProperties: Map, + @JsonProperty("description") private val description: String?, + @JsonProperty("frequency") private val frequency: BenefitFrequency?, + @JsonProperty("type") private val type: BenefitType?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -105,21 +107,18 @@ constructor( * limiting this to <30 characters due to limitations in specific providers (e.g. * Justworks). */ - @JsonProperty("description") fun description(description: String) = apply { this.description = description } - @JsonProperty("frequency") fun frequency(frequency: BenefitFrequency) = apply { this.frequency = frequency } /** Type of benefit. */ - @JsonProperty("type") fun type(type: BenefitType) = apply { this.type = type } + fun type(type: BenefitType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt index 9cfaf1e0..f5f1d11d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.benefits.IndividualService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -130,10 +133,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPageAsync.kt index 17c53431..b9f4793c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsync import java.util.Objects @@ -75,12 +76,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -134,10 +137,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPage.kt index 0fa3731d..6fe68d85 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.benefits.IndividualService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -130,10 +133,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPageAsync.kt index 922e047c..b4fdd6c4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +136,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt index 59bd9ac3..f01ebb86 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -50,12 +51,13 @@ constructor( } } - @JsonDeserialize(builder = HrisBenefitIndividualUnenrollManyBody.Builder::class) @NoAutoDetect class HrisBenefitIndividualUnenrollManyBody + @JsonCreator internal constructor( - private val individualIds: List?, - private val additionalProperties: Map, + @JsonProperty("individual_ids") private val individualIds: List?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** Array of individual_ids to unenroll. */ @@ -88,7 +90,6 @@ constructor( } /** Array of individual_ids to unenroll. */ - @JsonProperty("individual_ids") fun individualIds(individualIds: List) = apply { this.individualIds = individualIds } @@ -98,7 +99,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPage.kt index 56ba5279..5c9d3159 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.BenefitService import java.util.Objects @@ -67,12 +68,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -126,10 +129,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPageAsync.kt index 2e7db706..ad78a2d4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.BenefitServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +136,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPage.kt index 07a10a48..95cd2dbe 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.BenefitService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -130,10 +133,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPageAsync.kt index 6871d84a..e00f8e52 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.BenefitServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +136,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt index 06bfa50e..1de70a78 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -50,12 +51,13 @@ constructor( } } - @JsonDeserialize(builder = HrisBenefitUpdateBody.Builder::class) @NoAutoDetect class HrisBenefitUpdateBody + @JsonCreator internal constructor( - private val description: String?, - private val additionalProperties: Map, + @JsonProperty("description") private val description: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** Updated name or description. */ @@ -85,7 +87,6 @@ constructor( } /** Updated name or description. */ - @JsonProperty("description") fun description(description: String) = apply { this.description = description } fun additionalProperties(additionalProperties: Map) = apply { @@ -93,7 +94,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPage.kt index 9ab6f318..b24aa8e9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.DirectoryService import java.util.Objects @@ -83,13 +84,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val individuals: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("individuals") + private val individuals: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -154,17 +157,14 @@ private constructor( fun individuals(individuals: List) = individuals(JsonField.of(individuals)) - @JsonProperty("individuals") fun individuals(individuals: JsonField>) = apply { this.individuals = individuals } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt index 347dc98e..b0d74067 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.DirectoryServiceAsync import java.util.Objects @@ -86,13 +87,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val individuals: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("individuals") + private val individuals: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -157,17 +160,14 @@ private constructor( fun individuals(individuals: List) = individuals(JsonField.of(individuals)) - @JsonProperty("individuals") fun individuals(individuals: JsonField>) = apply { this.individuals = individuals } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt index a72ee4ff..fc5cb237 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.DirectoryService import java.util.Objects @@ -82,13 +83,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val individuals: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("individuals") + private val individuals: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -153,17 +156,14 @@ private constructor( fun individuals(individuals: List) = individuals(JsonField.of(individuals)) - @JsonProperty("individuals") fun individuals(individuals: JsonField>) = apply { this.individuals = individuals } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt index 3ab7e847..75f3a775 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.DirectoryServiceAsync import java.util.Objects @@ -85,13 +86,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val individuals: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("individuals") + private val individuals: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -156,17 +159,14 @@ private constructor( fun individuals(individuals: List) = individuals(JsonField.of(individuals)) - @JsonProperty("individuals") fun individuals(individuals: JsonField>) = apply { this.individuals = individuals } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt index bf9ca300..71ea48eb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.EmploymentService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,12 +136,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageAsync.kt index a6e2e991..9c7d988d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.EmploymentServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -136,12 +139,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt index 637188a9..623c3cae 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -40,12 +41,13 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams /** Individual Ids Request Body */ - @JsonDeserialize(builder = HrisEmploymentRetrieveManyBody.Builder::class) @NoAutoDetect class HrisEmploymentRetrieveManyBody + @JsonCreator internal constructor( - private val requests: List, - private val additionalProperties: Map, + @JsonProperty("requests") private val requests: List, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The array of batch requests. */ @@ -76,7 +78,6 @@ constructor( } /** The array of batch requests. */ - @JsonProperty("requests") fun requests(requests: List) = apply { this.requests = requests } fun additionalProperties(additionalProperties: Map) = apply { @@ -84,7 +85,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -289,12 +289,13 @@ constructor( ) } - @JsonDeserialize(builder = Request.Builder::class) @NoAutoDetect class Request + @JsonCreator private constructor( - private val individualId: String, - private val additionalProperties: Map, + @JsonProperty("individual_id") private val individualId: String, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -331,7 +332,6 @@ constructor( * the number of `individual_id` to send per request. It is preferantial to send all ids * in a single request for Finch to optimize provider rate-limits. */ - @JsonProperty("individual_id") fun individualId(individualId: String) = apply { this.individualId = individualId } fun additionalProperties(additionalProperties: Map) = apply { @@ -339,7 +339,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPage.kt index 4207b791..72a1d20e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.IndividualService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -131,12 +134,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageAsync.kt index b78233a3..efdfe58a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.IndividualServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -134,12 +137,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt index 17fc7b29..9dbe94f2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -47,13 +48,14 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = HrisIndividualRetrieveManyBody.Builder::class) @NoAutoDetect class HrisIndividualRetrieveManyBody + @JsonCreator internal constructor( - private val options: Options?, - private val requests: List?, - private val additionalProperties: Map, + @JsonProperty("options") private val options: Options?, + @JsonProperty("requests") private val requests: List?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("options") fun options(): Optional = Optional.ofNullable(options) @@ -87,10 +89,8 @@ constructor( hrisIndividualRetrieveManyBody.additionalProperties.toMutableMap() } - @JsonProperty("options") fun options(options: Options) = apply { this.options = options } - @JsonProperty("requests") fun requests(requests: List) = apply { this.requests = requests } fun additionalProperties(additionalProperties: Map) = apply { @@ -98,7 +98,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -307,12 +306,13 @@ constructor( ) } - @JsonDeserialize(builder = Options.Builder::class) @NoAutoDetect class Options + @JsonCreator private constructor( - private val include: List?, - private val additionalProperties: Map, + @JsonProperty("include") private val include: List?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("include") @@ -340,7 +340,6 @@ constructor( additionalProperties = options.additionalProperties.toMutableMap() } - @JsonProperty("include") fun include(include: List) = apply { this.include = include } fun additionalProperties(additionalProperties: Map) = apply { @@ -348,7 +347,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -385,12 +383,13 @@ constructor( "Options{include=$include, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Request.Builder::class) @NoAutoDetect class Request + @JsonCreator private constructor( - private val individualId: String?, - private val additionalProperties: Map, + @JsonProperty("individual_id") private val individualId: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("individual_id") @@ -418,7 +417,6 @@ constructor( additionalProperties = request.additionalProperties.toMutableMap() } - @JsonProperty("individual_id") fun individualId(individualId: String) = apply { this.individualId = individualId } fun additionalProperties(additionalProperties: Map) = apply { @@ -426,7 +424,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPage.kt index 55ce79fd..0c3034b0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.PayStatementService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -132,12 +135,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPageAsync.kt index 720003e1..84291ccb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.PayStatementServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val responses: JsonField>, - private val additionalProperties: Map, + @JsonProperty("responses") + private val responses: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -135,12 +138,10 @@ private constructor( fun responses(responses: List) = responses(JsonField.of(responses)) - @JsonProperty("responses") fun responses(responses: JsonField>) = apply { this.responses = responses } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt index fd76312c..934bc4ff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -40,12 +41,13 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = HrisPayStatementRetrieveManyBody.Builder::class) @NoAutoDetect class HrisPayStatementRetrieveManyBody + @JsonCreator internal constructor( - private val requests: List, - private val additionalProperties: Map, + @JsonProperty("requests") private val requests: List, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The array of batch requests. */ @@ -76,7 +78,6 @@ constructor( } /** The array of batch requests. */ - @JsonProperty("requests") fun requests(requests: List) = apply { this.requests = requests } fun additionalProperties(additionalProperties: Map) = apply { @@ -84,7 +85,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -289,14 +289,15 @@ constructor( ) } - @JsonDeserialize(builder = Request.Builder::class) @NoAutoDetect class Request + @JsonCreator private constructor( - private val paymentId: String, - private val limit: Long?, - private val offset: Long?, - private val additionalProperties: Map, + @JsonProperty("payment_id") private val paymentId: String, + @JsonProperty("limit") private val limit: Long?, + @JsonProperty("offset") private val offset: Long?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for a payment. */ @@ -335,21 +336,19 @@ constructor( } /** A stable Finch `id` (UUID v4) for a payment. */ - @JsonProperty("payment_id") fun paymentId(paymentId: String) = apply { this.paymentId = paymentId } /** Number of pay statements to return (defaults to all). */ - @JsonProperty("limit") fun limit(limit: Long) = apply { this.limit = limit } + fun limit(limit: Long) = apply { this.limit = limit } /** Index to start from. */ - @JsonProperty("offset") fun offset(offset: Long) = apply { this.offset = offset } + fun offset(offset: Long) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPage.kt index 94842363..8b7c0854 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.hris.PaymentService import java.util.Objects @@ -67,12 +68,13 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -126,10 +128,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPageAsync.kt index 13f61b41..f84e657c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.hris.PaymentServiceAsync import java.util.Objects @@ -74,12 +75,13 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +135,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt index e8e34210..1d180b02 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt @@ -6,13 +6,13 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -23,15 +23,19 @@ import java.util.Optional * may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the * provider returns. */ -@JsonDeserialize(builder = Income.Builder::class) @NoAutoDetect class Income +@JsonCreator private constructor( - private val unit: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val effectiveDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("unit") @ExcludeMissing private val unit: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("effective_date") + @ExcludeMissing + private val effectiveDate: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -115,32 +119,24 @@ private constructor( * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. */ - @JsonProperty("unit") - @ExcludeMissing fun unit(unit: JsonField) = apply { this.unit = unit } /** The income amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** The income amount in cents. */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } /** The currency code. */ fun currency(currency: String) = currency(JsonField.of(currency)) /** The currency code. */ - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } /** The date the income amount went into effect. */ fun effectiveDate(effectiveDate: String) = effectiveDate(JsonField.of(effectiveDate)) /** The date the income amount went into effect. */ - @JsonProperty("effective_date") - @ExcludeMissing fun effectiveDate(effectiveDate: JsonField) = apply { this.effectiveDate = effectiveDate } @@ -150,7 +146,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index b2369be5..e3e4883c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt @@ -6,36 +6,56 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Individual.Builder::class) @NoAutoDetect class Individual +@JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val preferredName: JsonField, - private val emails: JsonField>, - private val phoneNumbers: JsonField>, - private val gender: JsonField, - private val ethnicity: JsonField, - private val dob: JsonField, - private val residence: JsonField, - private val ssn: JsonField, - private val encryptedSsn: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField> = JsonMissing.of(), + @JsonProperty("phone_numbers") + @ExcludeMissing + private val phoneNumbers: JsonField> = JsonMissing.of(), + @JsonProperty("gender") + @ExcludeMissing + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), + @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), + @JsonProperty("residence") + @ExcludeMissing + private val residence: JsonField = JsonMissing.of(), + @JsonProperty("ssn") @ExcludeMissing private val ssn: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -198,53 +218,41 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ - @JsonProperty("first_name") - @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ fun middleName(middleName: String) = middleName(JsonField.of(middleName)) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - @ExcludeMissing fun middleName(middleName: JsonField) = apply { this.middleName = middleName } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** The legal last name of the individual. */ - @JsonProperty("last_name") - @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** The preferred name of the individual. */ fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) /** The preferred name of the individual. */ - @JsonProperty("preferred_name") - @ExcludeMissing fun preferredName(preferredName: JsonField) = apply { this.preferredName = preferredName } fun emails(emails: List) = emails(JsonField.of(emails)) - @JsonProperty("emails") - @ExcludeMissing fun emails(emails: JsonField>) = apply { this.emails = emails } fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) - @JsonProperty("phone_numbers") - @ExcludeMissing fun phoneNumbers(phoneNumbers: JsonField>) = apply { this.phoneNumbers = phoneNumbers } @@ -253,28 +261,20 @@ private constructor( fun gender(gender: Gender) = gender(JsonField.of(gender)) /** The gender of the individual. */ - @JsonProperty("gender") - @ExcludeMissing fun gender(gender: JsonField) = apply { this.gender = gender } /** The EEOC-defined ethnicity of the individual. */ fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") - @ExcludeMissing fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } fun dob(dob: String) = dob(JsonField.of(dob)) - @JsonProperty("dob") - @ExcludeMissing fun dob(dob: JsonField) = apply { this.dob = dob } fun residence(residence: Location) = residence(JsonField.of(residence)) - @JsonProperty("residence") - @ExcludeMissing fun residence(residence: JsonField) = apply { this.residence = residence } /** @@ -289,8 +289,6 @@ private constructor( * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") - @ExcludeMissing fun ssn(ssn: JsonField) = apply { this.ssn = ssn } /** @@ -305,8 +303,6 @@ private constructor( * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - @JsonProperty("encrypted_ssn") - @ExcludeMissing fun encryptedSsn(encryptedSsn: JsonField) = apply { this.encryptedSsn = encryptedSsn } @@ -316,7 +312,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -350,13 +345,16 @@ private constructor( ) } - @JsonDeserialize(builder = Email.Builder::class) @NoAutoDetect class Email + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -403,14 +401,10 @@ private constructor( fun data(data: String) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Type) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -418,7 +412,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -679,13 +672,16 @@ private constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = PhoneNumber.Builder::class) @NoAutoDetect class PhoneNumber + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -732,14 +728,10 @@ private constructor( fun data(data: String) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Type) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -747,7 +739,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt index 510bbc63..816f98ce 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt @@ -6,26 +6,28 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = IndividualBenefit.Builder::class) @NoAutoDetect class IndividualBenefit +@JsonCreator private constructor( - private val individualId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -80,22 +82,16 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } fun code(code: Long) = code(JsonField.of(code)) - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: Body) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -103,7 +99,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -127,16 +122,27 @@ private constructor( ) } - @JsonDeserialize(builder = Body.Builder::class) @NoAutoDetect class Body + @JsonCreator private constructor( - private val employeeDeduction: JsonField, - private val companyContribution: JsonField, - private val annualMaximum: JsonField, - private val catchUp: JsonField, - private val hsaContributionLimit: JsonField, - private val additionalProperties: Map, + @JsonProperty("employee_deduction") + @ExcludeMissing + private val employeeDeduction: JsonField = JsonMissing.of(), + @JsonProperty("company_contribution") + @ExcludeMissing + private val companyContribution: JsonField = JsonMissing.of(), + @JsonProperty("annual_maximum") + @ExcludeMissing + private val annualMaximum: JsonField = JsonMissing.of(), + @JsonProperty("catch_up") + @ExcludeMissing + private val catchUp: JsonField = JsonMissing.of(), + @JsonProperty("hsa_contribution_limit") + @ExcludeMissing + private val hsaContributionLimit: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun employeeDeduction(): Optional = @@ -227,8 +233,6 @@ private constructor( fun employeeDeduction(employeeDeduction: BenefitContribution) = employeeDeduction(JsonField.of(employeeDeduction)) - @JsonProperty("employee_deduction") - @ExcludeMissing fun employeeDeduction(employeeDeduction: JsonField) = apply { this.employeeDeduction = employeeDeduction } @@ -236,8 +240,6 @@ private constructor( fun companyContribution(companyContribution: BenefitContribution) = companyContribution(JsonField.of(companyContribution)) - @JsonProperty("company_contribution") - @ExcludeMissing fun companyContribution(companyContribution: JsonField) = apply { this.companyContribution = companyContribution } @@ -246,8 +248,6 @@ private constructor( fun annualMaximum(annualMaximum: Long) = annualMaximum(JsonField.of(annualMaximum)) /** If the benefit supports annual maximum, the amount in cents for this individual. */ - @JsonProperty("annual_maximum") - @ExcludeMissing fun annualMaximum(annualMaximum: JsonField) = apply { this.annualMaximum = annualMaximum } @@ -262,8 +262,6 @@ private constructor( * If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled for * this individual. */ - @JsonProperty("catch_up") - @ExcludeMissing fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } /** Type for HSA contribution limit if the benefit is a HSA. */ @@ -271,8 +269,6 @@ private constructor( hsaContributionLimit(JsonField.of(hsaContributionLimit)) /** Type for HSA contribution limit if the benefit is a HSA. */ - @JsonProperty("hsa_contribution_limit") - @ExcludeMissing fun hsaContributionLimit(hsaContributionLimit: JsonField) = apply { this.hsaContributionLimit = hsaContributionLimit @@ -283,7 +279,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt index be83dda0..4a84938e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponse.kt @@ -4,23 +4,28 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = IndividualEnrolledIdsResponse.Builder::class) @NoAutoDetect class IndividualEnrolledIdsResponse +@JsonCreator private constructor( - private val benefitId: JsonField, - private val individualIds: JsonField>, - private val additionalProperties: Map, + @JsonProperty("benefit_id") + @ExcludeMissing + private val benefitId: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun benefitId(): String = benefitId.getRequired("benefit_id") @@ -67,14 +72,10 @@ private constructor( fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) - @JsonProperty("benefit_id") - @ExcludeMissing fun benefitId(benefitId: JsonField) = apply { this.benefitId = benefitId } fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField>) = apply { this.individualIds = individualIds } @@ -84,7 +85,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt index 0d0e8282..3f8e2191 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = IndividualEvent.Builder::class) @NoAutoDetect class IndividualEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,12 +197,15 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val individualId: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the individual related to the event. */ @@ -250,8 +250,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) /** The ID of the individual related to the event. */ - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -261,7 +259,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt index e6b1146d..0d82062f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt @@ -4,29 +4,42 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = IndividualInDirectory.Builder::class) @NoAutoDetect class IndividualInDirectory +@JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val manager: JsonField, - private val department: JsonField, - private val isActive: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch id (UUID v4) for an individual in the company. */ @@ -125,54 +138,42 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch id (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ - @JsonProperty("first_name") - @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ fun middleName(middleName: String) = middleName(JsonField.of(middleName)) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - @ExcludeMissing fun middleName(middleName: JsonField) = apply { this.middleName = middleName } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** The legal last name of the individual. */ - @JsonProperty("last_name") - @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** The manager object. */ fun manager(manager: Manager) = manager(JsonField.of(manager)) /** The manager object. */ - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } /** The department object. */ fun department(department: Department) = department(JsonField.of(department)) /** The department object. */ - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } /** `true` if the individual is an active employee or contractor at the company. */ fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) /** `true` if the individual is an active employee or contractor at the company. */ - @JsonProperty("is_active") - @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } fun additionalProperties(additionalProperties: Map) = apply { @@ -180,7 +181,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -209,12 +209,15 @@ private constructor( } /** The department object. */ - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The name of the department. */ @@ -258,8 +261,6 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The name of the department. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { @@ -267,7 +268,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -304,12 +304,13 @@ private constructor( } /** The manager object. */ - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -353,8 +354,6 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { @@ -362,7 +361,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt index 3810edc3..21ff4f53 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt @@ -4,25 +4,30 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = IndividualResponse.Builder::class) @NoAutoDetect class IndividualResponse +@JsonCreator private constructor( - private val individualId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") + @ExcludeMissing + private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -77,22 +82,16 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } fun code(code: Long) = code(JsonField.of(code)) - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: Individual) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -100,7 +99,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt index f97014f2..540c4b65 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt @@ -6,36 +6,56 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = IndividualUpdateResponse.Builder::class) @NoAutoDetect class IndividualUpdateResponse +@JsonCreator private constructor( - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val preferredName: JsonField, - private val emails: JsonField>, - private val phoneNumbers: JsonField>, - private val gender: JsonField, - private val ethnicity: JsonField, - private val dob: JsonField, - private val ssn: JsonField, - private val encryptedSsn: JsonField, - private val residence: JsonField, - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField> = JsonMissing.of(), + @JsonProperty("phone_numbers") + @ExcludeMissing + private val phoneNumbers: JsonField> = JsonMissing.of(), + @JsonProperty("gender") + @ExcludeMissing + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), + @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), + @JsonProperty("ssn") @ExcludeMissing private val ssn: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonProperty("residence") + @ExcludeMissing + private val residence: JsonField = JsonMissing.of(), + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The legal first name of the individual. */ @@ -198,47 +218,35 @@ private constructor( fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ - @JsonProperty("first_name") - @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ fun middleName(middleName: String) = middleName(JsonField.of(middleName)) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - @ExcludeMissing fun middleName(middleName: JsonField) = apply { this.middleName = middleName } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** The legal last name of the individual. */ - @JsonProperty("last_name") - @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** The preferred name of the individual. */ fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) /** The preferred name of the individual. */ - @JsonProperty("preferred_name") - @ExcludeMissing fun preferredName(preferredName: JsonField) = apply { this.preferredName = preferredName } fun emails(emails: List) = emails(JsonField.of(emails)) - @JsonProperty("emails") - @ExcludeMissing fun emails(emails: JsonField>) = apply { this.emails = emails } fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) - @JsonProperty("phone_numbers") - @ExcludeMissing fun phoneNumbers(phoneNumbers: JsonField>) = apply { this.phoneNumbers = phoneNumbers } @@ -247,22 +255,16 @@ private constructor( fun gender(gender: Gender) = gender(JsonField.of(gender)) /** The gender of the individual. */ - @JsonProperty("gender") - @ExcludeMissing fun gender(gender: JsonField) = apply { this.gender = gender } /** The EEOC-defined ethnicity of the individual. */ fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") - @ExcludeMissing fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } fun dob(dob: String) = dob(JsonField.of(dob)) - @JsonProperty("dob") - @ExcludeMissing fun dob(dob: JsonField) = apply { this.dob = dob } /** @@ -277,8 +279,6 @@ private constructor( * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") - @ExcludeMissing fun ssn(ssn: JsonField) = apply { this.ssn = ssn } /** @@ -293,30 +293,25 @@ private constructor( * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - @JsonProperty("encrypted_ssn") - @ExcludeMissing fun encryptedSsn(encryptedSsn: JsonField) = apply { this.encryptedSsn = encryptedSsn } fun residence(residence: Location) = residence(JsonField.of(residence)) - @JsonProperty("residence") - @ExcludeMissing fun residence(residence: JsonField) = apply { this.residence = residence } /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(id: String) = id(JsonField.of(id)) /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -350,13 +345,16 @@ private constructor( ) } - @JsonDeserialize(builder = Email.Builder::class) @NoAutoDetect class Email + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -403,14 +401,10 @@ private constructor( fun data(data: String) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Type) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -418,7 +412,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -679,13 +672,16 @@ private constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = PhoneNumber.Builder::class) @NoAutoDetect class PhoneNumber + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -732,14 +728,10 @@ private constructor( fun data(data: String) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Type) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -747,7 +739,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt index d9e38e02..999ecab4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt @@ -6,39 +6,71 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Introspection.Builder::class) @NoAutoDetect class Introspection +@JsonCreator private constructor( - private val connectionId: JsonField, - private val connectionStatus: JsonField, - private val clientId: JsonField, - private val clientType: JsonField, - private val connectionType: JsonField, - private val companyId: JsonField, - private val accountId: JsonField, - private val customerId: JsonField, - private val customerName: JsonField, - private val customerEmail: JsonField, - private val authenticationMethods: JsonField>, - private val products: JsonField>, - private val username: JsonField, - private val providerId: JsonField, - private val payrollProviderId: JsonField, - private val manual: JsonField, - private val additionalProperties: Map, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("connection_status") + @ExcludeMissing + private val connectionStatus: JsonField = JsonMissing.of(), + @JsonProperty("client_id") + @ExcludeMissing + private val clientId: JsonField = JsonMissing.of(), + @JsonProperty("client_type") + @ExcludeMissing + private val clientType: JsonField = JsonMissing.of(), + @JsonProperty("connection_type") + @ExcludeMissing + private val connectionType: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("customer_id") + @ExcludeMissing + private val customerId: JsonField = JsonMissing.of(), + @JsonProperty("customer_name") + @ExcludeMissing + private val customerName: JsonField = JsonMissing.of(), + @JsonProperty("customer_email") + @ExcludeMissing + private val customerEmail: JsonField = JsonMissing.of(), + @JsonProperty("authentication_methods") + @ExcludeMissing + private val authenticationMethods: JsonField> = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonProperty("username") + @ExcludeMissing + private val username: JsonField = JsonMissing.of(), + @JsonProperty("provider_id") + @ExcludeMissing + private val providerId: JsonField = JsonMissing.of(), + @JsonProperty("payroll_provider_id") + @ExcludeMissing + private val payrollProviderId: JsonField = JsonMissing.of(), + @JsonProperty("manual") + @ExcludeMissing + private val manual: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The Finch UUID of the connection associated with the `access_token`. */ @@ -268,8 +300,6 @@ private constructor( fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) /** The Finch UUID of the connection associated with the `access_token`. */ - @JsonProperty("connection_id") - @ExcludeMissing fun connectionId(connectionId: JsonField) = apply { this.connectionId = connectionId } @@ -277,8 +307,6 @@ private constructor( fun connectionStatus(connectionStatus: ConnectionStatus) = connectionStatus(JsonField.of(connectionStatus)) - @JsonProperty("connection_status") - @ExcludeMissing fun connectionStatus(connectionStatus: JsonField) = apply { this.connectionStatus = connectionStatus } @@ -287,16 +315,12 @@ private constructor( fun clientId(clientId: String) = clientId(JsonField.of(clientId)) /** The client ID of the application associated with the `access_token`. */ - @JsonProperty("client_id") - @ExcludeMissing fun clientId(clientId: JsonField) = apply { this.clientId = clientId } /** The type of application associated with a token. */ fun clientType(clientType: ClientType) = clientType(JsonField.of(clientType)) /** The type of application associated with a token. */ - @JsonProperty("client_type") - @ExcludeMissing fun clientType(clientType: JsonField) = apply { this.clientType = clientType } /** @@ -312,8 +336,6 @@ private constructor( * - `provider` - connection to an external provider * - `finch` - finch-generated data. */ - @JsonProperty("connection_type") - @ExcludeMissing fun connectionType(connectionType: JsonField) = apply { this.connectionType = connectionType } @@ -328,8 +350,6 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this company ID. */ - @JsonProperty("company_id") - @ExcludeMissing fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** @@ -342,8 +362,6 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this account ID. */ - @JsonProperty("account_id") - @ExcludeMissing fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** @@ -356,8 +374,6 @@ private constructor( * The ID of your customer you provided to Finch when a connect session was created for this * connection. */ - @JsonProperty("customer_id") - @ExcludeMissing fun customerId(customerId: JsonField) = apply { this.customerId = customerId } /** @@ -370,8 +386,6 @@ private constructor( * The name of your customer you provided to Finch when a connect session was created for * this connection. */ - @JsonProperty("customer_name") - @ExcludeMissing fun customerName(customerName: JsonField) = apply { this.customerName = customerName } @@ -386,8 +400,6 @@ private constructor( * The email of your customer you provided to Finch when a connect session was created for * this connection. */ - @JsonProperty("customer_email") - @ExcludeMissing fun customerEmail(customerEmail: JsonField) = apply { this.customerEmail = customerEmail } @@ -395,8 +407,6 @@ private constructor( fun authenticationMethods(authenticationMethods: List) = authenticationMethods(JsonField.of(authenticationMethods)) - @JsonProperty("authentication_methods") - @ExcludeMissing fun authenticationMethods(authenticationMethods: JsonField>) = apply { this.authenticationMethods = authenticationMethods @@ -406,24 +416,18 @@ private constructor( fun products(products: List) = products(JsonField.of(products)) /** An array of the authorized products associated with the `access_token`. */ - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } /** The account username used for login associated with the `access_token`. */ fun username(username: String) = username(JsonField.of(username)) /** The account username used for login associated with the `access_token`. */ - @JsonProperty("username") - @ExcludeMissing fun username(username: JsonField) = apply { this.username = username } /** The ID of the provider associated with the `access_token`. */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token`. */ - @JsonProperty("provider_id") - @ExcludeMissing fun providerId(providerId: JsonField) = apply { this.providerId = providerId } /** @@ -437,8 +441,6 @@ private constructor( * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider * ID. */ - @JsonProperty("payroll_provider_id") - @ExcludeMissing fun payrollProviderId(payrollProviderId: JsonField) = apply { this.payrollProviderId = payrollProviderId } @@ -453,8 +455,6 @@ private constructor( * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. * (`true` if using Assisted Connect, `false` if connection is automated) */ - @JsonProperty("manual") - @ExcludeMissing fun manual(manual: JsonField) = apply { this.manual = manual } fun additionalProperties(additionalProperties: Map) = apply { @@ -462,7 +462,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -499,14 +498,19 @@ private constructor( ) } - @JsonDeserialize(builder = AuthenticationMethod.Builder::class) @NoAutoDetect class AuthenticationMethod + @JsonCreator private constructor( - private val type: JsonField, - private val connectionStatus: JsonField, - private val products: JsonField>, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("connection_status") + @ExcludeMissing + private val connectionStatus: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of authentication method. */ @@ -570,15 +574,11 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of authentication method. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun connectionStatus(connectionStatus: ConnectionStatus) = connectionStatus(JsonField.of(connectionStatus)) - @JsonProperty("connection_status") - @ExcludeMissing fun connectionStatus(connectionStatus: JsonField) = apply { this.connectionStatus = connectionStatus } @@ -587,8 +587,6 @@ private constructor( fun products(products: List) = products(JsonField.of(products)) /** An array of the authorized products associated with the `access_token`. */ - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } fun additionalProperties(additionalProperties: Map) = apply { @@ -596,7 +594,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -620,13 +617,18 @@ private constructor( ) } - @JsonDeserialize(builder = ConnectionStatus.Builder::class) @NoAutoDetect class ConnectionStatus + @JsonCreator private constructor( - private val status: JsonField, - private val message: JsonField, - private val additionalProperties: Map, + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonProperty("message") + @ExcludeMissing + private val message: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun status(): Optional = @@ -674,14 +676,10 @@ private constructor( fun status(status: ConnectionStatusType) = status(JsonField.of(status)) - @JsonProperty("status") - @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } fun message(message: String) = message(JsonField.of(message)) - @JsonProperty("message") - @ExcludeMissing fun message(message: JsonField) = apply { this.message = message } fun additionalProperties(additionalProperties: Map) = apply { @@ -689,7 +687,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -889,13 +886,18 @@ private constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = ConnectionStatus.Builder::class) @NoAutoDetect class ConnectionStatus + @JsonCreator private constructor( - private val status: JsonField, - private val message: JsonField, - private val additionalProperties: Map, + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonProperty("message") + @ExcludeMissing + private val message: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun status(): Optional = @@ -943,14 +945,10 @@ private constructor( fun status(status: ConnectionStatusType) = status(JsonField.of(status)) - @JsonProperty("status") - @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } fun message(message: String) = message(JsonField.of(message)) - @JsonProperty("message") - @ExcludeMissing fun message(message: JsonField) = apply { this.message = message } fun additionalProperties(additionalProperties: Map) = apply { @@ -958,7 +956,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index 125a85c0..33c31d45 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt @@ -23,6 +23,7 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.getOrThrow import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -310,12 +311,13 @@ constructor( ) } - @JsonDeserialize(builder = DataSyncAll.Builder::class) @NoAutoDetect class DataSyncAll + @JsonCreator private constructor( - private val type: Type, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of job to start. */ @@ -344,14 +346,13 @@ constructor( } /** The type of job to start. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -442,13 +443,14 @@ constructor( "DataSyncAll{type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = W4FormEmployeeSync.Builder::class) @NoAutoDetect class W4FormEmployeeSync + @JsonCreator private constructor( - private val type: Type, - private val individualId: String, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type, + @JsonProperty("individual_id") private val individualId: String, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of job to start. */ @@ -482,10 +484,9 @@ constructor( } /** The type of job to start. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** The unique ID of the individual for W-4 data sync. */ - @JsonProperty("individual_id") fun individualId(individualId: String) = apply { this.individualId = individualId } fun additionalProperties(additionalProperties: Map) = apply { @@ -493,7 +494,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPage.kt index a83fe3eb..d6048527 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.jobs.AutomatedService import java.util.Objects @@ -82,13 +83,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val data: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + private val data: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -150,15 +153,12 @@ private constructor( fun data(data: List) = data(JsonField.of(data)) - @JsonProperty("data") fun data(data: JsonField>) = apply { this.data = data } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt index aca6d42c..a580d6b8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.jobs.AutomatedServiceAsync import java.util.Objects @@ -85,13 +86,15 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val data: JsonField>, - private val paging: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + private val data: JsonField> = JsonMissing.of(), + @JsonProperty("paging") private val paging: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -153,15 +156,12 @@ private constructor( fun data(data: List) = data(JsonField.of(data)) - @JsonProperty("data") fun data(data: JsonField>) = apply { this.data = data } fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") fun paging(paging: JsonField) = apply { this.paging = paging } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt index 30ce2a27..2f36822a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = JobCompletionEvent.Builder::class) @NoAutoDetect class JobCompletionEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,13 +197,18 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val jobId: JsonField, - private val jobUrl: JsonField, - private val additionalProperties: Map, + @JsonProperty("job_id") + @ExcludeMissing + private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("job_url") + @ExcludeMissing + private val jobUrl: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the job which has completed. */ @@ -259,16 +261,12 @@ private constructor( fun jobId(jobId: String) = jobId(JsonField.of(jobId)) /** The id of the job which has completed. */ - @JsonProperty("job_id") - @ExcludeMissing fun jobId(jobId: JsonField) = apply { this.jobId = jobId } /** The url to query the result of the job. */ fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) /** The url to query the result of the job. */ - @JsonProperty("job_url") - @ExcludeMissing fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } fun additionalProperties(additionalProperties: Map) = apply { @@ -276,7 +274,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt index 60077873..06e6caba 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt @@ -4,25 +4,32 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = JobCreateResponse.Builder::class) @NoAutoDetect class JobCreateResponse +@JsonCreator private constructor( - private val jobId: JsonField, - private val jobUrl: JsonField, - private val allowedRefreshes: JsonField, - private val remainingRefreshes: JsonField, - private val additionalProperties: Map, + @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("job_url") + @ExcludeMissing + private val jobUrl: JsonField = JsonMissing.of(), + @JsonProperty("allowed_refreshes") + @ExcludeMissing + private val allowedRefreshes: JsonField = JsonMissing.of(), + @JsonProperty("remaining_refreshes") + @ExcludeMissing + private val remainingRefreshes: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the job that has been created. */ @@ -95,16 +102,12 @@ private constructor( fun jobId(jobId: String) = jobId(JsonField.of(jobId)) /** The id of the job that has been created. */ - @JsonProperty("job_id") - @ExcludeMissing fun jobId(jobId: JsonField) = apply { this.jobId = jobId } /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) /** The url that can be used to retrieve the job status */ - @JsonProperty("job_url") - @ExcludeMissing fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } /** The number of allowed refreshes per hour (per hour, fixed window) */ @@ -112,8 +115,6 @@ private constructor( allowedRefreshes(JsonField.of(allowedRefreshes)) /** The number of allowed refreshes per hour (per hour, fixed window) */ - @JsonProperty("allowed_refreshes") - @ExcludeMissing fun allowedRefreshes(allowedRefreshes: JsonField) = apply { this.allowedRefreshes = allowedRefreshes } @@ -123,8 +124,6 @@ private constructor( remainingRefreshes(JsonField.of(remainingRefreshes)) /** The number of remaining refreshes available (per hour, fixed window) */ - @JsonProperty("remaining_refreshes") - @ExcludeMissing fun remainingRefreshes(remainingRefreshes: JsonField) = apply { this.remainingRefreshes = remainingRefreshes } @@ -134,7 +133,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt index 03776466..3c6f51a9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt @@ -4,30 +4,37 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Location.Builder::class) @NoAutoDetect class Location +@JsonCreator 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 name: JsonField, - private val sourceId: JsonField, - private val additionalProperties: Map, + @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), + @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("source_id") + @ExcludeMissing + private val sourceId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Street address or PO box. */ @@ -130,60 +137,44 @@ private constructor( fun line1(line1: String) = line1(JsonField.of(line1)) /** Street address or PO box. */ - @JsonProperty("line1") - @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** Apartment, suite, unit, or building. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** Apartment, suite, unit, or building. */ - @JsonProperty("line2") - @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** City, district, suburb, town, or village. */ fun city(city: String) = city(JsonField.of(city)) /** City, district, suburb, town, or village. */ - @JsonProperty("city") - @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The state code. */ fun state(state: String) = state(JsonField.of(state)) /** The state code. */ - @JsonProperty("state") - @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The postal code or zip code. */ fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) /** The postal code or zip code. */ - @JsonProperty("postal_code") - @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } /** The 2-letter ISO 3166 country code. */ fun country(country: String) = country(JsonField.of(country)) /** The 2-letter ISO 3166 country code. */ - @JsonProperty("country") - @ExcludeMissing fun country(country: JsonField) = apply { this.country = country } fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) - @JsonProperty("source_id") - @ExcludeMissing fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } fun additionalProperties(additionalProperties: Map) = apply { @@ -191,7 +182,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt index 505a365c..5799ba8e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt @@ -6,26 +6,30 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = ManualAsyncJob.Builder::class) @NoAutoDetect class ManualAsyncJob +@JsonCreator private constructor( - private val jobId: JsonField, - private val status: JsonField, - private val body: JsonField>, - private val additionalProperties: Map, + @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), + @JsonProperty("body") + @ExcludeMissing + private val body: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun jobId(): String = jobId.getRequired("job_id") @@ -81,22 +85,16 @@ private constructor( fun jobId(jobId: String) = jobId(JsonField.of(jobId)) - @JsonProperty("job_id") - @ExcludeMissing fun jobId(jobId: JsonField) = apply { this.jobId = jobId } fun status(status: Status) = status(JsonField.of(status)) - @JsonProperty("status") - @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } /** Specific information about the job, such as individual statuses for batch jobs. */ fun body(body: List) = body(JsonField.of(body)) /** Specific information about the job, such as individual statuses for batch jobs. */ - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField>) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -104,7 +102,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt index 0de04653..3305db6c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt @@ -4,24 +4,27 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Money.Builder::class) @NoAutoDetect class Money +@JsonCreator private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Amount for money object (in cents) */ @@ -72,14 +75,10 @@ private constructor( fun amount(amount: Long) = amount(JsonField.of(amount)) /** Amount for money object (in cents) */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: String) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } fun additionalProperties(additionalProperties: Map) = apply { @@ -87,7 +86,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt index ecf878b2..527f4708 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt @@ -4,26 +4,35 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = OperationSupportMatrix.Builder::class) @NoAutoDetect class OperationSupportMatrix +@JsonCreator private constructor( - private val create: JsonField, - private val update: JsonField, - private val delete: JsonField, - private val read: JsonField, - private val additionalProperties: Map, + @JsonProperty("create") + @ExcludeMissing + private val create: JsonField = JsonMissing.of(), + @JsonProperty("update") + @ExcludeMissing + private val update: JsonField = JsonMissing.of(), + @JsonProperty("delete") + @ExcludeMissing + private val delete: JsonField = JsonMissing.of(), + @JsonProperty("read") + @ExcludeMissing + private val read: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -174,8 +183,6 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - @JsonProperty("create") - @ExcludeMissing fun create(create: JsonField) = apply { this.create = create } /** @@ -198,8 +205,6 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - @JsonProperty("update") - @ExcludeMissing fun update(update: JsonField) = apply { this.update = update } /** @@ -222,8 +227,6 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - @JsonProperty("delete") - @ExcludeMissing fun delete(delete: JsonField) = apply { this.delete = delete } /** @@ -246,8 +249,6 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - @JsonProperty("read") - @ExcludeMissing fun read(read: JsonField) = apply { this.read = read } fun additionalProperties(additionalProperties: Map) = apply { @@ -255,7 +256,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt index bd3dc813..fe1f77e2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Paging.kt @@ -4,24 +4,25 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Paging.Builder::class) @NoAutoDetect class Paging +@JsonCreator private constructor( - private val count: JsonField, - private val offset: JsonField, - private val additionalProperties: Map, + @JsonProperty("count") @ExcludeMissing private val count: JsonField = JsonMissing.of(), + @JsonProperty("offset") @ExcludeMissing private val offset: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The total number of elements for the entire query (not just the given page) */ @@ -74,16 +75,12 @@ private constructor( fun count(count: Long) = count(JsonField.of(count)) /** The total number of elements for the entire query (not just the given page) */ - @JsonProperty("count") - @ExcludeMissing fun count(count: JsonField) = apply { this.count = count } /** The current start index of the returned list of elements */ fun offset(offset: Long) = offset(JsonField.of(offset)) /** The current start index of the returned list of elements */ - @JsonProperty("offset") - @ExcludeMissing fun offset(offset: JsonField) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = apply { @@ -91,7 +88,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt index 53bddd69..8539c47f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupListResponse.kt @@ -6,26 +6,28 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PayGroupListResponse.Builder::class) @NoAutoDetect class PayGroupListResponse +@JsonCreator private constructor( - private val id: JsonField, - private val name: JsonField, - private val payFrequencies: JsonField>, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Finch id (uuidv4) for the pay group */ @@ -88,14 +90,12 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** Finch id (uuidv4) for the pay group */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** Name of the pay group */ fun name(name: String) = name(JsonField.of(name)) /** Name of the pay group */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** List of pay frequencies associated with this pay group */ @@ -103,8 +103,6 @@ private constructor( payFrequencies(JsonField.of(payFrequencies)) /** List of pay frequencies associated with this pay group */ - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField>) = apply { this.payFrequencies = payFrequencies } @@ -114,7 +112,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt index a501f108..390bd017 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt @@ -6,26 +6,30 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects -@JsonDeserialize(builder = PayGroupRetrieveResponse.Builder::class) @NoAutoDetect class PayGroupRetrieveResponse +@JsonCreator private constructor( - private val id: JsonField, - private val name: JsonField, - private val payFrequencies: JsonField>, - private val individualIds: JsonField>, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField> = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Finch id (uuidv4) for the pay group */ @@ -94,14 +98,12 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** Finch id (uuidv4) for the pay group */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** Name of the pay group */ fun name(name: String) = name(JsonField.of(name)) /** Name of the pay group */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** List of pay frequencies associated with this pay group */ @@ -109,16 +111,12 @@ private constructor( payFrequencies(JsonField.of(payFrequencies)) /** List of pay frequencies associated with this pay group */ - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField>) = apply { this.payFrequencies = payFrequencies } fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField>) = apply { this.individualIds = individualIds } @@ -128,7 +126,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt index 9f475c1c..76a86f01 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt @@ -6,33 +6,51 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PayStatement.Builder::class) @NoAutoDetect class PayStatement +@JsonCreator private constructor( - private val individualId: JsonField, - private val type: JsonField, - private val paymentMethod: JsonField, - private val totalHours: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val earnings: JsonField>, - private val taxes: JsonField>, - private val employeeDeductions: JsonField>, - private val employerContributions: JsonField>, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("payment_method") + @ExcludeMissing + private val paymentMethod: JsonField = JsonMissing.of(), + @JsonProperty("total_hours") + @ExcludeMissing + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("earnings") + @ExcludeMissing + private val earnings: JsonField> = JsonMissing.of(), + @JsonProperty("taxes") + @ExcludeMissing + private val taxes: JsonField> = JsonMissing.of(), + @JsonProperty("employee_deductions") + @ExcludeMissing + private val employeeDeductions: JsonField> = JsonMissing.of(), + @JsonProperty("employer_contributions") + @ExcludeMissing + private val employerContributions: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company */ @@ -159,8 +177,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) /** A stable Finch `id` (UUID v4) for an individual in the company */ - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -169,16 +185,12 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of the payment associated with the pay statement. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** The payment method. */ fun paymentMethod(paymentMethod: PaymentMethod) = paymentMethod(JsonField.of(paymentMethod)) /** The payment method. */ - @JsonProperty("payment_method") - @ExcludeMissing fun paymentMethod(paymentMethod: JsonField) = apply { this.paymentMethod = paymentMethod } @@ -187,36 +199,26 @@ private constructor( fun totalHours(totalHours: Double) = totalHours(JsonField.of(totalHours)) /** The number of hours worked for this pay period */ - @JsonProperty("total_hours") - @ExcludeMissing fun totalHours(totalHours: JsonField) = apply { this.totalHours = totalHours } fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } /** The array of earnings objects associated with this pay statement */ fun earnings(earnings: List) = earnings(JsonField.of(earnings)) /** The array of earnings objects associated with this pay statement */ - @JsonProperty("earnings") - @ExcludeMissing fun earnings(earnings: JsonField>) = apply { this.earnings = earnings } /** The array of taxes objects associated with this pay statement. */ fun taxes(taxes: List) = taxes(JsonField.of(taxes)) /** The array of taxes objects associated with this pay statement. */ - @JsonProperty("taxes") - @ExcludeMissing fun taxes(taxes: JsonField>) = apply { this.taxes = taxes } /** The array of deductions objects associated with this pay statement. */ @@ -224,8 +226,6 @@ private constructor( employeeDeductions(JsonField.of(employeeDeductions)) /** The array of deductions objects associated with this pay statement. */ - @JsonProperty("employee_deductions") - @ExcludeMissing fun employeeDeductions(employeeDeductions: JsonField>) = apply { this.employeeDeductions = employeeDeductions } @@ -233,8 +233,6 @@ private constructor( fun employerContributions(employerContributions: List) = employerContributions(JsonField.of(employerContributions)) - @JsonProperty("employer_contributions") - @ExcludeMissing fun employerContributions(employerContributions: JsonField>) = apply { this.employerContributions = employerContributions @@ -245,7 +243,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -276,16 +273,25 @@ private constructor( ) } - @JsonDeserialize(builder = Earning.Builder::class) @NoAutoDetect class Earning + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val hours: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("hours") + @ExcludeMissing + private val hours: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of earning. */ @@ -371,32 +377,24 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of earning. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** The exact name of the deduction from the pay statement. */ fun name(name: String) = name(JsonField.of(name)) /** The exact name of the deduction from the pay statement. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The earnings amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** The earnings amount in cents. */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } /** The earnings currency code. */ fun currency(currency: String) = currency(JsonField.of(currency)) /** The earnings currency code. */ - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } /** @@ -409,8 +407,6 @@ private constructor( * The number of hours associated with this earning. (For salaried employees, this could * be hours per pay period, `0` or `null`, depending on the provider). */ - @JsonProperty("hours") - @ExcludeMissing fun hours(hours: JsonField) = apply { this.hours = hours } fun additionalProperties(additionalProperties: Map) = apply { @@ -418,7 +414,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -585,16 +580,27 @@ private constructor( "Earning{type=$type, name=$name, amount=$amount, currency=$currency, hours=$hours, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployeeDeduction.Builder::class) @NoAutoDetect class EmployeeDeduction + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val preTax: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("pre_tax") + @ExcludeMissing + private val preTax: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The deduction name from the pay statement. */ @@ -674,40 +680,30 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The deduction name from the pay statement. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The deduction amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** The deduction amount in cents. */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } /** The deduction currency. */ fun currency(currency: String) = currency(JsonField.of(currency)) /** The deduction currency. */ - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } /** Boolean indicating if the deduction is pre-tax. */ fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) /** Boolean indicating if the deduction is pre-tax. */ - @JsonProperty("pre_tax") - @ExcludeMissing fun preTax(preTax: JsonField) = apply { this.preTax = preTax } /** Type of benefit. */ fun type(type: BenefitType) = type(JsonField.of(type)) /** Type of benefit. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -715,7 +711,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -759,15 +754,24 @@ private constructor( "EmployeeDeduction{name=$name, amount=$amount, currency=$currency, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployerContribution.Builder::class) @NoAutoDetect class EmployerContribution + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The contribution name from the pay statement. */ @@ -838,32 +842,24 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** The contribution name from the pay statement. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The contribution amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** The contribution amount in cents. */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } /** The contribution currency. */ fun currency(currency: String) = currency(JsonField.of(currency)) /** The contribution currency. */ - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } /** Type of benefit. */ fun type(type: BenefitType) = type(JsonField.of(type)) /** Type of benefit. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -871,7 +867,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -971,16 +966,25 @@ private constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = Tax.Builder::class) @NoAutoDetect class Tax + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val employer: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("employer") + @ExcludeMissing + private val employer: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of taxes. */ @@ -1060,40 +1064,30 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of taxes. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** The exact name of tax from the pay statement. */ fun name(name: String) = name(JsonField.of(name)) /** The exact name of tax from the pay statement. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** `true` if the amount is paid by the employers. */ fun employer(employer: Boolean) = employer(JsonField.of(employer)) /** `true` if the amount is paid by the employers. */ - @JsonProperty("employer") - @ExcludeMissing fun employer(employer: JsonField) = apply { this.employer = employer } /** The tax amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** The tax amount in cents. */ - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } /** The currency code. */ fun currency(currency: String) = currency(JsonField.of(currency)) /** The currency code. */ - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } fun additionalProperties(additionalProperties: Map) = apply { @@ -1101,7 +1095,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt index 2017f627..2729b01a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt @@ -6,28 +6,36 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PayStatementEvent.Builder::class) @NoAutoDetect class PayStatementEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +131,6 @@ private constructor( 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 } @@ -139,8 +145,6 @@ private constructor( * [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 } /** @@ -153,20 +157,14 @@ private constructor( * [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 { @@ -174,7 +172,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,13 +197,18 @@ private constructor( ) } - @JsonDeserialize(builder = Data.Builder::class) @NoAutoDetect class Data + @JsonCreator private constructor( - private val paymentId: JsonField, - private val individualId: JsonField, - private val additionalProperties: Map, + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the payment associated with the pay statement. */ @@ -260,16 +262,12 @@ private constructor( fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) /** The ID of the payment associated with the pay statement. */ - @JsonProperty("payment_id") - @ExcludeMissing fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } /** The ID of the individual associated with the pay statement. */ fun individualId(individualId: String) = individualId(JsonField.of(individualId)) /** The ID of the individual associated with the pay statement. */ - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -279,7 +277,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt index b30ed22c..733debfa 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt @@ -4,25 +4,30 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PayStatementResponse.Builder::class) @NoAutoDetect class PayStatementResponse +@JsonCreator private constructor( - private val paymentId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") + @ExcludeMissing + private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) @@ -76,20 +81,14 @@ private constructor( fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) - @JsonProperty("payment_id") - @ExcludeMissing fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } fun code(code: Long) = code(JsonField.of(code)) - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: PayStatementResponseBody) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -97,7 +96,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt index aace50d9..52acf10f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponseBody.kt @@ -4,24 +4,29 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PayStatementResponseBody.Builder::class) @NoAutoDetect class PayStatementResponseBody +@JsonCreator private constructor( - private val paging: JsonField, - private val payStatements: JsonField>, - private val additionalProperties: Map, + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), + @JsonProperty("pay_statements") + @ExcludeMissing + private val payStatements: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @@ -71,8 +76,6 @@ private constructor( fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") - @ExcludeMissing fun paging(paging: JsonField) = apply { this.paging = paging } /** The array of pay statements for the current payment. */ @@ -80,8 +83,6 @@ private constructor( payStatements(JsonField.of(payStatements)) /** The array of pay statements for the current payment. */ - @JsonProperty("pay_statements") - @ExcludeMissing fun payStatements(payStatements: JsonField>) = apply { this.payStatements = payStatements } @@ -91,7 +92,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt index dc4f6b31..7dca54c0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt @@ -6,35 +6,57 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Payment.Builder::class) @NoAutoDetect class Payment +@JsonCreator private constructor( - private val id: JsonField, - private val payPeriod: JsonField, - private val payDate: JsonField, - private val debitDate: JsonField, - private val companyDebit: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val employerTaxes: JsonField, - private val employeeTaxes: JsonField, - private val individualIds: JsonField>, - private val payGroupIds: JsonField>, - private val payFrequencies: JsonField>, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("pay_period") + @ExcludeMissing + private val payPeriod: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") + @ExcludeMissing + private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("debit_date") + @ExcludeMissing + private val debitDate: JsonField = JsonMissing.of(), + @JsonProperty("company_debit") + @ExcludeMissing + private val companyDebit: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("employer_taxes") + @ExcludeMissing + private val employerTaxes: JsonField = JsonMissing.of(), + @JsonProperty("employee_taxes") + @ExcludeMissing + private val employeeTaxes: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField> = JsonMissing.of(), + @JsonProperty("pay_group_ids") + @ExcludeMissing + private val payGroupIds: JsonField> = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The unique id for the payment. */ @@ -169,60 +191,44 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** The unique id for the payment. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The pay period object. */ fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) /** The pay period object. */ - @JsonProperty("pay_period") - @ExcludeMissing fun payPeriod(payPeriod: JsonField) = apply { this.payPeriod = payPeriod } fun payDate(payDate: String) = payDate(JsonField.of(payDate)) - @JsonProperty("pay_date") - @ExcludeMissing fun payDate(payDate: JsonField) = apply { this.payDate = payDate } fun debitDate(debitDate: String) = debitDate(JsonField.of(debitDate)) - @JsonProperty("debit_date") - @ExcludeMissing fun debitDate(debitDate: JsonField) = apply { this.debitDate = debitDate } fun companyDebit(companyDebit: Money) = companyDebit(JsonField.of(companyDebit)) - @JsonProperty("company_debit") - @ExcludeMissing fun companyDebit(companyDebit: JsonField) = apply { this.companyDebit = companyDebit } fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } fun employerTaxes(employerTaxes: Money) = employerTaxes(JsonField.of(employerTaxes)) - @JsonProperty("employer_taxes") - @ExcludeMissing fun employerTaxes(employerTaxes: JsonField) = apply { this.employerTaxes = employerTaxes } fun employeeTaxes(employeeTaxes: Money) = employeeTaxes(JsonField.of(employeeTaxes)) - @JsonProperty("employee_taxes") - @ExcludeMissing fun employeeTaxes(employeeTaxes: JsonField) = apply { this.employeeTaxes = employeeTaxes } @@ -231,8 +237,6 @@ private constructor( fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) /** Array of every individual on this payment. */ - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField>) = apply { this.individualIds = individualIds } @@ -241,8 +245,6 @@ private constructor( fun payGroupIds(payGroupIds: List) = payGroupIds(JsonField.of(payGroupIds)) /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ - @JsonProperty("pay_group_ids") - @ExcludeMissing fun payGroupIds(payGroupIds: JsonField>) = apply { this.payGroupIds = payGroupIds } @@ -252,8 +254,6 @@ private constructor( payFrequencies(JsonField.of(payFrequencies)) /** List of pay frequencies associated with this payment. */ - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField>) = apply { this.payFrequencies = payFrequencies } @@ -263,7 +263,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -396,13 +395,18 @@ private constructor( } /** The pay period object. */ - @JsonDeserialize(builder = PayPeriod.Builder::class) @NoAutoDetect class PayPeriod + @JsonCreator private constructor( - private val startDate: JsonField, - private val endDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) @@ -449,14 +453,10 @@ private constructor( fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun additionalProperties(additionalProperties: Map) = apply { @@ -464,7 +464,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt index 8cee7c1d..b1be775c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt @@ -4,23 +4,28 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = PaymentCreateResponse.Builder::class) @NoAutoDetect class PaymentCreateResponse +@JsonCreator private constructor( - private val paymentId: JsonField, - private val payDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") + @ExcludeMissing + private val payDate: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the payment. */ @@ -73,16 +78,12 @@ private constructor( fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) /** The ID of the payment. */ - @JsonProperty("payment_id") - @ExcludeMissing fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } /** The date of the payment. */ fun payDate(payDate: String) = payDate(JsonField.of(payDate)) /** The date of the payment. */ - @JsonProperty("pay_date") - @ExcludeMissing fun payDate(payDate: JsonField) = apply { this.payDate = payDate } fun additionalProperties(additionalProperties: Map) = apply { @@ -90,7 +91,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt index d7b7825f..efa267c6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt @@ -6,28 +6,38 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = PaymentEvent.Builder::class) @NoAutoDetect class PaymentEvent +@JsonCreator 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, + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("account_id") + @ExcludeMissing + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Unique Finch ID of the connection associated with the webhook event. */ @@ -123,8 +133,6 @@ private constructor( 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 } @@ -139,8 +147,6 @@ private constructor( * [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 } /** @@ -153,20 +159,14 @@ private constructor( * [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: PaymentIdentifiers) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun additionalProperties(additionalProperties: Map) = apply { @@ -174,7 +174,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -200,13 +199,18 @@ private constructor( ) } - @JsonDeserialize(builder = PaymentIdentifiers.Builder::class) @NoAutoDetect class PaymentIdentifiers + @JsonCreator private constructor( - private val paymentId: JsonField, - private val payDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") + @ExcludeMissing + private val payDate: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The ID of the payment. */ @@ -259,16 +263,12 @@ private constructor( fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) /** The ID of the payment. */ - @JsonProperty("payment_id") - @ExcludeMissing fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } /** The date of the payment. */ fun payDate(payDate: String) = payDate(JsonField.of(payDate)) /** The date of the payment. */ - @JsonProperty("pay_date") - @ExcludeMissing fun payDate(payDate: JsonField) = apply { this.payDate = payDate } fun additionalProperties(additionalProperties: Map) = apply { @@ -276,7 +276,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt index fbc6589d..5d6d47b4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.payroll.PayGroupService import java.util.Objects @@ -71,12 +72,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -130,10 +133,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPageAsync.kt index 915dd966..a59f56bf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.payroll.PayGroupServiceAsync import java.util.Objects @@ -74,12 +75,14 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") + private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +136,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt index cfd981f0..0dae0587 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt @@ -6,33 +6,45 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = Provider.Builder::class) @NoAutoDetect class Provider +@JsonCreator private constructor( - private val id: JsonField, - private val displayName: JsonField, - private val products: JsonField>, - private val icon: JsonField, - private val logo: JsonField, - private val mfaRequired: JsonField, - private val primaryColor: JsonField, - private val manual: JsonField, - private val beta: JsonField, - private val authenticationMethods: JsonField>, - private val additionalProperties: Map, + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("display_name") + @ExcludeMissing + private val displayName: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), + @JsonProperty("icon") @ExcludeMissing private val icon: JsonField = JsonMissing.of(), + @JsonProperty("logo") @ExcludeMissing private val logo: JsonField = JsonMissing.of(), + @JsonProperty("mfa_required") + @ExcludeMissing + private val mfaRequired: JsonField = JsonMissing.of(), + @JsonProperty("primary_color") + @ExcludeMissing + private val primaryColor: JsonField = JsonMissing.of(), + @JsonProperty("manual") + @ExcludeMissing + private val manual: JsonField = JsonMissing.of(), + @JsonProperty("beta") @ExcludeMissing private val beta: JsonField = JsonMissing.of(), + @JsonProperty("authentication_methods") + @ExcludeMissing + private val authenticationMethods: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the payroll provider used in Connect. */ @@ -171,54 +183,42 @@ private constructor( fun id(id: String) = id(JsonField.of(id)) /** The id of the payroll provider used in Connect. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + fun id(id: JsonField) = apply { this.id = id } /** The display name of the payroll provider. */ fun displayName(displayName: String) = displayName(JsonField.of(displayName)) /** The display name of the payroll provider. */ - @JsonProperty("display_name") - @ExcludeMissing fun displayName(displayName: JsonField) = apply { this.displayName = displayName } /** The list of Finch products supported on this payroll provider. */ fun products(products: List) = products(JsonField.of(products)) /** The list of Finch products supported on this payroll provider. */ - @JsonProperty("products") - @ExcludeMissing fun products(products: JsonField>) = apply { this.products = products } /** The url to the official icon of the payroll provider. */ fun icon(icon: String) = icon(JsonField.of(icon)) /** The url to the official icon of the payroll provider. */ - @JsonProperty("icon") - @ExcludeMissing fun icon(icon: JsonField) = apply { this.icon = icon } /** The url to the official logo of the payroll provider. */ fun logo(logo: String) = logo(JsonField.of(logo)) /** The url to the official logo of the payroll provider. */ - @JsonProperty("logo") - @ExcludeMissing fun logo(logo: JsonField) = apply { this.logo = logo } /** whether MFA is required for the provider. */ fun mfaRequired(mfaRequired: Boolean) = mfaRequired(JsonField.of(mfaRequired)) /** whether MFA is required for the provider. */ - @JsonProperty("mfa_required") - @ExcludeMissing fun mfaRequired(mfaRequired: JsonField) = apply { this.mfaRequired = mfaRequired } /** The hex code for the primary color of the payroll provider. */ fun primaryColor(primaryColor: String) = primaryColor(JsonField.of(primaryColor)) /** The hex code for the primary color of the payroll provider. */ - @JsonProperty("primary_color") - @ExcludeMissing fun primaryColor(primaryColor: JsonField) = apply { this.primaryColor = primaryColor } @@ -235,16 +235,12 @@ private constructor( * Flow by default. This field is now deprecated. Please check for a `type` of `assisted` in * the `authentication_methods` field instead. */ - @JsonProperty("manual") - @ExcludeMissing fun manual(manual: JsonField) = apply { this.manual = manual } /** `true` if the integration is in a beta state, `false` otherwise */ fun beta(beta: Boolean) = beta(JsonField.of(beta)) /** `true` if the integration is in a beta state, `false` otherwise */ - @JsonProperty("beta") - @ExcludeMissing fun beta(beta: JsonField) = apply { this.beta = beta } /** The list of authentication methods supported by the provider. */ @@ -252,8 +248,6 @@ private constructor( authenticationMethods(JsonField.of(authenticationMethods)) /** The list of authentication methods supported by the provider. */ - @JsonProperty("authentication_methods") - @ExcludeMissing fun authenticationMethods(authenticationMethods: JsonField>) = apply { this.authenticationMethods = authenticationMethods @@ -264,7 +258,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -295,14 +288,19 @@ private constructor( ) } - @JsonDeserialize(builder = AuthenticationMethod.Builder::class) @NoAutoDetect class AuthenticationMethod + @JsonCreator private constructor( - private val type: JsonField, - private val benefitsSupport: JsonField, - private val supportedFields: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("benefits_support") + @ExcludeMissing + private val benefitsSupport: JsonField = JsonMissing.of(), + @JsonProperty("supported_fields") + @ExcludeMissing + private val supportedFields: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of authentication method. */ @@ -372,8 +370,6 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) /** The type of authentication method. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } /** @@ -387,8 +383,6 @@ private constructor( * 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 } @@ -398,8 +392,6 @@ private constructor( 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 } @@ -409,7 +401,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -434,18 +425,33 @@ private constructor( } /** The supported data fields returned by our HR and payroll endpoints */ - @JsonDeserialize(builder = SupportedFields.Builder::class) @NoAutoDetect class SupportedFields + @JsonCreator 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 payGroup: JsonField, - private val additionalProperties: Map, + @JsonProperty("company") + @ExcludeMissing + private val company: JsonField = JsonMissing.of(), + @JsonProperty("directory") + @ExcludeMissing + private val directory: JsonField = JsonMissing.of(), + @JsonProperty("individual") + @ExcludeMissing + private val individual: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("payment") + @ExcludeMissing + private val payment: JsonField = JsonMissing.of(), + @JsonProperty("pay_statement") + @ExcludeMissing + private val payStatement: JsonField = JsonMissing.of(), + @JsonProperty("pay_group") + @ExcludeMissing + private val payGroup: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun company(): Optional = @@ -534,8 +540,6 @@ private constructor( fun company(company: SupportedCompanyFields) = company(JsonField.of(company)) - @JsonProperty("company") - @ExcludeMissing fun company(company: JsonField) = apply { this.company = company } @@ -543,8 +547,6 @@ private constructor( fun directory(directory: SupportedDirectoryFields) = directory(JsonField.of(directory)) - @JsonProperty("directory") - @ExcludeMissing fun directory(directory: JsonField) = apply { this.directory = directory } @@ -552,8 +554,6 @@ private constructor( fun individual(individual: SupportedIndividualFields) = individual(JsonField.of(individual)) - @JsonProperty("individual") - @ExcludeMissing fun individual(individual: JsonField) = apply { this.individual = individual } @@ -561,16 +561,12 @@ private constructor( 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 } @@ -578,16 +574,12 @@ private constructor( fun payStatement(payStatement: SupportedPayStatementFields) = payStatement(JsonField.of(payStatement)) - @JsonProperty("pay_statement") - @ExcludeMissing fun payStatement(payStatement: JsonField) = apply { this.payStatement = payStatement } fun payGroup(payGroup: SupportedPayGroupFields) = payGroup(JsonField.of(payGroup)) - @JsonProperty("pay_group") - @ExcludeMissing fun payGroup(payGroup: JsonField) = apply { this.payGroup = payGroup } @@ -597,7 +589,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -628,20 +619,39 @@ private constructor( ) } - @JsonDeserialize(builder = SupportedCompanyFields.Builder::class) @NoAutoDetect class SupportedCompanyFields + @JsonCreator 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, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("entity") + @ExcludeMissing + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("ein") + @ExcludeMissing + private val ein: JsonField = JsonMissing.of(), + @JsonProperty("accounts") + @ExcludeMissing + private val accounts: JsonField = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -746,29 +756,21 @@ private constructor( 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 } @@ -776,37 +778,27 @@ private constructor( 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 } @@ -816,7 +808,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -849,16 +840,27 @@ private constructor( ) } - @JsonDeserialize(builder = Accounts.Builder::class) @NoAutoDetect class Accounts + @JsonCreator 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, + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("account_name") + @ExcludeMissing + private val accountName: JsonField = JsonMissing.of(), + @JsonProperty("institution_name") + @ExcludeMissing + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("account_type") + @ExcludeMissing + private val accountType: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + private val accountNumber: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun routingNumber(): Optional = @@ -939,8 +941,6 @@ private constructor( fun routingNumber(routingNumber: Boolean) = routingNumber(JsonField.of(routingNumber)) - @JsonProperty("routing_number") - @ExcludeMissing fun routingNumber(routingNumber: JsonField) = apply { this.routingNumber = routingNumber } @@ -948,8 +948,6 @@ private constructor( fun accountName(accountName: Boolean) = accountName(JsonField.of(accountName)) - @JsonProperty("account_name") - @ExcludeMissing fun accountName(accountName: JsonField) = apply { this.accountName = accountName } @@ -957,8 +955,6 @@ private constructor( fun institutionName(institutionName: Boolean) = institutionName(JsonField.of(institutionName)) - @JsonProperty("institution_name") - @ExcludeMissing fun institutionName(institutionName: JsonField) = apply { this.institutionName = institutionName } @@ -966,8 +962,6 @@ private constructor( fun accountType(accountType: Boolean) = accountType(JsonField.of(accountType)) - @JsonProperty("account_type") - @ExcludeMissing fun accountType(accountType: JsonField) = apply { this.accountType = accountType } @@ -975,8 +969,6 @@ private constructor( fun accountNumber(accountNumber: Boolean) = accountNumber(JsonField.of(accountNumber)) - @JsonProperty("account_number") - @ExcludeMissing fun accountNumber(accountNumber: JsonField) = apply { this.accountNumber = accountNumber } @@ -987,7 +979,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1033,13 +1024,18 @@ private constructor( "Accounts{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Departments.Builder::class) @NoAutoDetect class Departments + @JsonCreator private constructor( - private val name: JsonField, - private val parent: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("parent") + @ExcludeMissing + private val parent: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1088,14 +1084,10 @@ private constructor( 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) = @@ -1104,7 +1096,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1129,12 +1120,16 @@ private constructor( ) } - @JsonDeserialize(builder = Parent.Builder::class) @NoAutoDetect class Parent + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -1176,8 +1171,6 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = @@ -1186,7 +1179,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1242,13 +1234,18 @@ private constructor( "Departments{name=$name, parent=$parent, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Entity.Builder::class) @NoAutoDetect class Entity + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -1297,14 +1294,10 @@ private constructor( 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) = @@ -1313,7 +1306,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1356,17 +1348,30 @@ private constructor( "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Locations.Builder::class) @NoAutoDetect class Locations + @JsonCreator 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, + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) @@ -1444,40 +1449,28 @@ private constructor( 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) = @@ -1486,7 +1479,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1551,13 +1543,18 @@ private constructor( "SupportedCompanyFields{id=$id, legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, ein=$ein, accounts=$accounts, departments=$departments, locations=$locations, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedDirectoryFields.Builder::class) @NoAutoDetect class SupportedDirectoryFields + @JsonCreator private constructor( - private val paging: JsonField, - private val individuals: JsonField, - private val additionalProperties: Map, + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), + @JsonProperty("individuals") + @ExcludeMissing + private val individuals: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @@ -1606,15 +1603,11 @@ private constructor( 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 } @@ -1624,7 +1617,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1650,18 +1642,33 @@ private constructor( ) } - @JsonDeserialize(builder = Individuals.Builder::class) @NoAutoDetect class Individuals + @JsonCreator 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, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1750,54 +1757,40 @@ private constructor( 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) = apply { this.isActive = isActive } fun department(department: Boolean) = department(JsonField.of(department)) - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } fun manager(manager: Manager) = manager(JsonField.of(manager)) - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } fun additionalProperties(additionalProperties: Map) = @@ -1806,7 +1799,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1836,12 +1828,16 @@ private constructor( ) } - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -1882,8 +1878,6 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = @@ -1892,7 +1886,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1948,13 +1941,18 @@ private constructor( "Individuals{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, isActive=$isActive, department=$department, manager=$manager, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Paging.Builder::class) @NoAutoDetect class Paging + @JsonCreator private constructor( - private val count: JsonField, - private val offset: JsonField, - private val additionalProperties: Map, + @JsonProperty("count") + @ExcludeMissing + private val count: JsonField = JsonMissing.of(), + @JsonProperty("offset") + @ExcludeMissing + private val offset: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun count(): Optional = Optional.ofNullable(count.getNullable("count")) @@ -2003,14 +2001,10 @@ private constructor( fun count(count: Boolean) = count(JsonField.of(count)) - @JsonProperty("count") - @ExcludeMissing fun count(count: JsonField) = apply { this.count = count } fun offset(offset: Boolean) = offset(JsonField.of(offset)) - @JsonProperty("offset") - @ExcludeMissing fun offset(offset: JsonField) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = @@ -2019,7 +2013,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2080,28 +2073,63 @@ private constructor( "SupportedDirectoryFields{paging=$paging, individuals=$individuals, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedEmploymentFields.Builder::class) @NoAutoDetect class SupportedEmploymentFields + @JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val title: JsonField, - private val startDate: JsonField, - private val endDate: JsonField, - private val isActive: JsonField, - private val employmentStatus: JsonField, - private val incomeHistory: JsonField, - private val classCode: JsonField, - private val customFields: JsonField, - private val department: JsonField, - private val employment: JsonField, - private val income: JsonField, - private val location: JsonField, - private val manager: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("title") + @ExcludeMissing + private val title: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") + @ExcludeMissing + private val employmentStatus: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField = JsonMissing.of(), + @JsonProperty("class_code") + @ExcludeMissing + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("custom_fields") + @ExcludeMissing + private val customFields: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), + @JsonProperty("employment") + @ExcludeMissing + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("location") + @ExcludeMissing + private val location: JsonField = JsonMissing.of(), + @JsonProperty("manager") + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -2271,63 +2299,45 @@ private constructor( 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 title(title: Boolean) = title(JsonField.of(title)) - @JsonProperty("title") - @ExcludeMissing fun title(title: JsonField) = apply { this.title = title } fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - @JsonProperty("is_active") - @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } fun employmentStatus(employmentStatus: Boolean) = employmentStatus(JsonField.of(employmentStatus)) - @JsonProperty("employment_status") - @ExcludeMissing fun employmentStatus(employmentStatus: JsonField) = apply { this.employmentStatus = employmentStatus } @@ -2335,16 +2345,12 @@ private constructor( fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) - @JsonProperty("income_history") - @ExcludeMissing fun incomeHistory(incomeHistory: JsonField) = apply { this.incomeHistory = incomeHistory } fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) - @JsonProperty("class_code") - @ExcludeMissing fun classCode(classCode: JsonField) = apply { this.classCode = classCode } @@ -2352,44 +2358,32 @@ private constructor( fun customFields(customFields: Boolean) = customFields(JsonField.of(customFields)) - @JsonProperty("custom_fields") - @ExcludeMissing fun customFields(customFields: JsonField) = apply { this.customFields = customFields } fun department(department: Department) = department(JsonField.of(department)) - @JsonProperty("department") - @ExcludeMissing fun department(department: JsonField) = apply { this.department = department } fun employment(employment: Employment) = employment(JsonField.of(employment)) - @JsonProperty("employment") - @ExcludeMissing fun employment(employment: JsonField) = apply { this.employment = employment } fun income(income: Income) = income(JsonField.of(income)) - @JsonProperty("income") - @ExcludeMissing fun income(income: JsonField) = apply { this.income = income } fun location(location: Location) = location(JsonField.of(location)) - @JsonProperty("location") - @ExcludeMissing fun location(location: JsonField) = apply { this.location = location } fun manager(manager: Manager) = manager(JsonField.of(manager)) - @JsonProperty("manager") - @ExcludeMissing fun manager(manager: JsonField) = apply { this.manager = manager } fun additionalProperties(additionalProperties: Map) = apply { @@ -2397,7 +2391,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2438,12 +2431,15 @@ private constructor( ) } - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -2484,8 +2480,6 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = @@ -2494,7 +2488,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2533,13 +2526,18 @@ private constructor( "Department{name=$name, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: JsonField, - private val subtype: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @@ -2588,14 +2586,10 @@ private constructor( 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) = @@ -2604,7 +2598,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2647,14 +2640,21 @@ private constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Income.Builder::class) @NoAutoDetect class Income + @JsonCreator private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val unit: JsonField, - private val additionalProperties: Map, + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("unit") + @ExcludeMissing + private val unit: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun amount(): Optional = @@ -2711,22 +2711,16 @@ private constructor( fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } fun unit(unit: Boolean) = unit(JsonField.of(unit)) - @JsonProperty("unit") - @ExcludeMissing fun unit(unit: JsonField) = apply { this.unit = unit } fun additionalProperties(additionalProperties: Map) = @@ -2735,7 +2729,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2779,17 +2772,30 @@ private constructor( "Income{amount=$amount, currency=$currency, unit=$unit, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Location.Builder::class) @NoAutoDetect class Location + @JsonCreator 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, + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) @@ -2867,40 +2873,28 @@ private constructor( 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) = @@ -2909,7 +2903,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -2956,12 +2949,15 @@ private constructor( "Location{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3002,8 +2998,6 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = @@ -3012,7 +3006,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3068,24 +3061,51 @@ private constructor( "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedIndividualFields.Builder::class) @NoAutoDetect class SupportedIndividualFields + @JsonCreator private constructor( - private val id: JsonField, - private val firstName: JsonField, - private val middleName: JsonField, - private val lastName: JsonField, - private val preferredName: JsonField, - private val dob: JsonField, - private val gender: JsonField, - private val ethnicity: JsonField, - private val ssn: JsonField, - private val encryptedSsn: JsonField, - private val emails: JsonField, - private val phoneNumbers: JsonField, - private val residence: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), + @JsonProperty("dob") + @ExcludeMissing + private val dob: JsonField = JsonMissing.of(), + @JsonProperty("gender") + @ExcludeMissing + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), + @JsonProperty("ssn") + @ExcludeMissing + private val ssn: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField = JsonMissing.of(), + @JsonProperty("phone_numbers") + @ExcludeMissing + private val phoneNumbers: JsonField = JsonMissing.of(), + @JsonProperty("residence") + @ExcludeMissing + private val residence: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3219,95 +3239,69 @@ private constructor( 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 preferredName(preferredName: Boolean) = preferredName(JsonField.of(preferredName)) - @JsonProperty("preferred_name") - @ExcludeMissing fun preferredName(preferredName: JsonField) = apply { this.preferredName = preferredName } fun dob(dob: Boolean) = dob(JsonField.of(dob)) - @JsonProperty("dob") - @ExcludeMissing fun dob(dob: JsonField) = apply { this.dob = dob } fun gender(gender: Boolean) = gender(JsonField.of(gender)) - @JsonProperty("gender") - @ExcludeMissing fun gender(gender: JsonField) = apply { this.gender = gender } fun ethnicity(ethnicity: Boolean) = ethnicity(JsonField.of(ethnicity)) - @JsonProperty("ethnicity") - @ExcludeMissing fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) - @JsonProperty("ssn") - @ExcludeMissing fun ssn(ssn: JsonField) = apply { this.ssn = ssn } fun encryptedSsn(encryptedSsn: Boolean) = encryptedSsn(JsonField.of(encryptedSsn)) - @JsonProperty("encrypted_ssn") - @ExcludeMissing fun encryptedSsn(encryptedSsn: JsonField) = apply { this.encryptedSsn = encryptedSsn } fun emails(emails: Emails) = emails(JsonField.of(emails)) - @JsonProperty("emails") - @ExcludeMissing fun emails(emails: JsonField) = apply { this.emails = emails } fun phoneNumbers(phoneNumbers: PhoneNumbers) = phoneNumbers(JsonField.of(phoneNumbers)) - @JsonProperty("phone_numbers") - @ExcludeMissing fun phoneNumbers(phoneNumbers: JsonField) = apply { this.phoneNumbers = phoneNumbers } fun residence(residence: Residence) = residence(JsonField.of(residence)) - @JsonProperty("residence") - @ExcludeMissing fun residence(residence: JsonField) = apply { this.residence = residence } @@ -3317,7 +3311,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3354,13 +3347,18 @@ private constructor( ) } - @JsonDeserialize(builder = Emails.Builder::class) @NoAutoDetect class Emails + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -3408,14 +3406,10 @@ private constructor( fun data(data: Boolean) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = @@ -3424,7 +3418,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3467,13 +3460,18 @@ private constructor( "Emails{data=$data, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = PhoneNumbers.Builder::class) @NoAutoDetect class PhoneNumbers + @JsonCreator private constructor( - private val data: JsonField, - private val type: JsonField, - private val additionalProperties: Map, + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun data(): Optional = Optional.ofNullable(data.getNullable("data")) @@ -3521,14 +3519,10 @@ private constructor( fun data(data: Boolean) = data(JsonField.of(data)) - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = @@ -3537,7 +3531,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3580,17 +3573,30 @@ private constructor( "PhoneNumbers{data=$data, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Residence.Builder::class) @NoAutoDetect class Residence + @JsonCreator private constructor( - private val city: JsonField, - private val country: JsonField, - private val line1: JsonField, - private val line2: JsonField, - private val postalCode: JsonField, - private val state: JsonField, - private val additionalProperties: Map, + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("line1") + @ExcludeMissing + private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + private val line2: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun city(): Optional = Optional.ofNullable(city.getNullable("city")) @@ -3668,40 +3674,28 @@ private constructor( fun city(city: Boolean) = city(JsonField.of(city)) - @JsonProperty("city") - @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } fun country(country: Boolean) = country(JsonField.of(country)) - @JsonProperty("country") - @ExcludeMissing fun country(country: JsonField) = apply { this.country = country } 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 postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) - @JsonProperty("postal_code") - @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: Boolean) = state(JsonField.of(state)) - @JsonProperty("state") - @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = @@ -3710,7 +3704,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3775,15 +3768,24 @@ private constructor( "SupportedIndividualFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, dob=$dob, gender=$gender, ethnicity=$ethnicity, ssn=$ssn, encryptedSsn=$encryptedSsn, emails=$emails, phoneNumbers=$phoneNumbers, residence=$residence, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPayGroupFields.Builder::class) @NoAutoDetect class SupportedPayGroupFields + @JsonCreator private constructor( - private val id: JsonField, - private val name: JsonField, - private val payFrequencies: JsonField, - private val individualIds: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -3849,21 +3851,15 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun payFrequencies(payFrequencies: Boolean) = payFrequencies(JsonField.of(payFrequencies)) - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField) = apply { this.payFrequencies = payFrequencies } @@ -3871,8 +3867,6 @@ private constructor( fun individualIds(individualIds: Boolean) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField) = apply { this.individualIds = individualIds } @@ -3882,7 +3876,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -3928,13 +3921,18 @@ private constructor( "SupportedPayGroupFields{id=$id, name=$name, payFrequencies=$payFrequencies, individualIds=$individualIds, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPayStatementFields.Builder::class) @NoAutoDetect class SupportedPayStatementFields + @JsonCreator private constructor( - private val paging: JsonField, - private val payStatements: JsonField, - private val additionalProperties: Map, + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), + @JsonProperty("pay_statements") + @ExcludeMissing + private val payStatements: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @@ -3984,15 +3982,11 @@ private constructor( fun paging(paging: Paging) = paging(JsonField.of(paging)) - @JsonProperty("paging") - @ExcludeMissing fun paging(paging: JsonField) = apply { this.paging = paging } fun payStatements(payStatements: PayStatements) = payStatements(JsonField.of(payStatements)) - @JsonProperty("pay_statements") - @ExcludeMissing fun payStatements(payStatements: JsonField) = apply { this.payStatements = payStatements } @@ -4002,7 +3996,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4028,13 +4021,18 @@ private constructor( ) } - @JsonDeserialize(builder = Paging.Builder::class) @NoAutoDetect class Paging + @JsonCreator private constructor( - private val count: JsonField, - private val offset: JsonField, - private val additionalProperties: Map, + @JsonProperty("count") + @ExcludeMissing + private val count: JsonField = JsonMissing.of(), + @JsonProperty("offset") + @ExcludeMissing + private val offset: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun count(): Boolean = count.getRequired("count") @@ -4082,14 +4080,10 @@ private constructor( fun count(count: Boolean) = count(JsonField.of(count)) - @JsonProperty("count") - @ExcludeMissing fun count(count: JsonField) = apply { this.count = count } fun offset(offset: Boolean) = offset(JsonField.of(offset)) - @JsonProperty("offset") - @ExcludeMissing fun offset(offset: JsonField) = apply { this.offset = offset } fun additionalProperties(additionalProperties: Map) = @@ -4098,7 +4092,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4141,21 +4134,44 @@ private constructor( "Paging{count=$count, offset=$offset, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = PayStatements.Builder::class) @NoAutoDetect class PayStatements + @JsonCreator private constructor( - private val individualId: JsonField, - private val type: JsonField, - private val paymentMethod: JsonField, - private val totalHours: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val earnings: JsonField, - private val employeeDeductions: JsonField, - private val employerContributions: JsonField, - private val taxes: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("payment_method") + @ExcludeMissing + private val paymentMethod: JsonField = JsonMissing.of(), + @JsonProperty("total_hours") + @ExcludeMissing + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("earnings") + @ExcludeMissing + private val earnings: JsonField = JsonMissing.of(), + @JsonProperty("employee_deductions") + @ExcludeMissing + private val employeeDeductions: JsonField = + JsonMissing.of(), + @JsonProperty("employer_contributions") + @ExcludeMissing + private val employerContributions: JsonField = + JsonMissing.of(), + @JsonProperty("taxes") + @ExcludeMissing + private val taxes: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -4280,53 +4296,39 @@ private constructor( fun individualId(individualId: Boolean) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun paymentMethod(paymentMethod: Boolean) = paymentMethod(JsonField.of(paymentMethod)) - @JsonProperty("payment_method") - @ExcludeMissing fun paymentMethod(paymentMethod: JsonField) = apply { this.paymentMethod = paymentMethod } fun totalHours(totalHours: Boolean) = totalHours(JsonField.of(totalHours)) - @JsonProperty("total_hours") - @ExcludeMissing fun totalHours(totalHours: JsonField) = apply { this.totalHours = totalHours } fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } fun earnings(earnings: Earnings) = earnings(JsonField.of(earnings)) - @JsonProperty("earnings") - @ExcludeMissing fun earnings(earnings: JsonField) = apply { this.earnings = earnings } @@ -4334,8 +4336,6 @@ private constructor( fun employeeDeductions(employeeDeductions: EmployeeDeductions) = employeeDeductions(JsonField.of(employeeDeductions)) - @JsonProperty("employee_deductions") - @ExcludeMissing fun employeeDeductions(employeeDeductions: JsonField) = apply { this.employeeDeductions = employeeDeductions @@ -4344,16 +4344,12 @@ private constructor( fun employerContributions(employerContributions: EmployerContributions) = employerContributions(JsonField.of(employerContributions)) - @JsonProperty("employer_contributions") - @ExcludeMissing fun employerContributions( employerContributions: JsonField ) = apply { this.employerContributions = employerContributions } fun taxes(taxes: Taxes) = taxes(JsonField.of(taxes)) - @JsonProperty("taxes") - @ExcludeMissing fun taxes(taxes: JsonField) = apply { this.taxes = taxes } fun additionalProperties(additionalProperties: Map) = @@ -4362,7 +4358,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4395,15 +4390,25 @@ private constructor( ) } - @JsonDeserialize(builder = Earnings.Builder::class) @NoAutoDetect class Earnings + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -4469,26 +4474,18 @@ private constructor( fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4499,7 +4496,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4544,16 +4540,28 @@ private constructor( "Earnings{type=$type, name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployeeDeductions.Builder::class) @NoAutoDetect class EmployeeDeductions + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val type: JsonField, - private val preTax: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("pre_tax") + @ExcludeMissing + private val preTax: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -4628,32 +4636,22 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) - @JsonProperty("pre_tax") - @ExcludeMissing fun preTax(preTax: JsonField) = apply { this.preTax = preTax } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4664,7 +4662,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4710,14 +4707,22 @@ private constructor( "EmployeeDeductions{name=$name, amount=$amount, type=$type, preTax=$preTax, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployerContributions.Builder::class) @NoAutoDetect class EmployerContributions + @JsonCreator private constructor( - private val name: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun name(): Optional = @@ -4777,20 +4782,14 @@ private constructor( fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4801,7 +4800,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -4845,16 +4843,28 @@ private constructor( "EmployerContributions{name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Taxes.Builder::class) @NoAutoDetect class Taxes + @JsonCreator private constructor( - private val type: JsonField, - private val name: JsonField, - private val employer: JsonField, - private val amount: JsonField, - private val currency: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("employer") + @ExcludeMissing + private val employer: JsonField = JsonMissing.of(), + @JsonProperty("amount") + @ExcludeMissing + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = + immutableEmptyMap(), ) { fun type(): Optional = @@ -4928,34 +4938,24 @@ private constructor( fun type(type: Boolean) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun name(name: Boolean) = name(JsonField.of(name)) - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun employer(employer: Boolean) = employer(JsonField.of(employer)) - @JsonProperty("employer") - @ExcludeMissing fun employer(employer: JsonField) = apply { this.employer = employer } fun amount(amount: Boolean) = amount(JsonField.of(amount)) - @JsonProperty("amount") - @ExcludeMissing fun amount(amount: JsonField) = apply { this.amount = amount } fun currency(currency: Boolean) = currency(JsonField.of(currency)) - @JsonProperty("currency") - @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } @@ -4966,7 +4966,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -5048,23 +5047,48 @@ private constructor( "SupportedPayStatementFields{paging=$paging, payStatements=$payStatements, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = SupportedPaymentFields.Builder::class) @NoAutoDetect class SupportedPaymentFields + @JsonCreator private constructor( - private val id: JsonField, - private val payDate: JsonField, - private val debitDate: JsonField, - private val companyDebit: JsonField, - private val grossPay: JsonField, - private val netPay: JsonField, - private val employerTaxes: JsonField, - private val employeeTaxes: JsonField, - private val individualIds: JsonField, - private val payPeriod: JsonField, - private val payGroupIds: JsonField, - private val payFrequencies: JsonField, - private val additionalProperties: Map, + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") + @ExcludeMissing + private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("debit_date") + @ExcludeMissing + private val debitDate: JsonField = JsonMissing.of(), + @JsonProperty("company_debit") + @ExcludeMissing + private val companyDebit: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("employer_taxes") + @ExcludeMissing + private val employerTaxes: JsonField = JsonMissing.of(), + @JsonProperty("employee_taxes") + @ExcludeMissing + private val employeeTaxes: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_period") + @ExcludeMissing + private val payPeriod: JsonField = JsonMissing.of(), + @JsonProperty("pay_group_ids") + @ExcludeMissing + private val payGroupIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") + @ExcludeMissing + private val payFrequencies: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) @@ -5194,20 +5218,14 @@ private constructor( fun id(id: Boolean) = id(JsonField.of(id)) - @JsonProperty("id") - @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) - @JsonProperty("pay_date") - @ExcludeMissing fun payDate(payDate: JsonField) = apply { this.payDate = payDate } fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - @JsonProperty("debit_date") - @ExcludeMissing fun debitDate(debitDate: JsonField) = apply { this.debitDate = debitDate } @@ -5215,29 +5233,21 @@ private constructor( fun companyDebit(companyDebit: Boolean) = companyDebit(JsonField.of(companyDebit)) - @JsonProperty("company_debit") - @ExcludeMissing fun companyDebit(companyDebit: JsonField) = apply { this.companyDebit = companyDebit } fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - @JsonProperty("gross_pay") - @ExcludeMissing fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - @JsonProperty("net_pay") - @ExcludeMissing fun netPay(netPay: JsonField) = apply { this.netPay = netPay } fun employerTaxes(employerTaxes: Boolean) = employerTaxes(JsonField.of(employerTaxes)) - @JsonProperty("employer_taxes") - @ExcludeMissing fun employerTaxes(employerTaxes: JsonField) = apply { this.employerTaxes = employerTaxes } @@ -5245,8 +5255,6 @@ private constructor( fun employeeTaxes(employeeTaxes: Boolean) = employeeTaxes(JsonField.of(employeeTaxes)) - @JsonProperty("employee_taxes") - @ExcludeMissing fun employeeTaxes(employeeTaxes: JsonField) = apply { this.employeeTaxes = employeeTaxes } @@ -5254,24 +5262,18 @@ private constructor( fun individualIds(individualIds: Boolean) = individualIds(JsonField.of(individualIds)) - @JsonProperty("individual_ids") - @ExcludeMissing fun individualIds(individualIds: JsonField) = apply { this.individualIds = individualIds } fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) - @JsonProperty("pay_period") - @ExcludeMissing fun payPeriod(payPeriod: JsonField) = apply { this.payPeriod = payPeriod } fun payGroupIds(payGroupIds: Boolean) = payGroupIds(JsonField.of(payGroupIds)) - @JsonProperty("pay_group_ids") - @ExcludeMissing fun payGroupIds(payGroupIds: JsonField) = apply { this.payGroupIds = payGroupIds } @@ -5279,8 +5281,6 @@ private constructor( fun payFrequencies(payFrequencies: Boolean) = payFrequencies(JsonField.of(payFrequencies)) - @JsonProperty("pay_frequencies") - @ExcludeMissing fun payFrequencies(payFrequencies: JsonField) = apply { this.payFrequencies = payFrequencies } @@ -5290,7 +5290,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -5326,13 +5325,18 @@ private constructor( ) } - @JsonDeserialize(builder = PayPeriod.Builder::class) @NoAutoDetect class PayPeriod + @JsonCreator private constructor( - private val startDate: JsonField, - private val endDate: JsonField, - private val additionalProperties: Map, + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { fun startDate(): Optional = @@ -5382,16 +5386,12 @@ private constructor( fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - @JsonProperty("start_date") - @ExcludeMissing fun startDate(startDate: JsonField) = apply { this.startDate = startDate } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) - @JsonProperty("end_date") - @ExcludeMissing fun endDate(endDate: JsonField) = apply { this.endDate = endDate } fun additionalProperties(additionalProperties: Map) = @@ -5400,7 +5400,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt index 9496f5c8..9f4ad152 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.blocking.ProviderService import java.util.Objects @@ -67,12 +68,13 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -126,10 +128,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPageAsync.kt index 6344fb83..607497d1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPageAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPageAsync.kt @@ -4,13 +4,14 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.services.async.ProviderServiceAsync import java.util.Objects @@ -74,12 +75,13 @@ private constructor( ) } - @JsonDeserialize(builder = Response.Builder::class) @NoAutoDetect class Response + @JsonCreator constructor( - private val items: JsonField>, - private val additionalProperties: Map, + @JsonProperty("items") private val items: JsonField> = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { private var validated: Boolean = false @@ -133,10 +135,8 @@ private constructor( fun items(items: List) = items(JsonField.of(items)) - @JsonProperty("items") fun items(items: JsonField>) = apply { this.items = items } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt index 09a47d7c..9178ee6b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -60,16 +61,17 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams /** Forward Request Body */ - @JsonDeserialize(builder = RequestForwardingForwardBody.Builder::class) @NoAutoDetect class RequestForwardingForwardBody + @JsonCreator internal constructor( - private val method: String, - private val route: String, - private val data: String?, - private val headers: JsonValue?, - private val params: JsonValue?, - private val additionalProperties: Map, + @JsonProperty("method") private val method: String, + @JsonProperty("route") private val route: String, + @JsonProperty("data") private val data: String?, + @JsonProperty("headers") private val headers: JsonValue?, + @JsonProperty("params") private val params: JsonValue?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -138,41 +140,39 @@ constructor( * The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , * `PUT` , `DELETE` , and `PATCH`. */ - @JsonProperty("method") fun method(method: String) = apply { this.method = method } + fun method(method: String) = apply { this.method = method } /** * The URL route path for the forwarded request. This value must begin with a * forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and * underscores. */ - @JsonProperty("route") fun route(route: String) = apply { this.route = route } + fun route(route: String) = apply { this.route = route } /** * The body for the forwarded request. This value must be specified as either a string * or a valid JSON object. */ - @JsonProperty("data") fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { this.data = data } /** * The HTTP headers to include on the forwarded request. This value must be specified as * an object of key-value pairs. Example: `{"Content-Type": "application/xml", * "X-API-Version": "v1" }` */ - @JsonProperty("headers") fun headers(headers: JsonValue) = apply { this.headers = headers } /** * The query parameters for the forwarded request. This value must be specified as a * valid JSON object rather than a query string. */ - @JsonProperty("params") fun params(params: JsonValue) = apply { this.params = params } + fun params(params: JsonValue) = apply { this.params = params } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt index 45a1cdde..e09623c2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt @@ -4,26 +4,31 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = RequestForwardingForwardResponse.Builder::class) @NoAutoDetect class RequestForwardingForwardResponse +@JsonCreator private constructor( - private val headers: JsonValue, - private val statusCode: JsonField, - private val data: JsonField, - private val request: JsonField, - private val additionalProperties: Map, + @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), + @JsonProperty("statusCode") + @ExcludeMissing + private val statusCode: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonProperty("request") + @ExcludeMissing + private val request: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -113,8 +118,6 @@ private constructor( * The HTTP headers of the forwarded request’s response, exactly as received from the * underlying integration’s API. */ - @JsonProperty("headers") - @ExcludeMissing fun headers(headers: JsonValue) = apply { this.headers = headers } /** @@ -127,8 +130,6 @@ private constructor( * The HTTP status code of the forwarded request’s response, exactly received from the * underlying integration’s API. This value will be returned as an integer. */ - @JsonProperty("statusCode") - @ExcludeMissing fun statusCode(statusCode: JsonField) = apply { this.statusCode = statusCode } /** @@ -143,8 +144,6 @@ private constructor( * received from the underlying integration’s API. This field may be null in the case where * the upstream system’s response is empty. */ - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } /** @@ -157,8 +156,6 @@ private constructor( * An object containing details of your original forwarded request, for your ease of * reference. */ - @JsonProperty("request") - @ExcludeMissing fun request(request: JsonField) = apply { this.request = request } fun additionalProperties(additionalProperties: Map) = apply { @@ -166,7 +163,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -194,16 +190,23 @@ private constructor( /** * An object containing details of your original forwarded request, for your ease of reference. */ - @JsonDeserialize(builder = Request.Builder::class) @NoAutoDetect class Request + @JsonCreator private constructor( - private val method: JsonField, - private val route: JsonField, - private val headers: JsonValue, - private val params: JsonValue, - private val data: JsonField, - private val additionalProperties: Map, + @JsonProperty("method") + @ExcludeMissing + private val method: JsonField = JsonMissing.of(), + @JsonProperty("route") + @ExcludeMissing + private val route: JsonField = JsonMissing.of(), + @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), + @JsonProperty("params") @ExcludeMissing private val params: JsonValue = JsonMissing.of(), + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -301,32 +304,24 @@ private constructor( * The HTTP method that was specified for the forwarded request. Valid values include: * `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. */ - @JsonProperty("method") - @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** The URL route path that was specified for the forwarded request. */ fun route(route: String) = route(JsonField.of(route)) /** The URL route path that was specified for the forwarded request. */ - @JsonProperty("route") - @ExcludeMissing fun route(route: JsonField) = apply { this.route = route } /** * The specified HTTP headers that were included in the forwarded request. If no headers * were specified, this will be returned as `null`. */ - @JsonProperty("headers") - @ExcludeMissing fun headers(headers: JsonValue) = apply { this.headers = headers } /** * The query parameters that were included in the forwarded request. If no query * parameters were specified, this will be returned as `null`. */ - @JsonProperty("params") - @ExcludeMissing fun params(params: JsonValue) = apply { this.params = params } /** @@ -341,8 +336,6 @@ private constructor( * in the original request, this value will be returned as null ; otherwise, this value * will always be returned as a string. */ - @JsonProperty("data") - @ExcludeMissing fun data(data: JsonField) = apply { this.data = data } fun additionalProperties(additionalProperties: Map) = apply { @@ -350,7 +343,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index 5a0954e1..5e699d02 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -75,19 +75,20 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxCompanyUpdateBody.Builder::class) @NoAutoDetect class SandboxCompanyUpdateBody + @JsonCreator internal constructor( - private val accounts: List?, - private val departments: List?, - private val ein: String?, - private val entity: Entity?, - private val legalName: String?, - private val locations: List?, - private val primaryEmail: String?, - private val primaryPhoneNumber: String?, - private val additionalProperties: Map, + @JsonProperty("accounts") private val accounts: List?, + @JsonProperty("departments") private val departments: List?, + @JsonProperty("ein") private val ein: String?, + @JsonProperty("entity") private val entity: Entity?, + @JsonProperty("legal_name") private val legalName: String?, + @JsonProperty("locations") private val locations: List?, + @JsonProperty("primary_email") private val primaryEmail: String?, + @JsonProperty("primary_phone_number") private val primaryPhoneNumber: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** An array of bank account objects associated with the payroll/HRIS system. */ @@ -156,34 +157,28 @@ constructor( } /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") fun accounts(accounts: List) = apply { this.accounts = accounts } /** The array of company departments. */ - @JsonProperty("departments") fun departments(departments: List) = apply { this.departments = departments } /** The employer identification number. */ - @JsonProperty("ein") fun ein(ein: String) = apply { this.ein = ein } + fun ein(ein: String) = apply { this.ein = ein } /** The entity type object. */ - @JsonProperty("entity") fun entity(entity: Entity) = apply { this.entity = entity } + fun entity(entity: Entity) = apply { this.entity = entity } /** The legal name of the company. */ - @JsonProperty("legal_name") fun legalName(legalName: String) = apply { this.legalName = legalName } - @JsonProperty("locations") fun locations(locations: List) = apply { this.locations = locations } /** The email of the main administrator on the account. */ - @JsonProperty("primary_email") fun primaryEmail(primaryEmail: String) = apply { this.primaryEmail = primaryEmail } /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - @JsonProperty("primary_phone_number") fun primaryPhoneNumber(primaryPhoneNumber: String) = apply { this.primaryPhoneNumber = primaryPhoneNumber } @@ -193,7 +188,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -456,16 +450,17 @@ constructor( ) } - @JsonDeserialize(builder = Account.Builder::class) @NoAutoDetect class Account + @JsonCreator private constructor( - private val routingNumber: String?, - private val accountName: String?, - private val institutionName: String?, - private val accountType: AccountType?, - private val accountNumber: String?, - private val additionalProperties: Map, + @JsonProperty("routing_number") private val routingNumber: String?, + @JsonProperty("account_name") private val accountName: String?, + @JsonProperty("institution_name") private val institutionName: String?, + @JsonProperty("account_type") private val accountType: AccountType?, + @JsonProperty("account_number") private val accountNumber: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** @@ -524,25 +519,20 @@ constructor( * A nine-digit code that's based on the U.S. Bank location where your account was * opened. */ - @JsonProperty("routing_number") fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } /** The name of the bank associated in the payroll/HRIS system. */ - @JsonProperty("account_name") fun accountName(accountName: String) = apply { this.accountName = accountName } /** Name of the banking institution. */ - @JsonProperty("institution_name") fun institutionName(institutionName: String) = apply { this.institutionName = institutionName } /** The type of bank account. */ - @JsonProperty("account_type") fun accountType(accountType: AccountType) = apply { this.accountType = accountType } /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } fun additionalProperties(additionalProperties: Map) = apply { @@ -550,7 +540,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -651,13 +640,14 @@ constructor( "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: String?, - private val parent: Parent?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonProperty("parent") private val parent: Parent?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The department name. */ @@ -691,17 +681,16 @@ constructor( } /** The department name. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } /** The parent department, if present. */ - @JsonProperty("parent") fun parent(parent: Parent) = apply { this.parent = parent } + fun parent(parent: Parent) = apply { this.parent = parent } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -725,12 +714,13 @@ constructor( } /** The parent department, if present. */ - @JsonDeserialize(builder = Parent.Builder::class) @NoAutoDetect class Parent + @JsonCreator private constructor( - private val name: String?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The parent department's name. */ @@ -759,14 +749,13 @@ constructor( } /** The parent department's name. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -824,13 +813,14 @@ constructor( } /** The entity type object. */ - @JsonDeserialize(builder = Entity.Builder::class) @NoAutoDetect class Entity + @JsonCreator private constructor( - private val type: Type?, - private val subtype: Subtype?, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type?, + @JsonProperty("subtype") private val subtype: Subtype?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The tax payer type of the company. */ @@ -864,10 +854,9 @@ constructor( } /** The tax payer type of the company. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** The tax payer subtype of the company. */ - @JsonProperty("subtype") fun subtype(subtype: Subtype) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -875,7 +864,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index 1455dab3..3ac768d6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -59,15 +59,16 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxConnectionAccountCreateBody.Builder::class) @NoAutoDetect class SandboxConnectionAccountCreateBody + @JsonCreator internal constructor( - private val companyId: String, - private val providerId: String, - private val authenticationType: AuthenticationType?, - private val products: List?, - private val additionalProperties: Map, + @JsonProperty("company_id") private val companyId: String, + @JsonProperty("provider_id") private val providerId: String, + @JsonProperty("authentication_type") private val authenticationType: AuthenticationType?, + @JsonProperty("products") private val products: List?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("company_id") fun companyId(): String = companyId @@ -117,14 +118,11 @@ constructor( sandboxConnectionAccountCreateBody.additionalProperties.toMutableMap() } - @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } /** The provider associated with the `access_token` */ - @JsonProperty("provider_id") fun providerId(providerId: String) = apply { this.providerId = providerId } - @JsonProperty("authentication_type") fun authenticationType(authenticationType: AuthenticationType) = apply { this.authenticationType = authenticationType } @@ -133,7 +131,6 @@ constructor( * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - @JsonProperty("products") fun products(products: List) = apply { this.products = products } fun additionalProperties(additionalProperties: Map) = apply { @@ -141,7 +138,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index f77f0094..a15a7a47 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt @@ -4,13 +4,14 @@ 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.ExcludeMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional @@ -40,12 +41,13 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxConnectionAccountUpdateBody.Builder::class) @NoAutoDetect class SandboxConnectionAccountUpdateBody + @JsonCreator internal constructor( - private val connectionStatus: ConnectionStatusType?, - private val additionalProperties: Map, + @JsonProperty("connection_status") private val connectionStatus: ConnectionStatusType?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("connection_status") @@ -77,7 +79,6 @@ constructor( sandboxConnectionAccountUpdateBody.additionalProperties.toMutableMap() } - @JsonProperty("connection_status") fun connectionStatus(connectionStatus: ConnectionStatusType) = apply { this.connectionStatus = connectionStatus } @@ -87,7 +88,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt index 3a5df09e..5273d320 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -59,15 +59,16 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxConnectionCreateBody.Builder::class) @NoAutoDetect class SandboxConnectionCreateBody + @JsonCreator internal constructor( - private val providerId: String, - private val authenticationType: AuthenticationType?, - private val employeeSize: Long?, - private val products: List?, - private val additionalProperties: Map, + @JsonProperty("provider_id") private val providerId: String, + @JsonProperty("authentication_type") private val authenticationType: AuthenticationType?, + @JsonProperty("employee_size") private val employeeSize: Long?, + @JsonProperty("products") private val products: List?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The provider associated with the connection */ @@ -118,10 +119,8 @@ constructor( } /** The provider associated with the connection */ - @JsonProperty("provider_id") fun providerId(providerId: String) = apply { this.providerId = providerId } - @JsonProperty("authentication_type") fun authenticationType(authenticationType: AuthenticationType) = apply { this.authenticationType = authenticationType } @@ -131,10 +130,8 @@ constructor( * to 20. Note that if this is higher than 100, historical payroll data will not be * generated, and instead only one pay period will be created. */ - @JsonProperty("employee_size") fun employeeSize(employeeSize: Long) = apply { this.employeeSize = employeeSize } - @JsonProperty("products") fun products(products: List) = apply { this.products = products } fun additionalProperties(additionalProperties: Map) = apply { @@ -142,7 +139,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index af23ac91..5e9a4df8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -45,11 +45,11 @@ constructor( * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - @JsonDeserialize(builder = SandboxDirectoryCreateBody.Builder::class) @NoAutoDetect class SandboxDirectoryCreateBody + @JsonCreator internal constructor( - private val body: List, + @JsonProperty("body") private val body: List, ) { /** @@ -78,7 +78,6 @@ constructor( * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - @JsonProperty("body") fun body(body: List) = apply { this.body = body } fun build(): SandboxDirectoryCreateBody = @@ -246,38 +245,39 @@ constructor( ) } - @JsonDeserialize(builder = IndividualOrEmployment.Builder::class) @NoAutoDetect class IndividualOrEmployment + @JsonCreator private constructor( - private val firstName: String?, - private val middleName: String?, - private val lastName: String?, - private val preferredName: String?, - private val emails: List?, - private val phoneNumbers: List?, - private val gender: Gender?, - private val ethnicity: Ethnicity?, - private val dob: String?, - private val ssn: String?, - private val encryptedSsn: String?, - private val residence: Location?, - private val title: String?, - private val manager: Manager?, - private val department: Department?, - private val employment: Employment?, - private val startDate: String?, - private val endDate: String?, - private val latestRehireDate: String?, - private val isActive: Boolean?, - private val employmentStatus: EmploymentStatus?, - private val classCode: String?, - private val location: Location?, - private val income: Income?, - private val incomeHistory: List?, - private val customFields: List?, - private val sourceId: String?, - private val additionalProperties: Map, + @JsonProperty("first_name") private val firstName: String?, + @JsonProperty("middle_name") private val middleName: String?, + @JsonProperty("last_name") private val lastName: String?, + @JsonProperty("preferred_name") private val preferredName: String?, + @JsonProperty("emails") private val emails: List?, + @JsonProperty("phone_numbers") private val phoneNumbers: List?, + @JsonProperty("gender") private val gender: Gender?, + @JsonProperty("ethnicity") private val ethnicity: Ethnicity?, + @JsonProperty("dob") private val dob: String?, + @JsonProperty("ssn") private val ssn: String?, + @JsonProperty("encrypted_ssn") private val encryptedSsn: String?, + @JsonProperty("residence") private val residence: Location?, + @JsonProperty("title") private val title: String?, + @JsonProperty("manager") private val manager: Manager?, + @JsonProperty("department") private val department: Department?, + @JsonProperty("employment") private val employment: Employment?, + @JsonProperty("start_date") private val startDate: String?, + @JsonProperty("end_date") private val endDate: String?, + @JsonProperty("latest_rehire_date") private val latestRehireDate: String?, + @JsonProperty("is_active") private val isActive: Boolean?, + @JsonProperty("employment_status") private val employmentStatus: EmploymentStatus?, + @JsonProperty("class_code") private val classCode: String?, + @JsonProperty("location") private val location: Location?, + @JsonProperty("income") private val income: Income?, + @JsonProperty("income_history") private val incomeHistory: List?, + @JsonProperty("custom_fields") private val customFields: List?, + @JsonProperty("source_id") private val sourceId: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The legal first name of the individual. */ @@ -458,96 +458,78 @@ constructor( } /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(firstName: String) = apply { this.firstName = firstName } /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(middleName: String) = apply { this.middleName = middleName } /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(lastName: String) = apply { this.lastName = lastName } /** The preferred name of the individual. */ - @JsonProperty("preferred_name") fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } - @JsonProperty("emails") fun emails(emails: List) = apply { this.emails = emails } + fun emails(emails: List) = apply { this.emails = emails } - @JsonProperty("phone_numbers") fun phoneNumbers(phoneNumbers: List) = apply { this.phoneNumbers = phoneNumbers } /** The gender of the individual. */ - @JsonProperty("gender") fun gender(gender: Gender) = apply { this.gender = gender } + fun gender(gender: Gender) = apply { this.gender = gender } /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } - @JsonProperty("dob") fun dob(dob: String) = apply { this.dob = dob } + fun dob(dob: String) = apply { this.dob = dob } /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") fun ssn(ssn: String) = apply { this.ssn = ssn } + fun ssn(ssn: String) = apply { this.ssn = ssn } /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param * set in the body. */ - @JsonProperty("encrypted_ssn") fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } - @JsonProperty("residence") fun residence(residence: Location) = apply { this.residence = residence } /** The current title of the individual. */ - @JsonProperty("title") fun title(title: String) = apply { this.title = title } + fun title(title: String) = apply { this.title = title } /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") fun manager(manager: Manager) = apply { this.manager = manager } /** The department object. */ - @JsonProperty("department") fun department(department: Department) = apply { this.department = department } /** The employment object. */ - @JsonProperty("employment") fun employment(employment: Employment) = apply { this.employment = employment } - @JsonProperty("start_date") fun startDate(startDate: String) = apply { this.startDate = startDate } - @JsonProperty("end_date") fun endDate(endDate: String) = apply { this.endDate = endDate } - @JsonProperty("latest_rehire_date") fun latestRehireDate(latestRehireDate: String) = apply { this.latestRehireDate = latestRehireDate } /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") fun isActive(isActive: Boolean) = apply { this.isActive = isActive } /** The detailed employment status of the individual. */ - @JsonProperty("employment_status") fun employmentStatus(employmentStatus: EmploymentStatus) = apply { this.employmentStatus = employmentStatus } /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") fun classCode(classCode: String) = apply { this.classCode = classCode } - @JsonProperty("location") fun location(location: Location) = apply { this.location = location } /** @@ -555,10 +537,9 @@ constructor( * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") fun income(income: Income) = apply { this.income = income } + fun income(income: Income) = apply { this.income = income } /** The array of income history. */ - @JsonProperty("income_history") fun incomeHistory(incomeHistory: List) = apply { this.incomeHistory = incomeHistory } @@ -567,13 +548,11 @@ constructor( * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. */ - @JsonProperty("custom_fields") fun customFields(customFields: List) = apply { this.customFields = customFields } /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } fun additionalProperties(additionalProperties: Map) = apply { @@ -581,7 +560,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -629,13 +607,14 @@ constructor( ) } - @JsonDeserialize(builder = CustomField.Builder::class) @NoAutoDetect class CustomField + @JsonCreator private constructor( - private val name: String?, - private val value: JsonValue?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonProperty("value") private val value: JsonValue?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) @@ -666,16 +645,15 @@ constructor( additionalProperties = customField.additionalProperties.toMutableMap() } - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } - @JsonProperty("value") fun value(value: JsonValue) = apply { this.value = value } + fun value(value: JsonValue) = apply { this.value = value } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -720,12 +698,13 @@ constructor( } /** The department object. */ - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: String?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The name of the department associated with the individual. */ @@ -754,14 +733,13 @@ constructor( } /** The name of the department associated with the individual. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -800,13 +778,14 @@ constructor( "Department{name=$name, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = Email.Builder::class) @NoAutoDetect class Email + @JsonCreator private constructor( - private val data: String?, - private val type: Type?, - private val additionalProperties: Map, + @JsonProperty("data") private val data: String?, + @JsonProperty("type") private val type: Type?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) @@ -837,16 +816,15 @@ constructor( additionalProperties = email.additionalProperties.toMutableMap() } - @JsonProperty("data") fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { this.data = data } - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -948,13 +926,14 @@ constructor( } /** The employment object. */ - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: Type?, - private val subtype: Subtype?, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type?, + @JsonProperty("subtype") private val subtype: Subtype?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The main employment type of the individual. */ @@ -991,13 +970,12 @@ constructor( } /** The main employment type of the individual. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** * The secondary employment type of the individual. Options: `full_time`, * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") fun subtype(subtype: Subtype) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -1005,7 +983,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1439,12 +1416,13 @@ constructor( } /** The manager object representing the manager of the individual within the org. */ - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: String?, - private val additionalProperties: Map, + @JsonProperty("id") private val id: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1473,14 +1451,13 @@ constructor( } /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") fun id(id: String) = apply { this.id = id } + fun id(id: String) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1518,13 +1495,14 @@ constructor( override fun toString() = "Manager{id=$id, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = PhoneNumber.Builder::class) @NoAutoDetect class PhoneNumber + @JsonCreator private constructor( - private val data: String?, - private val type: Type?, - private val additionalProperties: Map, + @JsonProperty("data") private val data: String?, + @JsonProperty("type") private val type: Type?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) @@ -1555,16 +1533,15 @@ constructor( additionalProperties = phoneNumber.additionalProperties.toMutableMap() } - @JsonProperty("data") fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { this.data = data } - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 0b480a53..9424d999 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -125,29 +125,30 @@ constructor( } } - @JsonDeserialize(builder = SandboxEmploymentUpdateBody.Builder::class) @NoAutoDetect class SandboxEmploymentUpdateBody + @JsonCreator internal constructor( - private val classCode: String?, - private val customFields: List?, - private val department: Department?, - private val employment: Employment?, - private val employmentStatus: EmploymentStatus?, - private val endDate: String?, - private val firstName: String?, - private val income: Income?, - private val incomeHistory: List?, - private val isActive: Boolean?, - private val lastName: String?, - private val latestRehireDate: String?, - private val location: Location?, - private val manager: Manager?, - private val middleName: String?, - private val sourceId: String?, - private val startDate: String?, - private val title: String?, - private val additionalProperties: Map, + @JsonProperty("class_code") private val classCode: String?, + @JsonProperty("custom_fields") private val customFields: List?, + @JsonProperty("department") private val department: Department?, + @JsonProperty("employment") private val employment: Employment?, + @JsonProperty("employment_status") private val employmentStatus: EmploymentStatus?, + @JsonProperty("end_date") private val endDate: String?, + @JsonProperty("first_name") private val firstName: String?, + @JsonProperty("income") private val income: Income?, + @JsonProperty("income_history") private val incomeHistory: List?, + @JsonProperty("is_active") private val isActive: Boolean?, + @JsonProperty("last_name") private val lastName: String?, + @JsonProperty("latest_rehire_date") private val latestRehireDate: String?, + @JsonProperty("location") private val location: Location?, + @JsonProperty("manager") private val manager: Manager?, + @JsonProperty("middle_name") private val middleName: String?, + @JsonProperty("source_id") private val sourceId: String?, + @JsonProperty("start_date") private val startDate: String?, + @JsonProperty("title") private val title: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** Worker's compensation classification code for this employee */ @@ -275,37 +276,30 @@ constructor( } /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") fun classCode(classCode: String) = apply { this.classCode = classCode } /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. */ - @JsonProperty("custom_fields") fun customFields(customFields: List) = apply { this.customFields = customFields } /** The department object. */ - @JsonProperty("department") fun department(department: Department) = apply { this.department = department } /** The employment object. */ - @JsonProperty("employment") fun employment(employment: Employment) = apply { this.employment = employment } /** The detailed employment status of the individual. */ - @JsonProperty("employment_status") fun employmentStatus(employmentStatus: EmploymentStatus) = apply { this.employmentStatus = employmentStatus } - @JsonProperty("end_date") fun endDate(endDate: String) = apply { this.endDate = endDate } /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(firstName: String) = apply { this.firstName = firstName } /** @@ -313,54 +307,44 @@ constructor( * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - @JsonProperty("income") fun income(income: Income) = apply { this.income = income } + fun income(income: Income) = apply { this.income = income } /** The array of income history. */ - @JsonProperty("income_history") fun incomeHistory(incomeHistory: List) = apply { this.incomeHistory = incomeHistory } /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") fun isActive(isActive: Boolean) = apply { this.isActive = isActive } /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(lastName: String) = apply { this.lastName = lastName } - @JsonProperty("latest_rehire_date") fun latestRehireDate(latestRehireDate: String) = apply { this.latestRehireDate = latestRehireDate } - @JsonProperty("location") fun location(location: Location) = apply { this.location = location } /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") fun manager(manager: Manager) = apply { this.manager = manager } /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(middleName: String) = apply { this.middleName = middleName } /** The source system's unique employment identifier for this individual */ - @JsonProperty("source_id") fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } - @JsonProperty("start_date") fun startDate(startDate: String) = apply { this.startDate = startDate } /** The current title of the individual. */ - @JsonProperty("title") fun title(title: String) = apply { this.title = title } + fun title(title: String) = apply { this.title = title } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -706,13 +690,14 @@ constructor( ) } - @JsonDeserialize(builder = CustomField.Builder::class) @NoAutoDetect class CustomField + @JsonCreator private constructor( - private val name: String?, - private val value: JsonValue?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonProperty("value") private val value: JsonValue?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) @@ -743,16 +728,15 @@ constructor( additionalProperties = customField.additionalProperties.toMutableMap() } - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } - @JsonProperty("value") fun value(value: JsonValue) = apply { this.value = value } + fun value(value: JsonValue) = apply { this.value = value } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -794,12 +778,13 @@ constructor( } /** The department object. */ - @JsonDeserialize(builder = Department.Builder::class) @NoAutoDetect class Department + @JsonCreator private constructor( - private val name: String?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The name of the department associated with the individual. */ @@ -828,14 +813,13 @@ constructor( } /** The name of the department associated with the individual. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -872,13 +856,14 @@ constructor( } /** The employment object. */ - @JsonDeserialize(builder = Employment.Builder::class) @NoAutoDetect class Employment + @JsonCreator private constructor( - private val type: Type?, - private val subtype: Subtype?, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type?, + @JsonProperty("subtype") private val subtype: Subtype?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The main employment type of the individual. */ @@ -915,13 +900,12 @@ constructor( } /** The main employment type of the individual. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - @JsonProperty("subtype") fun subtype(subtype: Subtype) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { @@ -929,7 +913,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1196,12 +1179,13 @@ constructor( } /** The manager object representing the manager of the individual within the org. */ - @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect class Manager + @JsonCreator private constructor( - private val id: String?, - private val additionalProperties: Map, + @JsonProperty("id") private val id: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -1230,14 +1214,13 @@ constructor( } /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") fun id(id: String) = apply { this.id = id } + fun id(id: String) = apply { this.id = id } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 6bf67b85..072d5124 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -101,23 +101,24 @@ constructor( } } - @JsonDeserialize(builder = SandboxIndividualUpdateBody.Builder::class) @NoAutoDetect class SandboxIndividualUpdateBody + @JsonCreator internal constructor( - private val dob: String?, - private val emails: List?, - private val encryptedSsn: String?, - private val ethnicity: Ethnicity?, - private val firstName: String?, - private val gender: Gender?, - private val lastName: String?, - private val middleName: String?, - private val phoneNumbers: List?, - private val preferredName: String?, - private val residence: Location?, - private val ssn: String?, - private val additionalProperties: Map, + @JsonProperty("dob") private val dob: String?, + @JsonProperty("emails") private val emails: List?, + @JsonProperty("encrypted_ssn") private val encryptedSsn: String?, + @JsonProperty("ethnicity") private val ethnicity: Ethnicity?, + @JsonProperty("first_name") private val firstName: String?, + @JsonProperty("gender") private val gender: Gender?, + @JsonProperty("last_name") private val lastName: String?, + @JsonProperty("middle_name") private val middleName: String?, + @JsonProperty("phone_numbers") private val phoneNumbers: List?, + @JsonProperty("preferred_name") private val preferredName: String?, + @JsonProperty("residence") private val residence: Location?, + @JsonProperty("ssn") private val ssn: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("dob") fun dob(): Optional = Optional.ofNullable(dob) @@ -212,47 +213,39 @@ constructor( sandboxIndividualUpdateBody.additionalProperties.toMutableMap() } - @JsonProperty("dob") fun dob(dob: String) = apply { this.dob = dob } + fun dob(dob: String) = apply { this.dob = dob } - @JsonProperty("emails") fun emails(emails: List) = apply { this.emails = emails } + fun emails(emails: List) = apply { this.emails = emails } /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param * set in the body. */ - @JsonProperty("encrypted_ssn") fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } /** The legal first name of the individual. */ - @JsonProperty("first_name") fun firstName(firstName: String) = apply { this.firstName = firstName } /** The gender of the individual. */ - @JsonProperty("gender") fun gender(gender: Gender) = apply { this.gender = gender } + fun gender(gender: Gender) = apply { this.gender = gender } /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(lastName: String) = apply { this.lastName = lastName } /** The legal middle name of the individual. */ - @JsonProperty("middle_name") fun middleName(middleName: String) = apply { this.middleName = middleName } - @JsonProperty("phone_numbers") fun phoneNumbers(phoneNumbers: List) = apply { this.phoneNumbers = phoneNumbers } /** The preferred name of the individual. */ - @JsonProperty("preferred_name") fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } - @JsonProperty("residence") fun residence(residence: Location) = apply { this.residence = residence } /** @@ -260,14 +253,13 @@ constructor( * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - @JsonProperty("ssn") fun ssn(ssn: String) = apply { this.ssn = ssn } + fun ssn(ssn: String) = apply { this.ssn = ssn } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -560,13 +552,14 @@ constructor( ) } - @JsonDeserialize(builder = Email.Builder::class) @NoAutoDetect class Email + @JsonCreator private constructor( - private val data: String?, - private val type: Type?, - private val additionalProperties: Map, + @JsonProperty("data") private val data: String?, + @JsonProperty("type") private val type: Type?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) @@ -597,16 +590,15 @@ constructor( additionalProperties = email.additionalProperties.toMutableMap() } - @JsonProperty("data") fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { this.data = data } - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -867,13 +859,14 @@ constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = PhoneNumber.Builder::class) @NoAutoDetect class PhoneNumber + @JsonCreator private constructor( - private val data: String?, - private val type: Type?, - private val additionalProperties: Map, + @JsonProperty("data") private val data: String?, + @JsonProperty("type") private val type: Type?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("data") fun data(): Optional = Optional.ofNullable(data) @@ -904,16 +897,15 @@ constructor( additionalProperties = phoneNumber.additionalProperties.toMutableMap() } - @JsonProperty("data") fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { this.data = data } - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt index a76b6864..c17023e5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt @@ -6,24 +6,26 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects -@JsonDeserialize(builder = SandboxJobConfiguration.Builder::class) @NoAutoDetect class SandboxJobConfiguration +@JsonCreator private constructor( - private val type: JsonField, - private val completionStatus: JsonField, - private val additionalProperties: Map, + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("completion_status") + @ExcludeMissing + private val completionStatus: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun type(): Type = type.getRequired("type") @@ -70,15 +72,11 @@ private constructor( fun type(type: Type) = type(JsonField.of(type)) - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun completionStatus(completionStatus: CompletionStatus) = completionStatus(JsonField.of(completionStatus)) - @JsonProperty("completion_status") - @ExcludeMissing fun completionStatus(completionStatus: JsonField) = apply { this.completionStatus = completionStatus } @@ -88,7 +86,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt index 48695183..10b9058e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -50,13 +50,14 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxJobConfigurationUpdateBody.Builder::class) @NoAutoDetect class SandboxJobConfigurationUpdateBody + @JsonCreator internal constructor( - private val completionStatus: CompletionStatus, - private val type: Type, - private val additionalProperties: Map, + @JsonProperty("completion_status") private val completionStatus: CompletionStatus, + @JsonProperty("type") private val type: Type, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("completion_status") @@ -91,19 +92,17 @@ constructor( sandboxJobConfigurationUpdateBody.additionalProperties.toMutableMap() } - @JsonProperty("completion_status") fun completionStatus(completionStatus: CompletionStatus) = apply { this.completionStatus = completionStatus } - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt index 86aa0c18..a31d94c1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -43,12 +43,13 @@ constructor( @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(builder = SandboxJobCreateBody.Builder::class) @NoAutoDetect class SandboxJobCreateBody + @JsonCreator internal constructor( - private val type: Type, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of job to start. Currently the only supported type is `data_sync_all` */ @@ -77,14 +78,13 @@ constructor( } /** The type of job to start. Currently the only supported type is `data_sync_all` */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index 78442c4b..99d4eb3e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt @@ -6,7 +6,6 @@ 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 @@ -14,6 +13,7 @@ import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams +import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects @@ -59,14 +59,15 @@ constructor( * Fields to configure the payment. Takes all fields from the `/payment` endpoint. All fields * are optional. */ - @JsonDeserialize(builder = SandboxPaymentCreateBody.Builder::class) @NoAutoDetect class SandboxPaymentCreateBody + @JsonCreator internal constructor( - private val endDate: String?, - private val payStatements: List?, - private val startDate: String?, - private val additionalProperties: Map, + @JsonProperty("end_date") private val endDate: String?, + @JsonProperty("pay_statements") private val payStatements: List?, + @JsonProperty("start_date") private val startDate: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { @JsonProperty("end_date") fun endDate(): Optional = Optional.ofNullable(endDate) @@ -103,15 +104,12 @@ constructor( additionalProperties = sandboxPaymentCreateBody.additionalProperties.toMutableMap() } - @JsonProperty("end_date") fun endDate(endDate: String) = apply { this.endDate = endDate } - @JsonProperty("pay_statements") fun payStatements(payStatements: List) = apply { this.payStatements = payStatements } - @JsonProperty("start_date") fun startDate(startDate: String) = apply { this.startDate = startDate } fun additionalProperties(additionalProperties: Map) = apply { @@ -119,7 +117,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -334,21 +331,24 @@ constructor( ) } - @JsonDeserialize(builder = PayStatement.Builder::class) @NoAutoDetect class PayStatement + @JsonCreator private constructor( - private val individualId: String?, - private val type: Type?, - private val paymentMethod: PaymentMethod?, - private val totalHours: Double?, - private val grossPay: Money?, - private val netPay: Money?, - private val earnings: List?, - private val taxes: List?, + @JsonProperty("individual_id") private val individualId: String?, + @JsonProperty("type") private val type: Type?, + @JsonProperty("payment_method") private val paymentMethod: PaymentMethod?, + @JsonProperty("total_hours") private val totalHours: Double?, + @JsonProperty("gross_pay") private val grossPay: Money?, + @JsonProperty("net_pay") private val netPay: Money?, + @JsonProperty("earnings") private val earnings: List?, + @JsonProperty("taxes") private val taxes: List?, + @JsonProperty("employee_deductions") private val employeeDeductions: List?, + @JsonProperty("employer_contributions") private val employerContributions: List?, - private val additionalProperties: Map, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company */ @@ -427,41 +427,34 @@ constructor( } /** A stable Finch `id` (UUID v4) for an individual in the company */ - @JsonProperty("individual_id") fun individualId(individualId: String) = apply { this.individualId = individualId } /** The type of the payment associated with the pay statement. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** The payment method. */ - @JsonProperty("payment_method") fun paymentMethod(paymentMethod: PaymentMethod) = apply { this.paymentMethod = paymentMethod } /** The number of hours worked for this pay period */ - @JsonProperty("total_hours") fun totalHours(totalHours: Double) = apply { this.totalHours = totalHours } - @JsonProperty("gross_pay") fun grossPay(grossPay: Money) = apply { this.grossPay = grossPay } - @JsonProperty("net_pay") fun netPay(netPay: Money) = apply { this.netPay = netPay } + fun netPay(netPay: Money) = apply { this.netPay = netPay } /** The array of earnings objects associated with this pay statement */ - @JsonProperty("earnings") fun earnings(earnings: List) = apply { this.earnings = earnings } /** The array of taxes objects associated with this pay statement. */ - @JsonProperty("taxes") fun taxes(taxes: List) = apply { this.taxes = taxes } + fun taxes(taxes: List) = apply { this.taxes = taxes } /** The array of deductions objects associated with this pay statement. */ - @JsonProperty("employee_deductions") fun employeeDeductions(employeeDeductions: List) = apply { this.employeeDeductions = employeeDeductions } - @JsonProperty("employer_contributions") fun employerContributions(employerContributions: List) = apply { this.employerContributions = employerContributions } @@ -471,7 +464,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -502,16 +494,17 @@ constructor( ) } - @JsonDeserialize(builder = Earning.Builder::class) @NoAutoDetect class Earning + @JsonCreator private constructor( - private val type: Type?, - private val name: String?, - private val amount: Long?, - private val currency: String?, - private val hours: Double?, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type?, + @JsonProperty("name") private val name: String?, + @JsonProperty("amount") private val amount: Long?, + @JsonProperty("currency") private val currency: String?, + @JsonProperty("hours") private val hours: Double?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of earning. */ @@ -564,30 +557,28 @@ constructor( } /** The type of earning. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** The exact name of the deduction from the pay statement. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } /** The earnings amount in cents. */ - @JsonProperty("amount") fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long) = apply { this.amount = amount } /** The earnings currency code. */ - @JsonProperty("currency") fun currency(currency: String) = apply { this.currency = currency } /** * The number of hours associated with this earning. (For salaried employees, this * could be hours per pay period, `0` or `null`, depending on the provider). */ - @JsonProperty("hours") fun hours(hours: Double) = apply { this.hours = hours } + fun hours(hours: Double) = apply { this.hours = hours } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -757,16 +748,17 @@ constructor( "Earning{type=$type, name=$name, amount=$amount, currency=$currency, hours=$hours, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployeeDeduction.Builder::class) @NoAutoDetect class EmployeeDeduction + @JsonCreator private constructor( - private val name: String?, - private val amount: Long?, - private val currency: String?, - private val preTax: Boolean?, - private val type: BenefitType?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonProperty("amount") private val amount: Long?, + @JsonProperty("currency") private val currency: String?, + @JsonProperty("pre_tax") private val preTax: Boolean?, + @JsonProperty("type") private val type: BenefitType?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The deduction name from the pay statement. */ @@ -816,28 +808,25 @@ constructor( } /** The deduction name from the pay statement. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } /** The deduction amount in cents. */ - @JsonProperty("amount") fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long) = apply { this.amount = amount } /** The deduction currency. */ - @JsonProperty("currency") fun currency(currency: String) = apply { this.currency = currency } /** Boolean indicating if the deduction is pre-tax. */ - @JsonProperty("pre_tax") fun preTax(preTax: Boolean) = apply { this.preTax = preTax } /** Type of benefit. */ - @JsonProperty("type") fun type(type: BenefitType) = apply { this.type = type } + fun type(type: BenefitType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -884,15 +873,16 @@ constructor( "EmployeeDeduction{name=$name, amount=$amount, currency=$currency, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } - @JsonDeserialize(builder = EmployerContribution.Builder::class) @NoAutoDetect class EmployerContribution + @JsonCreator private constructor( - private val name: String?, - private val amount: Long?, - private val currency: String?, - private val type: BenefitType?, - private val additionalProperties: Map, + @JsonProperty("name") private val name: String?, + @JsonProperty("amount") private val amount: Long?, + @JsonProperty("currency") private val currency: String?, + @JsonProperty("type") private val type: BenefitType?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The contribution name from the pay statement. */ @@ -937,24 +927,22 @@ constructor( } /** The contribution name from the pay statement. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } /** The contribution amount in cents. */ - @JsonProperty("amount") fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long) = apply { this.amount = amount } /** The contribution currency. */ - @JsonProperty("currency") fun currency(currency: String) = apply { this.currency = currency } /** Type of benefit. */ - @JsonProperty("type") fun type(type: BenefitType) = apply { this.type = type } + fun type(type: BenefitType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -1057,16 +1045,17 @@ constructor( override fun toString() = value.toString() } - @JsonDeserialize(builder = Tax.Builder::class) @NoAutoDetect class Tax + @JsonCreator private constructor( - private val type: Type?, - private val name: String?, - private val employer: Boolean?, - private val amount: Long?, - private val currency: String?, - private val additionalProperties: Map, + @JsonProperty("type") private val type: Type?, + @JsonProperty("name") private val name: String?, + @JsonProperty("employer") private val employer: Boolean?, + @JsonProperty("amount") private val amount: Long?, + @JsonProperty("currency") private val currency: String?, + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** The type of taxes. */ @@ -1117,20 +1106,18 @@ constructor( } /** The type of taxes. */ - @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { this.type = type } /** The exact name of tax from the pay statement. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + fun name(name: String) = apply { this.name = name } /** `true` if the amount is paid by the employers. */ - @JsonProperty("employer") fun employer(employer: Boolean) = apply { this.employer = employer } /** The tax amount in cents. */ - @JsonProperty("amount") fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long) = apply { this.amount = amount } /** The currency code. */ - @JsonProperty("currency") fun currency(currency: String) = apply { this.currency = currency } fun additionalProperties(additionalProperties: Map) = apply { @@ -1138,7 +1125,6 @@ constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt index e0592eef..8fa01679 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt @@ -4,23 +4,28 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = SessionNewResponse.Builder::class) @NoAutoDetect class SessionNewResponse +@JsonCreator private constructor( - private val sessionId: JsonField, - private val connectUrl: JsonField, - private val additionalProperties: Map, + @JsonProperty("session_id") + @ExcludeMissing + private val sessionId: JsonField = JsonMissing.of(), + @JsonProperty("connect_url") + @ExcludeMissing + private val connectUrl: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The unique identifier for the created connect session */ @@ -73,16 +78,12 @@ private constructor( fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) /** The unique identifier for the created connect session */ - @JsonProperty("session_id") - @ExcludeMissing fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } /** The Connect URL to redirect the user to for authentication */ fun connectUrl(connectUrl: String) = connectUrl(JsonField.of(connectUrl)) /** The Connect URL to redirect the user to for authentication */ - @JsonProperty("connect_url") - @ExcludeMissing fun connectUrl(connectUrl: JsonField) = apply { this.connectUrl = connectUrl } fun additionalProperties(additionalProperties: Map) = apply { @@ -90,7 +91,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt index 49d2510e..2c997ca8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt @@ -4,23 +4,28 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = SessionReauthenticateResponse.Builder::class) @NoAutoDetect class SessionReauthenticateResponse +@JsonCreator private constructor( - private val sessionId: JsonField, - private val connectUrl: JsonField, - private val additionalProperties: Map, + @JsonProperty("session_id") + @ExcludeMissing + private val sessionId: JsonField = JsonMissing.of(), + @JsonProperty("connect_url") + @ExcludeMissing + private val connectUrl: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The unique identifier for the created connect session */ @@ -73,16 +78,12 @@ private constructor( fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) /** The unique identifier for the created connect session */ - @JsonProperty("session_id") - @ExcludeMissing fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } /** The Connect URL to redirect the user to for reauthentication */ fun connectUrl(connectUrl: String) = connectUrl(JsonField.of(connectUrl)) /** The Connect URL to redirect the user to for reauthentication */ - @JsonProperty("connect_url") - @ExcludeMissing fun connectUrl(connectUrl: JsonField) = apply { this.connectUrl = connectUrl } fun additionalProperties(additionalProperties: Map) = apply { @@ -90,7 +91,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt index eb344a52..7cb4d5fa 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportPerBenefitType.kt @@ -4,24 +4,29 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = SupportPerBenefitType.Builder::class) @NoAutoDetect class SupportPerBenefitType +@JsonCreator private constructor( - private val companyBenefits: JsonField, - private val individualBenefits: JsonField, - private val additionalProperties: Map, + @JsonProperty("company_benefits") + @ExcludeMissing + private val companyBenefits: JsonField = JsonMissing.of(), + @JsonProperty("individual_benefits") + @ExcludeMissing + private val individualBenefits: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun companyBenefits(): Optional = @@ -73,8 +78,6 @@ private constructor( fun companyBenefits(companyBenefits: OperationSupportMatrix) = companyBenefits(JsonField.of(companyBenefits)) - @JsonProperty("company_benefits") - @ExcludeMissing fun companyBenefits(companyBenefits: JsonField) = apply { this.companyBenefits = companyBenefits } @@ -82,8 +85,6 @@ private constructor( fun individualBenefits(individualBenefits: OperationSupportMatrix) = individualBenefits(JsonField.of(individualBenefits)) - @JsonProperty("individual_benefits") - @ExcludeMissing fun individualBenefits(individualBenefits: JsonField) = apply { this.individualBenefits = individualBenefits } @@ -93,7 +94,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt index 9ace9456..1f6817c4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt @@ -6,31 +6,47 @@ 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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = SupportedBenefit.Builder::class) @NoAutoDetect class SupportedBenefit +@JsonCreator private constructor( - private val type: JsonField, - private val description: JsonField, - private val frequencies: JsonField>, - private val employeeDeduction: JsonField>, - private val companyContribution: JsonField>, - private val annualMaximum: JsonField, - private val catchUp: JsonField, - private val hsaContributionLimit: JsonField>, - private val additionalProperties: Map, + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + private val description: JsonField = JsonMissing.of(), + @JsonProperty("frequencies") + @ExcludeMissing + private val frequencies: JsonField> = JsonMissing.of(), + @JsonProperty("employee_deduction") + @ExcludeMissing + private val employeeDeduction: JsonField> = JsonMissing.of(), + @JsonProperty("company_contribution") + @ExcludeMissing + private val companyContribution: JsonField> = JsonMissing.of(), + @JsonProperty("annual_maximum") + @ExcludeMissing + private val annualMaximum: JsonField = JsonMissing.of(), + @JsonProperty("catch_up") + @ExcludeMissing + private val catchUp: JsonField = JsonMissing.of(), + @JsonProperty("hsa_contribution_limit") + @ExcludeMissing + private val hsaContributionLimit: JsonField> = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Type of benefit. */ @@ -157,14 +173,10 @@ private constructor( fun type(type: BenefitType) = type(JsonField.of(type)) /** Type of benefit. */ - @JsonProperty("type") - @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("description") - @ExcludeMissing fun description(description: JsonField) = apply { this.description = description } /** The list of frequencies supported by the provider for this benefit */ @@ -172,8 +184,6 @@ private constructor( frequencies(JsonField.of(frequencies)) /** The list of frequencies supported by the provider for this benefit */ - @JsonProperty("frequencies") - @ExcludeMissing fun frequencies(frequencies: JsonField>) = apply { this.frequencies = frequencies } @@ -183,8 +193,6 @@ private constructor( employeeDeduction(JsonField.of(employeeDeduction)) /** Supported deduction types. An empty array indicates deductions are not supported. */ - @JsonProperty("employee_deduction") - @ExcludeMissing fun employeeDeduction(employeeDeduction: JsonField>) = apply { this.employeeDeduction = employeeDeduction } @@ -198,8 +206,6 @@ private constructor( /** * Supported contribution types. An empty array indicates contributions are not supported. */ - @JsonProperty("company_contribution") - @ExcludeMissing fun companyContribution(companyContribution: JsonField>) = apply { this.companyContribution = companyContribution @@ -209,8 +215,6 @@ private constructor( fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) /** Whether the provider supports an annual maximum for this benefit. */ - @JsonProperty("annual_maximum") - @ExcludeMissing fun annualMaximum(annualMaximum: JsonField) = apply { this.annualMaximum = annualMaximum } @@ -225,8 +229,6 @@ private constructor( * Whether the provider supports catch up for this benefit. This field will only be true for * retirement benefits. */ - @JsonProperty("catch_up") - @ExcludeMissing fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } /** @@ -240,8 +242,6 @@ private constructor( * Whether the provider supports HSA contribution limits. Empty if this feature is not * supported for the benefit. This array only has values for HSA benefits. */ - @JsonProperty("hsa_contribution_limit") - @ExcludeMissing fun hsaContributionLimit(hsaContributionLimit: JsonField>) = apply { this.hsaContributionLimit = hsaContributionLimit @@ -252,7 +252,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt index 3d22a753..d28fc407 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt @@ -4,25 +4,28 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects import java.util.Optional -@JsonDeserialize(builder = UnenrolledIndividual.Builder::class) @NoAutoDetect class UnenrolledIndividual +@JsonCreator private constructor( - private val individualId: JsonField, - private val code: JsonField, - private val body: JsonField, - private val additionalProperties: Map, + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun individualId(): Optional = @@ -79,8 +82,6 @@ private constructor( fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - @JsonProperty("individual_id") - @ExcludeMissing fun individualId(individualId: JsonField) = apply { this.individualId = individualId } @@ -89,14 +90,10 @@ private constructor( fun code(code: Long) = code(JsonField.of(code)) /** HTTP status code */ - @JsonProperty("code") - @ExcludeMissing fun code(code: JsonField) = apply { this.code = code } fun body(body: Body) = body(JsonField.of(body)) - @JsonProperty("body") - @ExcludeMissing fun body(body: JsonField) = apply { this.body = body } fun additionalProperties(additionalProperties: Map) = apply { @@ -104,7 +101,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } @@ -128,14 +124,21 @@ private constructor( ) } - @JsonDeserialize(builder = Body.Builder::class) @NoAutoDetect class Body + @JsonCreator private constructor( - private val name: JsonField, - private val finchCode: JsonField, - private val message: JsonField, - private val additionalProperties: Map, + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("finch_code") + @ExcludeMissing + private val finchCode: JsonField = JsonMissing.of(), + @JsonProperty("message") + @ExcludeMissing + private val message: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), ) { /** Identifier indicating whether the benefit was newly enrolled or updated. */ @@ -197,24 +200,18 @@ private constructor( fun name(name: String) = name(JsonField.of(name)) /** Identifier indicating whether the benefit was newly enrolled or updated. */ - @JsonProperty("name") - @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** A descriptive identifier for the response. */ fun finchCode(finchCode: String) = finchCode(JsonField.of(finchCode)) /** A descriptive identifier for the response. */ - @JsonProperty("finch_code") - @ExcludeMissing fun finchCode(finchCode: JsonField) = apply { this.finchCode = finchCode } /** Short description in English that provides more information about the response. */ fun message(message: String) = message(JsonField.of(message)) /** Short description in English that provides more information about the response. */ - @JsonProperty("message") - @ExcludeMissing fun message(message: JsonField) = apply { this.message = message } fun additionalProperties(additionalProperties: Map) = apply { @@ -222,7 +219,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt index 0007a4e2..c039218a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UpdateCompanyBenefitResponse.kt @@ -4,22 +4,25 @@ 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.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.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects -@JsonDeserialize(builder = UpdateCompanyBenefitResponse.Builder::class) @NoAutoDetect class UpdateCompanyBenefitResponse +@JsonCreator private constructor( - private val benefitId: JsonField, - private val additionalProperties: Map, + @JsonProperty("benefit_id") + @ExcludeMissing + private val benefitId: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun benefitId(): String = benefitId.getRequired("benefit_id") @@ -59,8 +62,6 @@ private constructor( fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId)) - @JsonProperty("benefit_id") - @ExcludeMissing fun benefitId(benefitId: JsonField) = apply { this.benefitId = benefitId } fun additionalProperties(additionalProperties: Map) = apply { @@ -68,7 +69,6 @@ private constructor( putAllAdditionalProperties(additionalProperties) } - @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { additionalProperties.put(key, value) } From 720b4664e700de2ddc5438a6ef3b0b9a4e882b32 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:38:11 +0000 Subject: [PATCH 3/7] chore(internal): codegen related update (#374) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 1dac0f68..eee60015 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Finch + Copyright 2025 Finch Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From e61b257b31e6824ceabe52c3d01e97a76ea7d0b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 05:31:23 +0000 Subject: [PATCH 4/7] chore(internal): codegen related update (#376) --- .../api/models/AccessTokenCreateParams.kt | 75 ++---- .../api/models/AccountDisconnectParams.kt | 5 +- .../api/models/ConnectSessionNewParams.kt | 136 +++------- .../ConnectSessionReauthenticateParams.kt | 99 +++---- .../api/models/HrisBenefitCreateParams.kt | 69 ++--- ...fitIndividualRetrieveManyBenefitsParams.kt | 4 + ...HrisBenefitIndividualUnenrollManyParams.kt | 61 ++--- .../api/models/HrisBenefitUpdateParams.kt | 44 ++- .../HrisDirectoryListIndividualsParams.kt | 2 + .../api/models/HrisDirectoryListParams.kt | 2 + .../HrisEmploymentRetrieveManyParams.kt | 61 ++--- .../HrisIndividualRetrieveManyParams.kt | 80 +++--- .../HrisPayStatementRetrieveManyParams.kt | 61 ++--- .../api/models/HrisPaymentListParams.kt | 2 + .../api/models/JobAutomatedCreateParams.kt | 33 +-- .../api/models/JobAutomatedListParams.kt | 2 + .../api/models/PayrollPayGroupListParams.kt | 14 +- .../models/RequestForwardingForwardParams.kt | 114 ++++---- .../api/models/SandboxCompanyUpdateParams.kt | 163 +++++------ .../SandboxConnectionAccountCreateParams.kt | 101 +++---- .../SandboxConnectionAccountUpdateParams.kt | 44 ++- .../models/SandboxConnectionCreateParams.kt | 97 +++---- .../models/SandboxDirectoryCreateParams.kt | 122 +++------ .../models/SandboxEmploymentUpdateParams.kt | 255 +++++++----------- .../models/SandboxIndividualUpdateParams.kt | 189 +++++-------- .../SandboxJobConfigurationUpdateParams.kt | 56 ++-- .../api/models/SandboxJobCreateParams.kt | 44 ++- .../api/models/SandboxPaymentCreateParams.kt | 113 ++++---- 28 files changed, 805 insertions(+), 1243 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt index 7053a2db..205a5396 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt @@ -18,39 +18,26 @@ import java.util.Optional class AccessTokenCreateParams constructor( - private val code: String, - private val clientId: String?, - private val clientSecret: String?, - private val redirectUri: String?, + private val body: AccessTokenCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun code(): String = code + fun code(): String = body.code() - fun clientId(): Optional = Optional.ofNullable(clientId) + fun clientId(): Optional = body.clientId() - fun clientSecret(): Optional = Optional.ofNullable(clientSecret) + fun clientSecret(): Optional = body.clientSecret() - fun redirectUri(): Optional = Optional.ofNullable(redirectUri) + fun redirectUri(): Optional = body.redirectUri() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): AccessTokenCreateBody { - return AccessTokenCreateBody( - code, - clientId, - clientSecret, - redirectUri, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): AccessTokenCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -171,33 +158,24 @@ constructor( @NoAutoDetect class Builder { - private var code: String? = null - private var clientId: String? = null - private var clientSecret: String? = null - private var redirectUri: String? = null + private var body: AccessTokenCreateBody.Builder = AccessTokenCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accessTokenCreateParams: AccessTokenCreateParams) = apply { - code = accessTokenCreateParams.code - clientId = accessTokenCreateParams.clientId - clientSecret = accessTokenCreateParams.clientSecret - redirectUri = accessTokenCreateParams.redirectUri + body = accessTokenCreateParams.body.toBuilder() additionalHeaders = accessTokenCreateParams.additionalHeaders.toBuilder() additionalQueryParams = accessTokenCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - accessTokenCreateParams.additionalBodyProperties.toMutableMap() } - fun code(code: String) = apply { this.code = code } + fun code(code: String) = apply { body.code(code) } - fun clientId(clientId: String) = apply { this.clientId = clientId } + fun clientId(clientId: String) = apply { body.clientId(clientId) } - fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret } + fun clientSecret(clientSecret: String) = apply { body.clientSecret(clientSecret) } - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -298,36 +276,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): AccessTokenCreateParams = AccessTokenCreateParams( - checkNotNull(code) { "`code` is required but was not set" }, - clientId, - clientSecret, - redirectUri, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -336,11 +307,11 @@ constructor( return true } - return /* spotless:off */ other is AccessTokenCreateParams && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is AccessTokenCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(code, clientId, clientSecret, redirectUri, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "AccessTokenCreateParams{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "AccessTokenCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt index e88964ff..39fb907d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt @@ -24,9 +24,8 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> { - return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - } + internal fun getBody(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index 86c342ae..ce330248 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt @@ -21,59 +21,37 @@ import java.util.Optional class ConnectSessionNewParams constructor( - private val customerId: String, - private val customerName: String, - private val products: List, - private val customerEmail: String?, - private val integration: Integration?, - private val manual: Boolean?, - private val minutesToExpire: Double?, - private val redirectUri: String?, - private val sandbox: Sandbox?, + private val body: ConnectSessionNewBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun customerId(): String = customerId + fun customerId(): String = body.customerId() - fun customerName(): String = customerName + fun customerName(): String = body.customerName() - fun products(): List = products + fun products(): List = body.products() - fun customerEmail(): Optional = Optional.ofNullable(customerEmail) + fun customerEmail(): Optional = body.customerEmail() - fun integration(): Optional = Optional.ofNullable(integration) + fun integration(): Optional = body.integration() - fun manual(): Optional = Optional.ofNullable(manual) + fun manual(): Optional = body.manual() - fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire) + /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + fun minutesToExpire(): Optional = body.minutesToExpire() - fun redirectUri(): Optional = Optional.ofNullable(redirectUri) + fun redirectUri(): Optional = body.redirectUri() - fun sandbox(): Optional = Optional.ofNullable(sandbox) + fun sandbox(): Optional = body.sandbox() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): ConnectSessionNewBody { - return ConnectSessionNewBody( - customerId, - customerName, - products, - customerEmail, - integration, - manual, - minutesToExpire, - redirectUri, - sandbox, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): ConnectSessionNewBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -136,7 +114,7 @@ constructor( private var customerId: String? = null private var customerName: String? = null - private var products: List? = null + private var products: MutableList? = null private var customerEmail: String? = null private var integration: Integration? = null private var manual: Boolean? = null @@ -163,7 +141,13 @@ constructor( fun customerName(customerName: String) = apply { this.customerName = customerName } - fun products(products: List) = apply { this.products = products } + fun products(products: List) = apply { + this.products = products.toMutableList() + } + + fun addProduct(product: ConnectProducts) = apply { + products = (products ?: mutableListOf()).apply { add(product) } + } fun customerEmail(customerEmail: String) = apply { this.customerEmail = customerEmail } @@ -246,63 +230,41 @@ constructor( @NoAutoDetect class Builder { - private var customerId: String? = null - private var customerName: String? = null - private var products: MutableList = mutableListOf() - private var customerEmail: String? = null - private var integration: Integration? = null - private var manual: Boolean? = null - private var minutesToExpire: Double? = null - private var redirectUri: String? = null - private var sandbox: Sandbox? = null + private var body: ConnectSessionNewBody.Builder = ConnectSessionNewBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(connectSessionNewParams: ConnectSessionNewParams) = apply { - customerId = connectSessionNewParams.customerId - customerName = connectSessionNewParams.customerName - products = connectSessionNewParams.products.toMutableList() - customerEmail = connectSessionNewParams.customerEmail - integration = connectSessionNewParams.integration - manual = connectSessionNewParams.manual - minutesToExpire = connectSessionNewParams.minutesToExpire - redirectUri = connectSessionNewParams.redirectUri - sandbox = connectSessionNewParams.sandbox + body = connectSessionNewParams.body.toBuilder() additionalHeaders = connectSessionNewParams.additionalHeaders.toBuilder() additionalQueryParams = connectSessionNewParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - connectSessionNewParams.additionalBodyProperties.toMutableMap() } - fun customerId(customerId: String) = apply { this.customerId = customerId } + fun customerId(customerId: String) = apply { body.customerId(customerId) } - fun customerName(customerName: String) = apply { this.customerName = customerName } + fun customerName(customerName: String) = apply { body.customerName(customerName) } - fun products(products: List) = apply { - this.products.clear() - this.products.addAll(products) - } + fun products(products: List) = apply { body.products(products) } - fun addProduct(product: ConnectProducts) = apply { this.products.add(product) } + fun addProduct(product: ConnectProducts) = apply { body.addProduct(product) } - fun customerEmail(customerEmail: String) = apply { this.customerEmail = customerEmail } + fun customerEmail(customerEmail: String) = apply { body.customerEmail(customerEmail) } - fun integration(integration: Integration) = apply { this.integration = integration } + fun integration(integration: Integration) = apply { body.integration(integration) } - fun manual(manual: Boolean) = apply { this.manual = manual } + fun manual(manual: Boolean) = apply { body.manual(manual) } /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ fun minutesToExpire(minutesToExpire: Double) = apply { - this.minutesToExpire = minutesToExpire + body.minutesToExpire(minutesToExpire) } - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } - fun sandbox(sandbox: Sandbox) = apply { this.sandbox = sandbox } + fun sandbox(sandbox: Sandbox) = apply { body.sandbox(sandbox) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -403,41 +365,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): ConnectSessionNewParams = ConnectSessionNewParams( - checkNotNull(customerId) { "`customerId` is required but was not set" }, - checkNotNull(customerName) { "`customerName` is required but was not set" }, - products.toImmutable(), - customerEmail, - integration, - manual, - minutesToExpire, - redirectUri, - sandbox, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -753,11 +703,11 @@ constructor( return true } - return /* spotless:off */ other is ConnectSessionNewParams && customerId == other.customerId && customerName == other.customerName && products == other.products && customerEmail == other.customerEmail && integration == other.integration && manual == other.manual && minutesToExpire == other.minutesToExpire && redirectUri == other.redirectUri && sandbox == other.sandbox && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ConnectSessionNewParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(customerId, customerName, products, customerEmail, integration, manual, minutesToExpire, redirectUri, sandbox, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "ConnectSessionNewParams{customerId=$customerId, customerName=$customerName, products=$products, customerEmail=$customerEmail, integration=$integration, manual=$manual, minutesToExpire=$minutesToExpire, redirectUri=$redirectUri, sandbox=$sandbox, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "ConnectSessionNewParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index f94b5f64..86b01e4e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt @@ -21,39 +21,30 @@ import java.util.Optional class ConnectSessionReauthenticateParams constructor( - private val connectionId: String, - private val minutesToExpire: Long?, - private val products: List?, - private val redirectUri: String?, + private val body: ConnectSessionReauthenticateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun connectionId(): String = connectionId + /** The ID of the existing connection to reauthenticate */ + fun connectionId(): String = body.connectionId() - fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire) + /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + fun minutesToExpire(): Optional = body.minutesToExpire() - fun products(): Optional> = Optional.ofNullable(products) + /** The products to request access to (optional for reauthentication) */ + fun products(): Optional> = body.products() - fun redirectUri(): Optional = Optional.ofNullable(redirectUri) + /** The URI to redirect to after the Connect flow is completed */ + fun redirectUri(): Optional = body.redirectUri() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): ConnectSessionReauthenticateBody { - return ConnectSessionReauthenticateBody( - connectionId, - minutesToExpire, - products, - redirectUri, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): ConnectSessionReauthenticateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -103,7 +94,7 @@ constructor( private var connectionId: String? = null private var minutesToExpire: Long? = null - private var products: List? = null + private var products: MutableList? = null private var redirectUri: String? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -130,7 +121,14 @@ constructor( } /** The products to request access to (optional for reauthentication) */ - fun products(products: List) = apply { this.products = products } + fun products(products: List) = apply { + this.products = products.toMutableList() + } + + /** The products to request access to (optional for reauthentication) */ + fun addProduct(product: ConnectProducts) = apply { + products = (products ?: mutableListOf()).apply { add(product) } + } /** The URI to redirect to after the Connect flow is completed */ fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } @@ -192,50 +190,36 @@ constructor( @NoAutoDetect class Builder { - private var connectionId: String? = null - private var minutesToExpire: Long? = null - private var products: MutableList = mutableListOf() - private var redirectUri: String? = null + private var body: ConnectSessionReauthenticateBody.Builder = + ConnectSessionReauthenticateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(connectSessionReauthenticateParams: ConnectSessionReauthenticateParams) = apply { - connectionId = connectSessionReauthenticateParams.connectionId - minutesToExpire = connectSessionReauthenticateParams.minutesToExpire - products = - connectSessionReauthenticateParams.products?.toMutableList() ?: mutableListOf() - redirectUri = connectSessionReauthenticateParams.redirectUri + body = connectSessionReauthenticateParams.body.toBuilder() additionalHeaders = connectSessionReauthenticateParams.additionalHeaders.toBuilder() additionalQueryParams = connectSessionReauthenticateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - connectSessionReauthenticateParams.additionalBodyProperties.toMutableMap() } /** The ID of the existing connection to reauthenticate */ - fun connectionId(connectionId: String) = apply { this.connectionId = connectionId } + fun connectionId(connectionId: String) = apply { body.connectionId(connectionId) } /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ - fun minutesToExpire(minutesToExpire: Long) = apply { - this.minutesToExpire = minutesToExpire - } + fun minutesToExpire(minutesToExpire: Long) = apply { body.minutesToExpire(minutesToExpire) } /** The products to request access to (optional for reauthentication) */ - fun products(products: List) = apply { - this.products.clear() - this.products.addAll(products) - } + fun products(products: List) = apply { body.products(products) } /** The products to request access to (optional for reauthentication) */ - fun addProduct(product: ConnectProducts) = apply { this.products.add(product) } + fun addProduct(product: ConnectProducts) = apply { body.addProduct(product) } /** The URI to redirect to after the Connect flow is completed */ - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -336,36 +320,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): ConnectSessionReauthenticateParams = ConnectSessionReauthenticateParams( - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, - minutesToExpire, - products.toImmutable().ifEmpty { null }, - redirectUri, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -467,11 +444,11 @@ constructor( return true } - return /* spotless:off */ other is ConnectSessionReauthenticateParams && connectionId == other.connectionId && minutesToExpire == other.minutesToExpire && products == other.products && redirectUri == other.redirectUri && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ConnectSessionReauthenticateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(connectionId, minutesToExpire, products, redirectUri, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "ConnectSessionReauthenticateParams{connectionId=$connectionId, minutesToExpire=$minutesToExpire, products=$products, redirectUri=$redirectUri, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "ConnectSessionReauthenticateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt index d5d7a5f5..94778244 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt @@ -18,35 +18,29 @@ import java.util.Optional class HrisBenefitCreateParams constructor( - private val description: String?, - private val frequency: BenefitFrequency?, - private val type: BenefitType?, + private val body: HrisBenefitCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun description(): Optional = Optional.ofNullable(description) + /** + * Name of the benefit as it appears in the provider and pay statements. Recommend limiting this + * to <30 characters due to limitations in specific providers (e.g. Justworks). + */ + fun description(): Optional = body.description() - fun frequency(): Optional = Optional.ofNullable(frequency) + fun frequency(): Optional = body.frequency() - fun type(): Optional = Optional.ofNullable(type) + /** Type of benefit. */ + fun type(): Optional = body.type() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisBenefitCreateBody { - return HrisBenefitCreateBody( - description, - frequency, - type, - additionalBodyProperties, - ) - } + @JvmSynthetic internal fun getBody(): HrisBenefitCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -170,34 +164,27 @@ constructor( @NoAutoDetect class Builder { - private var description: String? = null - private var frequency: BenefitFrequency? = null - private var type: BenefitType? = null + private var body: HrisBenefitCreateBody.Builder = HrisBenefitCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(hrisBenefitCreateParams: HrisBenefitCreateParams) = apply { - description = hrisBenefitCreateParams.description - frequency = hrisBenefitCreateParams.frequency - type = hrisBenefitCreateParams.type + body = hrisBenefitCreateParams.body.toBuilder() additionalHeaders = hrisBenefitCreateParams.additionalHeaders.toBuilder() additionalQueryParams = hrisBenefitCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisBenefitCreateParams.additionalBodyProperties.toMutableMap() } /** * Name of the benefit as it appears in the provider and pay statements. Recommend limiting * this to <30 characters due to limitations in specific providers (e.g. Justworks). */ - fun description(description: String) = apply { this.description = description } + fun description(description: String) = apply { body.description(description) } - fun frequency(frequency: BenefitFrequency) = apply { this.frequency = frequency } + fun frequency(frequency: BenefitFrequency) = apply { body.frequency(frequency) } /** Type of benefit. */ - fun type(type: BenefitType) = apply { this.type = type } + fun type(type: BenefitType) = apply { body.type(type) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -298,35 +285,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisBenefitCreateParams = HrisBenefitCreateParams( - description, - frequency, - type, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -335,11 +316,11 @@ constructor( return true } - return /* spotless:off */ other is HrisBenefitCreateParams && description == other.description && frequency == other.frequency && type == other.type && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisBenefitCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(description, frequency, type, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisBenefitCreateParams{description=$description, frequency=$frequency, type=$type, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisBenefitCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt index b9d639fb..0f6dca6d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt @@ -18,6 +18,10 @@ constructor( fun benefitId(): String = benefitId + /** + * comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all + * individuals + */ fun individualIds(): Optional = Optional.ofNullable(individualIds) fun _additionalHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt index f01ebb86..0d55e642 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt @@ -19,26 +19,23 @@ import java.util.Optional class HrisBenefitIndividualUnenrollManyParams constructor( private val benefitId: String, - private val individualIds: List?, + private val body: HrisBenefitIndividualUnenrollManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { fun benefitId(): String = benefitId - fun individualIds(): Optional> = Optional.ofNullable(individualIds) + /** Array of individual_ids to unenroll. */ + fun individualIds(): Optional> = body.individualIds() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisBenefitIndividualUnenrollManyBody { - return HrisBenefitIndividualUnenrollManyBody(individualIds, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): HrisBenefitIndividualUnenrollManyBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -77,7 +74,7 @@ constructor( class Builder { - private var individualIds: List? = null + private var individualIds: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -91,7 +88,12 @@ constructor( /** Array of individual_ids to unenroll. */ fun individualIds(individualIds: List) = apply { - this.individualIds = individualIds + this.individualIds = individualIds.toMutableList() + } + + /** Array of individual_ids to unenroll. */ + fun addIndividualId(individualId: String) = apply { + individualIds = (individualIds ?: mutableListOf()).apply { add(individualId) } } fun additionalProperties(additionalProperties: Map) = apply { @@ -149,37 +151,30 @@ constructor( class Builder { private var benefitId: String? = null - private var individualIds: MutableList = mutableListOf() + private var body: HrisBenefitIndividualUnenrollManyBody.Builder = + HrisBenefitIndividualUnenrollManyBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( hrisBenefitIndividualUnenrollManyParams: HrisBenefitIndividualUnenrollManyParams ) = apply { benefitId = hrisBenefitIndividualUnenrollManyParams.benefitId - individualIds = - hrisBenefitIndividualUnenrollManyParams.individualIds?.toMutableList() - ?: mutableListOf() + body = hrisBenefitIndividualUnenrollManyParams.body.toBuilder() additionalHeaders = hrisBenefitIndividualUnenrollManyParams.additionalHeaders.toBuilder() additionalQueryParams = hrisBenefitIndividualUnenrollManyParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisBenefitIndividualUnenrollManyParams.additionalBodyProperties.toMutableMap() } fun benefitId(benefitId: String) = apply { this.benefitId = benefitId } /** Array of individual_ids to unenroll. */ - fun individualIds(individualIds: List) = apply { - this.individualIds.clear() - this.individualIds.addAll(individualIds) - } + fun individualIds(individualIds: List) = apply { body.individualIds(individualIds) } /** Array of individual_ids to unenroll. */ - fun addIndividualId(individualId: String) = apply { this.individualIds.add(individualId) } + fun addIndividualId(individualId: String) = apply { body.addIndividualId(individualId) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -280,34 +275,30 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisBenefitIndividualUnenrollManyParams = HrisBenefitIndividualUnenrollManyParams( checkNotNull(benefitId) { "`benefitId` is required but was not set" }, - individualIds.toImmutable().ifEmpty { null }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -316,11 +307,11 @@ constructor( return true } - return /* spotless:off */ other is HrisBenefitIndividualUnenrollManyParams && benefitId == other.benefitId && individualIds == other.individualIds && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisBenefitIndividualUnenrollManyParams && benefitId == other.benefitId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(benefitId, individualIds, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(benefitId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisBenefitIndividualUnenrollManyParams{benefitId=$benefitId, individualIds=$individualIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisBenefitIndividualUnenrollManyParams{benefitId=$benefitId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt index 1de70a78..7d539159 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt @@ -19,26 +19,23 @@ import java.util.Optional class HrisBenefitUpdateParams constructor( private val benefitId: String, - private val description: String?, + private val body: HrisBenefitUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { fun benefitId(): String = benefitId - fun description(): Optional = Optional.ofNullable(description) + /** Updated name or description. */ + fun description(): Optional = body.description() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisBenefitUpdateBody { - return HrisBenefitUpdateBody(description, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): HrisBenefitUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -141,25 +138,22 @@ constructor( class Builder { private var benefitId: String? = null - private var description: String? = null + private var body: HrisBenefitUpdateBody.Builder = HrisBenefitUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(hrisBenefitUpdateParams: HrisBenefitUpdateParams) = apply { benefitId = hrisBenefitUpdateParams.benefitId - description = hrisBenefitUpdateParams.description + body = hrisBenefitUpdateParams.body.toBuilder() additionalHeaders = hrisBenefitUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = hrisBenefitUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisBenefitUpdateParams.additionalBodyProperties.toMutableMap() } fun benefitId(benefitId: String) = apply { this.benefitId = benefitId } /** Updated name or description. */ - fun description(description: String) = apply { this.description = description } + fun description(description: String) = apply { body.description(description) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -260,34 +254,30 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisBenefitUpdateParams = HrisBenefitUpdateParams( checkNotNull(benefitId) { "`benefitId` is required but was not set" }, - description, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -296,11 +286,11 @@ constructor( return true } - return /* spotless:off */ other is HrisBenefitUpdateParams && benefitId == other.benefitId && description == other.description && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisBenefitUpdateParams && benefitId == other.benefitId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(benefitId, description, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(benefitId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisBenefitUpdateParams{benefitId=$benefitId, description=$description, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisBenefitUpdateParams{benefitId=$benefitId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt index 2c09b00e..28c88877 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt @@ -16,8 +16,10 @@ constructor( private val additionalQueryParams: QueryParams, ) { + /** Number of employees to return (defaults to all) */ fun limit(): Optional = Optional.ofNullable(limit) + /** Index to start from (defaults to 0) */ fun offset(): Optional = Optional.ofNullable(offset) fun _additionalHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt index ffc4b4bd..a6534671 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt @@ -16,8 +16,10 @@ constructor( private val additionalQueryParams: QueryParams, ) { + /** Number of employees to return (defaults to all) */ fun limit(): Optional = Optional.ofNullable(limit) + /** Index to start from (defaults to 0) */ fun offset(): Optional = Optional.ofNullable(offset) fun _additionalHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt index 623c3cae..16e6ac00 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt @@ -17,24 +17,21 @@ import java.util.Objects class HrisEmploymentRetrieveManyParams constructor( - private val requests: List, + private val body: HrisEmploymentRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun requests(): List = requests + /** The array of batch requests. */ + fun requests(): List = body.requests() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisEmploymentRetrieveManyBody { - return HrisEmploymentRetrieveManyBody(requests, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): HrisEmploymentRetrieveManyBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -66,7 +63,7 @@ constructor( class Builder { - private var requests: List? = null + private var requests: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -78,7 +75,14 @@ constructor( } /** The array of batch requests. */ - fun requests(requests: List) = apply { this.requests = requests } + fun requests(requests: List) = apply { + this.requests = requests.toMutableList() + } + + /** The array of batch requests. */ + fun addRequest(request: Request) = apply { + requests = (requests ?: mutableListOf()).apply { add(request) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -135,30 +139,25 @@ constructor( @NoAutoDetect class Builder { - private var requests: MutableList = mutableListOf() + private var body: HrisEmploymentRetrieveManyBody.Builder = + HrisEmploymentRetrieveManyBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(hrisEmploymentRetrieveManyParams: HrisEmploymentRetrieveManyParams) = apply { - requests = hrisEmploymentRetrieveManyParams.requests.toMutableList() + body = hrisEmploymentRetrieveManyParams.body.toBuilder() additionalHeaders = hrisEmploymentRetrieveManyParams.additionalHeaders.toBuilder() additionalQueryParams = hrisEmploymentRetrieveManyParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisEmploymentRetrieveManyParams.additionalBodyProperties.toMutableMap() } /** The array of batch requests. */ - fun requests(requests: List) = apply { - this.requests.clear() - this.requests.addAll(requests) - } + fun requests(requests: List) = apply { body.requests(requests) } /** The array of batch requests. */ - fun addRequest(request: Request) = apply { this.requests.add(request) } + fun addRequest(request: Request) = apply { body.addRequest(request) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -259,33 +258,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisEmploymentRetrieveManyParams = HrisEmploymentRetrieveManyParams( - requests.toImmutable(), + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -383,11 +378,11 @@ constructor( return true } - return /* spotless:off */ other is HrisEmploymentRetrieveManyParams && requests == other.requests && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisEmploymentRetrieveManyParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requests, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisEmploymentRetrieveManyParams{requests=$requests, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisEmploymentRetrieveManyParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt index 9dbe94f2..b03acaa9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt @@ -18,31 +18,22 @@ import java.util.Optional class HrisIndividualRetrieveManyParams constructor( - private val options: Options?, - private val requests: List?, + private val body: HrisIndividualRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun options(): Optional = Optional.ofNullable(options) + fun options(): Optional = body.options() - fun requests(): Optional> = Optional.ofNullable(requests) + fun requests(): Optional> = body.requests() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisIndividualRetrieveManyBody { - return HrisIndividualRetrieveManyBody( - options, - requests, - additionalBodyProperties, - ) - } + @JvmSynthetic internal fun getBody(): HrisIndividualRetrieveManyBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -77,7 +68,7 @@ constructor( class Builder { private var options: Options? = null - private var requests: List? = null + private var requests: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -91,7 +82,13 @@ constructor( fun options(options: Options) = apply { this.options = options } - fun requests(requests: List) = apply { this.requests = requests } + fun requests(requests: List) = apply { + this.requests = requests.toMutableList() + } + + fun addRequest(request: Request) = apply { + requests = (requests ?: mutableListOf()).apply { add(request) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -148,33 +145,25 @@ constructor( @NoAutoDetect class Builder { - private var options: Options? = null - private var requests: MutableList = mutableListOf() + private var body: HrisIndividualRetrieveManyBody.Builder = + HrisIndividualRetrieveManyBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(hrisIndividualRetrieveManyParams: HrisIndividualRetrieveManyParams) = apply { - options = hrisIndividualRetrieveManyParams.options - requests = - hrisIndividualRetrieveManyParams.requests?.toMutableList() ?: mutableListOf() + body = hrisIndividualRetrieveManyParams.body.toBuilder() additionalHeaders = hrisIndividualRetrieveManyParams.additionalHeaders.toBuilder() additionalQueryParams = hrisIndividualRetrieveManyParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisIndividualRetrieveManyParams.additionalBodyProperties.toMutableMap() } - fun options(options: Options) = apply { this.options = options } + fun options(options: Options) = apply { body.options(options) } - fun requests(requests: List) = apply { - this.requests.clear() - this.requests.addAll(requests) - } + fun requests(requests: List) = apply { body.requests(requests) } - fun addRequest(request: Request) = apply { this.requests.add(request) } + fun addRequest(request: Request) = apply { body.addRequest(request) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -275,34 +264,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisIndividualRetrieveManyParams = HrisIndividualRetrieveManyParams( - options, - requests.toImmutable().ifEmpty { null }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -331,7 +315,7 @@ constructor( class Builder { - private var include: List? = null + private var include: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -340,7 +324,11 @@ constructor( additionalProperties = options.additionalProperties.toMutableMap() } - fun include(include: List) = apply { this.include = include } + fun include(include: List) = apply { this.include = include.toMutableList() } + + fun addInclude(include: String) = apply { + this.include = (this.include ?: mutableListOf()).apply { add(include) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -464,11 +452,11 @@ constructor( return true } - return /* spotless:off */ other is HrisIndividualRetrieveManyParams && options == other.options && requests == other.requests && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisIndividualRetrieveManyParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(options, requests, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisIndividualRetrieveManyParams{options=$options, requests=$requests, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisIndividualRetrieveManyParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt index 934bc4ff..19df8ec7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt @@ -18,24 +18,21 @@ import java.util.Optional class HrisPayStatementRetrieveManyParams constructor( - private val requests: List, + private val body: HrisPayStatementRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun requests(): List = requests + /** The array of batch requests. */ + fun requests(): List = body.requests() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): HrisPayStatementRetrieveManyBody { - return HrisPayStatementRetrieveManyBody(requests, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): HrisPayStatementRetrieveManyBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -66,7 +63,7 @@ constructor( class Builder { - private var requests: List? = null + private var requests: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -78,7 +75,14 @@ constructor( } /** The array of batch requests. */ - fun requests(requests: List) = apply { this.requests = requests } + fun requests(requests: List) = apply { + this.requests = requests.toMutableList() + } + + /** The array of batch requests. */ + fun addRequest(request: Request) = apply { + requests = (requests ?: mutableListOf()).apply { add(request) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -135,30 +139,25 @@ constructor( @NoAutoDetect class Builder { - private var requests: MutableList = mutableListOf() + private var body: HrisPayStatementRetrieveManyBody.Builder = + HrisPayStatementRetrieveManyBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(hrisPayStatementRetrieveManyParams: HrisPayStatementRetrieveManyParams) = apply { - requests = hrisPayStatementRetrieveManyParams.requests.toMutableList() + body = hrisPayStatementRetrieveManyParams.body.toBuilder() additionalHeaders = hrisPayStatementRetrieveManyParams.additionalHeaders.toBuilder() additionalQueryParams = hrisPayStatementRetrieveManyParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - hrisPayStatementRetrieveManyParams.additionalBodyProperties.toMutableMap() } /** The array of batch requests. */ - fun requests(requests: List) = apply { - this.requests.clear() - this.requests.addAll(requests) - } + fun requests(requests: List) = apply { body.requests(requests) } /** The array of batch requests. */ - fun addRequest(request: Request) = apply { this.requests.add(request) } + fun addRequest(request: Request) = apply { body.addRequest(request) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -259,33 +258,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): HrisPayStatementRetrieveManyParams = HrisPayStatementRetrieveManyParams( - requests.toImmutable(), + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -395,11 +390,11 @@ constructor( return true } - return /* spotless:off */ other is HrisPayStatementRetrieveManyParams && requests == other.requests && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is HrisPayStatementRetrieveManyParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requests, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "HrisPayStatementRetrieveManyParams{requests=$requests, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "HrisPayStatementRetrieveManyParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt index 19dd3c8c..66d261fa 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt @@ -16,8 +16,10 @@ constructor( private val additionalQueryParams: QueryParams, ) { + /** The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. */ fun endDate(): LocalDate = endDate + /** The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. */ fun startDate(): LocalDate = startDate fun _additionalHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index 33c31d45..d7eadaff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt @@ -32,24 +32,20 @@ import kotlin.jvm.optionals.getOrNull class JobAutomatedCreateParams constructor( - private val dataSyncAll: DataSyncAll?, - private val w4FormEmployeeSync: W4FormEmployeeSync?, + private val body: JobAutomatedCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { - fun dataSyncAll(): Optional = Optional.ofNullable(dataSyncAll) + fun dataSyncAll(): Optional = body.dataSyncAll() - fun w4FormEmployeeSync(): Optional = Optional.ofNullable(w4FormEmployeeSync) + fun w4FormEmployeeSync(): Optional = body.w4FormEmployeeSync() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic - internal fun getBody(): JobAutomatedCreateBody { - return JobAutomatedCreateBody(dataSyncAll, w4FormEmployeeSync) - } + @JvmSynthetic internal fun getBody(): JobAutomatedCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -181,27 +177,23 @@ constructor( @NoAutoDetect class Builder { - private var dataSyncAll: DataSyncAll? = null - private var w4FormEmployeeSync: W4FormEmployeeSync? = null + private var body: JobAutomatedCreateBody? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(jobAutomatedCreateParams: JobAutomatedCreateParams) = apply { - dataSyncAll = jobAutomatedCreateParams.dataSyncAll - w4FormEmployeeSync = jobAutomatedCreateParams.w4FormEmployeeSync + body = jobAutomatedCreateParams.body additionalHeaders = jobAutomatedCreateParams.additionalHeaders.toBuilder() additionalQueryParams = jobAutomatedCreateParams.additionalQueryParams.toBuilder() } fun forDataSyncAll(dataSyncAll: DataSyncAll) = apply { - this.dataSyncAll = dataSyncAll - this.w4FormEmployeeSync = null + body = JobAutomatedCreateBody.ofDataSyncAll(dataSyncAll) } fun forW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - this.dataSyncAll = null - this.w4FormEmployeeSync = w4FormEmployeeSync + body = JobAutomatedCreateBody.ofW4FormEmployeeSync(w4FormEmployeeSync) } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -304,8 +296,7 @@ constructor( fun build(): JobAutomatedCreateParams = JobAutomatedCreateParams( - dataSyncAll, - w4FormEmployeeSync, + body ?: JobAutomatedCreateBody(), additionalHeaders.build(), additionalQueryParams.build(), ) @@ -590,11 +581,11 @@ constructor( return true } - return /* spotless:off */ other is JobAutomatedCreateParams && dataSyncAll == other.dataSyncAll && w4FormEmployeeSync == other.w4FormEmployeeSync && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is JobAutomatedCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(dataSyncAll, w4FormEmployeeSync, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "JobAutomatedCreateParams{dataSyncAll=$dataSyncAll, w4FormEmployeeSync=$w4FormEmployeeSync, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "JobAutomatedCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt index 3eb94cf4..16c7ca9c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt @@ -16,8 +16,10 @@ constructor( private val additionalQueryParams: QueryParams, ) { + /** Number of items to return */ fun limit(): Optional = Optional.ofNullable(limit) + /** Index to start from (defaults to 0) */ fun offset(): Optional = Optional.ofNullable(offset) fun _additionalHeaders(): Headers = additionalHeaders diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt index 96fa9258..6dc5bab6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt @@ -47,15 +47,14 @@ constructor( class Builder { private var individualId: String? = null - private var payFrequencies: MutableList = mutableListOf() + private var payFrequencies: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(payrollPayGroupListParams: PayrollPayGroupListParams) = apply { individualId = payrollPayGroupListParams.individualId - payFrequencies = - payrollPayGroupListParams.payFrequencies?.toMutableList() ?: mutableListOf() + payFrequencies = payrollPayGroupListParams.payFrequencies?.toMutableList() additionalHeaders = payrollPayGroupListParams.additionalHeaders.toBuilder() additionalQueryParams = payrollPayGroupListParams.additionalQueryParams.toBuilder() } @@ -63,11 +62,12 @@ constructor( fun individualId(individualId: String) = apply { this.individualId = individualId } fun payFrequencies(payFrequencies: List) = apply { - this.payFrequencies.clear() - this.payFrequencies.addAll(payFrequencies) + this.payFrequencies = payFrequencies.toMutableList() } - fun addPayFrequency(payFrequency: String) = apply { this.payFrequencies.add(payFrequency) } + fun addPayFrequency(payFrequency: String) = apply { + payFrequencies = (payFrequencies ?: mutableListOf()).apply { add(payFrequency) } + } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -170,7 +170,7 @@ constructor( fun build(): PayrollPayGroupListParams = PayrollPayGroupListParams( individualId, - payFrequencies.toImmutable().ifEmpty { null }, + payFrequencies?.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), ) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt index 9178ee6b..4b68239d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt @@ -18,43 +18,49 @@ import java.util.Optional class RequestForwardingForwardParams constructor( - private val method: String, - private val route: String, - private val data: String?, - private val headers: JsonValue?, - private val params: JsonValue?, + private val body: RequestForwardingForwardBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun method(): String = method - - fun route(): String = route - - fun data(): Optional = Optional.ofNullable(data) - - fun headers(): Optional = Optional.ofNullable(headers) - - fun params(): Optional = Optional.ofNullable(params) + /** + * The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , + * `DELETE` , and `PATCH`. + */ + fun method(): String = body.method() + + /** + * The URL route path for the forwarded request. This value must begin with a forward-slash ( / + * ) and may only contain alphanumeric characters, hyphens, and underscores. + */ + fun route(): String = body.route() + + /** + * The body for the forwarded request. This value must be specified as either a string or a + * valid JSON object. + */ + fun data(): Optional = body.data() + + /** + * The HTTP headers to include on the forwarded request. This value must be specified as an + * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": + * "v1" }` + */ + fun headers(): Optional = body.headers() + + /** + * The query parameters for the forwarded request. This value must be specified as a valid JSON + * object rather than a query string. + */ + fun params(): Optional = body.params() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): RequestForwardingForwardBody { - return RequestForwardingForwardBody( - method, - route, - data, - headers, - params, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): RequestForwardingForwardBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -226,58 +232,48 @@ constructor( @NoAutoDetect class Builder { - private var method: String? = null - private var route: String? = null - private var data: String? = null - private var headers: JsonValue? = null - private var params: JsonValue? = null + private var body: RequestForwardingForwardBody.Builder = + RequestForwardingForwardBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(requestForwardingForwardParams: RequestForwardingForwardParams) = apply { - method = requestForwardingForwardParams.method - route = requestForwardingForwardParams.route - data = requestForwardingForwardParams.data - headers = requestForwardingForwardParams.headers - params = requestForwardingForwardParams.params + body = requestForwardingForwardParams.body.toBuilder() additionalHeaders = requestForwardingForwardParams.additionalHeaders.toBuilder() additionalQueryParams = requestForwardingForwardParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - requestForwardingForwardParams.additionalBodyProperties.toMutableMap() } /** * The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , * `DELETE` , and `PATCH`. */ - fun method(method: String) = apply { this.method = method } + fun method(method: String) = apply { body.method(method) } /** * The URL route path for the forwarded request. This value must begin with a forward-slash * ( / ) and may only contain alphanumeric characters, hyphens, and underscores. */ - fun route(route: String) = apply { this.route = route } + fun route(route: String) = apply { body.route(route) } /** * The body for the forwarded request. This value must be specified as either a string or a * valid JSON object. */ - fun data(data: String) = apply { this.data = data } + fun data(data: String) = apply { body.data(data) } /** * The HTTP headers to include on the forwarded request. This value must be specified as an * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": * "v1" }` */ - fun headers(headers: JsonValue) = apply { this.headers = headers } + fun headers(headers: JsonValue) = apply { body.headers(headers) } /** * The query parameters for the forwarded request. This value must be specified as a valid * JSON object rather than a query string. */ - fun params(params: JsonValue) = apply { this.params = params } + fun params(params: JsonValue) = apply { body.params(params) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -378,37 +374,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): RequestForwardingForwardParams = RequestForwardingForwardParams( - checkNotNull(method) { "`method` is required but was not set" }, - checkNotNull(route) { "`route` is required but was not set" }, - data, - headers, - params, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -417,11 +405,11 @@ constructor( return true } - return /* spotless:off */ other is RequestForwardingForwardParams && method == other.method && route == other.route && data == other.data && headers == other.headers && params == other.params && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is RequestForwardingForwardParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(method, route, data, headers, params, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "RequestForwardingForwardParams{method=$method, route=$route, data=$data, headers=$headers, params=$params, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "RequestForwardingForwardParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index 5e699d02..acf8366a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt @@ -21,55 +21,41 @@ import java.util.Optional class SandboxCompanyUpdateParams constructor( - private val accounts: List?, - private val departments: List?, - private val ein: String?, - private val entity: Entity?, - private val legalName: String?, - private val locations: List?, - private val primaryEmail: String?, - private val primaryPhoneNumber: String?, + private val body: SandboxCompanyUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun accounts(): Optional> = Optional.ofNullable(accounts) + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(): Optional> = body.accounts() - fun departments(): Optional> = Optional.ofNullable(departments) + /** The array of company departments. */ + fun departments(): Optional> = body.departments() - fun ein(): Optional = Optional.ofNullable(ein) + /** The employer identification number. */ + fun ein(): Optional = body.ein() - fun entity(): Optional = Optional.ofNullable(entity) + /** The entity type object. */ + fun entity(): Optional = body.entity() - fun legalName(): Optional = Optional.ofNullable(legalName) + /** The legal name of the company. */ + fun legalName(): Optional = body.legalName() - fun locations(): Optional> = Optional.ofNullable(locations) + fun locations(): Optional> = body.locations() - fun primaryEmail(): Optional = Optional.ofNullable(primaryEmail) + /** The email of the main administrator on the account. */ + fun primaryEmail(): Optional = body.primaryEmail() - fun primaryPhoneNumber(): Optional = Optional.ofNullable(primaryPhoneNumber) + /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ + fun primaryPhoneNumber(): Optional = body.primaryPhoneNumber() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): SandboxCompanyUpdateBody { - return SandboxCompanyUpdateBody( - accounts, - departments, - ein, - entity, - legalName, - locations, - primaryEmail, - primaryPhoneNumber, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): SandboxCompanyUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -133,12 +119,12 @@ constructor( class Builder { - private var accounts: List? = null - private var departments: List? = null + private var accounts: MutableList? = null + private var departments: MutableList? = null private var ein: String? = null private var entity: Entity? = null private var legalName: String? = null - private var locations: List? = null + private var locations: MutableList? = null private var primaryEmail: String? = null private var primaryPhoneNumber: String? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -157,11 +143,23 @@ constructor( } /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = apply { this.accounts = accounts } + fun accounts(accounts: List) = apply { + this.accounts = accounts.toMutableList() + } + + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun addAccount(account: Account) = apply { + accounts = (accounts ?: mutableListOf()).apply { add(account) } + } /** The array of company departments. */ fun departments(departments: List) = apply { - this.departments = departments + this.departments = departments.toMutableList() + } + + /** The array of company departments. */ + fun addDepartment(department: Department) = apply { + departments = (departments ?: mutableListOf()).apply { add(department) } } /** The employer identification number. */ @@ -173,7 +171,13 @@ constructor( /** The legal name of the company. */ fun legalName(legalName: String) = apply { this.legalName = legalName } - fun locations(locations: List) = apply { this.locations = locations } + fun locations(locations: List) = apply { + this.locations = locations.toMutableList() + } + + fun addLocation(location: Location) = apply { + locations = (locations ?: mutableListOf()).apply { add(location) } + } /** The email of the main administrator on the account. */ fun primaryEmail(primaryEmail: String) = apply { this.primaryEmail = primaryEmail } @@ -244,74 +248,48 @@ constructor( @NoAutoDetect class Builder { - private var accounts: MutableList = mutableListOf() - private var departments: MutableList = mutableListOf() - private var ein: String? = null - private var entity: Entity? = null - private var legalName: String? = null - private var locations: MutableList = mutableListOf() - private var primaryEmail: String? = null - private var primaryPhoneNumber: String? = null + private var body: SandboxCompanyUpdateBody.Builder = SandboxCompanyUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxCompanyUpdateParams: SandboxCompanyUpdateParams) = apply { - accounts = sandboxCompanyUpdateParams.accounts?.toMutableList() ?: mutableListOf() - departments = sandboxCompanyUpdateParams.departments?.toMutableList() ?: mutableListOf() - ein = sandboxCompanyUpdateParams.ein - entity = sandboxCompanyUpdateParams.entity - legalName = sandboxCompanyUpdateParams.legalName - locations = sandboxCompanyUpdateParams.locations?.toMutableList() ?: mutableListOf() - primaryEmail = sandboxCompanyUpdateParams.primaryEmail - primaryPhoneNumber = sandboxCompanyUpdateParams.primaryPhoneNumber + body = sandboxCompanyUpdateParams.body.toBuilder() additionalHeaders = sandboxCompanyUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxCompanyUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxCompanyUpdateParams.additionalBodyProperties.toMutableMap() } /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = apply { - this.accounts.clear() - this.accounts.addAll(accounts) - } + fun accounts(accounts: List) = apply { body.accounts(accounts) } /** An array of bank account objects associated with the payroll/HRIS system. */ - fun addAccount(account: Account) = apply { this.accounts.add(account) } + fun addAccount(account: Account) = apply { body.addAccount(account) } /** The array of company departments. */ - fun departments(departments: List) = apply { - this.departments.clear() - this.departments.addAll(departments) - } + fun departments(departments: List) = apply { body.departments(departments) } /** The array of company departments. */ - fun addDepartment(department: Department) = apply { this.departments.add(department) } + fun addDepartment(department: Department) = apply { body.addDepartment(department) } /** The employer identification number. */ - fun ein(ein: String) = apply { this.ein = ein } + fun ein(ein: String) = apply { body.ein(ein) } /** The entity type object. */ - fun entity(entity: Entity) = apply { this.entity = entity } + fun entity(entity: Entity) = apply { body.entity(entity) } /** The legal name of the company. */ - fun legalName(legalName: String) = apply { this.legalName = legalName } + fun legalName(legalName: String) = apply { body.legalName(legalName) } - fun locations(locations: List) = apply { - this.locations.clear() - this.locations.addAll(locations) - } + fun locations(locations: List) = apply { body.locations(locations) } - fun addLocation(location: Location) = apply { this.locations.add(location) } + fun addLocation(location: Location) = apply { body.addLocation(location) } /** The email of the main administrator on the account. */ - fun primaryEmail(primaryEmail: String) = apply { this.primaryEmail = primaryEmail } + fun primaryEmail(primaryEmail: String) = apply { body.primaryEmail(primaryEmail) } /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ fun primaryPhoneNumber(primaryPhoneNumber: String) = apply { - this.primaryPhoneNumber = primaryPhoneNumber + body.primaryPhoneNumber(primaryPhoneNumber) } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -413,40 +391,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxCompanyUpdateParams = SandboxCompanyUpdateParams( - accounts.toImmutable().ifEmpty { null }, - departments.toImmutable().ifEmpty { null }, - ein, - entity, - legalName, - locations.toImmutable().ifEmpty { null }, - primaryEmail, - primaryPhoneNumber, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -1059,11 +1026,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxCompanyUpdateParams && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxCompanyUpdateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxCompanyUpdateParams{accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxCompanyUpdateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index 3ac768d6..986e641c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt @@ -21,39 +21,31 @@ import java.util.Optional class SandboxConnectionAccountCreateParams constructor( - private val companyId: String, - private val providerId: String, - private val authenticationType: AuthenticationType?, - private val products: List?, + private val body: SandboxConnectionAccountCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun companyId(): String = companyId + fun companyId(): String = body.companyId() - fun providerId(): String = providerId + /** The provider associated with the `access_token` */ + fun providerId(): String = body.providerId() - fun authenticationType(): Optional = Optional.ofNullable(authenticationType) + fun authenticationType(): Optional = body.authenticationType() - fun products(): Optional> = Optional.ofNullable(products) + /** + * Optional, defaults to Organization products (`company`, `directory`, `employment`, + * `individual`) + */ + fun products(): Optional> = body.products() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): SandboxConnectionAccountCreateBody { - return SandboxConnectionAccountCreateBody( - companyId, - providerId, - authenticationType, - products, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): SandboxConnectionAccountCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -103,7 +95,7 @@ constructor( private var companyId: String? = null private var providerId: String? = null private var authenticationType: AuthenticationType? = null - private var products: List? = null + private var products: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -131,7 +123,17 @@ constructor( * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - fun products(products: List) = apply { this.products = products } + fun products(products: List) = apply { + this.products = products.toMutableList() + } + + /** + * Optional, defaults to Organization products (`company`, `directory`, `employment`, + * `individual`) + */ + fun addProduct(product: String) = apply { + products = (products ?: mutableListOf()).apply { add(product) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -190,53 +192,41 @@ constructor( @NoAutoDetect class Builder { - private var companyId: String? = null - private var providerId: String? = null - private var authenticationType: AuthenticationType? = null - private var products: MutableList = mutableListOf() + private var body: SandboxConnectionAccountCreateBody.Builder = + SandboxConnectionAccountCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( sandboxConnectionAccountCreateParams: SandboxConnectionAccountCreateParams ) = apply { - companyId = sandboxConnectionAccountCreateParams.companyId - providerId = sandboxConnectionAccountCreateParams.providerId - authenticationType = sandboxConnectionAccountCreateParams.authenticationType - products = - sandboxConnectionAccountCreateParams.products?.toMutableList() ?: mutableListOf() + body = sandboxConnectionAccountCreateParams.body.toBuilder() additionalHeaders = sandboxConnectionAccountCreateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxConnectionAccountCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxConnectionAccountCreateParams.additionalBodyProperties.toMutableMap() } - fun companyId(companyId: String) = apply { this.companyId = companyId } + fun companyId(companyId: String) = apply { body.companyId(companyId) } /** The provider associated with the `access_token` */ - fun providerId(providerId: String) = apply { this.providerId = providerId } + fun providerId(providerId: String) = apply { body.providerId(providerId) } fun authenticationType(authenticationType: AuthenticationType) = apply { - this.authenticationType = authenticationType + body.authenticationType(authenticationType) } /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - fun products(products: List) = apply { - this.products.clear() - this.products.addAll(products) - } + fun products(products: List) = apply { body.products(products) } /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - fun addProduct(product: String) = apply { this.products.add(product) } + fun addProduct(product: String) = apply { body.addProduct(product) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -337,36 +327,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxConnectionAccountCreateParams = SandboxConnectionAccountCreateParams( - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, - authenticationType, - products.toImmutable().ifEmpty { null }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -444,11 +427,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxConnectionAccountCreateParams && companyId == other.companyId && providerId == other.providerId && authenticationType == other.authenticationType && products == other.products && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxConnectionAccountCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(companyId, providerId, authenticationType, products, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxConnectionAccountCreateParams{companyId=$companyId, providerId=$providerId, authenticationType=$authenticationType, products=$products, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxConnectionAccountCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index a15a7a47..1ef07df8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt @@ -18,24 +18,20 @@ import java.util.Optional class SandboxConnectionAccountUpdateParams constructor( - private val connectionStatus: ConnectionStatusType?, + private val body: SandboxConnectionAccountUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun connectionStatus(): Optional = Optional.ofNullable(connectionStatus) + fun connectionStatus(): Optional = body.connectionStatus() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): SandboxConnectionAccountUpdateBody { - return SandboxConnectionAccountUpdateBody(connectionStatus, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): SandboxConnectionAccountUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -137,25 +133,23 @@ constructor( @NoAutoDetect class Builder { - private var connectionStatus: ConnectionStatusType? = null + private var body: SandboxConnectionAccountUpdateBody.Builder = + SandboxConnectionAccountUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( sandboxConnectionAccountUpdateParams: SandboxConnectionAccountUpdateParams ) = apply { - connectionStatus = sandboxConnectionAccountUpdateParams.connectionStatus + body = sandboxConnectionAccountUpdateParams.body.toBuilder() additionalHeaders = sandboxConnectionAccountUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxConnectionAccountUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxConnectionAccountUpdateParams.additionalBodyProperties.toMutableMap() } fun connectionStatus(connectionStatus: ConnectionStatusType) = apply { - this.connectionStatus = connectionStatus + body.connectionStatus(connectionStatus) } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -257,33 +251,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxConnectionAccountUpdateParams = SandboxConnectionAccountUpdateParams( - connectionStatus, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -292,11 +282,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxConnectionAccountUpdateParams && connectionStatus == other.connectionStatus && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxConnectionAccountUpdateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(connectionStatus, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxConnectionAccountUpdateParams{connectionStatus=$connectionStatus, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxConnectionAccountUpdateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt index 5273d320..02e95de9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt @@ -21,39 +21,32 @@ import java.util.Optional class SandboxConnectionCreateParams constructor( - private val providerId: String, - private val authenticationType: AuthenticationType?, - private val employeeSize: Long?, - private val products: List?, + private val body: SandboxConnectionCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun providerId(): String = providerId + /** The provider associated with the connection */ + fun providerId(): String = body.providerId() - fun authenticationType(): Optional = Optional.ofNullable(authenticationType) + fun authenticationType(): Optional = body.authenticationType() - fun employeeSize(): Optional = Optional.ofNullable(employeeSize) + /** + * Optional: the size of the employer to be created with this connection. Defaults to 20. Note + * that if this is higher than 100, historical payroll data will not be generated, and instead + * only one pay period will be created. + */ + fun employeeSize(): Optional = body.employeeSize() - fun products(): Optional> = Optional.ofNullable(products) + fun products(): Optional> = body.products() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): SandboxConnectionCreateBody { - return SandboxConnectionCreateBody( - providerId, - authenticationType, - employeeSize, - products, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): SandboxConnectionCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -105,7 +98,7 @@ constructor( private var providerId: String? = null private var authenticationType: AuthenticationType? = null private var employeeSize: Long? = null - private var products: List? = null + private var products: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -132,7 +125,13 @@ constructor( */ fun employeeSize(employeeSize: Long) = apply { this.employeeSize = employeeSize } - fun products(products: List) = apply { this.products = products } + fun products(products: List) = apply { + this.products = products.toMutableList() + } + + fun addProduct(product: String) = apply { + products = (products ?: mutableListOf()).apply { add(product) } + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -191,31 +190,23 @@ constructor( @NoAutoDetect class Builder { - private var providerId: String? = null - private var authenticationType: AuthenticationType? = null - private var employeeSize: Long? = null - private var products: MutableList = mutableListOf() + private var body: SandboxConnectionCreateBody.Builder = + SandboxConnectionCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxConnectionCreateParams: SandboxConnectionCreateParams) = apply { - providerId = sandboxConnectionCreateParams.providerId - authenticationType = sandboxConnectionCreateParams.authenticationType - employeeSize = sandboxConnectionCreateParams.employeeSize - products = sandboxConnectionCreateParams.products?.toMutableList() ?: mutableListOf() + body = sandboxConnectionCreateParams.body.toBuilder() additionalHeaders = sandboxConnectionCreateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxConnectionCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxConnectionCreateParams.additionalBodyProperties.toMutableMap() } /** The provider associated with the connection */ - fun providerId(providerId: String) = apply { this.providerId = providerId } + fun providerId(providerId: String) = apply { body.providerId(providerId) } fun authenticationType(authenticationType: AuthenticationType) = apply { - this.authenticationType = authenticationType + body.authenticationType(authenticationType) } /** @@ -223,14 +214,11 @@ constructor( * Note that if this is higher than 100, historical payroll data will not be generated, and * instead only one pay period will be created. */ - fun employeeSize(employeeSize: Long) = apply { this.employeeSize = employeeSize } + fun employeeSize(employeeSize: Long) = apply { body.employeeSize(employeeSize) } - fun products(products: List) = apply { - this.products.clear() - this.products.addAll(products) - } + fun products(products: List) = apply { body.products(products) } - fun addProduct(product: String) = apply { this.products.add(product) } + fun addProduct(product: String) = apply { body.addProduct(product) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -331,36 +319,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxConnectionCreateParams = SandboxConnectionCreateParams( - checkNotNull(providerId) { "`providerId` is required but was not set" }, - authenticationType, - employeeSize, - products.toImmutable().ifEmpty { null }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -438,11 +419,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxConnectionCreateParams && providerId == other.providerId && authenticationType == other.authenticationType && employeeSize == other.employeeSize && products == other.products && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxConnectionCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(providerId, authenticationType, employeeSize, products, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxConnectionCreateParams{providerId=$providerId, authenticationType=$authenticationType, employeeSize=$employeeSize, products=$products, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxConnectionCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index 5e9a4df8..a8b10d8b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -26,83 +26,22 @@ constructor( private val additionalQueryParams: QueryParams, ) { + /** + * Array of individuals to create. Takes all combined fields from `/individual` and + * `/employment` endpoints. All fields are optional. + */ fun body(): List = body fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic - internal fun getBody(): List { - return body - } + @JvmSynthetic internal fun getBody(): List = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams - /** - * Array of individuals to create. Takes all combined fields from `/individual` and - * `/employment` endpoints. All fields are optional. - */ - @NoAutoDetect - class SandboxDirectoryCreateBody - @JsonCreator - internal constructor( - @JsonProperty("body") private val body: List, - ) { - - /** - * Array of individuals to create. Takes all combined fields from `/individual` and - * `/employment` endpoints. All fields are optional. - */ - @JsonProperty("body") fun body(): List = body - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var body: List? = null - - @JvmSynthetic - internal fun from(sandboxDirectoryCreateBody: SandboxDirectoryCreateBody) = apply { - body = sandboxDirectoryCreateBody.body.toMutableList() - } - - /** - * Array of individuals to create. Takes all combined fields from `/individual` and - * `/employment` endpoints. All fields are optional. - */ - fun body(body: List) = apply { this.body = body } - - fun build(): SandboxDirectoryCreateBody = - SandboxDirectoryCreateBody( - checkNotNull(body) { "`body` is required but was not set" }.toImmutable() - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is SandboxDirectoryCreateBody && body == other.body /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(body) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = "SandboxDirectoryCreateBody{body=$body}" - } - fun toBuilder() = Builder().from(this) companion object { @@ -113,7 +52,7 @@ constructor( @NoAutoDetect class Builder { - private var body: MutableList = mutableListOf() + private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -128,16 +67,15 @@ constructor( * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - fun body(body: List) = apply { - this.body.clear() - this.body.addAll(body) - } + fun body(body: List) = apply { this.body = body.toMutableList() } /** * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - fun addBody(body: IndividualOrEmployment) = apply { this.body.add(body) } + fun addBody(body: IndividualOrEmployment) = apply { + this.body = (this.body ?: mutableListOf()).apply { add(body) } + } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -239,7 +177,7 @@ constructor( fun build(): SandboxDirectoryCreateParams = SandboxDirectoryCreateParams( - body.toImmutable(), + checkNotNull(body) { "`body` is required but was not set" }.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), ) @@ -400,8 +338,8 @@ constructor( private var middleName: String? = null private var lastName: String? = null private var preferredName: String? = null - private var emails: List? = null - private var phoneNumbers: List? = null + private var emails: MutableList? = null + private var phoneNumbers: MutableList? = null private var gender: Gender? = null private var ethnicity: Ethnicity? = null private var dob: String? = null @@ -420,8 +358,8 @@ constructor( private var classCode: String? = null private var location: Location? = null private var income: Income? = null - private var incomeHistory: List? = null - private var customFields: List? = null + private var incomeHistory: MutableList? = null + private var customFields: MutableList? = null private var sourceId: String? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -469,10 +407,18 @@ constructor( /** The preferred name of the individual. */ fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } - fun emails(emails: List) = apply { this.emails = emails } + fun emails(emails: List) = apply { this.emails = emails.toMutableList() } + + fun addEmail(email: Email) = apply { + emails = (emails ?: mutableListOf()).apply { add(email) } + } fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers = phoneNumbers + this.phoneNumbers = phoneNumbers.toMutableList() + } + + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { + phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } } /** The gender of the individual. */ @@ -541,7 +487,13 @@ constructor( /** The array of income history. */ fun incomeHistory(incomeHistory: List) = apply { - this.incomeHistory = incomeHistory + this.incomeHistory = incomeHistory.toMutableList() + } + + /** The array of income history. */ + fun addIncomeHistory(incomeHistory: Income) = apply { + this.incomeHistory = + (this.incomeHistory ?: mutableListOf()).apply { add(incomeHistory) } } /** @@ -549,7 +501,15 @@ constructor( * in the system. Custom fields are not currently supported for assisted connections. */ fun customFields(customFields: List) = apply { - this.customFields = customFields + this.customFields = customFields.toMutableList() + } + + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun addCustomField(customField: CustomField) = apply { + customFields = (customFields ?: mutableListOf()).apply { add(customField) } } /** The source system's unique employment identifier for this individual */ diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 9424d999..dde7bd10 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -22,97 +22,77 @@ import java.util.Optional class SandboxEmploymentUpdateParams constructor( private val individualId: String, - private val classCode: String?, - private val customFields: List?, - private val department: Department?, - private val employment: Employment?, - private val employmentStatus: EmploymentStatus?, - private val endDate: String?, - private val firstName: String?, - private val income: Income?, - private val incomeHistory: List?, - private val isActive: Boolean?, - private val lastName: String?, - private val latestRehireDate: String?, - private val location: Location?, - private val manager: Manager?, - private val middleName: String?, - private val sourceId: String?, - private val startDate: String?, - private val title: String?, + private val body: SandboxEmploymentUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { fun individualId(): String = individualId - fun classCode(): Optional = Optional.ofNullable(classCode) + /** Worker's compensation classification code for this employee */ + fun classCode(): Optional = body.classCode() - fun customFields(): Optional> = Optional.ofNullable(customFields) + /** + * Custom fields for the individual. These are fields which are defined by the employer in the + * system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(): Optional> = body.customFields() - fun department(): Optional = Optional.ofNullable(department) + /** The department object. */ + fun department(): Optional = body.department() - fun employment(): Optional = Optional.ofNullable(employment) + /** The employment object. */ + fun employment(): Optional = body.employment() - fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) + /** The detailed employment status of the individual. */ + fun employmentStatus(): Optional = body.employmentStatus() - fun endDate(): Optional = Optional.ofNullable(endDate) + fun endDate(): Optional = body.endDate() - fun firstName(): Optional = Optional.ofNullable(firstName) + /** The legal first name of the individual. */ + fun firstName(): Optional = body.firstName() - fun income(): Optional = Optional.ofNullable(income) + /** + * The employee's income as reported by the provider. This may not always be annualized income, + * but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the + * provider returns. + */ + fun income(): Optional = body.income() - fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory) + /** The array of income history. */ + fun incomeHistory(): Optional> = body.incomeHistory() - fun isActive(): Optional = Optional.ofNullable(isActive) + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(): Optional = body.isActive() - fun lastName(): Optional = Optional.ofNullable(lastName) + /** The legal last name of the individual. */ + fun lastName(): Optional = body.lastName() - fun latestRehireDate(): Optional = Optional.ofNullable(latestRehireDate) + fun latestRehireDate(): Optional = body.latestRehireDate() - fun location(): Optional = Optional.ofNullable(location) + fun location(): Optional = body.location() - fun manager(): Optional = Optional.ofNullable(manager) + /** The manager object representing the manager of the individual within the org. */ + fun manager(): Optional = body.manager() - fun middleName(): Optional = Optional.ofNullable(middleName) + /** The legal middle name of the individual. */ + fun middleName(): Optional = body.middleName() - fun sourceId(): Optional = Optional.ofNullable(sourceId) + /** The source system's unique employment identifier for this individual */ + fun sourceId(): Optional = body.sourceId() - fun startDate(): Optional = Optional.ofNullable(startDate) + fun startDate(): Optional = body.startDate() - fun title(): Optional = Optional.ofNullable(title) + /** The current title of the individual. */ + fun title(): Optional = body.title() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): SandboxEmploymentUpdateBody { - return SandboxEmploymentUpdateBody( - classCode, - customFields, - department, - employment, - employmentStatus, - endDate, - firstName, - income, - incomeHistory, - isActive, - lastName, - latestRehireDate, - location, - manager, - middleName, - sourceId, - startDate, - title, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): SandboxEmploymentUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -232,14 +212,14 @@ constructor( class Builder { private var classCode: String? = null - private var customFields: List? = null + private var customFields: MutableList? = null private var department: Department? = null private var employment: Employment? = null private var employmentStatus: EmploymentStatus? = null private var endDate: String? = null private var firstName: String? = null private var income: Income? = null - private var incomeHistory: List? = null + private var incomeHistory: MutableList? = null private var isActive: Boolean? = null private var lastName: String? = null private var latestRehireDate: String? = null @@ -283,7 +263,15 @@ constructor( * in the system. Custom fields are not currently supported for assisted connections. */ fun customFields(customFields: List) = apply { - this.customFields = customFields + this.customFields = customFields.toMutableList() + } + + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun addCustomField(customField: CustomField) = apply { + customFields = (customFields ?: mutableListOf()).apply { add(customField) } } /** The department object. */ @@ -311,7 +299,13 @@ constructor( /** The array of income history. */ fun incomeHistory(incomeHistory: List) = apply { - this.incomeHistory = incomeHistory + this.incomeHistory = incomeHistory.toMutableList() + } + + /** The array of income history. */ + fun addIncomeHistory(incomeHistory: Income) = apply { + this.incomeHistory = + (this.incomeHistory ?: mutableListOf()).apply { add(incomeHistory) } } /** `true` if the individual an an active employee or contractor at the company. */ @@ -412,136 +406,94 @@ constructor( class Builder { private var individualId: String? = null - private var classCode: String? = null - private var customFields: MutableList = mutableListOf() - private var department: Department? = null - private var employment: Employment? = null - private var employmentStatus: EmploymentStatus? = null - private var endDate: String? = null - private var firstName: String? = null - private var income: Income? = null - private var incomeHistory: MutableList = mutableListOf() - private var isActive: Boolean? = null - private var lastName: String? = null - private var latestRehireDate: String? = null - private var location: Location? = null - private var manager: Manager? = null - private var middleName: String? = null - private var sourceId: String? = null - private var startDate: String? = null - private var title: String? = null + private var body: SandboxEmploymentUpdateBody.Builder = + SandboxEmploymentUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxEmploymentUpdateParams: SandboxEmploymentUpdateParams) = apply { individualId = sandboxEmploymentUpdateParams.individualId - classCode = sandboxEmploymentUpdateParams.classCode - customFields = - sandboxEmploymentUpdateParams.customFields?.toMutableList() ?: mutableListOf() - department = sandboxEmploymentUpdateParams.department - employment = sandboxEmploymentUpdateParams.employment - employmentStatus = sandboxEmploymentUpdateParams.employmentStatus - endDate = sandboxEmploymentUpdateParams.endDate - firstName = sandboxEmploymentUpdateParams.firstName - income = sandboxEmploymentUpdateParams.income - incomeHistory = - sandboxEmploymentUpdateParams.incomeHistory?.toMutableList() ?: mutableListOf() - isActive = sandboxEmploymentUpdateParams.isActive - lastName = sandboxEmploymentUpdateParams.lastName - latestRehireDate = sandboxEmploymentUpdateParams.latestRehireDate - location = sandboxEmploymentUpdateParams.location - manager = sandboxEmploymentUpdateParams.manager - middleName = sandboxEmploymentUpdateParams.middleName - sourceId = sandboxEmploymentUpdateParams.sourceId - startDate = sandboxEmploymentUpdateParams.startDate - title = sandboxEmploymentUpdateParams.title + body = sandboxEmploymentUpdateParams.body.toBuilder() additionalHeaders = sandboxEmploymentUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxEmploymentUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxEmploymentUpdateParams.additionalBodyProperties.toMutableMap() } fun individualId(individualId: String) = apply { this.individualId = individualId } /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = apply { this.classCode = classCode } + fun classCode(classCode: String) = apply { body.classCode(classCode) } /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ fun customFields(customFields: List) = apply { - this.customFields.clear() - this.customFields.addAll(customFields) + body.customFields(customFields) } /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ - fun addCustomField(customField: CustomField) = apply { this.customFields.add(customField) } + fun addCustomField(customField: CustomField) = apply { body.addCustomField(customField) } /** The department object. */ - fun department(department: Department) = apply { this.department = department } + fun department(department: Department) = apply { body.department(department) } /** The employment object. */ - fun employment(employment: Employment) = apply { this.employment = employment } + fun employment(employment: Employment) = apply { body.employment(employment) } /** The detailed employment status of the individual. */ fun employmentStatus(employmentStatus: EmploymentStatus) = apply { - this.employmentStatus = employmentStatus + body.employmentStatus(employmentStatus) } - fun endDate(endDate: String) = apply { this.endDate = endDate } + fun endDate(endDate: String) = apply { body.endDate(endDate) } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + fun firstName(firstName: String) = apply { body.firstName(firstName) } /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - fun income(income: Income) = apply { this.income = income } + fun income(income: Income) = apply { body.income(income) } /** The array of income history. */ fun incomeHistory(incomeHistory: List) = apply { - this.incomeHistory.clear() - this.incomeHistory.addAll(incomeHistory) + body.incomeHistory(incomeHistory) } /** The array of income history. */ - fun addIncomeHistory(incomeHistory: Income) = apply { - this.incomeHistory.add(incomeHistory) - } + fun addIncomeHistory(incomeHistory: Income) = apply { body.addIncomeHistory(incomeHistory) } /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = apply { this.isActive = isActive } + fun isActive(isActive: Boolean) = apply { body.isActive(isActive) } /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + fun lastName(lastName: String) = apply { body.lastName(lastName) } fun latestRehireDate(latestRehireDate: String) = apply { - this.latestRehireDate = latestRehireDate + body.latestRehireDate(latestRehireDate) } - fun location(location: Location) = apply { this.location = location } + fun location(location: Location) = apply { body.location(location) } /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = apply { this.manager = manager } + fun manager(manager: Manager) = apply { body.manager(manager) } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + fun middleName(middleName: String) = apply { body.middleName(middleName) } /** The source system's unique employment identifier for this individual */ - fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } + fun sourceId(sourceId: String) = apply { body.sourceId(sourceId) } - fun startDate(startDate: String) = apply { this.startDate = startDate } + fun startDate(startDate: String) = apply { body.startDate(startDate) } /** The current title of the individual. */ - fun title(title: String) = apply { this.title = title } + fun title(title: String) = apply { body.title(title) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -642,51 +594,30 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxEmploymentUpdateParams = SandboxEmploymentUpdateParams( checkNotNull(individualId) { "`individualId` is required but was not set" }, - classCode, - customFields.toImmutable().ifEmpty { null }, - department, - employment, - employmentStatus, - endDate, - firstName, - income, - incomeHistory.toImmutable().ifEmpty { null }, - isActive, - lastName, - latestRehireDate, - location, - manager, - middleName, - sourceId, - startDate, - title, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -1260,11 +1191,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxEmploymentUpdateParams && individualId == other.individualId && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxEmploymentUpdateParams && individualId == other.individualId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxEmploymentUpdateParams{individualId=$individualId, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxEmploymentUpdateParams{individualId=$individualId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 072d5124..091dac04 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -22,73 +22,60 @@ import java.util.Optional class SandboxIndividualUpdateParams constructor( private val individualId: String, - private val dob: String?, - private val emails: List?, - private val encryptedSsn: String?, - private val ethnicity: Ethnicity?, - private val firstName: String?, - private val gender: Gender?, - private val lastName: String?, - private val middleName: String?, - private val phoneNumbers: List?, - private val preferredName: String?, - private val residence: Location?, - private val ssn: String?, + private val body: SandboxIndividualUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { fun individualId(): String = individualId - fun dob(): Optional = Optional.ofNullable(dob) + fun dob(): Optional = body.dob() - fun emails(): Optional> = Optional.ofNullable(emails) + fun emails(): Optional> = body.emails() - fun encryptedSsn(): Optional = Optional.ofNullable(encryptedSsn) + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in + * the body. + */ + fun encryptedSsn(): Optional = body.encryptedSsn() - fun ethnicity(): Optional = Optional.ofNullable(ethnicity) + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(): Optional = body.ethnicity() - fun firstName(): Optional = Optional.ofNullable(firstName) + /** The legal first name of the individual. */ + fun firstName(): Optional = body.firstName() - fun gender(): Optional = Optional.ofNullable(gender) + /** The gender of the individual. */ + fun gender(): Optional = body.gender() - fun lastName(): Optional = Optional.ofNullable(lastName) + /** The legal last name of the individual. */ + fun lastName(): Optional = body.lastName() - fun middleName(): Optional = Optional.ofNullable(middleName) + /** The legal middle name of the individual. */ + fun middleName(): Optional = body.middleName() - fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers) + fun phoneNumbers(): Optional> = body.phoneNumbers() - fun preferredName(): Optional = Optional.ofNullable(preferredName) + /** The preferred name of the individual. */ + fun preferredName(): Optional = body.preferredName() - fun residence(): Optional = Optional.ofNullable(residence) + fun residence(): Optional = body.residence() - fun ssn(): Optional = Optional.ofNullable(ssn) + /** + * Social Security Number of the individual. This field is only available with the `ssn` scope + * enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + fun ssn(): Optional = body.ssn() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties - - @JvmSynthetic - internal fun getBody(): SandboxIndividualUpdateBody { - return SandboxIndividualUpdateBody( - dob, - emails, - encryptedSsn, - ethnicity, - firstName, - gender, - lastName, - middleName, - phoneNumbers, - preferredName, - residence, - ssn, - additionalBodyProperties, - ) - } + fun _additionalBodyProperties(): Map = body._additionalProperties() + + @JvmSynthetic internal fun getBody(): SandboxIndividualUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -182,14 +169,14 @@ constructor( class Builder { private var dob: String? = null - private var emails: List? = null + private var emails: MutableList? = null private var encryptedSsn: String? = null private var ethnicity: Ethnicity? = null private var firstName: String? = null private var gender: Gender? = null private var lastName: String? = null private var middleName: String? = null - private var phoneNumbers: List? = null + private var phoneNumbers: MutableList? = null private var preferredName: String? = null private var residence: Location? = null private var ssn: String? = null @@ -215,7 +202,11 @@ constructor( fun dob(dob: String) = apply { this.dob = dob } - fun emails(emails: List) = apply { this.emails = emails } + fun emails(emails: List) = apply { this.emails = emails.toMutableList() } + + fun addEmail(email: Email) = apply { + emails = (emails ?: mutableListOf()).apply { add(email) } + } /** * Social Security Number of the individual in **encrypted** format. This field is only @@ -240,7 +231,11 @@ constructor( fun middleName(middleName: String) = apply { this.middleName = middleName } fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers = phoneNumbers + this.phoneNumbers = phoneNumbers.toMutableList() + } + + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { + phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } } /** The preferred name of the individual. */ @@ -321,95 +316,66 @@ constructor( class Builder { private var individualId: String? = null - private var dob: String? = null - private var emails: MutableList = mutableListOf() - private var encryptedSsn: String? = null - private var ethnicity: Ethnicity? = null - private var firstName: String? = null - private var gender: Gender? = null - private var lastName: String? = null - private var middleName: String? = null - private var phoneNumbers: MutableList = mutableListOf() - private var preferredName: String? = null - private var residence: Location? = null - private var ssn: String? = null + private var body: SandboxIndividualUpdateBody.Builder = + SandboxIndividualUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxIndividualUpdateParams: SandboxIndividualUpdateParams) = apply { individualId = sandboxIndividualUpdateParams.individualId - dob = sandboxIndividualUpdateParams.dob - emails = sandboxIndividualUpdateParams.emails?.toMutableList() ?: mutableListOf() - encryptedSsn = sandboxIndividualUpdateParams.encryptedSsn - ethnicity = sandboxIndividualUpdateParams.ethnicity - firstName = sandboxIndividualUpdateParams.firstName - gender = sandboxIndividualUpdateParams.gender - lastName = sandboxIndividualUpdateParams.lastName - middleName = sandboxIndividualUpdateParams.middleName - phoneNumbers = - sandboxIndividualUpdateParams.phoneNumbers?.toMutableList() ?: mutableListOf() - preferredName = sandboxIndividualUpdateParams.preferredName - residence = sandboxIndividualUpdateParams.residence - ssn = sandboxIndividualUpdateParams.ssn + body = sandboxIndividualUpdateParams.body.toBuilder() additionalHeaders = sandboxIndividualUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxIndividualUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxIndividualUpdateParams.additionalBodyProperties.toMutableMap() } fun individualId(individualId: String) = apply { this.individualId = individualId } - fun dob(dob: String) = apply { this.dob = dob } + fun dob(dob: String) = apply { body.dob(dob) } - fun emails(emails: List) = apply { - this.emails.clear() - this.emails.addAll(emails) - } + fun emails(emails: List) = apply { body.emails(emails) } - fun addEmail(email: Email) = apply { this.emails.add(email) } + fun addEmail(email: Email) = apply { body.addEmail(email) } /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } + fun encryptedSsn(encryptedSsn: String) = apply { body.encryptedSsn(encryptedSsn) } /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } + fun ethnicity(ethnicity: Ethnicity) = apply { body.ethnicity(ethnicity) } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + fun firstName(firstName: String) = apply { body.firstName(firstName) } /** The gender of the individual. */ - fun gender(gender: Gender) = apply { this.gender = gender } + fun gender(gender: Gender) = apply { body.gender(gender) } /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + fun lastName(lastName: String) = apply { body.lastName(lastName) } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + fun middleName(middleName: String) = apply { body.middleName(middleName) } fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers.clear() - this.phoneNumbers.addAll(phoneNumbers) + body.phoneNumbers(phoneNumbers) } - fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { this.phoneNumbers.add(phoneNumber) } + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { body.addPhoneNumber(phoneNumber) } /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } + fun preferredName(preferredName: String) = apply { body.preferredName(preferredName) } - fun residence(residence: Location) = apply { this.residence = residence } + fun residence(residence: Location) = apply { body.residence(residence) } /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - fun ssn(ssn: String) = apply { this.ssn = ssn } + fun ssn(ssn: String) = apply { body.ssn(ssn) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -510,45 +476,30 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxIndividualUpdateParams = SandboxIndividualUpdateParams( checkNotNull(individualId) { "`individualId` is required but was not set" }, - dob, - emails.toImmutable().ifEmpty { null }, - encryptedSsn, - ethnicity, - firstName, - gender, - lastName, - middleName, - phoneNumbers.toImmutable().ifEmpty { null }, - preferredName, - residence, - ssn, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -1008,11 +959,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxIndividualUpdateParams && individualId == other.individualId && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxIndividualUpdateParams && individualId == other.individualId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxIndividualUpdateParams{individualId=$individualId, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxIndividualUpdateParams{individualId=$individualId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt index 10b9058e..745f1e13 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParams.kt @@ -20,31 +20,22 @@ import java.util.Objects class SandboxJobConfigurationUpdateParams constructor( - private val completionStatus: CompletionStatus, - private val type: Type, + private val body: SandboxJobConfigurationUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun completionStatus(): CompletionStatus = completionStatus + fun completionStatus(): CompletionStatus = body.completionStatus() - fun type(): Type = type + fun type(): Type = body.type() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): SandboxJobConfigurationUpdateBody { - return SandboxJobConfigurationUpdateBody( - completionStatus, - type, - additionalBodyProperties, - ) - } + @JvmSynthetic internal fun getBody(): SandboxJobConfigurationUpdateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -155,30 +146,26 @@ constructor( @NoAutoDetect class Builder { - private var completionStatus: CompletionStatus? = null - private var type: Type? = null + private var body: SandboxJobConfigurationUpdateBody.Builder = + SandboxJobConfigurationUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( sandboxJobConfigurationUpdateParams: SandboxJobConfigurationUpdateParams ) = apply { - completionStatus = sandboxJobConfigurationUpdateParams.completionStatus - type = sandboxJobConfigurationUpdateParams.type + body = sandboxJobConfigurationUpdateParams.body.toBuilder() additionalHeaders = sandboxJobConfigurationUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxJobConfigurationUpdateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxJobConfigurationUpdateParams.additionalBodyProperties.toMutableMap() } fun completionStatus(completionStatus: CompletionStatus) = apply { - this.completionStatus = completionStatus + body.completionStatus(completionStatus) } - fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { body.type(type) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -279,34 +266,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxJobConfigurationUpdateParams = SandboxJobConfigurationUpdateParams( - checkNotNull(completionStatus) { "`completionStatus` is required but was not set" }, - checkNotNull(type) { "`type` is required but was not set" }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -435,11 +417,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxJobConfigurationUpdateParams && completionStatus == other.completionStatus && type == other.type && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxJobConfigurationUpdateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completionStatus, type, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxJobConfigurationUpdateParams{completionStatus=$completionStatus, type=$type, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxJobConfigurationUpdateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt index a31d94c1..09ceb3b3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt @@ -20,24 +20,21 @@ import java.util.Objects class SandboxJobCreateParams constructor( - private val type: Type, + private val body: SandboxJobCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun type(): Type = type + /** The type of job to start. Currently the only supported type is `data_sync_all` */ + fun type(): Type = body.type() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): SandboxJobCreateBody { - return SandboxJobCreateBody(type, additionalBodyProperties) - } + @JvmSynthetic internal fun getBody(): SandboxJobCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -134,22 +131,19 @@ constructor( @NoAutoDetect class Builder { - private var type: Type? = null + private var body: SandboxJobCreateBody.Builder = SandboxJobCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxJobCreateParams: SandboxJobCreateParams) = apply { - type = sandboxJobCreateParams.type + body = sandboxJobCreateParams.body.toBuilder() additionalHeaders = sandboxJobCreateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxJobCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxJobCreateParams.additionalBodyProperties.toMutableMap() } /** The type of job to start. Currently the only supported type is `data_sync_all` */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Type) = apply { body.type(type) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -250,33 +244,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxJobCreateParams = SandboxJobCreateParams( - checkNotNull(type) { "`type` is required but was not set" }, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -336,11 +326,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxJobCreateParams && type == other.type && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxJobCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(type, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxJobCreateParams{type=$type, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxJobCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index 99d4eb3e..52f30fdc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt @@ -21,35 +21,24 @@ import java.util.Optional class SandboxPaymentCreateParams constructor( - private val endDate: String?, - private val payStatements: List?, - private val startDate: String?, + private val body: SandboxPaymentCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, - private val additionalBodyProperties: Map, ) { - fun endDate(): Optional = Optional.ofNullable(endDate) + fun endDate(): Optional = body.endDate() - fun payStatements(): Optional> = Optional.ofNullable(payStatements) + fun payStatements(): Optional> = body.payStatements() - fun startDate(): Optional = Optional.ofNullable(startDate) + fun startDate(): Optional = body.startDate() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - fun _additionalBodyProperties(): Map = additionalBodyProperties + fun _additionalBodyProperties(): Map = body._additionalProperties() - @JvmSynthetic - internal fun getBody(): SandboxPaymentCreateBody { - return SandboxPaymentCreateBody( - endDate, - payStatements, - startDate, - additionalBodyProperties, - ) - } + @JvmSynthetic internal fun getBody(): SandboxPaymentCreateBody = body @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders @@ -92,7 +81,7 @@ constructor( class Builder { private var endDate: String? = null - private var payStatements: List? = null + private var payStatements: MutableList? = null private var startDate: String? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -107,7 +96,11 @@ constructor( fun endDate(endDate: String) = apply { this.endDate = endDate } fun payStatements(payStatements: List) = apply { - this.payStatements = payStatements + this.payStatements = payStatements.toMutableList() + } + + fun addPayStatement(payStatement: PayStatement) = apply { + payStatements = (payStatements ?: mutableListOf()).apply { add(payStatement) } } fun startDate(startDate: String) = apply { this.startDate = startDate } @@ -168,37 +161,28 @@ constructor( @NoAutoDetect class Builder { - private var endDate: String? = null - private var payStatements: MutableList = mutableListOf() - private var startDate: String? = null + private var body: SandboxPaymentCreateBody.Builder = SandboxPaymentCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxPaymentCreateParams: SandboxPaymentCreateParams) = apply { - endDate = sandboxPaymentCreateParams.endDate - payStatements = - sandboxPaymentCreateParams.payStatements?.toMutableList() ?: mutableListOf() - startDate = sandboxPaymentCreateParams.startDate + body = sandboxPaymentCreateParams.body.toBuilder() additionalHeaders = sandboxPaymentCreateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxPaymentCreateParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - sandboxPaymentCreateParams.additionalBodyProperties.toMutableMap() } - fun endDate(endDate: String) = apply { this.endDate = endDate } + fun endDate(endDate: String) = apply { body.endDate(endDate) } fun payStatements(payStatements: List) = apply { - this.payStatements.clear() - this.payStatements.addAll(payStatements) + body.payStatements(payStatements) } fun addPayStatement(payStatement: PayStatement) = apply { - this.payStatements.add(payStatement) + body.addPayStatement(payStatement) } - fun startDate(startDate: String) = apply { this.startDate = startDate } + fun startDate(startDate: String) = apply { body.startDate(startDate) } fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -299,35 +283,29 @@ constructor( } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - putAllAdditionalBodyProperties(additionalBodyProperties) + body.additionalProperties(additionalBodyProperties) } fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - additionalBodyProperties.put(key, value) + body.putAdditionalProperty(key, value) } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) + body.putAllAdditionalProperties(additionalBodyProperties) } - fun removeAdditionalBodyProperty(key: String) = apply { - additionalBodyProperties.remove(key) - } + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } fun removeAllAdditionalBodyProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalBodyProperty) + body.removeAllAdditionalProperties(keys) } fun build(): SandboxPaymentCreateParams = SandboxPaymentCreateParams( - endDate, - payStatements.toImmutable().ifEmpty { null }, - startDate, + body.build(), additionalHeaders.build(), additionalQueryParams.build(), - additionalBodyProperties.toImmutable(), ) } @@ -405,10 +383,10 @@ constructor( private var totalHours: Double? = null private var grossPay: Money? = null private var netPay: Money? = null - private var earnings: List? = null - private var taxes: List? = null - private var employeeDeductions: List? = null - private var employerContributions: List? = null + private var earnings: MutableList? = null + private var taxes: MutableList? = null + private var employeeDeductions: MutableList? = null + private var employerContributions: MutableList? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -445,18 +423,39 @@ constructor( fun netPay(netPay: Money) = apply { this.netPay = netPay } /** The array of earnings objects associated with this pay statement */ - fun earnings(earnings: List) = apply { this.earnings = earnings } + fun earnings(earnings: List) = apply { + this.earnings = earnings.toMutableList() + } + + /** The array of earnings objects associated with this pay statement */ + fun addEarning(earning: Earning) = apply { + earnings = (earnings ?: mutableListOf()).apply { add(earning) } + } /** The array of taxes objects associated with this pay statement. */ - fun taxes(taxes: List) = apply { this.taxes = taxes } + fun taxes(taxes: List) = apply { this.taxes = taxes.toMutableList() } + + /** The array of taxes objects associated with this pay statement. */ + fun addTax(tax: Tax) = apply { taxes = (taxes ?: mutableListOf()).apply { add(tax) } } /** The array of deductions objects associated with this pay statement. */ fun employeeDeductions(employeeDeductions: List) = apply { - this.employeeDeductions = employeeDeductions + this.employeeDeductions = employeeDeductions.toMutableList() + } + + /** The array of deductions objects associated with this pay statement. */ + fun addEmployeeDeduction(employeeDeduction: EmployeeDeduction) = apply { + employeeDeductions = + (employeeDeductions ?: mutableListOf()).apply { add(employeeDeduction) } } fun employerContributions(employerContributions: List) = apply { - this.employerContributions = employerContributions + this.employerContributions = employerContributions.toMutableList() + } + + fun addEmployerContribution(employerContribution: EmployerContribution) = apply { + employerContributions = + (employerContributions ?: mutableListOf()).apply { add(employerContribution) } } fun additionalProperties(additionalProperties: Map) = apply { @@ -1326,11 +1325,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxPaymentCreateParams && endDate == other.endDate && payStatements == other.payStatements && startDate == other.startDate && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxPaymentCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(endDate, payStatements, startDate, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxPaymentCreateParams{endDate=$endDate, payStatements=$payStatements, startDate=$startDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxPaymentCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } From 0d8e0c980e77ceb4870ae930a22bc893249596b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:49:36 +0000 Subject: [PATCH 5/7] style(internal): sort fields (#377) --- .../api/models/AccountCreateResponse.kt | 130 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 2282 ++++++++--------- .../api/models/AccountUpdateResponse.kt | 68 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 154 +- .../api/models/AutomatedCreateResponse.kt | 50 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 86 +- .../api/models/BenefitContribution.kt | 36 +- .../models/BenefitFeaturesAndOperations.kt | 194 +- .../tryfinch/api/models/BenefitsSupport.kt | 268 +- .../kotlin/com/tryfinch/api/models/Company.kt | 342 +-- .../com/tryfinch/api/models/CompanyBenefit.kt | 44 +- .../com/tryfinch/api/models/CompanyEvent.kt | 112 +- .../api/models/CompanyUpdateResponse.kt | 336 +-- .../api/models/ConnectSessionNewParams.kt | 22 +- .../api/models/ConnectionCreateResponse.kt | 134 +- .../api/models/CreateAccessTokenResponse.kt | 144 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 112 +- .../com/tryfinch/api/models/EmploymentData.kt | 442 ++-- .../api/models/EmploymentDataResponse.kt | 52 +- .../tryfinch/api/models/EmploymentEvent.kt | 112 +- .../api/models/EmploymentUpdateResponse.kt | 456 ++-- .../tryfinch/api/models/EnrolledIndividual.kt | 88 +- .../kotlin/com/tryfinch/api/models/Income.kt | 54 +- .../com/tryfinch/api/models/Individual.kt | 258 +- .../tryfinch/api/models/IndividualBenefit.kt | 138 +- .../tryfinch/api/models/IndividualEvent.kt | 112 +- .../api/models/IndividualInDirectory.kt | 102 +- .../tryfinch/api/models/IndividualResponse.kt | 52 +- .../api/models/IndividualUpdateResponse.kt | 304 +-- .../com/tryfinch/api/models/Introspection.kt | 492 ++-- .../api/models/JobAutomatedCreateParams.kt | 26 +- .../tryfinch/api/models/JobCompletionEvent.kt | 112 +- .../tryfinch/api/models/JobCreateResponse.kt | 50 +- .../com/tryfinch/api/models/Location.kt | 128 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 40 +- .../api/models/OperationSupportMatrix.kt | 44 +- .../api/models/PayGroupRetrieveResponse.kt | 40 +- .../com/tryfinch/api/models/PayStatement.kt | 494 ++-- .../tryfinch/api/models/PayStatementEvent.kt | 152 +- .../api/models/PayStatementResponse.kt | 46 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 234 +- .../api/models/PaymentCreateResponse.kt | 40 +- .../com/tryfinch/api/models/PaymentEvent.kt | 156 +- .../com/tryfinch/api/models/Provider.kt | 2248 ++++++++-------- .../RequestForwardingForwardResponse.kt | 204 +- .../api/models/SandboxCompanyUpdateParams.kt | 102 +- .../models/SandboxDirectoryCreateParams.kt | 474 ++-- .../models/SandboxEmploymentUpdateParams.kt | 26 +- .../api/models/SandboxJobConfiguration.kt | 30 +- .../api/models/SandboxPaymentCreateParams.kt | 314 +-- .../tryfinch/api/models/SessionNewResponse.kt | 40 +- .../models/SessionReauthenticateResponse.kt | 40 +- .../tryfinch/api/models/SupportedBenefit.kt | 212 +- .../api/models/UnenrolledIndividual.kt | 88 +- 54 files changed, 6258 insertions(+), 6258 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt index e8bf4cca..328ed3c2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt @@ -21,38 +21,31 @@ import java.util.Objects class AccountCreateResponse @JsonCreator private constructor( - @JsonProperty("connection_id") - @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), - @JsonProperty("company_id") - @ExcludeMissing - private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("provider_id") + @JsonProperty("access_token") @ExcludeMissing - private val providerId: JsonField = JsonMissing.of(), + private val accessToken: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing private val accountId: JsonField = JsonMissing.of(), @JsonProperty("authentication_type") @ExcludeMissing private val authenticationType: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), @JsonProperty("products") @ExcludeMissing private val products: JsonField> = JsonMissing.of(), - @JsonProperty("access_token") + @JsonProperty("provider_id") @ExcludeMissing - private val accessToken: JsonField = JsonMissing.of(), + private val providerId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the new connection */ - fun connectionId(): String = connectionId.getRequired("connection_id") - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(): String = companyId.getRequired("company_id") - - /** The ID of the provider associated with the `access_token` */ - fun providerId(): String = providerId.getRequired("provider_id") + fun accessToken(): String = accessToken.getRequired("access_token") /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(): String = accountId.getRequired("account_id") @@ -60,18 +53,18 @@ private constructor( fun authenticationType(): AuthenticationType = authenticationType.getRequired("authentication_type") - fun products(): List = products.getRequired("products") - - fun accessToken(): String = accessToken.getRequired("access_token") + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(): String = companyId.getRequired("company_id") /** The ID of the new connection */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun connectionId(): String = connectionId.getRequired("connection_id") - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + fun products(): List = products.getRequired("products") /** The ID of the provider associated with the `access_token` */ - @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId + fun providerId(): String = providerId.getRequired("provider_id") + + @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId @@ -80,9 +73,16 @@ private constructor( @ExcludeMissing fun _authenticationType() = authenticationType + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + + /** The ID of the new connection */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + @JsonProperty("products") @ExcludeMissing fun _products() = products - @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken + /** The ID of the provider associated with the `access_token` */ + @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId @JsonAnyGetter @ExcludeMissing @@ -92,13 +92,13 @@ private constructor( fun validate(): AccountCreateResponse = apply { if (!validated) { - connectionId() - companyId() - providerId() + accessToken() accountId() authenticationType() + companyId() + connectionId() products() - accessToken() + providerId() validated = true } } @@ -112,46 +112,30 @@ private constructor( class Builder { - private var connectionId: JsonField = JsonMissing.of() - private var companyId: JsonField = JsonMissing.of() - private var providerId: JsonField = JsonMissing.of() + private var accessToken: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() private var authenticationType: JsonField = JsonMissing.of() + private var companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() - private var accessToken: JsonField = JsonMissing.of() + private var providerId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountCreateResponse: AccountCreateResponse) = apply { - connectionId = accountCreateResponse.connectionId - companyId = accountCreateResponse.companyId - providerId = accountCreateResponse.providerId + accessToken = accountCreateResponse.accessToken accountId = accountCreateResponse.accountId authenticationType = accountCreateResponse.authenticationType + companyId = accountCreateResponse.companyId + connectionId = accountCreateResponse.connectionId products = accountCreateResponse.products - accessToken = accountCreateResponse.accessToken + providerId = accountCreateResponse.providerId additionalProperties = accountCreateResponse.additionalProperties.toMutableMap() } - /** The ID of the new connection */ - fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - - /** The ID of the new connection */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - - /** The ID of the provider associated with the `access_token` */ - fun providerId(providerId: String) = providerId(JsonField.of(providerId)) + fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) - /** The ID of the provider associated with the `access_token` */ - fun providerId(providerId: JsonField) = apply { this.providerId = providerId } + fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) @@ -166,13 +150,29 @@ private constructor( this.authenticationType = authenticationType } + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** The ID of the new connection */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) + + /** The ID of the new connection */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + fun products(products: List) = products(JsonField.of(products)) fun products(products: JsonField>) = apply { this.products = products } - fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) + /** The ID of the provider associated with the `access_token` */ + fun providerId(providerId: String) = providerId(JsonField.of(providerId)) - fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + /** The ID of the provider associated with the `access_token` */ + fun providerId(providerId: JsonField) = apply { this.providerId = providerId } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -195,13 +195,13 @@ private constructor( fun build(): AccountCreateResponse = AccountCreateResponse( - connectionId, - companyId, - providerId, + accessToken, accountId, authenticationType, + companyId, + connectionId, products.map { it.toImmutable() }, - accessToken, + providerId, additionalProperties.toImmutable(), ) } @@ -280,15 +280,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountCreateResponse && connectionId == other.connectionId && companyId == other.companyId && providerId == other.providerId && accountId == other.accountId && authenticationType == other.authenticationType && products == other.products && accessToken == other.accessToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountCreateResponse && accessToken == other.accessToken && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && connectionId == other.connectionId && products == other.products && providerId == other.providerId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, authenticationType, companyId, connectionId, products, providerId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountCreateResponse{connectionId=$connectionId, companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, additionalProperties=$additionalProperties}" + "AccountCreateResponse{accessToken=$accessToken, accountId=$accountId, authenticationType=$authenticationType, companyId=$companyId, connectionId=$connectionId, products=$products, providerId=$providerId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt index 5feb948b..cee081a2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class AccountUpdateEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): AccountUpdateEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountUpdateEvent: AccountUpdateEvent) = apply { - connectionId = accountUpdateEvent.connectionId - companyId = accountUpdateEvent.companyId accountId = accountUpdateEvent.accountId - eventType = accountUpdateEvent.eventType + companyId = accountUpdateEvent.companyId + connectionId = accountUpdateEvent.connectionId data = accountUpdateEvent.data + eventType = accountUpdateEvent.eventType additionalProperties = accountUpdateEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): AccountUpdateEvent = AccountUpdateEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -201,27 +201,27 @@ private constructor( class Data @JsonCreator private constructor( - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), @JsonProperty("authentication_method") @ExcludeMissing private val authenticationMethod: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun status(): ConnectionStatusType = status.getRequired("status") - fun authenticationMethod(): AuthenticationMethod = authenticationMethod.getRequired("authentication_method") - @JsonProperty("status") @ExcludeMissing fun _status() = status + fun status(): ConnectionStatusType = status.getRequired("status") @JsonProperty("authentication_method") @ExcludeMissing fun _authenticationMethod() = authenticationMethod + @JsonProperty("status") @ExcludeMissing fun _status() = status + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -230,8 +230,8 @@ private constructor( fun validate(): Data = apply { if (!validated) { - status() authenticationMethod().validate() + status() validated = true } } @@ -245,21 +245,17 @@ private constructor( class Builder { - private var status: JsonField = JsonMissing.of() private var authenticationMethod: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(data: Data) = apply { - status = data.status authenticationMethod = data.authenticationMethod + status = data.status additionalProperties = data.additionalProperties.toMutableMap() } - fun status(status: ConnectionStatusType) = status(JsonField.of(status)) - - fun status(status: JsonField) = apply { this.status = status } - fun authenticationMethod(authenticationMethod: AuthenticationMethod) = authenticationMethod(JsonField.of(authenticationMethod)) @@ -268,6 +264,10 @@ private constructor( this.authenticationMethod = authenticationMethod } + fun status(status: ConnectionStatusType) = status(JsonField.of(status)) + + fun status(status: JsonField) = apply { this.status = status } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -289,8 +289,8 @@ private constructor( fun build(): Data = Data( - status, authenticationMethod, + status, additionalProperties.toImmutable(), ) } @@ -299,22 +299,19 @@ private constructor( class AuthenticationMethod @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("benefits_support") @ExcludeMissing private val benefitsSupport: JsonField = JsonMissing.of(), @JsonProperty("supported_fields") @ExcludeMissing private val supportedFields: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 @@ -327,7 +324,7 @@ private constructor( Optional.ofNullable(supportedFields.getNullable("supported_fields")) /** The type of authentication method. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** * Each benefit type and their supported features. If the benefit type is not supported, @@ -342,6 +339,9 @@ private constructor( @ExcludeMissing fun _supportedFields() = supportedFields + /** The type of authentication method. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -350,9 +350,9 @@ private constructor( fun validate(): AuthenticationMethod = apply { if (!validated) { - type() benefitsSupport().map { it.validate() } supportedFields().map { it.validate() } + type() validated = true } } @@ -366,25 +366,19 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var benefitsSupport: JsonField = JsonMissing.of() private var supportedFields: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - type = authenticationMethod.type benefitsSupport = authenticationMethod.benefitsSupport supportedFields = authenticationMethod.supportedFields + type = authenticationMethod.type additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } - /** The type of authentication method. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The type of authentication method. */ - 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 @@ -409,6 +403,12 @@ private constructor( this.supportedFields = supportedFields } + /** The type of authentication method. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The type of authentication method. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -433,9 +433,9 @@ private constructor( fun build(): AuthenticationMethod = AuthenticationMethod( - type, benefitsSupport, supportedFields, + type, additionalProperties.toImmutable(), ) } @@ -451,21 +451,21 @@ private constructor( @JsonProperty("directory") @ExcludeMissing private val directory: JsonField = JsonMissing.of(), - @JsonProperty("individual") - @ExcludeMissing - private val individual: JsonField = JsonMissing.of(), @JsonProperty("employment") @ExcludeMissing private val employment: JsonField = JsonMissing.of(), - @JsonProperty("payment") + @JsonProperty("individual") @ExcludeMissing - private val payment: JsonField = JsonMissing.of(), + private val individual: JsonField = JsonMissing.of(), + @JsonProperty("pay_group") + @ExcludeMissing + private val payGroup: JsonField = JsonMissing.of(), @JsonProperty("pay_statement") @ExcludeMissing private val payStatement: JsonField = JsonMissing.of(), - @JsonProperty("pay_group") + @JsonProperty("payment") @ExcludeMissing - private val payGroup: JsonField = JsonMissing.of(), + private val payment: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -476,34 +476,34 @@ private constructor( 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 individual(): Optional = + Optional.ofNullable(individual.getNullable("individual")) + + fun payGroup(): Optional = + Optional.ofNullable(payGroup.getNullable("pay_group")) fun payStatement(): Optional = Optional.ofNullable(payStatement.getNullable("pay_statement")) - fun payGroup(): Optional = - Optional.ofNullable(payGroup.getNullable("pay_group")) + fun payment(): Optional = + Optional.ofNullable(payment.getNullable("payment")) @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("individual") @ExcludeMissing fun _individual() = individual + + @JsonProperty("pay_group") @ExcludeMissing fun _payGroup() = payGroup @JsonProperty("pay_statement") @ExcludeMissing fun _payStatement() = payStatement - @JsonProperty("pay_group") @ExcludeMissing fun _payGroup() = payGroup + @JsonProperty("payment") @ExcludeMissing fun _payment() = payment @JsonAnyGetter @ExcludeMissing @@ -515,11 +515,11 @@ private constructor( 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() } + individual().map { it.validate() } payGroup().map { it.validate() } + payStatement().map { it.validate() } + payment().map { it.validate() } validated = true } } @@ -535,23 +535,23 @@ private constructor( 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 individual: JsonField = JsonMissing.of() + private var payGroup: JsonField = JsonMissing.of() private var payStatement: JsonField = JsonMissing.of() - private var payGroup: JsonField = JsonMissing.of() + private var payment: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedFields: SupportedFields) = apply { company = supportedFields.company directory = supportedFields.directory - individual = supportedFields.individual employment = supportedFields.employment - payment = supportedFields.payment - payStatement = supportedFields.payStatement + individual = supportedFields.individual payGroup = supportedFields.payGroup + payStatement = supportedFields.payStatement + payment = supportedFields.payment additionalProperties = supportedFields.additionalProperties.toMutableMap() } @@ -568,13 +568,6 @@ private constructor( this.directory = directory } - fun individual(individual: SupportedIndividualFields) = - individual(JsonField.of(individual)) - - fun individual(individual: JsonField) = apply { - this.individual = individual - } - fun employment(employment: SupportedEmploymentFields) = employment(JsonField.of(employment)) @@ -582,10 +575,18 @@ private constructor( this.employment = employment } - fun payment(payment: SupportedPaymentFields) = payment(JsonField.of(payment)) + fun individual(individual: SupportedIndividualFields) = + individual(JsonField.of(individual)) - fun payment(payment: JsonField) = apply { - this.payment = payment + fun individual(individual: JsonField) = apply { + this.individual = individual + } + + fun payGroup(payGroup: SupportedPayGroupFields) = + payGroup(JsonField.of(payGroup)) + + fun payGroup(payGroup: JsonField) = apply { + this.payGroup = payGroup } fun payStatement(payStatement: SupportedPayStatementFields) = @@ -595,11 +596,10 @@ private constructor( this.payStatement = payStatement } - fun payGroup(payGroup: SupportedPayGroupFields) = - payGroup(JsonField.of(payGroup)) + fun payment(payment: SupportedPaymentFields) = payment(JsonField.of(payment)) - fun payGroup(payGroup: JsonField) = apply { - this.payGroup = payGroup + fun payment(payment: JsonField) = apply { + this.payment = payment } fun additionalProperties(additionalProperties: Map) = apply { @@ -628,11 +628,11 @@ private constructor( SupportedFields( company, directory, - individual, employment, - payment, - payStatement, + individual, payGroup, + payStatement, + payment, additionalProperties.toImmutable(), ) } @@ -644,64 +644,72 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("legal_name") - @ExcludeMissing - private val legalName: JsonField = JsonMissing.of(), - @JsonProperty("entity") - @ExcludeMissing - private val entity: JsonField = JsonMissing.of(), - @JsonProperty("primary_email") + @JsonProperty("accounts") @ExcludeMissing - private val primaryEmail: JsonField = JsonMissing.of(), - @JsonProperty("primary_phone_number") + private val accounts: JsonField = JsonMissing.of(), + @JsonProperty("departments") @ExcludeMissing - private val primaryPhoneNumber: JsonField = JsonMissing.of(), + private val departments: JsonField = JsonMissing.of(), @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), - @JsonProperty("accounts") + @JsonProperty("entity") @ExcludeMissing - private val accounts: JsonField = JsonMissing.of(), - @JsonProperty("departments") + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") @ExcludeMissing - private val departments: JsonField = JsonMissing.of(), + private val legalName: JsonField = JsonMissing.of(), @JsonProperty("locations") @ExcludeMissing private val locations: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - fun legalName(): Optional = - Optional.ofNullable(legalName.getNullable("legal_name")) + fun accounts(): Optional = + Optional.ofNullable(accounts.getNullable("accounts")) + + fun departments(): Optional = + Optional.ofNullable(departments.getNullable("departments")) + + fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity")) + fun legalName(): Optional = + Optional.ofNullable(legalName.getNullable("legal_name")) + + fun locations(): Optional = + Optional.ofNullable(locations.getNullable("locations")) + 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")) + @JsonProperty("id") @ExcludeMissing fun _id() = id - fun accounts(): Optional = - Optional.ofNullable(accounts.getNullable("accounts")) + @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts - fun departments(): Optional = - Optional.ofNullable(departments.getNullable("departments")) + @JsonProperty("departments") @ExcludeMissing fun _departments() = departments - fun locations(): Optional = - Optional.ofNullable(locations.getNullable("locations")) + @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("entity") @ExcludeMissing fun _entity() = entity @JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName - @JsonProperty("entity") @ExcludeMissing fun _entity() = entity + @JsonProperty("locations") @ExcludeMissing fun _locations() = locations @JsonProperty("primary_email") @ExcludeMissing @@ -711,14 +719,6 @@ private constructor( @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 @@ -728,14 +728,14 @@ private constructor( fun validate(): SupportedCompanyFields = apply { if (!validated) { id() - legalName() - entity().map { it.validate() } - primaryEmail() - primaryPhoneNumber() - ein() accounts().map { it.validate() } departments().map { it.validate() } + ein() + entity().map { it.validate() } + legalName() locations().map { it.validate() } + primaryEmail() + primaryPhoneNumber() validated = true } } @@ -750,28 +750,28 @@ private constructor( 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 ein: JsonField = JsonMissing.of() + private var entity: JsonField = JsonMissing.of() + private var legalName: JsonField = JsonMissing.of() private var locations: JsonField = JsonMissing.of() + private var primaryEmail: JsonField = JsonMissing.of() + private var primaryPhoneNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedCompanyFields: SupportedCompanyFields) = apply { id = supportedCompanyFields.id - legalName = supportedCompanyFields.legalName - entity = supportedCompanyFields.entity - primaryEmail = supportedCompanyFields.primaryEmail - primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber - ein = supportedCompanyFields.ein accounts = supportedCompanyFields.accounts departments = supportedCompanyFields.departments + ein = supportedCompanyFields.ein + entity = supportedCompanyFields.entity + legalName = supportedCompanyFields.legalName locations = supportedCompanyFields.locations + primaryEmail = supportedCompanyFields.primaryEmail + primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber additionalProperties = supportedCompanyFields.additionalProperties.toMutableMap() } @@ -780,15 +780,38 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } + fun accounts(accounts: Accounts) = accounts(JsonField.of(accounts)) + + fun accounts(accounts: JsonField) = apply { + this.accounts = accounts + } + + fun departments(departments: Departments) = + departments(JsonField.of(departments)) + + fun departments(departments: JsonField) = apply { + this.departments = departments + } + + fun ein(ein: Boolean) = ein(JsonField.of(ein)) + + fun ein(ein: JsonField) = apply { this.ein = ein } + + fun entity(entity: Entity) = entity(JsonField.of(entity)) + + fun entity(entity: JsonField) = apply { this.entity = entity } + fun legalName(legalName: Boolean) = legalName(JsonField.of(legalName)) fun legalName(legalName: JsonField) = apply { this.legalName = legalName } - fun entity(entity: Entity) = entity(JsonField.of(entity)) + fun locations(locations: Locations) = locations(JsonField.of(locations)) - fun entity(entity: JsonField) = apply { this.entity = entity } + fun locations(locations: JsonField) = apply { + this.locations = locations + } fun primaryEmail(primaryEmail: Boolean) = primaryEmail(JsonField.of(primaryEmail)) @@ -804,29 +827,6 @@ private constructor( this.primaryPhoneNumber = primaryPhoneNumber } - fun ein(ein: Boolean) = ein(JsonField.of(ein)) - - fun ein(ein: JsonField) = apply { this.ein = ein } - - fun accounts(accounts: Accounts) = accounts(JsonField.of(accounts)) - - fun accounts(accounts: JsonField) = apply { - this.accounts = accounts - } - - fun departments(departments: Departments) = - departments(JsonField.of(departments)) - - fun departments(departments: JsonField) = apply { - this.departments = departments - } - - fun locations(locations: Locations) = locations(JsonField.of(locations)) - - fun locations(locations: JsonField) = apply { - this.locations = locations - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -852,14 +852,14 @@ private constructor( fun build(): SupportedCompanyFields = SupportedCompanyFields( id, - legalName, - entity, - primaryEmail, - primaryPhoneNumber, - ein, accounts, departments, + ein, + entity, + legalName, locations, + primaryEmail, + primaryPhoneNumber, additionalProperties.toImmutable(), ) } @@ -868,60 +868,60 @@ private constructor( class Accounts @JsonCreator private constructor( - @JsonProperty("routing_number") - @ExcludeMissing - private val routingNumber: JsonField = JsonMissing.of(), @JsonProperty("account_name") @ExcludeMissing private val accountName: JsonField = JsonMissing.of(), - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - private val institutionName: JsonField = JsonMissing.of(), + private val accountNumber: JsonField = JsonMissing.of(), @JsonProperty("account_type") @ExcludeMissing private val accountType: JsonField = JsonMissing.of(), - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - private val accountNumber: JsonField = JsonMissing.of(), + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - 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 accountNumber(): Optional = + Optional.ofNullable(accountNumber.getNullable("account_number")) fun accountType(): Optional = Optional.ofNullable(accountType.getNullable("account_type")) - fun accountNumber(): Optional = - Optional.ofNullable(accountNumber.getNullable("account_number")) + fun institutionName(): Optional = + Optional.ofNullable(institutionName.getNullable("institution_name")) - @JsonProperty("routing_number") - @ExcludeMissing - fun _routingNumber() = routingNumber + fun routingNumber(): Optional = + Optional.ofNullable(routingNumber.getNullable("routing_number")) @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - fun _institutionName() = institutionName + fun _accountNumber() = accountNumber @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - fun _accountNumber() = accountNumber + fun _institutionName() = institutionName + + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber() = routingNumber @JsonAnyGetter @ExcludeMissing @@ -931,11 +931,11 @@ private constructor( fun validate(): Accounts = apply { if (!validated) { - routingNumber() accountName() - institutionName() - accountType() accountNumber() + accountType() + institutionName() + routingNumber() validated = true } } @@ -949,31 +949,24 @@ private constructor( 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 accountType: JsonField = JsonMissing.of() + private var institutionName: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accounts: Accounts) = apply { - routingNumber = accounts.routingNumber accountName = accounts.accountName - institutionName = accounts.institutionName - accountType = accounts.accountType accountNumber = accounts.accountNumber + accountType = accounts.accountType + institutionName = accounts.institutionName + routingNumber = accounts.routingNumber additionalProperties = accounts.additionalProperties.toMutableMap() } - fun routingNumber(routingNumber: Boolean) = - routingNumber(JsonField.of(routingNumber)) - - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } - fun accountName(accountName: Boolean) = accountName(JsonField.of(accountName)) @@ -981,11 +974,11 @@ private constructor( this.accountName = accountName } - fun institutionName(institutionName: Boolean) = - institutionName(JsonField.of(institutionName)) + fun accountNumber(accountNumber: Boolean) = + accountNumber(JsonField.of(accountNumber)) - fun institutionName(institutionName: JsonField) = apply { - this.institutionName = institutionName + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber } fun accountType(accountType: Boolean) = @@ -995,11 +988,18 @@ private constructor( this.accountType = accountType } - fun accountNumber(accountNumber: Boolean) = - accountNumber(JsonField.of(accountNumber)) + fun institutionName(institutionName: Boolean) = + institutionName(JsonField.of(institutionName)) - fun accountNumber(accountNumber: JsonField) = apply { - this.accountNumber = accountNumber + fun institutionName(institutionName: JsonField) = apply { + this.institutionName = institutionName + } + + fun routingNumber(routingNumber: Boolean) = + routingNumber(JsonField.of(routingNumber)) + + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } fun additionalProperties(additionalProperties: Map) = @@ -1026,11 +1026,11 @@ private constructor( fun build(): Accounts = Accounts( - routingNumber, accountName, - institutionName, - accountType, accountNumber, + accountType, + institutionName, + routingNumber, additionalProperties.toImmutable(), ) } @@ -1040,17 +1040,17 @@ private constructor( return true } - return /* spotless:off */ other is Accounts && routingNumber == other.routingNumber && accountName == other.accountName && institutionName == other.institutionName && accountType == other.accountType && accountNumber == other.accountNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Accounts && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(routingNumber, accountName, institutionName, accountType, accountNumber, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Accounts{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" + "Accounts{accountName=$accountName, accountNumber=$accountNumber, accountType=$accountType, institutionName=$institutionName, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1274,27 +1274,27 @@ private constructor( class Entity @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), - @JsonAnySetter + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1303,8 +1303,8 @@ private constructor( fun validate(): Entity = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -1318,28 +1318,28 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(entity: Entity) = apply { - type = entity.type subtype = entity.subtype + type = entity.type additionalProperties = entity.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - fun subtype(subtype: Boolean) = subtype(JsonField.of(subtype)) fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1364,8 +1364,8 @@ private constructor( fun build(): Entity = Entity( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -1375,75 +1375,75 @@ private constructor( return true } - return /* spotless:off */ other is Entity && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Entity{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class Locations @JsonCreator private constructor( + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), - @JsonProperty("city") - @ExcludeMissing - private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), @JsonProperty("postal_code") @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun city(): Optional = + Optional.ofNullable(city.getNullable("city")) + + fun country(): Optional = + Optional.ofNullable(country.getNullable("country")) + 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 postalCode(): Optional = + Optional.ofNullable(postalCode.getNullable("postal_code")) fun state(): Optional = Optional.ofNullable(state.getNullable("state")) - fun postalCode(): Optional = - Optional.ofNullable(postalCode.getNullable("postal_code")) + @JsonProperty("city") @ExcludeMissing fun _city() = city - fun country(): Optional = - Optional.ofNullable(country.getNullable("country")) + @JsonProperty("country") @ExcludeMissing fun _country() = 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 + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -1453,12 +1453,12 @@ private constructor( fun validate(): Locations = apply { if (!validated) { + city() + country() line1() line2() - city() - state() postalCode() - country() + state() validated = true } } @@ -1472,41 +1472,43 @@ private constructor( class Builder { + private var city: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() 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 state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(locations: Locations) = apply { + city = locations.city + country = locations.country line1 = locations.line1 line2 = locations.line2 - city = locations.city - state = locations.state postalCode = locations.postalCode - country = locations.country + state = locations.state additionalProperties = locations.additionalProperties.toMutableMap() } - fun line1(line1: Boolean) = line1(JsonField.of(line1)) + fun city(city: Boolean) = city(JsonField.of(city)) - fun line1(line1: JsonField) = apply { this.line1 = line1 } + fun city(city: JsonField) = apply { this.city = city } - fun line2(line2: Boolean) = line2(JsonField.of(line2)) + fun country(country: Boolean) = country(JsonField.of(country)) - fun line2(line2: JsonField) = apply { this.line2 = line2 } + fun country(country: JsonField) = apply { + this.country = country + } - fun city(city: Boolean) = city(JsonField.of(city)) + fun line1(line1: Boolean) = line1(JsonField.of(line1)) - fun city(city: JsonField) = apply { this.city = city } + fun line1(line1: JsonField) = apply { this.line1 = line1 } - fun state(state: Boolean) = state(JsonField.of(state)) + fun line2(line2: Boolean) = line2(JsonField.of(line2)) - fun state(state: JsonField) = apply { this.state = state } + fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) @@ -1515,11 +1517,9 @@ private constructor( this.postalCode = postalCode } - fun country(country: Boolean) = country(JsonField.of(country)) + fun state(state: Boolean) = state(JsonField.of(state)) - fun country(country: JsonField) = apply { - this.country = country - } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { @@ -1545,12 +1545,12 @@ private constructor( fun build(): Locations = Locations( + city, + country, line1, line2, - city, - state, postalCode, - country, + state, additionalProperties.toImmutable(), ) } @@ -1560,17 +1560,17 @@ private constructor( return true } - return /* spotless:off */ other is Locations && line1 == other.line1 && line2 == other.line2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Locations && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(line1, line2, city, state, postalCode, country, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Locations{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "Locations{city=$city, country=$country, line1=$line1, line2=$line2, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1578,43 +1578,43 @@ private constructor( return true } - return /* spotless:off */ other is SupportedCompanyFields && id == other.id && legalName == other.legalName && entity == other.entity && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && ein == other.ein && accounts == other.accounts && departments == other.departments && locations == other.locations && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedCompanyFields && id == other.id && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, legalName, entity, primaryEmail, primaryPhoneNumber, ein, accounts, departments, locations, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = 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}" + "SupportedCompanyFields{id=$id, accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect class SupportedDirectoryFields @JsonCreator private constructor( - @JsonProperty("paging") - @ExcludeMissing - private val paging: JsonField = JsonMissing.of(), @JsonProperty("individuals") @ExcludeMissing private val individuals: JsonField = JsonMissing.of(), + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun paging(): Optional = - Optional.ofNullable(paging.getNullable("paging")) - fun individuals(): Optional = Optional.ofNullable(individuals.getNullable("individuals")) - @JsonProperty("paging") @ExcludeMissing fun _paging() = paging + fun paging(): Optional = + Optional.ofNullable(paging.getNullable("paging")) @JsonProperty("individuals") @ExcludeMissing fun _individuals() = individuals + @JsonProperty("paging") @ExcludeMissing fun _paging() = paging + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1623,8 +1623,8 @@ private constructor( fun validate(): SupportedDirectoryFields = apply { if (!validated) { - paging().map { it.validate() } individuals().map { it.validate() } + paging().map { it.validate() } validated = true } } @@ -1638,24 +1638,20 @@ private constructor( class Builder { - private var paging: JsonField = JsonMissing.of() private var individuals: JsonField = JsonMissing.of() + private var paging: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedDirectoryFields: SupportedDirectoryFields) = apply { - paging = supportedDirectoryFields.paging individuals = supportedDirectoryFields.individuals + paging = supportedDirectoryFields.paging additionalProperties = supportedDirectoryFields.additionalProperties.toMutableMap() } - fun paging(paging: Paging) = paging(JsonField.of(paging)) - - fun paging(paging: JsonField) = apply { this.paging = paging } - fun individuals(individuals: Individuals) = individuals(JsonField.of(individuals)) @@ -1663,6 +1659,10 @@ private constructor( this.individuals = individuals } + fun paging(paging: Paging) = paging(JsonField.of(paging)) + + fun paging(paging: JsonField) = apply { this.paging = paging } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1687,8 +1687,8 @@ private constructor( fun build(): SupportedDirectoryFields = SupportedDirectoryFields( - paging, individuals, + paging, additionalProperties.toImmutable(), ) } @@ -1700,24 +1700,24 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") - @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("department") + @JsonProperty("last_name") @ExcludeMissing - private val department: JsonField = JsonMissing.of(), + private val lastName: JsonField = JsonMissing.of(), @JsonProperty("manager") @ExcludeMissing private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), @@ -1725,38 +1725,38 @@ private constructor( fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun department(): Optional = + Optional.ofNullable(department.getNullable("department")) + 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 lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonProperty("department") @ExcludeMissing fun _department() = department - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - @JsonProperty("department") @ExcludeMissing fun _department() = department + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1766,12 +1766,12 @@ private constructor( fun validate(): Individuals = apply { if (!validated) { id() + department() firstName() - middleName() - lastName() isActive() - department() + lastName() manager().map { it.validate() } + middleName() validated = true } } @@ -1786,24 +1786,24 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var department: 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 lastName: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individuals: Individuals) = apply { id = individuals.id + department = individuals.department firstName = individuals.firstName - middleName = individuals.middleName - lastName = individuals.lastName isActive = individuals.isActive - department = individuals.department + lastName = individuals.lastName manager = individuals.manager + middleName = individuals.middleName additionalProperties = individuals.additionalProperties.toMutableMap() } @@ -1812,23 +1812,17 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - - fun firstName(firstName: JsonField) = apply { - this.firstName = firstName - } - - fun middleName(middleName: Boolean) = - middleName(JsonField.of(middleName)) + fun department(department: Boolean) = + department(JsonField.of(department)) - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName + fun department(department: JsonField) = apply { + this.department = department } - fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - fun lastName(lastName: JsonField) = apply { - this.lastName = lastName + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName } fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) @@ -1837,11 +1831,10 @@ private constructor( this.isActive = isActive } - fun department(department: Boolean) = - department(JsonField.of(department)) + fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - fun department(department: JsonField) = apply { - this.department = department + fun lastName(lastName: JsonField) = apply { + this.lastName = lastName } fun manager(manager: Manager) = manager(JsonField.of(manager)) @@ -1850,6 +1843,13 @@ private constructor( this.manager = manager } + fun middleName(middleName: Boolean) = + middleName(JsonField.of(middleName)) + + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1875,12 +1875,12 @@ private constructor( fun build(): Individuals = Individuals( id, + department, firstName, - middleName, - lastName, isActive, - department, + lastName, manager, + middleName, additionalProperties.toImmutable(), ) } @@ -1989,17 +1989,17 @@ private constructor( return true } - return /* spotless:off */ other is Individuals && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && isActive == other.isActive && department == other.department && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Individuals && id == other.id && department == other.department && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && manager == other.manager && middleName == other.middleName && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, isActive, department, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, department, firstName, isActive, lastName, manager, middleName, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Individuals{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, isActive=$isActive, department=$department, manager=$manager, additionalProperties=$additionalProperties}" + "Individuals{id=$id, department=$department, firstName=$firstName, isActive=$isActive, lastName=$lastName, manager=$manager, middleName=$middleName, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2123,17 +2123,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedDirectoryFields && paging == other.paging && individuals == other.individuals && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedDirectoryFields && individuals == other.individuals && paging == other.paging && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paging, individuals, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(individuals, paging, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedDirectoryFields{paging=$paging, individuals=$individuals, additionalProperties=$additionalProperties}" + "SupportedDirectoryFields{individuals=$individuals, paging=$paging, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2143,86 +2143,60 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("first_name") + @JsonProperty("class_code") @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("custom_fields") @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") + private val customFields: JsonField = JsonMissing.of(), + @JsonProperty("department") @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("title") + private val department: JsonField = JsonMissing.of(), + @JsonProperty("employment") @ExcludeMissing - private val title: JsonField = JsonMissing.of(), - @JsonProperty("start_date") + private val employment: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), + private val employmentStatus: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), - @JsonProperty("is_active") + @JsonProperty("first_name") @ExcludeMissing - private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("employment_status") + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("income") @ExcludeMissing - private val employmentStatus: JsonField = JsonMissing.of(), + private val income: JsonField = JsonMissing.of(), @JsonProperty("income_history") @ExcludeMissing private val incomeHistory: JsonField = JsonMissing.of(), - @JsonProperty("class_code") - @ExcludeMissing - private val classCode: JsonField = JsonMissing.of(), - @JsonProperty("custom_fields") - @ExcludeMissing - private val customFields: JsonField = JsonMissing.of(), - @JsonProperty("department") - @ExcludeMissing - private val department: JsonField = JsonMissing.of(), - @JsonProperty("employment") + @JsonProperty("is_active") @ExcludeMissing - private val employment: JsonField = JsonMissing.of(), - @JsonProperty("income") + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("last_name") @ExcludeMissing - private val income: JsonField = JsonMissing.of(), + private val lastName: JsonField = JsonMissing.of(), @JsonProperty("location") @ExcludeMissing private val location: JsonField = JsonMissing.of(), @JsonProperty("manager") @ExcludeMissing private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("title") + @ExcludeMissing + private val title: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { 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 title(): Optional = Optional.ofNullable(title.getNullable("title")) - - fun startDate(): Optional = - Optional.ofNullable(startDate.getNullable("start_date")) - - fun endDate(): Optional = - Optional.ofNullable(endDate.getNullable("end_date")) - - fun isActive(): Optional = - Optional.ofNullable(isActive.getNullable("is_active")) - - fun employmentStatus(): Optional = - Optional.ofNullable(employmentStatus.getNullable("employment_status")) - - fun incomeHistory(): Optional = - Optional.ofNullable(incomeHistory.getNullable("income_history")) - fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) @@ -2235,54 +2209,80 @@ private constructor( fun employment(): Optional = Optional.ofNullable(employment.getNullable("employment")) + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + + fun endDate(): Optional = + Optional.ofNullable(endDate.getNullable("end_date")) + + fun firstName(): Optional = + Optional.ofNullable(firstName.getNullable("first_name")) + fun income(): Optional = Optional.ofNullable(income.getNullable("income")) + fun incomeHistory(): Optional = + Optional.ofNullable(incomeHistory.getNullable("income_history")) + + fun isActive(): Optional = + Optional.ofNullable(isActive.getNullable("is_active")) + + fun lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) + fun location(): Optional = Optional.ofNullable(location.getNullable("location")) fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + fun startDate(): Optional = + Optional.ofNullable(startDate.getNullable("start_date")) - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + fun title(): Optional = Optional.ofNullable(title.getNullable("title")) - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("title") @ExcludeMissing fun _title() = title + @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + @JsonProperty("custom_fields") + @ExcludeMissing + fun _customFields() = customFields - @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + @JsonProperty("department") @ExcludeMissing fun _department() = department - @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + @JsonProperty("employment") @ExcludeMissing fun _employment() = employment @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus + @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + + @JsonProperty("income") @ExcludeMissing fun _income() = income + @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory - @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode + @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - @JsonProperty("custom_fields") - @ExcludeMissing - fun _customFields() = customFields + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - @JsonProperty("department") @ExcludeMissing fun _department() = department + @JsonProperty("location") @ExcludeMissing fun _location() = location - @JsonProperty("employment") @ExcludeMissing fun _employment() = employment + @JsonProperty("manager") @ExcludeMissing fun _manager() = manager - @JsonProperty("income") @ExcludeMissing fun _income() = income + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName - @JsonProperty("location") @ExcludeMissing fun _location() = location + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate - @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + @JsonProperty("title") @ExcludeMissing fun _title() = title @JsonAnyGetter @ExcludeMissing @@ -2293,22 +2293,22 @@ private constructor( fun validate(): SupportedEmploymentFields = apply { if (!validated) { id() - firstName() - middleName() - lastName() - title() - startDate() - endDate() - isActive() - employmentStatus() - incomeHistory() classCode() customFields() department().map { it.validate() } employment().map { it.validate() } + employmentStatus() + endDate() + firstName() income().map { it.validate() } + incomeHistory() + isActive() + lastName() location().map { it.validate() } manager().map { it.validate() } + middleName() + startDate() + title() validated = true } } @@ -2323,22 +2323,22 @@ private constructor( 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 title: JsonField = JsonMissing.of() - private var startDate: JsonField = JsonMissing.of() - private var endDate: JsonField = JsonMissing.of() - private var isActive: JsonField = JsonMissing.of() - private var employmentStatus: JsonField = JsonMissing.of() - private var incomeHistory: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField = JsonMissing.of() private var department: JsonField = JsonMissing.of() private var employment: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() + private var endDate: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() + private var incomeHistory: JsonField = JsonMissing.of() + private var isActive: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() + private var title: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -2346,22 +2346,22 @@ private constructor( internal fun from(supportedEmploymentFields: SupportedEmploymentFields) = apply { id = supportedEmploymentFields.id - firstName = supportedEmploymentFields.firstName - middleName = supportedEmploymentFields.middleName - lastName = supportedEmploymentFields.lastName - title = supportedEmploymentFields.title - startDate = supportedEmploymentFields.startDate - endDate = supportedEmploymentFields.endDate - isActive = supportedEmploymentFields.isActive - employmentStatus = supportedEmploymentFields.employmentStatus - incomeHistory = supportedEmploymentFields.incomeHistory classCode = supportedEmploymentFields.classCode customFields = supportedEmploymentFields.customFields department = supportedEmploymentFields.department employment = supportedEmploymentFields.employment + employmentStatus = supportedEmploymentFields.employmentStatus + endDate = supportedEmploymentFields.endDate + firstName = supportedEmploymentFields.firstName income = supportedEmploymentFields.income + incomeHistory = supportedEmploymentFields.incomeHistory + isActive = supportedEmploymentFields.isActive + lastName = supportedEmploymentFields.lastName location = supportedEmploymentFields.location manager = supportedEmploymentFields.manager + middleName = supportedEmploymentFields.middleName + startDate = supportedEmploymentFields.startDate + title = supportedEmploymentFields.title additionalProperties = supportedEmploymentFields.additionalProperties.toMutableMap() } @@ -2370,50 +2370,53 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) + fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) - fun firstName(firstName: JsonField) = apply { - this.firstName = firstName + fun classCode(classCode: JsonField) = apply { + this.classCode = classCode } - fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) + fun customFields(customFields: Boolean) = + customFields(JsonField.of(customFields)) - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName + fun customFields(customFields: JsonField) = apply { + this.customFields = customFields } - fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) + fun department(department: Department) = + department(JsonField.of(department)) - fun lastName(lastName: JsonField) = apply { - this.lastName = lastName + fun department(department: JsonField) = apply { + this.department = department } - fun title(title: Boolean) = title(JsonField.of(title)) + fun employment(employment: Employment) = + employment(JsonField.of(employment)) - fun title(title: JsonField) = apply { this.title = title } + fun employment(employment: JsonField) = apply { + this.employment = employment + } - fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) + fun employmentStatus(employmentStatus: Boolean) = + employmentStatus(JsonField.of(employmentStatus)) - fun startDate(startDate: JsonField) = apply { - this.startDate = startDate + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - fun isActive(isActive: JsonField) = apply { - this.isActive = isActive + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName } - fun employmentStatus(employmentStatus: Boolean) = - employmentStatus(JsonField.of(employmentStatus)) + fun income(income: Income) = income(JsonField.of(income)) - fun employmentStatus(employmentStatus: JsonField) = apply { - this.employmentStatus = employmentStatus - } + fun income(income: JsonField) = apply { this.income = income } fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) @@ -2422,46 +2425,43 @@ private constructor( this.incomeHistory = incomeHistory } - fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - fun classCode(classCode: JsonField) = apply { - this.classCode = classCode + fun isActive(isActive: JsonField) = apply { + this.isActive = isActive } - fun customFields(customFields: Boolean) = - customFields(JsonField.of(customFields)) + fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - fun customFields(customFields: JsonField) = apply { - this.customFields = customFields + fun lastName(lastName: JsonField) = apply { + this.lastName = lastName } - fun department(department: Department) = - department(JsonField.of(department)) + fun location(location: Location) = location(JsonField.of(location)) - fun department(department: JsonField) = apply { - this.department = department + fun location(location: JsonField) = apply { + this.location = location } - fun employment(employment: Employment) = - employment(JsonField.of(employment)) + fun manager(manager: Manager) = manager(JsonField.of(manager)) - fun employment(employment: JsonField) = apply { - this.employment = employment - } + fun manager(manager: JsonField) = apply { this.manager = manager } - fun income(income: Income) = income(JsonField.of(income)) + fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) - fun income(income: JsonField) = apply { this.income = income } + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName + } - fun location(location: Location) = location(JsonField.of(location)) + fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - fun location(location: JsonField) = apply { - this.location = location + fun startDate(startDate: JsonField) = apply { + this.startDate = startDate } - fun manager(manager: Manager) = manager(JsonField.of(manager)) + fun title(title: Boolean) = title(JsonField.of(title)) - fun manager(manager: JsonField) = apply { this.manager = manager } + fun title(title: JsonField) = apply { this.title = title } fun additionalProperties(additionalProperties: Map) = apply { @@ -2488,22 +2488,22 @@ private constructor( fun build(): SupportedEmploymentFields = SupportedEmploymentFields( id, - firstName, - middleName, - lastName, - title, - startDate, - endDate, - isActive, - employmentStatus, - incomeHistory, classCode, customFields, department, employment, + employmentStatus, + endDate, + firstName, income, + incomeHistory, + isActive, + lastName, location, manager, + middleName, + startDate, + title, additionalProperties.toImmutable(), ) } @@ -2610,27 +2610,27 @@ private constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2639,8 +2639,8 @@ private constructor( fun validate(): Employment = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -2654,29 +2654,29 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - fun subtype(subtype: Boolean) = subtype(JsonField.of(subtype)) fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2701,8 +2701,8 @@ private constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -2712,17 +2712,17 @@ private constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2863,58 +2863,58 @@ private constructor( class Location @JsonCreator private constructor( + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), - @JsonProperty("city") - @ExcludeMissing - private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), @JsonProperty("postal_code") @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun city(): Optional = + Optional.ofNullable(city.getNullable("city")) + + fun country(): Optional = + Optional.ofNullable(country.getNullable("country")) + 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 postalCode(): Optional = + Optional.ofNullable(postalCode.getNullable("postal_code")) fun state(): Optional = Optional.ofNullable(state.getNullable("state")) - fun postalCode(): Optional = - Optional.ofNullable(postalCode.getNullable("postal_code")) + @JsonProperty("city") @ExcludeMissing fun _city() = city - fun country(): Optional = - Optional.ofNullable(country.getNullable("country")) + @JsonProperty("country") @ExcludeMissing fun _country() = 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 + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -2924,12 +2924,12 @@ private constructor( fun validate(): Location = apply { if (!validated) { + city() + country() line1() line2() - city() - state() postalCode() - country() + state() validated = true } } @@ -2943,41 +2943,43 @@ private constructor( class Builder { + private var city: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() 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 state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(location: Location) = apply { + city = location.city + country = location.country line1 = location.line1 line2 = location.line2 - city = location.city - state = location.state postalCode = location.postalCode - country = location.country + state = location.state additionalProperties = location.additionalProperties.toMutableMap() } - fun line1(line1: Boolean) = line1(JsonField.of(line1)) + fun city(city: Boolean) = city(JsonField.of(city)) - fun line1(line1: JsonField) = apply { this.line1 = line1 } + fun city(city: JsonField) = apply { this.city = city } - fun line2(line2: Boolean) = line2(JsonField.of(line2)) + fun country(country: Boolean) = country(JsonField.of(country)) - fun line2(line2: JsonField) = apply { this.line2 = line2 } + fun country(country: JsonField) = apply { + this.country = country + } - fun city(city: Boolean) = city(JsonField.of(city)) + fun line1(line1: Boolean) = line1(JsonField.of(line1)) - fun city(city: JsonField) = apply { this.city = city } + fun line1(line1: JsonField) = apply { this.line1 = line1 } - fun state(state: Boolean) = state(JsonField.of(state)) + fun line2(line2: Boolean) = line2(JsonField.of(line2)) - fun state(state: JsonField) = apply { this.state = state } + fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) @@ -2986,11 +2988,9 @@ private constructor( this.postalCode = postalCode } - fun country(country: Boolean) = country(JsonField.of(country)) + fun state(state: Boolean) = state(JsonField.of(state)) - fun country(country: JsonField) = apply { - this.country = country - } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { @@ -3016,12 +3016,12 @@ private constructor( fun build(): Location = Location( + city, + country, line1, line2, - city, - state, postalCode, - country, + state, additionalProperties.toImmutable(), ) } @@ -3031,17 +3031,17 @@ private constructor( return true } - return /* spotless:off */ other is Location && line1 == other.line1 && line2 == other.line2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Location && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(line1, line2, city, state, postalCode, country, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Location{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "Location{city=$city, country=$country, line1=$line1, line2=$line2, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3144,17 +3144,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && employmentStatus == other.employmentStatus && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && location == other.location && manager == other.manager && middleName == other.middleName && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, employmentStatus, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, location, manager, middleName, startDate, title, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" + "SupportedEmploymentFields{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, location=$location, manager=$manager, middleName=$middleName, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3164,114 +3164,114 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("first_name") - @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") - @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("preferred_name") - @ExcludeMissing - private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), - @JsonProperty("gender") + @JsonProperty("emails") @ExcludeMissing - private val gender: JsonField = JsonMissing.of(), + private val emails: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), @JsonProperty("ethnicity") @ExcludeMissing private val ethnicity: JsonField = JsonMissing.of(), - @JsonProperty("ssn") + @JsonProperty("first_name") @ExcludeMissing - private val ssn: JsonField = JsonMissing.of(), - @JsonProperty("encrypted_ssn") + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("gender") @ExcludeMissing - private val encryptedSsn: JsonField = JsonMissing.of(), - @JsonProperty("emails") + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("last_name") @ExcludeMissing - private val emails: JsonField = JsonMissing.of(), + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("residence") @ExcludeMissing private val residence: JsonField = JsonMissing.of(), + @JsonProperty("ssn") + @ExcludeMissing + private val ssn: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - fun firstName(): Optional = - Optional.ofNullable(firstName.getNullable("first_name")) + fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - fun middleName(): Optional = - Optional.ofNullable(middleName.getNullable("middle_name")) + fun emails(): Optional = + Optional.ofNullable(emails.getNullable("emails")) - fun lastName(): Optional = - Optional.ofNullable(lastName.getNullable("last_name")) + fun encryptedSsn(): Optional = + Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) - fun preferredName(): Optional = - Optional.ofNullable(preferredName.getNullable("preferred_name")) + fun ethnicity(): Optional = + Optional.ofNullable(ethnicity.getNullable("ethnicity")) - fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) + fun firstName(): Optional = + Optional.ofNullable(firstName.getNullable("first_name")) fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) - fun ethnicity(): Optional = - Optional.ofNullable(ethnicity.getNullable("ethnicity")) - - fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) - - fun encryptedSsn(): Optional = - Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) + fun lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) - fun emails(): Optional = - Optional.ofNullable(emails.getNullable("emails")) + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) fun phoneNumbers(): Optional = Optional.ofNullable(phoneNumbers.getNullable("phone_numbers")) + fun preferredName(): Optional = + Optional.ofNullable(preferredName.getNullable("preferred_name")) + fun residence(): Optional = Optional.ofNullable(residence.getNullable("residence")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("emails") @ExcludeMissing fun _emails() = emails - @JsonProperty("preferred_name") + @JsonProperty("encrypted_ssn") @ExcludeMissing - fun _preferredName() = preferredName - - @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - - @JsonProperty("gender") @ExcludeMissing fun _gender() = gender + fun _encryptedSsn() = encryptedSsn @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity - @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - @JsonProperty("encrypted_ssn") - @ExcludeMissing - fun _encryptedSsn() = encryptedSsn + @JsonProperty("gender") @ExcludeMissing fun _gender() = gender - @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers + @JsonProperty("preferred_name") + @ExcludeMissing + fun _preferredName() = preferredName + @JsonProperty("residence") @ExcludeMissing fun _residence() = residence + @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -3281,18 +3281,18 @@ private constructor( fun validate(): SupportedIndividualFields = apply { if (!validated) { id() - firstName() - middleName() - lastName() - preferredName() dob() - gender() - ethnicity() - ssn() - encryptedSsn() emails().map { it.validate() } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() phoneNumbers().map { it.validate() } + preferredName() residence().map { it.validate() } + ssn() validated = true } } @@ -3307,18 +3307,18 @@ private constructor( 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 preferredName: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() - private var gender: JsonField = JsonMissing.of() - private var ethnicity: JsonField = JsonMissing.of() - private var ssn: JsonField = JsonMissing.of() - private var encryptedSsn: JsonField = JsonMissing.of() private var emails: JsonField = JsonMissing.of() + private var encryptedSsn: JsonField = JsonMissing.of() + private var ethnicity: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() + private var gender: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField = JsonMissing.of() + private var preferredName: JsonField = JsonMissing.of() private var residence: JsonField = JsonMissing.of() + private var ssn: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3326,18 +3326,18 @@ private constructor( internal fun from(supportedIndividualFields: SupportedIndividualFields) = apply { id = supportedIndividualFields.id - firstName = supportedIndividualFields.firstName - middleName = supportedIndividualFields.middleName - lastName = supportedIndividualFields.lastName - preferredName = supportedIndividualFields.preferredName dob = supportedIndividualFields.dob - gender = supportedIndividualFields.gender - ethnicity = supportedIndividualFields.ethnicity - ssn = supportedIndividualFields.ssn - encryptedSsn = supportedIndividualFields.encryptedSsn emails = supportedIndividualFields.emails + encryptedSsn = supportedIndividualFields.encryptedSsn + ethnicity = supportedIndividualFields.ethnicity + firstName = supportedIndividualFields.firstName + gender = supportedIndividualFields.gender + lastName = supportedIndividualFields.lastName + middleName = supportedIndividualFields.middleName phoneNumbers = supportedIndividualFields.phoneNumbers + preferredName = supportedIndividualFields.preferredName residence = supportedIndividualFields.residence + ssn = supportedIndividualFields.ssn additionalProperties = supportedIndividualFields.additionalProperties.toMutableMap() } @@ -3346,59 +3346,48 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) + fun dob(dob: Boolean) = dob(JsonField.of(dob)) - fun firstName(firstName: JsonField) = apply { - this.firstName = firstName - } + fun dob(dob: JsonField) = apply { this.dob = dob } - fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) + fun emails(emails: Emails) = emails(JsonField.of(emails)) - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName - } + fun emails(emails: JsonField) = apply { this.emails = emails } - fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) + fun encryptedSsn(encryptedSsn: Boolean) = + encryptedSsn(JsonField.of(encryptedSsn)) - fun lastName(lastName: JsonField) = apply { - this.lastName = lastName + fun encryptedSsn(encryptedSsn: JsonField) = apply { + this.encryptedSsn = encryptedSsn } - fun preferredName(preferredName: Boolean) = - preferredName(JsonField.of(preferredName)) + fun ethnicity(ethnicity: Boolean) = ethnicity(JsonField.of(ethnicity)) - fun preferredName(preferredName: JsonField) = apply { - this.preferredName = preferredName + fun ethnicity(ethnicity: JsonField) = apply { + this.ethnicity = ethnicity } - fun dob(dob: Boolean) = dob(JsonField.of(dob)) + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - fun dob(dob: JsonField) = apply { this.dob = dob } + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName + } fun gender(gender: Boolean) = gender(JsonField.of(gender)) fun gender(gender: JsonField) = apply { this.gender = gender } - fun ethnicity(ethnicity: Boolean) = ethnicity(JsonField.of(ethnicity)) - - fun ethnicity(ethnicity: JsonField) = apply { - this.ethnicity = ethnicity - } - - fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) - - fun ssn(ssn: JsonField) = apply { this.ssn = ssn } - - fun encryptedSsn(encryptedSsn: Boolean) = - encryptedSsn(JsonField.of(encryptedSsn)) + fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - fun encryptedSsn(encryptedSsn: JsonField) = apply { - this.encryptedSsn = encryptedSsn + fun lastName(lastName: JsonField) = apply { + this.lastName = lastName } - fun emails(emails: Emails) = emails(JsonField.of(emails)) + fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) - fun emails(emails: JsonField) = apply { this.emails = emails } + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName + } fun phoneNumbers(phoneNumbers: PhoneNumbers) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -3407,12 +3396,23 @@ private constructor( this.phoneNumbers = phoneNumbers } + fun preferredName(preferredName: Boolean) = + preferredName(JsonField.of(preferredName)) + + fun preferredName(preferredName: JsonField) = apply { + this.preferredName = preferredName + } + fun residence(residence: Residence) = residence(JsonField.of(residence)) fun residence(residence: JsonField) = apply { this.residence = residence } + fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) + + fun ssn(ssn: JsonField) = apply { this.ssn = ssn } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -3438,18 +3438,18 @@ private constructor( fun build(): SupportedIndividualFields = SupportedIndividualFields( id, - firstName, - middleName, - lastName, - preferredName, dob, - gender, - ethnicity, - ssn, - encryptedSsn, emails, + encryptedSsn, + ethnicity, + firstName, + gender, + lastName, + middleName, phoneNumbers, + preferredName, residence, + ssn, additionalProperties.toImmutable(), ) } @@ -3877,17 +3877,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedIndividualFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && dob == other.dob && gender == other.gender && ethnicity == other.ethnicity && ssn == other.ssn && encryptedSsn == other.encryptedSsn && emails == other.emails && phoneNumbers == other.phoneNumbers && residence == other.residence && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedIndividualFields && id == other.id && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, preferredName, dob, gender, ethnicity, ssn, encryptedSsn, emails, phoneNumbers, residence, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedIndividualFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, dob=$dob, gender=$gender, ethnicity=$ethnicity, ssn=$ssn, encryptedSsn=$encryptedSsn, emails=$emails, phoneNumbers=$phoneNumbers, residence=$residence, additionalProperties=$additionalProperties}" + "SupportedIndividualFields{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3897,41 +3897,41 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("pay_frequencies") @ExcludeMissing private val payFrequencies: JsonField = JsonMissing.of(), - @JsonProperty("individual_ids") - @ExcludeMissing - private val individualIds: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun individualIds(): Optional = + Optional.ofNullable(individualIds.getNullable("individual_ids")) + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) fun payFrequencies(): Optional = Optional.ofNullable(payFrequencies.getNullable("pay_frequencies")) - fun individualIds(): Optional = - Optional.ofNullable(individualIds.getNullable("individual_ids")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("individual_ids") + @ExcludeMissing + fun _individualIds() = individualIds + @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies - @JsonProperty("individual_ids") - @ExcludeMissing - fun _individualIds() = individualIds - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -3941,9 +3941,9 @@ private constructor( fun validate(): SupportedPayGroupFields = apply { if (!validated) { id() + individualIds() name() payFrequencies() - individualIds() validated = true } } @@ -3958,9 +3958,9 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var individualIds: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var payFrequencies: JsonField = JsonMissing.of() - private var individualIds: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3968,9 +3968,9 @@ private constructor( internal fun from(supportedPayGroupFields: SupportedPayGroupFields) = apply { id = supportedPayGroupFields.id + individualIds = supportedPayGroupFields.individualIds name = supportedPayGroupFields.name payFrequencies = supportedPayGroupFields.payFrequencies - individualIds = supportedPayGroupFields.individualIds additionalProperties = supportedPayGroupFields.additionalProperties.toMutableMap() } @@ -3979,6 +3979,13 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } + fun individualIds(individualIds: Boolean) = + individualIds(JsonField.of(individualIds)) + + fun individualIds(individualIds: JsonField) = apply { + this.individualIds = individualIds + } + fun name(name: Boolean) = name(JsonField.of(name)) fun name(name: JsonField) = apply { this.name = name } @@ -3990,13 +3997,6 @@ private constructor( this.payFrequencies = payFrequencies } - fun individualIds(individualIds: Boolean) = - individualIds(JsonField.of(individualIds)) - - fun individualIds(individualIds: JsonField) = apply { - this.individualIds = individualIds - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -4022,9 +4022,9 @@ private constructor( fun build(): SupportedPayGroupFields = SupportedPayGroupFields( id, + individualIds, name, payFrequencies, - individualIds, additionalProperties.toImmutable(), ) } @@ -4034,17 +4034,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPayGroupFields && id == other.id && name == other.name && payFrequencies == other.payFrequencies && individualIds == other.individualIds && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedPayGroupFields && id == other.id && individualIds == other.individualIds && name == other.name && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, payFrequencies, individualIds, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, individualIds, name, payFrequencies, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedPayGroupFields{id=$id, name=$name, payFrequencies=$payFrequencies, individualIds=$individualIds, additionalProperties=$additionalProperties}" + "SupportedPayGroupFields{id=$id, individualIds=$individualIds, name=$name, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -4270,24 +4270,6 @@ private constructor( class PayStatements @JsonCreator private constructor( - @JsonProperty("individual_id") - @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("payment_method") - @ExcludeMissing - private val paymentMethod: JsonField = JsonMissing.of(), - @JsonProperty("total_hours") - @ExcludeMissing - private val totalHours: JsonField = JsonMissing.of(), - @JsonProperty("gross_pay") - @ExcludeMissing - private val grossPay: JsonField = JsonMissing.of(), - @JsonProperty("net_pay") - @ExcludeMissing - private val netPay: JsonField = JsonMissing.of(), @JsonProperty("earnings") @ExcludeMissing private val earnings: JsonField = JsonMissing.of(), @@ -4299,32 +4281,32 @@ private constructor( @ExcludeMissing private val employerContributions: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("payment_method") + @ExcludeMissing + private val paymentMethod: JsonField = JsonMissing.of(), @JsonProperty("taxes") @ExcludeMissing private val taxes: JsonField = JsonMissing.of(), + @JsonProperty("total_hours") + @ExcludeMissing + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) - - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - - fun paymentMethod(): Optional = - Optional.ofNullable(paymentMethod.getNullable("payment_method")) - - fun totalHours(): Optional = - Optional.ofNullable(totalHours.getNullable("total_hours")) - - fun grossPay(): Optional = - Optional.ofNullable(grossPay.getNullable("gross_pay")) - - fun netPay(): Optional = - Optional.ofNullable(netPay.getNullable("net_pay")) - fun earnings(): Optional = Optional.ofNullable(earnings.getNullable("earnings")) @@ -4338,24 +4320,26 @@ private constructor( employerContributions.getNullable("employer_contributions") ) - fun taxes(): Optional = - Optional.ofNullable(taxes.getNullable("taxes")) + fun grossPay(): Optional = + Optional.ofNullable(grossPay.getNullable("gross_pay")) - @JsonProperty("individual_id") - @ExcludeMissing - fun _individualId() = individualId + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun netPay(): Optional = + Optional.ofNullable(netPay.getNullable("net_pay")) - @JsonProperty("payment_method") - @ExcludeMissing - fun _paymentMethod() = paymentMethod + fun paymentMethod(): Optional = + Optional.ofNullable(paymentMethod.getNullable("payment_method")) - @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + fun taxes(): Optional = + Optional.ofNullable(taxes.getNullable("taxes")) - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + fun totalHours(): Optional = + Optional.ofNullable(totalHours.getNullable("total_hours")) - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("earnings") @ExcludeMissing fun _earnings() = earnings @@ -4367,8 +4351,24 @@ private constructor( @ExcludeMissing fun _employerContributions() = employerContributions + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + + @JsonProperty("individual_id") + @ExcludeMissing + fun _individualId() = individualId + + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + + @JsonProperty("payment_method") + @ExcludeMissing + fun _paymentMethod() = paymentMethod + @JsonProperty("taxes") @ExcludeMissing fun _taxes() = taxes + @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4377,16 +4377,16 @@ private constructor( fun validate(): PayStatements = apply { if (!validated) { - individualId() - type() - paymentMethod() - totalHours() - grossPay() - netPay() earnings().map { it.validate() } employeeDeductions().map { it.validate() } employerContributions().map { it.validate() } + grossPay() + individualId() + netPay() + paymentMethod() taxes().map { it.validate() } + totalHours() + type() validated = true } } @@ -4400,72 +4400,37 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var paymentMethod: JsonField = JsonMissing.of() - private var totalHours: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() private var earnings: JsonField = JsonMissing.of() private var employeeDeductions: JsonField = JsonMissing.of() private var employerContributions: JsonField = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var paymentMethod: JsonField = JsonMissing.of() private var taxes: JsonField = JsonMissing.of() + private var totalHours: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatements: PayStatements) = apply { - individualId = payStatements.individualId - type = payStatements.type - paymentMethod = payStatements.paymentMethod - totalHours = payStatements.totalHours - grossPay = payStatements.grossPay - netPay = payStatements.netPay earnings = payStatements.earnings employeeDeductions = payStatements.employeeDeductions employerContributions = payStatements.employerContributions + grossPay = payStatements.grossPay + individualId = payStatements.individualId + netPay = payStatements.netPay + paymentMethod = payStatements.paymentMethod taxes = payStatements.taxes + totalHours = payStatements.totalHours + type = payStatements.type additionalProperties = payStatements.additionalProperties.toMutableMap() } - fun individualId(individualId: Boolean) = - individualId(JsonField.of(individualId)) - - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } - - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - - fun paymentMethod(paymentMethod: Boolean) = - paymentMethod(JsonField.of(paymentMethod)) - - fun paymentMethod(paymentMethod: JsonField) = apply { - this.paymentMethod = paymentMethod - } - - fun totalHours(totalHours: Boolean) = - totalHours(JsonField.of(totalHours)) - - fun totalHours(totalHours: JsonField) = apply { - this.totalHours = totalHours - } - - fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - - fun grossPay(grossPay: JsonField) = apply { - this.grossPay = grossPay - } - - fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - - fun netPay(netPay: JsonField) = apply { this.netPay = netPay } - fun earnings(earnings: Earnings) = earnings(JsonField.of(earnings)) fun earnings(earnings: JsonField) = apply { @@ -4487,10 +4452,45 @@ private constructor( employerContributions: JsonField ) = apply { this.employerContributions = employerContributions } + fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) + + fun grossPay(grossPay: JsonField) = apply { + this.grossPay = grossPay + } + + fun individualId(individualId: Boolean) = + individualId(JsonField.of(individualId)) + + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } + + fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) + + fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + + fun paymentMethod(paymentMethod: Boolean) = + paymentMethod(JsonField.of(paymentMethod)) + + fun paymentMethod(paymentMethod: JsonField) = apply { + this.paymentMethod = paymentMethod + } + fun taxes(taxes: Taxes) = taxes(JsonField.of(taxes)) fun taxes(taxes: JsonField) = apply { this.taxes = taxes } + fun totalHours(totalHours: Boolean) = + totalHours(JsonField.of(totalHours)) + + fun totalHours(totalHours: JsonField) = apply { + this.totalHours = totalHours + } + + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -4515,16 +4515,16 @@ private constructor( fun build(): PayStatements = PayStatements( - individualId, - type, - paymentMethod, - totalHours, - grossPay, - netPay, earnings, employeeDeductions, employerContributions, + grossPay, + individualId, + netPay, + paymentMethod, taxes, + totalHours, + type, additionalProperties.toImmutable(), ) } @@ -4533,43 +4533,43 @@ private constructor( class Earnings @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = @@ -4579,10 +4579,10 @@ private constructor( fun validate(): Earnings = apply { if (!validated) { - type() - name() amount() currency() + name() + type() validated = true } } @@ -4596,31 +4596,23 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(earnings: Earnings) = apply { - type = earnings.type - name = earnings.name amount = earnings.amount currency = earnings.currency + name = earnings.name + type = earnings.type additionalProperties = earnings.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { @@ -4633,6 +4625,14 @@ private constructor( this.currency = currency } + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties( additionalProperties: Map ) = apply { @@ -4658,10 +4658,10 @@ private constructor( fun build(): Earnings = Earnings( - type, - name, amount, currency, + name, + type, additionalProperties.toImmutable(), ) } @@ -4671,67 +4671,67 @@ private constructor( return true } - return /* spotless:off */ other is Earnings && type == other.type && name == other.name && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earnings && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earnings{type=$type, name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Earnings{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployeeDeductions @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("currency") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonProperty("pre_tax") @ExcludeMissing private val preTax: JsonField = JsonMissing.of(), - @JsonProperty("currency") + @JsonProperty("type") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) + fun currency(): Optional = + Optional.ofNullable(currency.getNullable("currency")) + + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) fun preTax(): Optional = Optional.ofNullable(preTax.getNullable("pre_tax")) - fun currency(): Optional = - Optional.ofNullable(currency.getNullable("currency")) - - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonProperty("pre_tax") @ExcludeMissing fun _preTax() = preTax - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @ExcludeMissing @@ -4742,11 +4742,11 @@ private constructor( fun validate(): EmployeeDeductions = apply { if (!validated) { - name() amount() - type() - preTax() currency() + name() + preTax() + type() validated = true } } @@ -4760,38 +4760,40 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var preTax: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var preTax: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employeeDeductions: EmployeeDeductions) = apply { - name = employeeDeductions.name amount = employeeDeductions.amount - type = employeeDeductions.type - preTax = employeeDeductions.preTax currency = employeeDeductions.currency + name = employeeDeductions.name + preTax = employeeDeductions.preTax + type = employeeDeductions.type additionalProperties = employeeDeductions.additionalProperties.toMutableMap() } - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { this.amount = amount } - fun type(type: Boolean) = type(JsonField.of(type)) + fun currency(currency: Boolean) = currency(JsonField.of(currency)) - fun type(type: JsonField) = apply { this.type = type } + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) @@ -4799,11 +4801,9 @@ private constructor( this.preTax = preTax } - fun currency(currency: Boolean) = currency(JsonField.of(currency)) + fun type(type: Boolean) = type(JsonField.of(type)) - fun currency(currency: JsonField) = apply { - this.currency = currency - } + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties( additionalProperties: Map @@ -4830,11 +4830,11 @@ private constructor( fun build(): EmployeeDeductions = EmployeeDeductions( - name, amount, - type, - preTax, currency, + name, + preTax, + type, additionalProperties.toImmutable(), ) } @@ -4844,52 +4844,52 @@ private constructor( return true } - return /* spotless:off */ other is EmployeeDeductions && name == other.name && amount == other.amount && type == other.type && preTax == other.preTax && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeductions && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, type, preTax, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeductions{name=$name, amount=$amount, type=$type, preTax=$preTax, currency=$currency, additionalProperties=$additionalProperties}" + "EmployeeDeductions{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployerContributions @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("name") @ExcludeMissing fun _name() = name + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = @@ -4899,9 +4899,9 @@ private constructor( fun validate(): EmployerContributions = apply { if (!validated) { - name() amount() currency() + name() validated = true } } @@ -4915,27 +4915,23 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employerContributions: EmployerContributions) = apply { - name = employerContributions.name amount = employerContributions.amount currency = employerContributions.currency + name = employerContributions.name additionalProperties = employerContributions.additionalProperties .toMutableMap() } - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { @@ -4948,6 +4944,10 @@ private constructor( this.currency = currency } + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + fun additionalProperties( additionalProperties: Map ) = apply { @@ -4973,9 +4973,9 @@ private constructor( fun build(): EmployerContributions = EmployerContributions( - name, amount, currency, + name, additionalProperties.toImmutable(), ) } @@ -4985,68 +4985,68 @@ private constructor( return true } - return /* spotless:off */ other is EmployerContributions && name == other.name && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContributions && amount == other.amount && currency == other.currency && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContributions{name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "EmployerContributions{amount=$amount, currency=$currency, name=$name, additionalProperties=$additionalProperties}" } @NoAutoDetect class Taxes @JsonCreator private constructor( - @JsonProperty("type") + @JsonProperty("amount") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing - private val name: JsonField = JsonMissing.of(), + private val currency: JsonField = JsonMissing.of(), @JsonProperty("employer") @ExcludeMissing private val employer: JsonField = JsonMissing.of(), - @JsonProperty("amount") + @JsonProperty("name") @ExcludeMissing - private val amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - - fun employer(): Optional = - Optional.ofNullable(employer.getNullable("employer")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun employer(): Optional = + Optional.ofNullable(employer.getNullable("employer")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) - @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = @@ -5056,11 +5056,11 @@ private constructor( fun validate(): Taxes = apply { if (!validated) { - type() - name() - employer() amount() currency() + employer() + name() + type() validated = true } } @@ -5074,31 +5074,35 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var employer: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var employer: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(taxes: Taxes) = apply { - type = taxes.type - name = taxes.name - employer = taxes.employer amount = taxes.amount currency = taxes.currency + employer = taxes.employer + name = taxes.name + type = taxes.type additionalProperties = taxes.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) + fun amount(amount: Boolean) = amount(JsonField.of(amount)) - fun type(type: JsonField) = apply { this.type = type } + fun amount(amount: JsonField) = apply { + this.amount = amount + } - fun name(name: Boolean) = name(JsonField.of(name)) + fun currency(currency: Boolean) = currency(JsonField.of(currency)) - fun name(name: JsonField) = apply { this.name = name } + fun currency(currency: JsonField) = apply { + this.currency = currency + } fun employer(employer: Boolean) = employer(JsonField.of(employer)) @@ -5106,17 +5110,13 @@ private constructor( this.employer = employer } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) + fun name(name: Boolean) = name(JsonField.of(name)) - fun amount(amount: JsonField) = apply { - this.amount = amount - } + fun name(name: JsonField) = apply { this.name = name } - fun currency(currency: Boolean) = currency(JsonField.of(currency)) + fun type(type: Boolean) = type(JsonField.of(type)) - fun currency(currency: JsonField) = apply { - this.currency = currency - } + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties( additionalProperties: Map @@ -5143,11 +5143,11 @@ private constructor( fun build(): Taxes = Taxes( - type, - name, - employer, amount, currency, + employer, + name, + type, additionalProperties.toImmutable(), ) } @@ -5157,17 +5157,17 @@ private constructor( return true } - return /* spotless:off */ other is Taxes && type == other.type && name == other.name && employer == other.employer && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Taxes && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, employer, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Taxes{type=$type, name=$name, employer=$employer, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Taxes{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5175,17 +5175,17 @@ private constructor( return true } - return /* spotless:off */ other is PayStatements && individualId == other.individualId && type == other.type && paymentMethod == other.paymentMethod && totalHours == other.totalHours && grossPay == other.grossPay && netPay == other.netPay && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && taxes == other.taxes && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatements && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && grossPay == other.grossPay && individualId == other.individualId && netPay == other.netPay && paymentMethod == other.paymentMethod && taxes == other.taxes && totalHours == other.totalHours && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, type, paymentMethod, totalHours, grossPay, netPay, earnings, employeeDeductions, employerContributions, taxes, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(earnings, employeeDeductions, employerContributions, grossPay, individualId, netPay, paymentMethod, taxes, totalHours, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatements{individualId=$individualId, type=$type, paymentMethod=$paymentMethod, totalHours=$totalHours, grossPay=$grossPay, netPay=$netPay, earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, taxes=$taxes, additionalProperties=$additionalProperties}" + "PayStatements{earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, grossPay=$grossPay, individualId=$individualId, netPay=$netPay, paymentMethod=$paymentMethod, taxes=$taxes, totalHours=$totalHours, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5213,112 +5213,112 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("pay_date") - @ExcludeMissing - private val payDate: JsonField = JsonMissing.of(), - @JsonProperty("debit_date") - @ExcludeMissing - private val debitDate: JsonField = JsonMissing.of(), @JsonProperty("company_debit") @ExcludeMissing private val companyDebit: JsonField = JsonMissing.of(), - @JsonProperty("gross_pay") + @JsonProperty("debit_date") @ExcludeMissing - private val grossPay: JsonField = JsonMissing.of(), - @JsonProperty("net_pay") + private val debitDate: JsonField = JsonMissing.of(), + @JsonProperty("employee_taxes") @ExcludeMissing - private val netPay: JsonField = JsonMissing.of(), + private val employeeTaxes: JsonField = JsonMissing.of(), @JsonProperty("employer_taxes") @ExcludeMissing private val employerTaxes: JsonField = JsonMissing.of(), - @JsonProperty("employee_taxes") + @JsonProperty("gross_pay") @ExcludeMissing - private val employeeTaxes: JsonField = JsonMissing.of(), + private val grossPay: JsonField = JsonMissing.of(), @JsonProperty("individual_ids") @ExcludeMissing private val individualIds: JsonField = JsonMissing.of(), - @JsonProperty("pay_period") + @JsonProperty("net_pay") @ExcludeMissing - private val payPeriod: JsonField = JsonMissing.of(), - @JsonProperty("pay_group_ids") + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") @ExcludeMissing - private val payGroupIds: JsonField = JsonMissing.of(), + private val payDate: JsonField = JsonMissing.of(), @JsonProperty("pay_frequencies") @ExcludeMissing private val payFrequencies: JsonField = JsonMissing.of(), + @JsonProperty("pay_group_ids") + @ExcludeMissing + private val payGroupIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_period") + @ExcludeMissing + private val payPeriod: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - fun payDate(): Optional = - Optional.ofNullable(payDate.getNullable("pay_date")) - - fun debitDate(): Optional = - Optional.ofNullable(debitDate.getNullable("debit_date")) - fun companyDebit(): Optional = Optional.ofNullable(companyDebit.getNullable("company_debit")) - fun grossPay(): Optional = - Optional.ofNullable(grossPay.getNullable("gross_pay")) + fun debitDate(): Optional = + Optional.ofNullable(debitDate.getNullable("debit_date")) - fun netPay(): Optional = - Optional.ofNullable(netPay.getNullable("net_pay")) + fun employeeTaxes(): Optional = + Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) fun employerTaxes(): Optional = Optional.ofNullable(employerTaxes.getNullable("employer_taxes")) - fun employeeTaxes(): Optional = - Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) + fun grossPay(): Optional = + Optional.ofNullable(grossPay.getNullable("gross_pay")) fun individualIds(): Optional = Optional.ofNullable(individualIds.getNullable("individual_ids")) - fun payPeriod(): Optional = - Optional.ofNullable(payPeriod.getNullable("pay_period")) + fun netPay(): Optional = + Optional.ofNullable(netPay.getNullable("net_pay")) - fun payGroupIds(): Optional = - Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) + fun payDate(): Optional = + Optional.ofNullable(payDate.getNullable("pay_date")) fun payFrequencies(): Optional = Optional.ofNullable(payFrequencies.getNullable("pay_frequencies")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun payGroupIds(): Optional = + Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) - @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate + fun payPeriod(): Optional = + Optional.ofNullable(payPeriod.getNullable("pay_period")) - @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate + @JsonProperty("id") @ExcludeMissing fun _id() = id @JsonProperty("company_debit") @ExcludeMissing fun _companyDebit() = companyDebit - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + @JsonProperty("employee_taxes") + @ExcludeMissing + fun _employeeTaxes() = employeeTaxes @JsonProperty("employer_taxes") @ExcludeMissing fun _employerTaxes() = employerTaxes - @JsonProperty("employee_taxes") - @ExcludeMissing - fun _employeeTaxes() = employeeTaxes + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds - @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay - @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies + @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + + @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -5328,17 +5328,17 @@ private constructor( fun validate(): SupportedPaymentFields = apply { if (!validated) { id() - payDate() - debitDate() companyDebit() - grossPay() - netPay() - employerTaxes() + debitDate() employeeTaxes() + employerTaxes() + grossPay() individualIds() - payPeriod().map { it.validate() } - payGroupIds() + netPay() + payDate() payFrequencies() + payGroupIds() + payPeriod().map { it.validate() } validated = true } } @@ -5353,34 +5353,34 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() - private var payDate: JsonField = JsonMissing.of() - private var debitDate: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() - private var employerTaxes: JsonField = JsonMissing.of() + private var debitDate: JsonField = JsonMissing.of() private var employeeTaxes: JsonField = JsonMissing.of() + private var employerTaxes: JsonField = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() private var individualIds: JsonField = JsonMissing.of() - private var payPeriod: JsonField = JsonMissing.of() - private var payGroupIds: JsonField = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var payDate: JsonField = JsonMissing.of() private var payFrequencies: JsonField = JsonMissing.of() + private var payGroupIds: JsonField = JsonMissing.of() + private var payPeriod: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedPaymentFields: SupportedPaymentFields) = apply { id = supportedPaymentFields.id - payDate = supportedPaymentFields.payDate - debitDate = supportedPaymentFields.debitDate companyDebit = supportedPaymentFields.companyDebit - grossPay = supportedPaymentFields.grossPay - netPay = supportedPaymentFields.netPay - employerTaxes = supportedPaymentFields.employerTaxes + debitDate = supportedPaymentFields.debitDate employeeTaxes = supportedPaymentFields.employeeTaxes + employerTaxes = supportedPaymentFields.employerTaxes + grossPay = supportedPaymentFields.grossPay individualIds = supportedPaymentFields.individualIds - payPeriod = supportedPaymentFields.payPeriod - payGroupIds = supportedPaymentFields.payGroupIds + netPay = supportedPaymentFields.netPay + payDate = supportedPaymentFields.payDate payFrequencies = supportedPaymentFields.payFrequencies + payGroupIds = supportedPaymentFields.payGroupIds + payPeriod = supportedPaymentFields.payPeriod additionalProperties = supportedPaymentFields.additionalProperties.toMutableMap() } @@ -5389,16 +5389,6 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) - - fun payDate(payDate: JsonField) = apply { this.payDate = payDate } - - fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - - fun debitDate(debitDate: JsonField) = apply { - this.debitDate = debitDate - } - fun companyDebit(companyDebit: Boolean) = companyDebit(JsonField.of(companyDebit)) @@ -5406,15 +5396,18 @@ private constructor( this.companyDebit = companyDebit } - fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) + fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - fun grossPay(grossPay: JsonField) = apply { - this.grossPay = grossPay + fun debitDate(debitDate: JsonField) = apply { + this.debitDate = debitDate } - fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) + fun employeeTaxes(employeeTaxes: Boolean) = + employeeTaxes(JsonField.of(employeeTaxes)) - fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + fun employeeTaxes(employeeTaxes: JsonField) = apply { + this.employeeTaxes = employeeTaxes + } fun employerTaxes(employerTaxes: Boolean) = employerTaxes(JsonField.of(employerTaxes)) @@ -5423,11 +5416,10 @@ private constructor( this.employerTaxes = employerTaxes } - fun employeeTaxes(employeeTaxes: Boolean) = - employeeTaxes(JsonField.of(employeeTaxes)) + fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - fun employeeTaxes(employeeTaxes: JsonField) = apply { - this.employeeTaxes = employeeTaxes + fun grossPay(grossPay: JsonField) = apply { + this.grossPay = grossPay } fun individualIds(individualIds: Boolean) = @@ -5437,10 +5429,19 @@ private constructor( this.individualIds = individualIds } - fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) + fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - fun payPeriod(payPeriod: JsonField) = apply { - this.payPeriod = payPeriod + fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + + fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) + + fun payDate(payDate: JsonField) = apply { this.payDate = payDate } + + fun payFrequencies(payFrequencies: Boolean) = + payFrequencies(JsonField.of(payFrequencies)) + + fun payFrequencies(payFrequencies: JsonField) = apply { + this.payFrequencies = payFrequencies } fun payGroupIds(payGroupIds: Boolean) = @@ -5450,11 +5451,10 @@ private constructor( this.payGroupIds = payGroupIds } - fun payFrequencies(payFrequencies: Boolean) = - payFrequencies(JsonField.of(payFrequencies)) + fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) - fun payFrequencies(payFrequencies: JsonField) = apply { - this.payFrequencies = payFrequencies + fun payPeriod(payPeriod: JsonField) = apply { + this.payPeriod = payPeriod } fun additionalProperties(additionalProperties: Map) = @@ -5482,17 +5482,17 @@ private constructor( fun build(): SupportedPaymentFields = SupportedPaymentFields( id, - payDate, - debitDate, companyDebit, - grossPay, - netPay, - employerTaxes, + debitDate, employeeTaxes, + employerTaxes, + grossPay, individualIds, - payPeriod, - payGroupIds, + netPay, + payDate, payFrequencies, + payGroupIds, + payPeriod, additionalProperties.toImmutable(), ) } @@ -5501,27 +5501,27 @@ private constructor( class PayPeriod @JsonCreator private constructor( - @JsonProperty("start_date") - @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun startDate(): Optional = - Optional.ofNullable(startDate.getNullable("start_date")) - fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + fun startDate(): Optional = + Optional.ofNullable(startDate.getNullable("start_date")) @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -5530,8 +5530,8 @@ private constructor( fun validate(): PayPeriod = apply { if (!validated) { - startDate() endDate() + startDate() validated = true } } @@ -5545,30 +5545,30 @@ private constructor( class Builder { - private var startDate: JsonField = JsonMissing.of() private var endDate: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - startDate = payPeriod.startDate endDate = payPeriod.endDate + startDate = payPeriod.startDate additionalProperties = payPeriod.additionalProperties.toMutableMap() } - fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - - fun startDate(startDate: JsonField) = apply { - this.startDate = startDate - } - fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) + + fun startDate(startDate: JsonField) = apply { + this.startDate = startDate + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -5593,8 +5593,8 @@ private constructor( fun build(): PayPeriod = PayPeriod( - startDate, endDate, + startDate, additionalProperties.toImmutable(), ) } @@ -5604,17 +5604,17 @@ private constructor( return true } - return /* spotless:off */ other is PayPeriod && startDate == other.startDate && endDate == other.endDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayPeriod && endDate == other.endDate && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(startDate, endDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(endDate, startDate, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayPeriod{startDate=$startDate, endDate=$endDate, additionalProperties=$additionalProperties}" + "PayPeriod{endDate=$endDate, startDate=$startDate, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5622,17 +5622,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPaymentFields && id == other.id && payDate == other.payDate && debitDate == other.debitDate && companyDebit == other.companyDebit && grossPay == other.grossPay && netPay == other.netPay && employerTaxes == other.employerTaxes && employeeTaxes == other.employeeTaxes && individualIds == other.individualIds && payPeriod == other.payPeriod && payGroupIds == other.payGroupIds && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedPaymentFields && id == other.id && companyDebit == other.companyDebit && debitDate == other.debitDate && employeeTaxes == other.employeeTaxes && employerTaxes == other.employerTaxes && grossPay == other.grossPay && individualIds == other.individualIds && netPay == other.netPay && payDate == other.payDate && payFrequencies == other.payFrequencies && payGroupIds == other.payGroupIds && payPeriod == other.payPeriod && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, payDate, debitDate, companyDebit, grossPay, netPay, employerTaxes, employeeTaxes, individualIds, payPeriod, payGroupIds, payFrequencies, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, companyDebit, debitDate, employeeTaxes, employerTaxes, grossPay, individualIds, netPay, payDate, payFrequencies, payGroupIds, payPeriod, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedPaymentFields{id=$id, payDate=$payDate, debitDate=$debitDate, companyDebit=$companyDebit, grossPay=$grossPay, netPay=$netPay, employerTaxes=$employerTaxes, employeeTaxes=$employeeTaxes, individualIds=$individualIds, payPeriod=$payPeriod, payGroupIds=$payGroupIds, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" + "SupportedPaymentFields{id=$id, companyDebit=$companyDebit, debitDate=$debitDate, employeeTaxes=$employeeTaxes, employerTaxes=$employerTaxes, grossPay=$grossPay, individualIds=$individualIds, netPay=$netPay, payDate=$payDate, payFrequencies=$payFrequencies, payGroupIds=$payGroupIds, payPeriod=$payPeriod, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5640,17 +5640,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedFields && company == other.company && directory == other.directory && individual == other.individual && employment == other.employment && payment == other.payment && payStatement == other.payStatement && payGroup == other.payGroup && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedFields && company == other.company && directory == other.directory && employment == other.employment && individual == other.individual && payGroup == other.payGroup && payStatement == other.payStatement && payment == other.payment && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(company, directory, individual, employment, payment, payStatement, payGroup, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(company, directory, employment, individual, payGroup, payStatement, payment, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedFields{company=$company, directory=$directory, individual=$individual, employment=$employment, payment=$payment, payStatement=$payStatement, payGroup=$payGroup, additionalProperties=$additionalProperties}" + "SupportedFields{company=$company, directory=$directory, employment=$employment, individual=$individual, payGroup=$payGroup, payStatement=$payStatement, payment=$payment, additionalProperties=$additionalProperties}" } class Type @@ -5733,17 +5733,17 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationMethod && type == other.type && benefitsSupport == other.benefitsSupport && supportedFields == other.supportedFields && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AuthenticationMethod && benefitsSupport == other.benefitsSupport && supportedFields == other.supportedFields && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, benefitsSupport, supportedFields, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(benefitsSupport, supportedFields, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AuthenticationMethod{type=$type, benefitsSupport=$benefitsSupport, supportedFields=$supportedFields, additionalProperties=$additionalProperties}" + "AuthenticationMethod{benefitsSupport=$benefitsSupport, supportedFields=$supportedFields, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5751,17 +5751,17 @@ private constructor( return true } - return /* spotless:off */ other is Data && status == other.status && authenticationMethod == other.authenticationMethod && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Data && authenticationMethod == other.authenticationMethod && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(status, authenticationMethod, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(authenticationMethod, status, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Data{status=$status, authenticationMethod=$authenticationMethod, additionalProperties=$additionalProperties}" + "Data{authenticationMethod=$authenticationMethod, status=$status, additionalProperties=$additionalProperties}" } class EventType @@ -5820,15 +5820,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountUpdateEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountUpdateEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountUpdateEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "AccountUpdateEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt index 55c812b3..c8b5162a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt @@ -22,9 +22,6 @@ import java.util.Optional class AccountUpdateResponse @JsonCreator private constructor( - @JsonProperty("connection_id") - @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing private val accountId: JsonField = JsonMissing.of(), @@ -34,19 +31,18 @@ private constructor( @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("products") + @ExcludeMissing + private val products: JsonField> = JsonMissing.of(), @JsonProperty("provider_id") @ExcludeMissing private val providerId: JsonField = JsonMissing.of(), - @JsonProperty("products") + @JsonProperty("connection_id") @ExcludeMissing - private val products: JsonField> = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the new connection */ - fun connectionId(): Optional = - Optional.ofNullable(connectionId.getNullable("connection_id")) - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(): String = accountId.getRequired("account_id") @@ -56,13 +52,14 @@ private constructor( /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun companyId(): String = companyId.getRequired("company_id") + fun products(): List = products.getRequired("products") + /** The ID of the provider associated with the `access_token` */ fun providerId(): String = providerId.getRequired("provider_id") - fun products(): List = products.getRequired("products") - /** The ID of the new connection */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId @@ -74,10 +71,13 @@ private constructor( /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("products") @ExcludeMissing fun _products() = products + /** The ID of the provider associated with the `access_token` */ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId - @JsonProperty("products") @ExcludeMissing fun _products() = products + /** The ID of the new connection */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonAnyGetter @ExcludeMissing @@ -87,12 +87,12 @@ private constructor( fun validate(): AccountUpdateResponse = apply { if (!validated) { - connectionId() accountId() authenticationType() companyId() - providerId() products() + providerId() + connectionId() validated = true } } @@ -106,33 +106,25 @@ private constructor( class Builder { - private var connectionId: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() private var authenticationType: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() - private var providerId: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() + private var providerId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountUpdateResponse: AccountUpdateResponse) = apply { - connectionId = accountUpdateResponse.connectionId accountId = accountUpdateResponse.accountId authenticationType = accountUpdateResponse.authenticationType companyId = accountUpdateResponse.companyId - providerId = accountUpdateResponse.providerId products = accountUpdateResponse.products + providerId = accountUpdateResponse.providerId + connectionId = accountUpdateResponse.connectionId additionalProperties = accountUpdateResponse.additionalProperties.toMutableMap() } - /** The ID of the new connection */ - fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - - /** The ID of the new connection */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) @@ -152,15 +144,23 @@ private constructor( /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun products(products: List) = products(JsonField.of(products)) + + fun products(products: JsonField>) = apply { this.products = products } + /** The ID of the provider associated with the `access_token` */ fun providerId(providerId: String) = providerId(JsonField.of(providerId)) /** The ID of the provider associated with the `access_token` */ fun providerId(providerId: JsonField) = apply { this.providerId = providerId } - fun products(products: List) = products(JsonField.of(products)) + /** The ID of the new connection */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun products(products: JsonField>) = apply { this.products = products } + /** The ID of the new connection */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -183,12 +183,12 @@ private constructor( fun build(): AccountUpdateResponse = AccountUpdateResponse( - connectionId, accountId, authenticationType, companyId, - providerId, products.map { it.toImmutable() }, + providerId, + connectionId, additionalProperties.toImmutable(), ) } @@ -267,15 +267,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountUpdateResponse && connectionId == other.connectionId && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && providerId == other.providerId && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountUpdateResponse && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && products == other.products && providerId == other.providerId && connectionId == other.connectionId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, accountId, authenticationType, companyId, providerId, products, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, authenticationType, companyId, products, providerId, connectionId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountUpdateResponse{connectionId=$connectionId, accountId=$accountId, authenticationType=$authenticationType, companyId=$companyId, providerId=$providerId, products=$products, additionalProperties=$additionalProperties}" + "AccountUpdateResponse{accountId=$accountId, authenticationType=$authenticationType, companyId=$companyId, products=$products, providerId=$providerId, connectionId=$connectionId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt index 0f490e3e..73d86867 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt @@ -23,39 +23,32 @@ import java.util.Optional class AutomatedAsyncJob @JsonCreator private constructor( - @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), - @JsonProperty("job_url") - @ExcludeMissing - private val jobUrl: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("status") + @JsonProperty("completed_at") @ExcludeMissing - private val status: JsonField = JsonMissing.of(), + private val completedAt: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing private val createdAt: JsonField = JsonMissing.of(), + @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), + @JsonProperty("job_url") + @ExcludeMissing + private val jobUrl: JsonField = JsonMissing.of(), @JsonProperty("scheduled_at") @ExcludeMissing private val scheduledAt: JsonField = JsonMissing.of(), @JsonProperty("started_at") @ExcludeMissing private val startedAt: JsonField = JsonMissing.of(), - @JsonProperty("completed_at") + @JsonProperty("status") @ExcludeMissing - private val completedAt: JsonField = JsonMissing.of(), + private val status: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The id of the job that has been created. */ - fun jobId(): String = jobId.getRequired("job_id") - - /** The url that can be used to retrieve the job status */ - fun jobUrl(): String = jobUrl.getRequired("job_url") - - /** Only `data_sync_all` currently supported */ - fun type(): Type = type.getRequired("type") - - fun status(): Status = status.getRequired("status") + /** The datetime the job completed. */ + fun completedAt(): Optional = + Optional.ofNullable(completedAt.getNullable("completed_at")) /** * The datetime when the job was created. for scheduled jobs, this will be the initial @@ -63,6 +56,12 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + /** The id of the job that has been created. */ + fun jobId(): String = jobId.getRequired("job_id") + + /** The url that can be used to retrieve the job status */ + fun jobUrl(): String = jobUrl.getRequired("job_url") + /** * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in the * future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null. @@ -74,20 +73,13 @@ private constructor( fun startedAt(): Optional = Optional.ofNullable(startedAt.getNullable("started_at")) - /** The datetime the job completed. */ - fun completedAt(): Optional = - Optional.ofNullable(completedAt.getNullable("completed_at")) - - /** The id of the job that has been created. */ - @JsonProperty("job_id") @ExcludeMissing fun _jobId() = jobId - - /** The url that can be used to retrieve the job status */ - @JsonProperty("job_url") @ExcludeMissing fun _jobUrl() = jobUrl + fun status(): Status = status.getRequired("status") /** Only `data_sync_all` currently supported */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Type = type.getRequired("type") - @JsonProperty("status") @ExcludeMissing fun _status() = status + /** The datetime the job completed. */ + @JsonProperty("completed_at") @ExcludeMissing fun _completedAt() = completedAt /** * The datetime when the job was created. for scheduled jobs, this will be the initial @@ -95,6 +87,12 @@ private constructor( */ @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt + /** The id of the job that has been created. */ + @JsonProperty("job_id") @ExcludeMissing fun _jobId() = jobId + + /** The url that can be used to retrieve the job status */ + @JsonProperty("job_url") @ExcludeMissing fun _jobUrl() = jobUrl + /** * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in the * future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null. @@ -104,8 +102,10 @@ private constructor( /** The datetime a job entered into the job queue. */ @JsonProperty("started_at") @ExcludeMissing fun _startedAt() = startedAt - /** The datetime the job completed. */ - @JsonProperty("completed_at") @ExcludeMissing fun _completedAt() = completedAt + @JsonProperty("status") @ExcludeMissing fun _status() = status + + /** Only `data_sync_all` currently supported */ + @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @ExcludeMissing @@ -115,14 +115,14 @@ private constructor( fun validate(): AutomatedAsyncJob = apply { if (!validated) { + completedAt() + createdAt() jobId() jobUrl() - type() - status() - createdAt() scheduledAt() startedAt() - completedAt() + status() + type() validated = true } } @@ -136,50 +136,36 @@ private constructor( class Builder { + private var completedAt: JsonField = JsonMissing.of() + private var createdAt: JsonField = JsonMissing.of() private var jobId: JsonField = JsonMissing.of() private var jobUrl: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var createdAt: JsonField = JsonMissing.of() private var scheduledAt: JsonField = JsonMissing.of() private var startedAt: JsonField = JsonMissing.of() - private var completedAt: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(automatedAsyncJob: AutomatedAsyncJob) = apply { + completedAt = automatedAsyncJob.completedAt + createdAt = automatedAsyncJob.createdAt jobId = automatedAsyncJob.jobId jobUrl = automatedAsyncJob.jobUrl - type = automatedAsyncJob.type - status = automatedAsyncJob.status - createdAt = automatedAsyncJob.createdAt scheduledAt = automatedAsyncJob.scheduledAt startedAt = automatedAsyncJob.startedAt - completedAt = automatedAsyncJob.completedAt + status = automatedAsyncJob.status + type = automatedAsyncJob.type additionalProperties = automatedAsyncJob.additionalProperties.toMutableMap() } - /** The id of the job that has been created. */ - fun jobId(jobId: String) = jobId(JsonField.of(jobId)) - - /** The id of the job that has been created. */ - fun jobId(jobId: JsonField) = apply { this.jobId = jobId } - - /** The url that can be used to retrieve the job status */ - fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) - - /** The url that can be used to retrieve the job status */ - fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } - - /** Only `data_sync_all` currently supported */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Only `data_sync_all` currently supported */ - fun type(type: JsonField) = apply { this.type = type } - - fun status(status: Status) = status(JsonField.of(status)) + /** The datetime the job completed. */ + fun completedAt(completedAt: OffsetDateTime) = completedAt(JsonField.of(completedAt)) - fun status(status: JsonField) = apply { this.status = status } + /** The datetime the job completed. */ + fun completedAt(completedAt: JsonField) = apply { + this.completedAt = completedAt + } /** * The datetime when the job was created. for scheduled jobs, this will be the initial @@ -195,6 +181,18 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + /** The id of the job that has been created. */ + fun jobId(jobId: String) = jobId(JsonField.of(jobId)) + + /** The id of the job that has been created. */ + fun jobId(jobId: JsonField) = apply { this.jobId = jobId } + + /** The url that can be used to retrieve the job status */ + fun jobUrl(jobUrl: String) = jobUrl(JsonField.of(jobUrl)) + + /** The url that can be used to retrieve the job status */ + fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } + /** * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in * the future if the job has not yet been enqueued. For ad-hoc jobs, this field will @@ -217,13 +215,15 @@ private constructor( /** The datetime a job entered into the job queue. */ fun startedAt(startedAt: JsonField) = apply { this.startedAt = startedAt } - /** The datetime the job completed. */ - fun completedAt(completedAt: OffsetDateTime) = completedAt(JsonField.of(completedAt)) + fun status(status: Status) = status(JsonField.of(status)) - /** The datetime the job completed. */ - fun completedAt(completedAt: JsonField) = apply { - this.completedAt = completedAt - } + fun status(status: JsonField) = apply { this.status = status } + + /** Only `data_sync_all` currently supported */ + fun type(type: Type) = type(JsonField.of(type)) + + /** Only `data_sync_all` currently supported */ + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -246,14 +246,14 @@ private constructor( fun build(): AutomatedAsyncJob = AutomatedAsyncJob( + completedAt, + createdAt, jobId, jobUrl, - type, - status, - createdAt, scheduledAt, startedAt, - completedAt, + status, + type, additionalProperties.toImmutable(), ) } @@ -395,15 +395,15 @@ private constructor( return true } - return /* spotless:off */ other is AutomatedAsyncJob && jobId == other.jobId && jobUrl == other.jobUrl && type == other.type && status == other.status && createdAt == other.createdAt && scheduledAt == other.scheduledAt && startedAt == other.startedAt && completedAt == other.completedAt && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AutomatedAsyncJob && completedAt == other.completedAt && createdAt == other.createdAt && jobId == other.jobId && jobUrl == other.jobUrl && scheduledAt == other.scheduledAt && startedAt == other.startedAt && status == other.status && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(jobId, jobUrl, type, status, createdAt, scheduledAt, startedAt, completedAt, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(completedAt, createdAt, jobId, jobUrl, scheduledAt, startedAt, status, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AutomatedAsyncJob{jobId=$jobId, jobUrl=$jobUrl, type=$type, status=$status, createdAt=$createdAt, scheduledAt=$scheduledAt, startedAt=$startedAt, completedAt=$completedAt, additionalProperties=$additionalProperties}" + "AutomatedAsyncJob{completedAt=$completedAt, createdAt=$createdAt, jobId=$jobId, jobUrl=$jobUrl, scheduledAt=$scheduledAt, startedAt=$startedAt, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt index 0c75bcdd..089deb06 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt @@ -19,40 +19,40 @@ import java.util.Objects class AutomatedCreateResponse @JsonCreator private constructor( + @JsonProperty("allowed_refreshes") + @ExcludeMissing + private val allowedRefreshes: JsonField = JsonMissing.of(), @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), @JsonProperty("job_url") @ExcludeMissing private val jobUrl: JsonField = JsonMissing.of(), - @JsonProperty("allowed_refreshes") - @ExcludeMissing - private val allowedRefreshes: JsonField = JsonMissing.of(), @JsonProperty("remaining_refreshes") @ExcludeMissing private val remainingRefreshes: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(): Long = allowedRefreshes.getRequired("allowed_refreshes") + /** The id of the job that has been created. */ fun jobId(): String = jobId.getRequired("job_id") /** The url that can be used to retrieve the job status */ fun jobUrl(): String = jobUrl.getRequired("job_url") - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(): Long = allowedRefreshes.getRequired("allowed_refreshes") - /** The number of remaining refreshes available (per hour, fixed window) */ fun remainingRefreshes(): Long = remainingRefreshes.getRequired("remaining_refreshes") + /** The number of allowed refreshes per hour (per hour, fixed window) */ + @JsonProperty("allowed_refreshes") @ExcludeMissing fun _allowedRefreshes() = allowedRefreshes + /** The id of the job that has been created. */ @JsonProperty("job_id") @ExcludeMissing fun _jobId() = jobId /** The url that can be used to retrieve the job status */ @JsonProperty("job_url") @ExcludeMissing fun _jobUrl() = jobUrl - /** The number of allowed refreshes per hour (per hour, fixed window) */ - @JsonProperty("allowed_refreshes") @ExcludeMissing fun _allowedRefreshes() = allowedRefreshes - /** The number of remaining refreshes available (per hour, fixed window) */ @JsonProperty("remaining_refreshes") @ExcludeMissing @@ -66,9 +66,9 @@ private constructor( fun validate(): AutomatedCreateResponse = apply { if (!validated) { + allowedRefreshes() jobId() jobUrl() - allowedRefreshes() remainingRefreshes() validated = true } @@ -83,21 +83,30 @@ private constructor( class Builder { + private var allowedRefreshes: JsonField = JsonMissing.of() private var jobId: JsonField = JsonMissing.of() private var jobUrl: JsonField = JsonMissing.of() - private var allowedRefreshes: JsonField = JsonMissing.of() private var remainingRefreshes: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(automatedCreateResponse: AutomatedCreateResponse) = apply { + allowedRefreshes = automatedCreateResponse.allowedRefreshes jobId = automatedCreateResponse.jobId jobUrl = automatedCreateResponse.jobUrl - allowedRefreshes = automatedCreateResponse.allowedRefreshes remainingRefreshes = automatedCreateResponse.remainingRefreshes additionalProperties = automatedCreateResponse.additionalProperties.toMutableMap() } + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(allowedRefreshes: Long) = + allowedRefreshes(JsonField.of(allowedRefreshes)) + + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(allowedRefreshes: JsonField) = apply { + this.allowedRefreshes = allowedRefreshes + } + /** The id of the job that has been created. */ fun jobId(jobId: String) = jobId(JsonField.of(jobId)) @@ -110,15 +119,6 @@ private constructor( /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(allowedRefreshes: Long) = - allowedRefreshes(JsonField.of(allowedRefreshes)) - - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(allowedRefreshes: JsonField) = apply { - this.allowedRefreshes = allowedRefreshes - } - /** The number of remaining refreshes available (per hour, fixed window) */ fun remainingRefreshes(remainingRefreshes: Long) = remainingRefreshes(JsonField.of(remainingRefreshes)) @@ -149,9 +149,9 @@ private constructor( fun build(): AutomatedCreateResponse = AutomatedCreateResponse( + allowedRefreshes, jobId, jobUrl, - allowedRefreshes, remainingRefreshes, additionalProperties.toImmutable(), ) @@ -162,15 +162,15 @@ private constructor( return true } - return /* spotless:off */ other is AutomatedCreateResponse && jobId == other.jobId && jobUrl == other.jobUrl && allowedRefreshes == other.allowedRefreshes && remainingRefreshes == other.remainingRefreshes && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AutomatedCreateResponse && allowedRefreshes == other.allowedRefreshes && jobId == other.jobId && jobUrl == other.jobUrl && remainingRefreshes == other.remainingRefreshes && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(jobId, jobUrl, allowedRefreshes, remainingRefreshes, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(allowedRefreshes, jobId, jobUrl, remainingRefreshes, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AutomatedCreateResponse{jobId=$jobId, jobUrl=$jobUrl, allowedRefreshes=$allowedRefreshes, remainingRefreshes=$remainingRefreshes, additionalProperties=$additionalProperties}" + "AutomatedCreateResponse{allowedRefreshes=$allowedRefreshes, jobId=$jobId, jobUrl=$jobUrl, remainingRefreshes=$remainingRefreshes, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt index 860d5245..8fc57748 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt @@ -20,21 +20,23 @@ import java.util.Optional class BaseWebhookEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 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") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use @@ -42,14 +44,15 @@ private constructor( */ fun companyId(): String = companyId.getRequired("company_id") + /** 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 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") - - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use @@ -57,11 +60,8 @@ private constructor( */ @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 + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonAnyGetter @ExcludeMissing @@ -71,9 +71,9 @@ private constructor( fun validate(): BaseWebhookEvent = apply { if (!validated) { - connectionId() - companyId() accountId() + companyId() + connectionId() validated = true } } @@ -87,50 +87,50 @@ private constructor( class Builder { - private var connectionId: JsonField = JsonMissing.of() - private var companyId: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() + private var companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(baseWebhookEvent: BaseWebhookEvent) = apply { - connectionId = baseWebhookEvent.connectionId - companyId = baseWebhookEvent.companyId accountId = baseWebhookEvent.accountId + companyId = baseWebhookEvent.companyId + connectionId = baseWebhookEvent.connectionId additionalProperties = baseWebhookEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** 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. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -153,9 +153,9 @@ private constructor( fun build(): BaseWebhookEvent = BaseWebhookEvent( - connectionId, - companyId, accountId, + companyId, + connectionId, additionalProperties.toImmutable(), ) } @@ -165,15 +165,15 @@ private constructor( return true } - return /* spotless:off */ other is BaseWebhookEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BaseWebhookEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BaseWebhookEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, additionalProperties=$additionalProperties}" + "BaseWebhookEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt index 9ef6ed82..2fa66770 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt @@ -22,23 +22,23 @@ import java.util.Optional class BenefitContribution @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Contribution type. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) /** Contribution type. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount + /** Contribution type. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -47,8 +47,8 @@ private constructor( fun validate(): BenefitContribution = apply { if (!validated) { - type() amount() + type() validated = true } } @@ -62,29 +62,29 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(benefitContribution: BenefitContribution) = apply { - type = benefitContribution.type amount = benefitContribution.amount + type = benefitContribution.type additionalProperties = benefitContribution.additionalProperties.toMutableMap() } - /** Contribution type. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Contribution type. */ - fun type(type: JsonField) = apply { this.type = type } - /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** Contribution amount in cents (if `fixed`) or basis points (if `percent`). */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** Contribution type. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** Contribution type. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -106,8 +106,8 @@ private constructor( fun build(): BenefitContribution = BenefitContribution( - type, amount, + type, additionalProperties.toImmutable(), ) } @@ -174,15 +174,15 @@ private constructor( return true } - return /* spotless:off */ other is BenefitContribution && type == other.type && amount == other.amount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BenefitContribution && amount == other.amount && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, amount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BenefitContribution{type=$type, amount=$amount, additionalProperties=$additionalProperties}" + "BenefitContribution{amount=$amount, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt index dc30773d..9f4489fe 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt @@ -122,24 +122,24 @@ private constructor( class BenefitFeature @JsonCreator private constructor( - @JsonProperty("description") - @ExcludeMissing - private val description: JsonField = JsonMissing.of(), - @JsonProperty("frequencies") + @JsonProperty("annual_maximum") @ExcludeMissing - private val frequencies: JsonField> = JsonMissing.of(), - @JsonProperty("employee_deduction") + private val annualMaximum: JsonField = JsonMissing.of(), + @JsonProperty("catch_up") @ExcludeMissing - private val employeeDeduction: JsonField> = JsonMissing.of(), + private val catchUp: JsonField = JsonMissing.of(), @JsonProperty("company_contribution") @ExcludeMissing private val companyContribution: JsonField> = JsonMissing.of(), - @JsonProperty("annual_maximum") + @JsonProperty("description") @ExcludeMissing - private val annualMaximum: JsonField = JsonMissing.of(), - @JsonProperty("catch_up") + private val description: JsonField = JsonMissing.of(), + @JsonProperty("employee_deduction") @ExcludeMissing - private val catchUp: JsonField = JsonMissing.of(), + private val employeeDeduction: JsonField> = JsonMissing.of(), + @JsonProperty("frequencies") + @ExcludeMissing + private val frequencies: JsonField> = JsonMissing.of(), @JsonProperty("hsa_contribution_limit") @ExcludeMissing private val hsaContributionLimit: JsonField> = JsonMissing.of(), @@ -147,23 +147,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - fun description(): Optional = - Optional.ofNullable(description.getNullable("description")) - - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(): Optional> = - Optional.ofNullable(frequencies.getNullable("frequencies")) - - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(): Optional> = - Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) - - /** - * Supported contribution types. An empty array indicates contributions are not supported. - */ - fun companyContribution(): Optional> = - Optional.ofNullable(companyContribution.getNullable("company_contribution")) - /** Whether the provider supports an annual maximum for this benefit. */ fun annualMaximum(): Optional = Optional.ofNullable(annualMaximum.getNullable("annual_maximum")) @@ -175,28 +158,28 @@ private constructor( fun catchUp(): Optional = Optional.ofNullable(catchUp.getNullable("catch_up")) /** - * Whether the provider supports HSA contribution limits. Empty if this feature is not - * supported for the benefit. This array only has values for HSA benefits. + * Supported contribution types. An empty array indicates contributions are not supported. */ - fun hsaContributionLimit(): Optional> = - Optional.ofNullable(hsaContributionLimit.getNullable("hsa_contribution_limit")) - - @JsonProperty("description") @ExcludeMissing fun _description() = description + fun companyContribution(): Optional> = + Optional.ofNullable(companyContribution.getNullable("company_contribution")) - /** The list of frequencies supported by the provider for this benefit */ - @JsonProperty("frequencies") @ExcludeMissing fun _frequencies() = frequencies + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) /** Supported deduction types. An empty array indicates deductions are not supported. */ - @JsonProperty("employee_deduction") - @ExcludeMissing - fun _employeeDeduction() = employeeDeduction + fun employeeDeduction(): Optional> = + Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) + + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(): Optional> = + Optional.ofNullable(frequencies.getNullable("frequencies")) /** - * Supported contribution types. An empty array indicates contributions are not supported. + * Whether the provider supports HSA contribution limits. Empty if this feature is not + * supported for the benefit. This array only has values for HSA benefits. */ - @JsonProperty("company_contribution") - @ExcludeMissing - fun _companyContribution() = companyContribution + fun hsaContributionLimit(): Optional> = + Optional.ofNullable(hsaContributionLimit.getNullable("hsa_contribution_limit")) /** Whether the provider supports an annual maximum for this benefit. */ @JsonProperty("annual_maximum") @ExcludeMissing fun _annualMaximum() = annualMaximum @@ -207,6 +190,23 @@ private constructor( */ @JsonProperty("catch_up") @ExcludeMissing fun _catchUp() = catchUp + /** + * Supported contribution types. An empty array indicates contributions are not supported. + */ + @JsonProperty("company_contribution") + @ExcludeMissing + fun _companyContribution() = companyContribution + + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** Supported deduction types. An empty array indicates deductions are not supported. */ + @JsonProperty("employee_deduction") + @ExcludeMissing + fun _employeeDeduction() = employeeDeduction + + /** The list of frequencies supported by the provider for this benefit */ + @JsonProperty("frequencies") @ExcludeMissing fun _frequencies() = frequencies + /** * Whether the provider supports HSA contribution limits. Empty if this feature is not * supported for the benefit. This array only has values for HSA benefits. @@ -223,12 +223,12 @@ private constructor( fun validate(): BenefitFeature = apply { if (!validated) { - description() - frequencies() - employeeDeduction() - companyContribution() annualMaximum() catchUp() + companyContribution() + description() + employeeDeduction() + frequencies() hsaContributionLimit() validated = true } @@ -243,52 +243,48 @@ private constructor( class Builder { - private var description: JsonField = JsonMissing.of() - private var frequencies: JsonField> = JsonMissing.of() - private var employeeDeduction: JsonField> = JsonMissing.of() - private var companyContribution: JsonField> = - JsonMissing.of() private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() + private var companyContribution: JsonField> = + JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var employeeDeduction: JsonField> = JsonMissing.of() + private var frequencies: JsonField> = JsonMissing.of() private var hsaContributionLimit: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(benefitFeature: BenefitFeature) = apply { - description = benefitFeature.description - frequencies = benefitFeature.frequencies - employeeDeduction = benefitFeature.employeeDeduction - companyContribution = benefitFeature.companyContribution annualMaximum = benefitFeature.annualMaximum catchUp = benefitFeature.catchUp + companyContribution = benefitFeature.companyContribution + description = benefitFeature.description + employeeDeduction = benefitFeature.employeeDeduction + frequencies = benefitFeature.frequencies hsaContributionLimit = benefitFeature.hsaContributionLimit additionalProperties = benefitFeature.additionalProperties.toMutableMap() } - fun description(description: String) = description(JsonField.of(description)) - - fun description(description: JsonField) = apply { - this.description = description - } - - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(frequencies: List) = - frequencies(JsonField.of(frequencies)) + /** Whether the provider supports an annual maximum for this benefit. */ + fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(frequencies: JsonField>) = apply { - this.frequencies = frequencies + /** Whether the provider supports an annual maximum for this benefit. */ + fun annualMaximum(annualMaximum: JsonField) = apply { + this.annualMaximum = annualMaximum } - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(employeeDeduction: List) = - employeeDeduction(JsonField.of(employeeDeduction)) + /** + * Whether the provider supports catch up for this benefit. This field will only be true + * for retirement benefits. + */ + fun catchUp(catchUp: Boolean) = catchUp(JsonField.of(catchUp)) - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(employeeDeduction: JsonField>) = apply { - this.employeeDeduction = employeeDeduction - } + /** + * Whether the provider supports catch up for this benefit. This field will only be true + * for retirement benefits. + */ + fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } /** * Supported contribution types. An empty array indicates contributions are not @@ -306,25 +302,29 @@ private constructor( this.companyContribution = companyContribution } - /** Whether the provider supports an annual maximum for this benefit. */ - fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) + fun description(description: String) = description(JsonField.of(description)) - /** Whether the provider supports an annual maximum for this benefit. */ - fun annualMaximum(annualMaximum: JsonField) = apply { - this.annualMaximum = annualMaximum + fun description(description: JsonField) = apply { + this.description = description } - /** - * Whether the provider supports catch up for this benefit. This field will only be true - * for retirement benefits. - */ - fun catchUp(catchUp: Boolean) = catchUp(JsonField.of(catchUp)) + /** Supported deduction types. An empty array indicates deductions are not supported. */ + fun employeeDeduction(employeeDeduction: List) = + employeeDeduction(JsonField.of(employeeDeduction)) - /** - * Whether the provider supports catch up for this benefit. This field will only be true - * for retirement benefits. - */ - fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } + /** Supported deduction types. An empty array indicates deductions are not supported. */ + fun employeeDeduction(employeeDeduction: JsonField>) = apply { + this.employeeDeduction = employeeDeduction + } + + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(frequencies: List) = + frequencies(JsonField.of(frequencies)) + + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(frequencies: JsonField>) = apply { + this.frequencies = frequencies + } /** * Whether the provider supports HSA contribution limits. Empty if this feature is not @@ -363,12 +363,12 @@ private constructor( fun build(): BenefitFeature = BenefitFeature( - description, - frequencies.map { it.toImmutable() }, - employeeDeduction.map { it.toImmutable() }, - companyContribution.map { it.toImmutable() }, annualMaximum, catchUp, + companyContribution.map { it.toImmutable() }, + description, + employeeDeduction.map { it.toImmutable() }, + frequencies.map { it.toImmutable() }, hsaContributionLimit.map { it.toImmutable() }, additionalProperties.toImmutable(), ) @@ -550,17 +550,17 @@ private constructor( return true } - return /* spotless:off */ other is BenefitFeature && description == other.description && frequencies == other.frequencies && employeeDeduction == other.employeeDeduction && companyContribution == other.companyContribution && annualMaximum == other.annualMaximum && catchUp == other.catchUp && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BenefitFeature && annualMaximum == other.annualMaximum && catchUp == other.catchUp && companyContribution == other.companyContribution && description == other.description && employeeDeduction == other.employeeDeduction && frequencies == other.frequencies && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(description, frequencies, employeeDeduction, companyContribution, annualMaximum, catchUp, hsaContributionLimit, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(annualMaximum, catchUp, companyContribution, description, employeeDeduction, frequencies, hsaContributionLimit, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BenefitFeature{description=$description, frequencies=$frequencies, employeeDeduction=$employeeDeduction, companyContribution=$companyContribution, annualMaximum=$annualMaximum, catchUp=$catchUp, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}" + "BenefitFeature{annualMaximum=$annualMaximum, catchUp=$catchUp, companyContribution=$companyContribution, description=$description, employeeDeduction=$employeeDeduction, frequencies=$frequencies, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt index c36d6219..06e19af6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt @@ -24,104 +24,104 @@ import java.util.Optional class BenefitsSupport @JsonCreator private constructor( - @JsonProperty("s125_medical") + @JsonProperty("commuter") @ExcludeMissing - private val s125Medical: JsonField = JsonMissing.of(), - @JsonProperty("s125_dental") + private val commuter: JsonField = JsonMissing.of(), + @JsonProperty("custom_post_tax") @ExcludeMissing - private val s125Dental: JsonField = JsonMissing.of(), - @JsonProperty("s125_vision") + private val customPostTax: JsonField = JsonMissing.of(), + @JsonProperty("custom_pre_tax") @ExcludeMissing - private val s125Vision: JsonField = JsonMissing.of(), - @JsonProperty("hsa_pre") + private val customPreTax: JsonField = JsonMissing.of(), + @JsonProperty("fsa_dependent_care") @ExcludeMissing - private val hsaPre: JsonField = JsonMissing.of(), + private val fsaDependentCare: JsonField = JsonMissing.of(), + @JsonProperty("fsa_medical") + @ExcludeMissing + private val fsaMedical: JsonField = JsonMissing.of(), @JsonProperty("hsa_post") @ExcludeMissing private val hsaPost: JsonField = JsonMissing.of(), - @JsonProperty("fsa_medical") + @JsonProperty("hsa_pre") @ExcludeMissing - private val fsaMedical: JsonField = JsonMissing.of(), - @JsonProperty("fsa_dependent_care") + private val hsaPre: JsonField = JsonMissing.of(), + @JsonProperty("s125_dental") @ExcludeMissing - private val fsaDependentCare: JsonField = JsonMissing.of(), - @JsonProperty("simple_ira") + private val s125Dental: JsonField = JsonMissing.of(), + @JsonProperty("s125_medical") @ExcludeMissing - private val simpleIra: JsonField = JsonMissing.of(), + private val s125Medical: JsonField = JsonMissing.of(), + @JsonProperty("s125_vision") + @ExcludeMissing + private val s125Vision: JsonField = JsonMissing.of(), @JsonProperty("simple") @ExcludeMissing private val simple: JsonField = JsonMissing.of(), - @JsonProperty("commuter") - @ExcludeMissing - private val commuter: JsonField = JsonMissing.of(), - @JsonProperty("custom_post_tax") - @ExcludeMissing - private val customPostTax: JsonField = JsonMissing.of(), - @JsonProperty("custom_pre_tax") + @JsonProperty("simple_ira") @ExcludeMissing - private val customPreTax: JsonField = JsonMissing.of(), + private val simpleIra: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun s125Medical(): Optional = - Optional.ofNullable(s125Medical.getNullable("s125_medical")) + fun commuter(): Optional = + Optional.ofNullable(commuter.getNullable("commuter")) - fun s125Dental(): Optional = - Optional.ofNullable(s125Dental.getNullable("s125_dental")) + fun customPostTax(): Optional = + Optional.ofNullable(customPostTax.getNullable("custom_post_tax")) - fun s125Vision(): Optional = - Optional.ofNullable(s125Vision.getNullable("s125_vision")) + fun customPreTax(): Optional = + Optional.ofNullable(customPreTax.getNullable("custom_pre_tax")) - fun hsaPre(): Optional = - Optional.ofNullable(hsaPre.getNullable("hsa_pre")) + fun fsaDependentCare(): Optional = + Optional.ofNullable(fsaDependentCare.getNullable("fsa_dependent_care")) + + fun fsaMedical(): Optional = + Optional.ofNullable(fsaMedical.getNullable("fsa_medical")) fun hsaPost(): Optional = Optional.ofNullable(hsaPost.getNullable("hsa_post")) - fun fsaMedical(): Optional = - Optional.ofNullable(fsaMedical.getNullable("fsa_medical")) + fun hsaPre(): Optional = + Optional.ofNullable(hsaPre.getNullable("hsa_pre")) - fun fsaDependentCare(): Optional = - Optional.ofNullable(fsaDependentCare.getNullable("fsa_dependent_care")) + fun s125Dental(): Optional = + Optional.ofNullable(s125Dental.getNullable("s125_dental")) - fun simpleIra(): Optional = - Optional.ofNullable(simpleIra.getNullable("simple_ira")) + fun s125Medical(): Optional = + Optional.ofNullable(s125Medical.getNullable("s125_medical")) + + fun s125Vision(): Optional = + Optional.ofNullable(s125Vision.getNullable("s125_vision")) fun simple(): Optional = Optional.ofNullable(simple.getNullable("simple")) - fun commuter(): Optional = - Optional.ofNullable(commuter.getNullable("commuter")) - - fun customPostTax(): Optional = - Optional.ofNullable(customPostTax.getNullable("custom_post_tax")) + fun simpleIra(): Optional = + Optional.ofNullable(simpleIra.getNullable("simple_ira")) - fun customPreTax(): Optional = - Optional.ofNullable(customPreTax.getNullable("custom_pre_tax")) + @JsonProperty("commuter") @ExcludeMissing fun _commuter() = commuter - @JsonProperty("s125_medical") @ExcludeMissing fun _s125Medical() = s125Medical + @JsonProperty("custom_post_tax") @ExcludeMissing fun _customPostTax() = customPostTax - @JsonProperty("s125_dental") @ExcludeMissing fun _s125Dental() = s125Dental + @JsonProperty("custom_pre_tax") @ExcludeMissing fun _customPreTax() = customPreTax - @JsonProperty("s125_vision") @ExcludeMissing fun _s125Vision() = s125Vision + @JsonProperty("fsa_dependent_care") @ExcludeMissing fun _fsaDependentCare() = fsaDependentCare - @JsonProperty("hsa_pre") @ExcludeMissing fun _hsaPre() = hsaPre + @JsonProperty("fsa_medical") @ExcludeMissing fun _fsaMedical() = fsaMedical @JsonProperty("hsa_post") @ExcludeMissing fun _hsaPost() = hsaPost - @JsonProperty("fsa_medical") @ExcludeMissing fun _fsaMedical() = fsaMedical - - @JsonProperty("fsa_dependent_care") @ExcludeMissing fun _fsaDependentCare() = fsaDependentCare + @JsonProperty("hsa_pre") @ExcludeMissing fun _hsaPre() = hsaPre - @JsonProperty("simple_ira") @ExcludeMissing fun _simpleIra() = simpleIra + @JsonProperty("s125_dental") @ExcludeMissing fun _s125Dental() = s125Dental - @JsonProperty("simple") @ExcludeMissing fun _simple() = simple + @JsonProperty("s125_medical") @ExcludeMissing fun _s125Medical() = s125Medical - @JsonProperty("commuter") @ExcludeMissing fun _commuter() = commuter + @JsonProperty("s125_vision") @ExcludeMissing fun _s125Vision() = s125Vision - @JsonProperty("custom_post_tax") @ExcludeMissing fun _customPostTax() = customPostTax + @JsonProperty("simple") @ExcludeMissing fun _simple() = simple - @JsonProperty("custom_pre_tax") @ExcludeMissing fun _customPreTax() = customPreTax + @JsonProperty("simple_ira") @ExcludeMissing fun _simpleIra() = simpleIra @JsonAnyGetter @ExcludeMissing @@ -131,18 +131,18 @@ private constructor( fun validate(): BenefitsSupport = apply { if (!validated) { - s125Medical().map { it.validate() } - s125Dental().map { it.validate() } - s125Vision().map { it.validate() } - hsaPre().map { it.validate() } - hsaPost().map { it.validate() } - fsaMedical().map { it.validate() } - fsaDependentCare().map { it.validate() } - simpleIra().map { it.validate() } - simple().map { it.validate() } commuter().map { it.validate() } customPostTax().map { it.validate() } customPreTax().map { it.validate() } + fsaDependentCare().map { it.validate() } + fsaMedical().map { it.validate() } + hsaPost().map { it.validate() } + hsaPre().map { it.validate() } + s125Dental().map { it.validate() } + s125Medical().map { it.validate() } + s125Vision().map { it.validate() } + simple().map { it.validate() } + simpleIra().map { it.validate() } validated = true } } @@ -156,66 +156,62 @@ private constructor( class Builder { - private var s125Medical: JsonField = JsonMissing.of() - private var s125Dental: JsonField = JsonMissing.of() - private var s125Vision: JsonField = JsonMissing.of() - private var hsaPre: JsonField = JsonMissing.of() - private var hsaPost: JsonField = JsonMissing.of() - private var fsaMedical: JsonField = JsonMissing.of() - private var fsaDependentCare: JsonField = JsonMissing.of() - private var simpleIra: JsonField = JsonMissing.of() - private var simple: JsonField = JsonMissing.of() private var commuter: JsonField = JsonMissing.of() private var customPostTax: JsonField = JsonMissing.of() private var customPreTax: JsonField = JsonMissing.of() + private var fsaDependentCare: JsonField = JsonMissing.of() + private var fsaMedical: JsonField = JsonMissing.of() + private var hsaPost: JsonField = JsonMissing.of() + private var hsaPre: JsonField = JsonMissing.of() + private var s125Dental: JsonField = JsonMissing.of() + private var s125Medical: JsonField = JsonMissing.of() + private var s125Vision: JsonField = JsonMissing.of() + private var simple: JsonField = JsonMissing.of() + private var simpleIra: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(benefitsSupport: BenefitsSupport) = apply { - s125Medical = benefitsSupport.s125Medical - s125Dental = benefitsSupport.s125Dental - s125Vision = benefitsSupport.s125Vision - hsaPre = benefitsSupport.hsaPre - hsaPost = benefitsSupport.hsaPost - fsaMedical = benefitsSupport.fsaMedical - fsaDependentCare = benefitsSupport.fsaDependentCare - simpleIra = benefitsSupport.simpleIra - simple = benefitsSupport.simple commuter = benefitsSupport.commuter customPostTax = benefitsSupport.customPostTax customPreTax = benefitsSupport.customPreTax + fsaDependentCare = benefitsSupport.fsaDependentCare + fsaMedical = benefitsSupport.fsaMedical + hsaPost = benefitsSupport.hsaPost + hsaPre = benefitsSupport.hsaPre + s125Dental = benefitsSupport.s125Dental + s125Medical = benefitsSupport.s125Medical + s125Vision = benefitsSupport.s125Vision + simple = benefitsSupport.simple + simpleIra = benefitsSupport.simpleIra additionalProperties = benefitsSupport.additionalProperties.toMutableMap() } - fun s125Medical(s125Medical: BenefitFeaturesAndOperations) = - s125Medical(JsonField.of(s125Medical)) + fun commuter(commuter: BenefitFeaturesAndOperations) = commuter(JsonField.of(commuter)) - fun s125Medical(s125Medical: JsonField) = apply { - this.s125Medical = s125Medical + fun commuter(commuter: JsonField) = apply { + this.commuter = commuter } - fun s125Dental(s125Dental: BenefitFeaturesAndOperations) = - s125Dental(JsonField.of(s125Dental)) + fun customPostTax(customPostTax: BenefitFeaturesAndOperations) = + customPostTax(JsonField.of(customPostTax)) - fun s125Dental(s125Dental: JsonField) = apply { - this.s125Dental = s125Dental + fun customPostTax(customPostTax: JsonField) = apply { + this.customPostTax = customPostTax } - fun s125Vision(s125Vision: BenefitFeaturesAndOperations) = - s125Vision(JsonField.of(s125Vision)) + fun customPreTax(customPreTax: BenefitFeaturesAndOperations) = + customPreTax(JsonField.of(customPreTax)) - fun s125Vision(s125Vision: JsonField) = apply { - this.s125Vision = s125Vision + fun customPreTax(customPreTax: JsonField) = apply { + this.customPreTax = customPreTax } - fun hsaPre(hsaPre: BenefitFeaturesAndOperations) = hsaPre(JsonField.of(hsaPre)) - - fun hsaPre(hsaPre: JsonField) = apply { this.hsaPre = hsaPre } - - fun hsaPost(hsaPost: BenefitFeaturesAndOperations) = hsaPost(JsonField.of(hsaPost)) + fun fsaDependentCare(fsaDependentCare: BenefitFeaturesAndOperations) = + fsaDependentCare(JsonField.of(fsaDependentCare)) - fun hsaPost(hsaPost: JsonField) = apply { - this.hsaPost = hsaPost + fun fsaDependentCare(fsaDependentCare: JsonField) = apply { + this.fsaDependentCare = fsaDependentCare } fun fsaMedical(fsaMedical: BenefitFeaturesAndOperations) = @@ -225,41 +221,45 @@ private constructor( this.fsaMedical = fsaMedical } - fun fsaDependentCare(fsaDependentCare: BenefitFeaturesAndOperations) = - fsaDependentCare(JsonField.of(fsaDependentCare)) + fun hsaPost(hsaPost: BenefitFeaturesAndOperations) = hsaPost(JsonField.of(hsaPost)) - fun fsaDependentCare(fsaDependentCare: JsonField) = apply { - this.fsaDependentCare = fsaDependentCare + fun hsaPost(hsaPost: JsonField) = apply { + this.hsaPost = hsaPost } - fun simpleIra(simpleIra: BenefitFeaturesAndOperations) = simpleIra(JsonField.of(simpleIra)) + fun hsaPre(hsaPre: BenefitFeaturesAndOperations) = hsaPre(JsonField.of(hsaPre)) - fun simpleIra(simpleIra: JsonField) = apply { - this.simpleIra = simpleIra - } + fun hsaPre(hsaPre: JsonField) = apply { this.hsaPre = hsaPre } - fun simple(simple: BenefitFeaturesAndOperations) = simple(JsonField.of(simple)) + fun s125Dental(s125Dental: BenefitFeaturesAndOperations) = + s125Dental(JsonField.of(s125Dental)) - fun simple(simple: JsonField) = apply { this.simple = simple } + fun s125Dental(s125Dental: JsonField) = apply { + this.s125Dental = s125Dental + } - fun commuter(commuter: BenefitFeaturesAndOperations) = commuter(JsonField.of(commuter)) + fun s125Medical(s125Medical: BenefitFeaturesAndOperations) = + s125Medical(JsonField.of(s125Medical)) - fun commuter(commuter: JsonField) = apply { - this.commuter = commuter + fun s125Medical(s125Medical: JsonField) = apply { + this.s125Medical = s125Medical } - fun customPostTax(customPostTax: BenefitFeaturesAndOperations) = - customPostTax(JsonField.of(customPostTax)) + fun s125Vision(s125Vision: BenefitFeaturesAndOperations) = + s125Vision(JsonField.of(s125Vision)) - fun customPostTax(customPostTax: JsonField) = apply { - this.customPostTax = customPostTax + fun s125Vision(s125Vision: JsonField) = apply { + this.s125Vision = s125Vision } - fun customPreTax(customPreTax: BenefitFeaturesAndOperations) = - customPreTax(JsonField.of(customPreTax)) + fun simple(simple: BenefitFeaturesAndOperations) = simple(JsonField.of(simple)) - fun customPreTax(customPreTax: JsonField) = apply { - this.customPreTax = customPreTax + fun simple(simple: JsonField) = apply { this.simple = simple } + + fun simpleIra(simpleIra: BenefitFeaturesAndOperations) = simpleIra(JsonField.of(simpleIra)) + + fun simpleIra(simpleIra: JsonField) = apply { + this.simpleIra = simpleIra } fun additionalProperties(additionalProperties: Map) = apply { @@ -283,18 +283,18 @@ private constructor( fun build(): BenefitsSupport = BenefitsSupport( - s125Medical, - s125Dental, - s125Vision, - hsaPre, - hsaPost, - fsaMedical, - fsaDependentCare, - simpleIra, - simple, commuter, customPostTax, customPreTax, + fsaDependentCare, + fsaMedical, + hsaPost, + hsaPre, + s125Dental, + s125Medical, + s125Vision, + simple, + simpleIra, additionalProperties.toImmutable(), ) } @@ -304,15 +304,15 @@ private constructor( return true } - return /* spotless:off */ other is BenefitsSupport && s125Medical == other.s125Medical && s125Dental == other.s125Dental && s125Vision == other.s125Vision && hsaPre == other.hsaPre && hsaPost == other.hsaPost && fsaMedical == other.fsaMedical && fsaDependentCare == other.fsaDependentCare && simpleIra == other.simpleIra && simple == other.simple && commuter == other.commuter && customPostTax == other.customPostTax && customPreTax == other.customPreTax && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BenefitsSupport && commuter == other.commuter && customPostTax == other.customPostTax && customPreTax == other.customPreTax && fsaDependentCare == other.fsaDependentCare && fsaMedical == other.fsaMedical && hsaPost == other.hsaPost && hsaPre == other.hsaPre && s125Dental == other.s125Dental && s125Medical == other.s125Medical && s125Vision == other.s125Vision && simple == other.simple && simpleIra == other.simpleIra && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(s125Medical, s125Dental, s125Vision, hsaPre, hsaPost, fsaMedical, fsaDependentCare, simpleIra, simple, commuter, customPostTax, customPreTax, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(commuter, customPostTax, customPreTax, fsaDependentCare, fsaMedical, hsaPost, hsaPre, s125Dental, s125Medical, s125Vision, simple, simpleIra, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BenefitsSupport{s125Medical=$s125Medical, s125Dental=$s125Dental, s125Vision=$s125Vision, hsaPre=$hsaPre, hsaPost=$hsaPost, fsaMedical=$fsaMedical, fsaDependentCare=$fsaDependentCare, simpleIra=$simpleIra, simple=$simple, commuter=$commuter, customPostTax=$customPostTax, customPreTax=$customPreTax, additionalProperties=$additionalProperties}" + "BenefitsSupport{commuter=$commuter, customPostTax=$customPostTax, customPreTax=$customPreTax, fsaDependentCare=$fsaDependentCare, fsaMedical=$fsaMedical, hsaPost=$hsaPost, hsaPre=$hsaPre, s125Dental=$s125Dental, s125Medical=$s125Medical, s125Vision=$s125Vision, simple=$simple, simpleIra=$simpleIra, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt index 656acc52..bca50d5c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt @@ -23,40 +23,53 @@ class Company @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("legal_name") + @JsonProperty("accounts") @ExcludeMissing - private val legalName: JsonField = JsonMissing.of(), + private val accounts: JsonField> = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField> = JsonMissing.of(), + @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), @JsonProperty("entity") @ExcludeMissing private val entity: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField> = JsonMissing.of(), @JsonProperty("primary_email") @ExcludeMissing private val primaryEmail: JsonField = JsonMissing.of(), @JsonProperty("primary_phone_number") @ExcludeMissing private val primaryPhoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("departments") - @ExcludeMissing - private val departments: JsonField> = JsonMissing.of(), - @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), - @JsonProperty("locations") - @ExcludeMissing - private val locations: JsonField> = JsonMissing.of(), - @JsonProperty("accounts") - @ExcludeMissing - private val accounts: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for the company. */ fun id(): String = id.getRequired("id") - /** The legal name of the company. */ - fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(): Optional> = Optional.ofNullable(accounts.getNullable("accounts")) + + /** The array of company departments. */ + fun departments(): Optional> = + Optional.ofNullable(departments.getNullable("departments")) + + /** The employer identification number. */ + fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) /** The entity type object. */ fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity")) + /** The legal name of the company. */ + fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) + + fun locations(): Optional> = + Optional.ofNullable(locations.getNullable("locations")) + /** The email of the main administrator on the account. */ fun primaryEmail(): Optional = Optional.ofNullable(primaryEmail.getNullable("primary_email")) @@ -65,27 +78,25 @@ private constructor( fun primaryPhoneNumber(): Optional = Optional.ofNullable(primaryPhoneNumber.getNullable("primary_phone_number")) - /** The array of company departments. */ - fun departments(): Optional> = - Optional.ofNullable(departments.getNullable("departments")) + /** A stable Finch `id` (UUID v4) for the company. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id - /** The employer identification number. */ - fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) + /** An array of bank account objects associated with the payroll/HRIS system. */ + @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts - fun locations(): Optional> = - Optional.ofNullable(locations.getNullable("locations")) + /** The array of company departments. */ + @JsonProperty("departments") @ExcludeMissing fun _departments() = departments - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(): Optional> = Optional.ofNullable(accounts.getNullable("accounts")) + /** The employer identification number. */ + @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - /** A stable Finch `id` (UUID v4) for the company. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id + /** The entity type object. */ + @JsonProperty("entity") @ExcludeMissing fun _entity() = entity /** The legal name of the company. */ @JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName - /** The entity type object. */ - @JsonProperty("entity") @ExcludeMissing fun _entity() = entity + @JsonProperty("locations") @ExcludeMissing fun _locations() = locations /** The email of the main administrator on the account. */ @JsonProperty("primary_email") @ExcludeMissing fun _primaryEmail() = primaryEmail @@ -95,17 +106,6 @@ private constructor( @ExcludeMissing fun _primaryPhoneNumber() = primaryPhoneNumber - /** The array of company departments. */ - @JsonProperty("departments") @ExcludeMissing fun _departments() = departments - - /** The employer identification number. */ - @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - - @JsonProperty("locations") @ExcludeMissing fun _locations() = locations - - /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -115,14 +115,14 @@ private constructor( fun validate(): Company = apply { if (!validated) { id() - legalName() - entity().map { it.validate() } - primaryEmail() - primaryPhoneNumber() + accounts().map { it.forEach { it.validate() } } departments().map { it.forEach { it?.validate() } } ein() + entity().map { it.validate() } + legalName() locations().map { it.forEach { it?.validate() } } - accounts().map { it.forEach { it.validate() } } + primaryEmail() + primaryPhoneNumber() validated = true } } @@ -137,27 +137,27 @@ private constructor( 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 accounts: JsonField> = JsonMissing.of() private var departments: JsonField> = JsonMissing.of() private var ein: JsonField = JsonMissing.of() + private var entity: JsonField = JsonMissing.of() + private var legalName: JsonField = JsonMissing.of() private var locations: JsonField> = JsonMissing.of() - private var accounts: JsonField> = JsonMissing.of() + private var primaryEmail: JsonField = JsonMissing.of() + private var primaryPhoneNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(company: Company) = apply { id = company.id - legalName = company.legalName - entity = company.entity - primaryEmail = company.primaryEmail - primaryPhoneNumber = company.primaryPhoneNumber + accounts = company.accounts departments = company.departments ein = company.ein + entity = company.entity + legalName = company.legalName locations = company.locations - accounts = company.accounts + primaryEmail = company.primaryEmail + primaryPhoneNumber = company.primaryPhoneNumber additionalProperties = company.additionalProperties.toMutableMap() } @@ -167,11 +167,25 @@ private constructor( /** A stable Finch `id` (UUID v4) for the company. */ fun id(id: JsonField) = apply { this.id = id } - /** The legal name of the company. */ - fun legalName(legalName: String) = legalName(JsonField.of(legalName)) + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: List) = accounts(JsonField.of(accounts)) - /** The legal name of the company. */ - fun legalName(legalName: JsonField) = apply { this.legalName = legalName } + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } + + /** The array of company departments. */ + fun departments(departments: List) = departments(JsonField.of(departments)) + + /** The array of company departments. */ + fun departments(departments: JsonField>) = apply { + this.departments = departments + } + + /** The employer identification number. */ + fun ein(ein: String) = ein(JsonField.of(ein)) + + /** The employer identification number. */ + fun ein(ein: JsonField) = apply { this.ein = ein } /** The entity type object. */ fun entity(entity: Entity) = entity(JsonField.of(entity)) @@ -179,6 +193,16 @@ private constructor( /** The entity type object. */ fun entity(entity: JsonField) = apply { this.entity = entity } + /** The legal name of the company. */ + fun legalName(legalName: String) = legalName(JsonField.of(legalName)) + + /** The legal name of the company. */ + fun legalName(legalName: JsonField) = apply { this.legalName = legalName } + + fun locations(locations: List) = locations(JsonField.of(locations)) + + fun locations(locations: JsonField>) = apply { this.locations = locations } + /** The email of the main administrator on the account. */ fun primaryEmail(primaryEmail: String) = primaryEmail(JsonField.of(primaryEmail)) @@ -196,30 +220,6 @@ private constructor( this.primaryPhoneNumber = primaryPhoneNumber } - /** The array of company departments. */ - fun departments(departments: List) = departments(JsonField.of(departments)) - - /** The array of company departments. */ - fun departments(departments: JsonField>) = apply { - this.departments = departments - } - - /** The employer identification number. */ - fun ein(ein: String) = ein(JsonField.of(ein)) - - /** The employer identification number. */ - fun ein(ein: JsonField) = apply { this.ein = ein } - - fun locations(locations: List) = locations(JsonField.of(locations)) - - fun locations(locations: JsonField>) = apply { this.locations = locations } - - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = accounts(JsonField.of(accounts)) - - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -242,14 +242,14 @@ private constructor( fun build(): Company = Company( id, - legalName, - entity, - primaryEmail, - primaryPhoneNumber, + accounts.map { it.toImmutable() }, departments.map { it.toImmutable() }, ein, + entity, + legalName, locations.map { it.toImmutable() }, - accounts.map { it.toImmutable() }, + primaryEmail, + primaryPhoneNumber, additionalProperties.toImmutable(), ) } @@ -258,63 +258,63 @@ private constructor( class Account @JsonCreator private constructor( - @JsonProperty("routing_number") - @ExcludeMissing - private val routingNumber: JsonField = JsonMissing.of(), @JsonProperty("account_name") @ExcludeMissing private val accountName: JsonField = JsonMissing.of(), - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - private val institutionName: JsonField = JsonMissing.of(), + private val accountNumber: JsonField = JsonMissing.of(), @JsonProperty("account_type") @ExcludeMissing private val accountType: JsonField = JsonMissing.of(), - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - private val accountNumber: JsonField = JsonMissing.of(), + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * A nine-digit code that's based on the U.S. Bank location where your account was opened. - */ - fun routingNumber(): Optional = - Optional.ofNullable(routingNumber.getNullable("routing_number")) - /** The name of the bank associated in the payroll/HRIS system. */ fun accountName(): Optional = Optional.ofNullable(accountName.getNullable("account_name")) - /** Name of the banking institution. */ - fun institutionName(): Optional = - Optional.ofNullable(institutionName.getNullable("institution_name")) + /** 10-12 digit number to specify the bank account */ + fun accountNumber(): Optional = + Optional.ofNullable(accountNumber.getNullable("account_number")) /** The type of bank account. */ fun accountType(): Optional = Optional.ofNullable(accountType.getNullable("account_type")) - /** 10-12 digit number to specify the bank account */ - fun accountNumber(): Optional = - Optional.ofNullable(accountNumber.getNullable("account_number")) + /** Name of the banking institution. */ + fun institutionName(): Optional = + Optional.ofNullable(institutionName.getNullable("institution_name")) /** * A nine-digit code that's based on the U.S. Bank location where your account was opened. */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun routingNumber(): Optional = + Optional.ofNullable(routingNumber.getNullable("routing_number")) /** The name of the bank associated in the payroll/HRIS system. */ @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName - /** Name of the banking institution. */ - @JsonProperty("institution_name") @ExcludeMissing fun _institutionName() = institutionName + /** 10-12 digit number to specify the bank account */ + @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber /** The type of bank account. */ @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType - /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber + /** Name of the banking institution. */ + @JsonProperty("institution_name") @ExcludeMissing fun _institutionName() = institutionName + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was opened. + */ + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber @JsonAnyGetter @ExcludeMissing @@ -324,11 +324,11 @@ private constructor( fun validate(): Account = apply { if (!validated) { - routingNumber() accountName() - institutionName() - accountType() accountNumber() + accountType() + institutionName() + routingNumber() validated = true } } @@ -342,37 +342,23 @@ private constructor( 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 accountType: JsonField = JsonMissing.of() + private var institutionName: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(account: Account) = apply { - routingNumber = account.routingNumber accountName = account.accountName - institutionName = account.institutionName - accountType = account.accountType accountNumber = account.accountNumber + accountType = account.accountType + institutionName = account.institutionName + routingNumber = account.routingNumber additionalProperties = account.additionalProperties.toMutableMap() } - /** - * A nine-digit code that's based on the U.S. Bank location where your account was - * opened. - */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - - /** - * A nine-digit code that's based on the U.S. Bank location where your account was - * opened. - */ - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } - /** The name of the bank associated in the payroll/HRIS system. */ fun accountName(accountName: String) = accountName(JsonField.of(accountName)) @@ -381,13 +367,12 @@ private constructor( this.accountName = accountName } - /** Name of the banking institution. */ - fun institutionName(institutionName: String) = - institutionName(JsonField.of(institutionName)) + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) - /** Name of the banking institution. */ - fun institutionName(institutionName: JsonField) = apply { - this.institutionName = institutionName + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber } /** The type of bank account. */ @@ -398,12 +383,27 @@ private constructor( this.accountType = accountType } - /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + /** Name of the banking institution. */ + fun institutionName(institutionName: String) = + institutionName(JsonField.of(institutionName)) - /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: JsonField) = apply { - this.accountNumber = accountNumber + /** Name of the banking institution. */ + fun institutionName(institutionName: JsonField) = apply { + this.institutionName = institutionName + } + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } fun additionalProperties(additionalProperties: Map) = apply { @@ -427,11 +427,11 @@ private constructor( fun build(): Account = Account( - routingNumber, accountName, - institutionName, - accountType, accountNumber, + accountType, + institutionName, + routingNumber, additionalProperties.toImmutable(), ) } @@ -498,17 +498,17 @@ private constructor( return true } - return /* spotless:off */ other is Account && routingNumber == other.routingNumber && accountName == other.accountName && institutionName == other.institutionName && accountType == other.accountType && accountNumber == other.accountNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Account && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(routingNumber, accountName, institutionName, accountType, accountNumber, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" + "Account{accountName=$accountName, accountNumber=$accountNumber, accountType=$accountType, institutionName=$institutionName, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -731,26 +731,26 @@ private constructor( class Entity @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The tax payer type of the company. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** The tax payer subtype of the company. */ fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) /** The tax payer type of the company. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** The tax payer subtype of the company. */ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + /** The tax payer type of the company. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -759,8 +759,8 @@ private constructor( fun validate(): Entity = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -774,29 +774,29 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(entity: Entity) = apply { - type = entity.type subtype = entity.subtype + type = entity.type additionalProperties = entity.additionalProperties.toMutableMap() } - /** The tax payer type of the company. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The tax payer type of the company. */ - fun type(type: JsonField) = apply { this.type = type } - /** The tax payer subtype of the company. */ fun subtype(subtype: Subtype) = subtype(JsonField.of(subtype)) /** The tax payer subtype of the company. */ fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + /** The tax payer type of the company. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The tax payer type of the company. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -818,8 +818,8 @@ private constructor( fun build(): Entity = Entity( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -979,17 +979,17 @@ private constructor( return true } - return /* spotless:off */ other is Entity && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Entity{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -997,15 +997,15 @@ private constructor( return true } - return /* spotless:off */ other is Company && id == other.id && legalName == other.legalName && entity == other.entity && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && departments == other.departments && ein == other.ein && locations == other.locations && accounts == other.accounts && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Company && id == other.id && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, legalName, entity, primaryEmail, primaryPhoneNumber, departments, ein, locations, accounts, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Company{id=$id, legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, departments=$departments, ein=$ein, locations=$locations, accounts=$accounts, additionalProperties=$additionalProperties}" + "Company{id=$id, accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt index 984afee3..d1ba1f43 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt @@ -23,38 +23,38 @@ private constructor( @JsonProperty("benefit_id") @ExcludeMissing private val benefitId: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), @JsonProperty("frequency") @ExcludeMissing private val frequency: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun benefitId(): String = benefitId.getRequired("benefit_id") - /** Type of benefit. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - fun description(): Optional = Optional.ofNullable(description.getNullable("description")) fun frequency(): Optional = Optional.ofNullable(frequency.getNullable("frequency")) - @JsonProperty("benefit_id") @ExcludeMissing fun _benefitId() = benefitId - /** Type of benefit. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) + + @JsonProperty("benefit_id") @ExcludeMissing fun _benefitId() = benefitId @JsonProperty("description") @ExcludeMissing fun _description() = description @JsonProperty("frequency") @ExcludeMissing fun _frequency() = frequency + /** Type of benefit. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -64,9 +64,9 @@ private constructor( fun validate(): CompanyBenefit = apply { if (!validated) { benefitId() - type() description() frequency() + type() validated = true } } @@ -81,17 +81,17 @@ private constructor( class Builder { private var benefitId: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var frequency: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(companyBenefit: CompanyBenefit) = apply { benefitId = companyBenefit.benefitId - type = companyBenefit.type description = companyBenefit.description frequency = companyBenefit.frequency + type = companyBenefit.type additionalProperties = companyBenefit.additionalProperties.toMutableMap() } @@ -99,12 +99,6 @@ private constructor( fun benefitId(benefitId: JsonField) = apply { this.benefitId = benefitId } - /** Type of benefit. */ - fun type(type: BenefitType) = type(JsonField.of(type)) - - /** Type of benefit. */ - fun type(type: JsonField) = apply { this.type = type } - fun description(description: String) = description(JsonField.of(description)) fun description(description: JsonField) = apply { this.description = description } @@ -113,6 +107,12 @@ private constructor( fun frequency(frequency: JsonField) = apply { this.frequency = frequency } + /** Type of benefit. */ + fun type(type: BenefitType) = type(JsonField.of(type)) + + /** Type of benefit. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -135,9 +135,9 @@ private constructor( fun build(): CompanyBenefit = CompanyBenefit( benefitId, - type, description, frequency, + type, additionalProperties.toImmutable(), ) } @@ -147,15 +147,15 @@ private constructor( return true } - return /* spotless:off */ other is CompanyBenefit && benefitId == other.benefitId && type == other.type && description == other.description && frequency == other.frequency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompanyBenefit && benefitId == other.benefitId && description == other.description && frequency == other.frequency && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(benefitId, type, description, frequency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(benefitId, description, frequency, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CompanyBenefit{benefitId=$benefitId, type=$type, description=$description, frequency=$frequency, additionalProperties=$additionalProperties}" + "CompanyBenefit{benefitId=$benefitId, description=$description, frequency=$frequency, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt index 245cbd05..db775844 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class CompanyEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): CompanyEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(companyEvent: CompanyEvent) = apply { - connectionId = companyEvent.connectionId - companyId = companyEvent.companyId accountId = companyEvent.accountId - eventType = companyEvent.eventType + companyId = companyEvent.companyId + connectionId = companyEvent.connectionId data = companyEvent.data + eventType = companyEvent.eventType additionalProperties = companyEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): CompanyEvent = CompanyEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -328,15 +328,15 @@ private constructor( return true } - return /* spotless:off */ other is CompanyEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompanyEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CompanyEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "CompanyEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt index 34c6f114..d73e6600 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt @@ -22,37 +22,50 @@ import java.util.Optional class CompanyUpdateResponse @JsonCreator private constructor( - @JsonProperty("legal_name") + @JsonProperty("accounts") @ExcludeMissing - private val legalName: JsonField = JsonMissing.of(), + private val accounts: JsonField> = JsonMissing.of(), + @JsonProperty("departments") + @ExcludeMissing + private val departments: JsonField> = JsonMissing.of(), + @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), @JsonProperty("entity") @ExcludeMissing private val entity: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") + @ExcludeMissing + private val legalName: JsonField = JsonMissing.of(), + @JsonProperty("locations") + @ExcludeMissing + private val locations: JsonField> = JsonMissing.of(), @JsonProperty("primary_email") @ExcludeMissing private val primaryEmail: JsonField = JsonMissing.of(), @JsonProperty("primary_phone_number") @ExcludeMissing private val primaryPhoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("departments") - @ExcludeMissing - private val departments: JsonField> = JsonMissing.of(), - @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), - @JsonProperty("locations") - @ExcludeMissing - private val locations: JsonField> = JsonMissing.of(), - @JsonProperty("accounts") - @ExcludeMissing - private val accounts: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The legal name of the company. */ - fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(): Optional> = Optional.ofNullable(accounts.getNullable("accounts")) + + /** The array of company departments. */ + fun departments(): Optional> = + Optional.ofNullable(departments.getNullable("departments")) + + /** The employer identification number. */ + fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) /** The entity type object. */ fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity")) + /** The legal name of the company. */ + fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) + + fun locations(): Optional> = + Optional.ofNullable(locations.getNullable("locations")) + /** The email of the main administrator on the account. */ fun primaryEmail(): Optional = Optional.ofNullable(primaryEmail.getNullable("primary_email")) @@ -61,24 +74,22 @@ private constructor( fun primaryPhoneNumber(): Optional = Optional.ofNullable(primaryPhoneNumber.getNullable("primary_phone_number")) + /** An array of bank account objects associated with the payroll/HRIS system. */ + @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts + /** The array of company departments. */ - fun departments(): Optional> = - Optional.ofNullable(departments.getNullable("departments")) + @JsonProperty("departments") @ExcludeMissing fun _departments() = departments /** The employer identification number. */ - fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) - - fun locations(): Optional> = - Optional.ofNullable(locations.getNullable("locations")) + @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(): Optional> = Optional.ofNullable(accounts.getNullable("accounts")) + /** The entity type object. */ + @JsonProperty("entity") @ExcludeMissing fun _entity() = entity /** The legal name of the company. */ @JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName - /** The entity type object. */ - @JsonProperty("entity") @ExcludeMissing fun _entity() = entity + @JsonProperty("locations") @ExcludeMissing fun _locations() = locations /** The email of the main administrator on the account. */ @JsonProperty("primary_email") @ExcludeMissing fun _primaryEmail() = primaryEmail @@ -88,17 +99,6 @@ private constructor( @ExcludeMissing fun _primaryPhoneNumber() = primaryPhoneNumber - /** The array of company departments. */ - @JsonProperty("departments") @ExcludeMissing fun _departments() = departments - - /** The employer identification number. */ - @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - - @JsonProperty("locations") @ExcludeMissing fun _locations() = locations - - /** An array of bank account objects associated with the payroll/HRIS system. */ - @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -107,14 +107,14 @@ private constructor( fun validate(): CompanyUpdateResponse = apply { if (!validated) { - legalName() - entity().map { it.validate() } - primaryEmail() - primaryPhoneNumber() + accounts().map { it.forEach { it.validate() } } departments().map { it.forEach { it?.validate() } } ein() + entity().map { it.validate() } + legalName() locations().map { it.forEach { it?.validate() } } - accounts().map { it.forEach { it.validate() } } + primaryEmail() + primaryPhoneNumber() validated = true } } @@ -128,34 +128,48 @@ private constructor( class Builder { - 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 accounts: JsonField> = JsonMissing.of() private var departments: JsonField> = JsonMissing.of() private var ein: JsonField = JsonMissing.of() + private var entity: JsonField = JsonMissing.of() + private var legalName: JsonField = JsonMissing.of() private var locations: JsonField> = JsonMissing.of() - private var accounts: JsonField> = JsonMissing.of() + private var primaryEmail: JsonField = JsonMissing.of() + private var primaryPhoneNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(companyUpdateResponse: CompanyUpdateResponse) = apply { - legalName = companyUpdateResponse.legalName - entity = companyUpdateResponse.entity - primaryEmail = companyUpdateResponse.primaryEmail - primaryPhoneNumber = companyUpdateResponse.primaryPhoneNumber + accounts = companyUpdateResponse.accounts departments = companyUpdateResponse.departments ein = companyUpdateResponse.ein + entity = companyUpdateResponse.entity + legalName = companyUpdateResponse.legalName locations = companyUpdateResponse.locations - accounts = companyUpdateResponse.accounts + primaryEmail = companyUpdateResponse.primaryEmail + primaryPhoneNumber = companyUpdateResponse.primaryPhoneNumber additionalProperties = companyUpdateResponse.additionalProperties.toMutableMap() } - /** The legal name of the company. */ - fun legalName(legalName: String) = legalName(JsonField.of(legalName)) + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: List) = accounts(JsonField.of(accounts)) - /** The legal name of the company. */ - fun legalName(legalName: JsonField) = apply { this.legalName = legalName } + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } + + /** The array of company departments. */ + fun departments(departments: List) = departments(JsonField.of(departments)) + + /** The array of company departments. */ + fun departments(departments: JsonField>) = apply { + this.departments = departments + } + + /** The employer identification number. */ + fun ein(ein: String) = ein(JsonField.of(ein)) + + /** The employer identification number. */ + fun ein(ein: JsonField) = apply { this.ein = ein } /** The entity type object. */ fun entity(entity: Entity) = entity(JsonField.of(entity)) @@ -163,6 +177,16 @@ private constructor( /** The entity type object. */ fun entity(entity: JsonField) = apply { this.entity = entity } + /** The legal name of the company. */ + fun legalName(legalName: String) = legalName(JsonField.of(legalName)) + + /** The legal name of the company. */ + fun legalName(legalName: JsonField) = apply { this.legalName = legalName } + + fun locations(locations: List) = locations(JsonField.of(locations)) + + fun locations(locations: JsonField>) = apply { this.locations = locations } + /** The email of the main administrator on the account. */ fun primaryEmail(primaryEmail: String) = primaryEmail(JsonField.of(primaryEmail)) @@ -180,30 +204,6 @@ private constructor( this.primaryPhoneNumber = primaryPhoneNumber } - /** The array of company departments. */ - fun departments(departments: List) = departments(JsonField.of(departments)) - - /** The array of company departments. */ - fun departments(departments: JsonField>) = apply { - this.departments = departments - } - - /** The employer identification number. */ - fun ein(ein: String) = ein(JsonField.of(ein)) - - /** The employer identification number. */ - fun ein(ein: JsonField) = apply { this.ein = ein } - - fun locations(locations: List) = locations(JsonField.of(locations)) - - fun locations(locations: JsonField>) = apply { this.locations = locations } - - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = accounts(JsonField.of(accounts)) - - /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: JsonField>) = apply { this.accounts = accounts } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -225,14 +225,14 @@ private constructor( fun build(): CompanyUpdateResponse = CompanyUpdateResponse( - legalName, - entity, - primaryEmail, - primaryPhoneNumber, + accounts.map { it.toImmutable() }, departments.map { it.toImmutable() }, ein, + entity, + legalName, locations.map { it.toImmutable() }, - accounts.map { it.toImmutable() }, + primaryEmail, + primaryPhoneNumber, additionalProperties.toImmutable(), ) } @@ -241,63 +241,63 @@ private constructor( class Account @JsonCreator private constructor( - @JsonProperty("routing_number") - @ExcludeMissing - private val routingNumber: JsonField = JsonMissing.of(), @JsonProperty("account_name") @ExcludeMissing private val accountName: JsonField = JsonMissing.of(), - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - private val institutionName: JsonField = JsonMissing.of(), + private val accountNumber: JsonField = JsonMissing.of(), @JsonProperty("account_type") @ExcludeMissing private val accountType: JsonField = JsonMissing.of(), - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - private val accountNumber: JsonField = JsonMissing.of(), + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * A nine-digit code that's based on the U.S. Bank location where your account was opened. - */ - fun routingNumber(): Optional = - Optional.ofNullable(routingNumber.getNullable("routing_number")) - /** The name of the bank associated in the payroll/HRIS system. */ fun accountName(): Optional = Optional.ofNullable(accountName.getNullable("account_name")) - /** Name of the banking institution. */ - fun institutionName(): Optional = - Optional.ofNullable(institutionName.getNullable("institution_name")) + /** 10-12 digit number to specify the bank account */ + fun accountNumber(): Optional = + Optional.ofNullable(accountNumber.getNullable("account_number")) /** The type of bank account. */ fun accountType(): Optional = Optional.ofNullable(accountType.getNullable("account_type")) - /** 10-12 digit number to specify the bank account */ - fun accountNumber(): Optional = - Optional.ofNullable(accountNumber.getNullable("account_number")) + /** Name of the banking institution. */ + fun institutionName(): Optional = + Optional.ofNullable(institutionName.getNullable("institution_name")) /** * A nine-digit code that's based on the U.S. Bank location where your account was opened. */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun routingNumber(): Optional = + Optional.ofNullable(routingNumber.getNullable("routing_number")) /** The name of the bank associated in the payroll/HRIS system. */ @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName - /** Name of the banking institution. */ - @JsonProperty("institution_name") @ExcludeMissing fun _institutionName() = institutionName + /** 10-12 digit number to specify the bank account */ + @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber /** The type of bank account. */ @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType - /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber + /** Name of the banking institution. */ + @JsonProperty("institution_name") @ExcludeMissing fun _institutionName() = institutionName + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was opened. + */ + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber @JsonAnyGetter @ExcludeMissing @@ -307,11 +307,11 @@ private constructor( fun validate(): Account = apply { if (!validated) { - routingNumber() accountName() - institutionName() - accountType() accountNumber() + accountType() + institutionName() + routingNumber() validated = true } } @@ -325,37 +325,23 @@ private constructor( 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 accountType: JsonField = JsonMissing.of() + private var institutionName: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(account: Account) = apply { - routingNumber = account.routingNumber accountName = account.accountName - institutionName = account.institutionName - accountType = account.accountType accountNumber = account.accountNumber + accountType = account.accountType + institutionName = account.institutionName + routingNumber = account.routingNumber additionalProperties = account.additionalProperties.toMutableMap() } - /** - * A nine-digit code that's based on the U.S. Bank location where your account was - * opened. - */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - - /** - * A nine-digit code that's based on the U.S. Bank location where your account was - * opened. - */ - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } - /** The name of the bank associated in the payroll/HRIS system. */ fun accountName(accountName: String) = accountName(JsonField.of(accountName)) @@ -364,13 +350,12 @@ private constructor( this.accountName = accountName } - /** Name of the banking institution. */ - fun institutionName(institutionName: String) = - institutionName(JsonField.of(institutionName)) + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) - /** Name of the banking institution. */ - fun institutionName(institutionName: JsonField) = apply { - this.institutionName = institutionName + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber } /** The type of bank account. */ @@ -381,12 +366,27 @@ private constructor( this.accountType = accountType } - /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + /** Name of the banking institution. */ + fun institutionName(institutionName: String) = + institutionName(JsonField.of(institutionName)) - /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: JsonField) = apply { - this.accountNumber = accountNumber + /** Name of the banking institution. */ + fun institutionName(institutionName: JsonField) = apply { + this.institutionName = institutionName + } + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } fun additionalProperties(additionalProperties: Map) = apply { @@ -410,11 +410,11 @@ private constructor( fun build(): Account = Account( - routingNumber, accountName, - institutionName, - accountType, accountNumber, + accountType, + institutionName, + routingNumber, additionalProperties.toImmutable(), ) } @@ -481,17 +481,17 @@ private constructor( return true } - return /* spotless:off */ other is Account && routingNumber == other.routingNumber && accountName == other.accountName && institutionName == other.institutionName && accountType == other.accountType && accountNumber == other.accountNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Account && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(routingNumber, accountName, institutionName, accountType, accountNumber, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" + "Account{accountName=$accountName, accountNumber=$accountNumber, accountType=$accountType, institutionName=$institutionName, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -714,26 +714,26 @@ private constructor( class Entity @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The tax payer type of the company. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** The tax payer subtype of the company. */ fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) /** The tax payer type of the company. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** The tax payer subtype of the company. */ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + /** The tax payer type of the company. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -742,8 +742,8 @@ private constructor( fun validate(): Entity = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -757,29 +757,29 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(entity: Entity) = apply { - type = entity.type subtype = entity.subtype + type = entity.type additionalProperties = entity.additionalProperties.toMutableMap() } - /** The tax payer type of the company. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The tax payer type of the company. */ - fun type(type: JsonField) = apply { this.type = type } - /** The tax payer subtype of the company. */ fun subtype(subtype: Subtype) = subtype(JsonField.of(subtype)) /** The tax payer subtype of the company. */ fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + /** The tax payer type of the company. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The tax payer type of the company. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -801,8 +801,8 @@ private constructor( fun build(): Entity = Entity( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -962,17 +962,17 @@ private constructor( return true } - return /* spotless:off */ other is Entity && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Entity{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -980,15 +980,15 @@ private constructor( return true } - return /* spotless:off */ other is CompanyUpdateResponse && legalName == other.legalName && entity == other.entity && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && departments == other.departments && ein == other.ein && locations == other.locations && accounts == other.accounts && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompanyUpdateResponse && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(legalName, entity, primaryEmail, primaryPhoneNumber, departments, ein, locations, accounts, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CompanyUpdateResponse{legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, departments=$departments, ein=$ein, locations=$locations, accounts=$accounts, additionalProperties=$additionalProperties}" + "CompanyUpdateResponse{accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index ce330248..414ae9ed 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt @@ -488,17 +488,17 @@ constructor( class Integration @JsonCreator private constructor( - @JsonProperty("provider") private val provider: String?, @JsonProperty("auth_method") private val authMethod: AuthMethod?, + @JsonProperty("provider") private val provider: String?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - @JsonProperty("provider") fun provider(): Optional = Optional.ofNullable(provider) - @JsonProperty("auth_method") fun authMethod(): Optional = Optional.ofNullable(authMethod) + @JsonProperty("provider") fun provider(): Optional = Optional.ofNullable(provider) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -512,21 +512,21 @@ constructor( class Builder { - private var provider: String? = null private var authMethod: AuthMethod? = null + private var provider: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(integration: Integration) = apply { - provider = integration.provider authMethod = integration.authMethod + provider = integration.provider additionalProperties = integration.additionalProperties.toMutableMap() } - fun provider(provider: String) = apply { this.provider = provider } - fun authMethod(authMethod: AuthMethod) = apply { this.authMethod = authMethod } + fun provider(provider: String) = apply { this.provider = provider } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -548,8 +548,8 @@ constructor( fun build(): Integration = Integration( - provider, authMethod, + provider, additionalProperties.toImmutable(), ) } @@ -628,17 +628,17 @@ constructor( return true } - return /* spotless:off */ other is Integration && provider == other.provider && authMethod == other.authMethod && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Integration && authMethod == other.authMethod && provider == other.provider && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(provider, authMethod, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(authMethod, provider, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Integration{provider=$provider, authMethod=$authMethod, additionalProperties=$additionalProperties}" + "Integration{authMethod=$authMethod, provider=$provider, additionalProperties=$additionalProperties}" } class Sandbox diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt index 1b4fb285..45a15e15 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt @@ -22,41 +22,34 @@ import java.util.Optional class ConnectionCreateResponse @JsonCreator private constructor( - @JsonProperty("connection_id") - @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), - @JsonProperty("company_id") - @ExcludeMissing - private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("provider_id") + @JsonProperty("access_token") @ExcludeMissing - private val providerId: JsonField = JsonMissing.of(), + private val accessToken: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing private val accountId: JsonField = JsonMissing.of(), @JsonProperty("authentication_type") @ExcludeMissing private val authenticationType: JsonField = JsonMissing.of(), + @JsonProperty("company_id") + @ExcludeMissing + private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), @JsonProperty("products") @ExcludeMissing private val products: JsonField> = JsonMissing.of(), - @JsonProperty("access_token") + @JsonProperty("provider_id") @ExcludeMissing - private val accessToken: JsonField = JsonMissing.of(), + private val providerId: JsonField = JsonMissing.of(), @JsonProperty("token_type") @ExcludeMissing private val tokenType: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the new connection */ - fun connectionId(): String = connectionId.getRequired("connection_id") - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(): String = companyId.getRequired("company_id") - - /** The ID of the provider associated with the `access_token`. */ - fun providerId(): String = providerId.getRequired("provider_id") + fun accessToken(): String = accessToken.getRequired("access_token") /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(): String = accountId.getRequired("account_id") @@ -64,20 +57,20 @@ private constructor( fun authenticationType(): AuthenticationType = authenticationType.getRequired("authentication_type") - fun products(): List = products.getRequired("products") - - fun accessToken(): String = accessToken.getRequired("access_token") - - fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(): String = companyId.getRequired("company_id") /** The ID of the new connection */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun connectionId(): String = connectionId.getRequired("connection_id") - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + fun products(): List = products.getRequired("products") /** The ID of the provider associated with the `access_token`. */ - @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId + fun providerId(): String = providerId.getRequired("provider_id") + + fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) + + @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId @@ -86,9 +79,16 @@ private constructor( @ExcludeMissing fun _authenticationType() = authenticationType + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + + /** The ID of the new connection */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + @JsonProperty("products") @ExcludeMissing fun _products() = products - @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken + /** The ID of the provider associated with the `access_token`. */ + @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId @JsonProperty("token_type") @ExcludeMissing fun _tokenType() = tokenType @@ -100,13 +100,13 @@ private constructor( fun validate(): ConnectionCreateResponse = apply { if (!validated) { - connectionId() - companyId() - providerId() + accessToken() accountId() authenticationType() + companyId() + connectionId() products() - accessToken() + providerId() tokenType() validated = true } @@ -121,48 +121,32 @@ private constructor( class Builder { - private var connectionId: JsonField = JsonMissing.of() - private var companyId: JsonField = JsonMissing.of() - private var providerId: JsonField = JsonMissing.of() + private var accessToken: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() private var authenticationType: JsonField = JsonMissing.of() + private var companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() - private var accessToken: JsonField = JsonMissing.of() + private var providerId: JsonField = JsonMissing.of() private var tokenType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(connectionCreateResponse: ConnectionCreateResponse) = apply { - connectionId = connectionCreateResponse.connectionId - companyId = connectionCreateResponse.companyId - providerId = connectionCreateResponse.providerId + accessToken = connectionCreateResponse.accessToken accountId = connectionCreateResponse.accountId authenticationType = connectionCreateResponse.authenticationType + companyId = connectionCreateResponse.companyId + connectionId = connectionCreateResponse.connectionId products = connectionCreateResponse.products - accessToken = connectionCreateResponse.accessToken + providerId = connectionCreateResponse.providerId tokenType = connectionCreateResponse.tokenType additionalProperties = connectionCreateResponse.additionalProperties.toMutableMap() } - /** The ID of the new connection */ - fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - - /** The ID of the new connection */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) - - /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - - /** The ID of the provider associated with the `access_token`. */ - fun providerId(providerId: String) = providerId(JsonField.of(providerId)) + fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) - /** The ID of the provider associated with the `access_token`. */ - fun providerId(providerId: JsonField) = apply { this.providerId = providerId } + fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ fun accountId(accountId: String) = accountId(JsonField.of(accountId)) @@ -177,13 +161,29 @@ private constructor( this.authenticationType = authenticationType } + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** The ID of the new connection */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) + + /** The ID of the new connection */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + fun products(products: List) = products(JsonField.of(products)) fun products(products: JsonField>) = apply { this.products = products } - fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken)) + /** The ID of the provider associated with the `access_token`. */ + fun providerId(providerId: String) = providerId(JsonField.of(providerId)) - fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + /** The ID of the provider associated with the `access_token`. */ + fun providerId(providerId: JsonField) = apply { this.providerId = providerId } fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) @@ -210,13 +210,13 @@ private constructor( fun build(): ConnectionCreateResponse = ConnectionCreateResponse( - connectionId, - companyId, - providerId, + accessToken, accountId, authenticationType, + companyId, + connectionId, products.map { it.toImmutable() }, - accessToken, + providerId, tokenType, additionalProperties.toImmutable(), ) @@ -296,15 +296,15 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionCreateResponse && connectionId == other.connectionId && companyId == other.companyId && providerId == other.providerId && accountId == other.accountId && authenticationType == other.authenticationType && products == other.products && accessToken == other.accessToken && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ConnectionCreateResponse && accessToken == other.accessToken && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && connectionId == other.connectionId && products == other.products && providerId == other.providerId && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, tokenType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, authenticationType, companyId, connectionId, products, providerId, tokenType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ConnectionCreateResponse{connectionId=$connectionId, companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, tokenType=$tokenType, additionalProperties=$additionalProperties}" + "ConnectionCreateResponse{accessToken=$accessToken, accountId=$accountId, authenticationType=$authenticationType, companyId=$companyId, connectionId=$connectionId, products=$products, providerId=$providerId, tokenType=$tokenType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt index 78778ad6..95b4087a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt @@ -25,15 +25,6 @@ private constructor( @JsonProperty("access_token") @ExcludeMissing private val accessToken: JsonField = JsonMissing.of(), - @JsonProperty("token_type") - @ExcludeMissing - private val tokenType: JsonField = JsonMissing.of(), - @JsonProperty("connection_id") - @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), - @JsonProperty("customer_id") - @ExcludeMissing - private val customerId: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing private val accountId: JsonField = JsonMissing.of(), @@ -43,6 +34,9 @@ private constructor( @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + private val connectionId: JsonField = JsonMissing.of(), @JsonProperty("connection_type") @ExcludeMissing private val connectionType: JsonField = JsonMissing.of(), @@ -52,24 +46,18 @@ private constructor( @JsonProperty("provider_id") @ExcludeMissing private val providerId: JsonField = JsonMissing.of(), + @JsonProperty("customer_id") + @ExcludeMissing + private val customerId: JsonField = JsonMissing.of(), + @JsonProperty("token_type") + @ExcludeMissing + private val tokenType: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The access token for the connection. */ fun accessToken(): String = accessToken.getRequired("access_token") - /** The RFC 8693 token type (Finch uses `bearer` tokens) */ - fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) - - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(): String = connectionId.getRequired("connection_id") - - /** - * The ID of your customer you provided to Finch when a connect session was created for this - * connection. - */ - fun customerId(): Optional = Optional.ofNullable(customerId.getNullable("customer_id")) - /** [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ fun accountId(): String = accountId.getRequired("account_id") @@ -79,6 +67,9 @@ private constructor( /** [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ fun companyId(): String = companyId.getRequired("company_id") + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(): String = connectionId.getRequired("connection_id") + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -92,20 +83,17 @@ private constructor( /** The ID of the provider associated with the `access_token`. */ fun providerId(): String = providerId.getRequired("provider_id") - /** The access token for the connection. */ - @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken - - /** The RFC 8693 token type (Finch uses `bearer` tokens) */ - @JsonProperty("token_type") @ExcludeMissing fun _tokenType() = tokenType - - /** The Finch UUID of the connection associated with the `access_token`. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId - /** * The ID of your customer you provided to Finch when a connect session was created for this * connection. */ - @JsonProperty("customer_id") @ExcludeMissing fun _customerId() = customerId + fun customerId(): Optional = Optional.ofNullable(customerId.getNullable("customer_id")) + + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) + + /** The access token for the connection. */ + @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken /** [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId @@ -116,6 +104,9 @@ private constructor( /** [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** The Finch UUID of the connection associated with the `access_token`. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -129,6 +120,15 @@ private constructor( /** The ID of the provider associated with the `access_token`. */ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId + /** + * The ID of your customer you provided to Finch when a connect session was created for this + * connection. + */ + @JsonProperty("customer_id") @ExcludeMissing fun _customerId() = customerId + + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + @JsonProperty("token_type") @ExcludeMissing fun _tokenType() = tokenType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -138,15 +138,15 @@ private constructor( fun validate(): CreateAccessTokenResponse = apply { if (!validated) { accessToken() - tokenType() - connectionId() - customerId() accountId() clientType() companyId() + connectionId() connectionType() products() providerId() + customerId() + tokenType() validated = true } } @@ -161,29 +161,29 @@ private constructor( class Builder { private var accessToken: JsonField = JsonMissing.of() - private var tokenType: JsonField = JsonMissing.of() - private var connectionId: JsonField = JsonMissing.of() - private var customerId: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() private var clientType: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var connectionType: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() private var providerId: JsonField = JsonMissing.of() + private var customerId: JsonField = JsonMissing.of() + private var tokenType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createAccessTokenResponse: CreateAccessTokenResponse) = apply { accessToken = createAccessTokenResponse.accessToken - tokenType = createAccessTokenResponse.tokenType - connectionId = createAccessTokenResponse.connectionId - customerId = createAccessTokenResponse.customerId accountId = createAccessTokenResponse.accountId clientType = createAccessTokenResponse.clientType companyId = createAccessTokenResponse.companyId + connectionId = createAccessTokenResponse.connectionId connectionType = createAccessTokenResponse.connectionType products = createAccessTokenResponse.products providerId = createAccessTokenResponse.providerId + customerId = createAccessTokenResponse.customerId + tokenType = createAccessTokenResponse.tokenType additionalProperties = createAccessTokenResponse.additionalProperties.toMutableMap() } @@ -193,32 +193,6 @@ private constructor( /** The access token for the connection. */ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } - /** The RFC 8693 token type (Finch uses `bearer` tokens) */ - fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) - - /** The RFC 8693 token type (Finch uses `bearer` tokens) */ - fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } - - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - - /** - * The ID of your customer you provided to Finch when a connect session was created for this - * connection. - */ - fun customerId(customerId: String) = customerId(JsonField.of(customerId)) - - /** - * The ID of your customer you provided to Finch when a connect session was created for this - * connection. - */ - fun customerId(customerId: JsonField) = apply { this.customerId = customerId } - /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ @@ -245,6 +219,14 @@ private constructor( */ fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) + + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -274,6 +256,24 @@ private constructor( /** The ID of the provider associated with the `access_token`. */ fun providerId(providerId: JsonField) = apply { this.providerId = providerId } + /** + * The ID of your customer you provided to Finch when a connect session was created for this + * connection. + */ + fun customerId(customerId: String) = customerId(JsonField.of(customerId)) + + /** + * The ID of your customer you provided to Finch when a connect session was created for this + * connection. + */ + fun customerId(customerId: JsonField) = apply { this.customerId = customerId } + + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) + + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -296,15 +296,15 @@ private constructor( fun build(): CreateAccessTokenResponse = CreateAccessTokenResponse( accessToken, - tokenType, - connectionId, - customerId, accountId, clientType, companyId, + connectionId, connectionType, products.map { it.toImmutable() }, providerId, + customerId, + tokenType, additionalProperties.toImmutable(), ) } @@ -434,15 +434,15 @@ private constructor( return true } - return /* spotless:off */ other is CreateAccessTokenResponse && accessToken == other.accessToken && tokenType == other.tokenType && connectionId == other.connectionId && customerId == other.customerId && accountId == other.accountId && clientType == other.clientType && companyId == other.companyId && connectionType == other.connectionType && products == other.products && providerId == other.providerId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateAccessTokenResponse && accessToken == other.accessToken && accountId == other.accountId && clientType == other.clientType && companyId == other.companyId && connectionId == other.connectionId && connectionType == other.connectionType && products == other.products && providerId == other.providerId && customerId == other.customerId && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accessToken, tokenType, connectionId, customerId, accountId, clientType, companyId, connectionType, products, providerId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, clientType, companyId, connectionId, connectionType, products, providerId, customerId, tokenType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreateAccessTokenResponse{accessToken=$accessToken, tokenType=$tokenType, connectionId=$connectionId, customerId=$customerId, accountId=$accountId, clientType=$clientType, companyId=$companyId, connectionType=$connectionType, products=$products, providerId=$providerId, additionalProperties=$additionalProperties}" + "CreateAccessTokenResponse{accessToken=$accessToken, accountId=$accountId, clientType=$clientType, companyId=$companyId, connectionId=$connectionId, connectionType=$connectionType, products=$products, providerId=$providerId, customerId=$customerId, tokenType=$tokenType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt index 2e8bfa3a..4790f6c0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class DirectoryEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): DirectoryEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(directoryEvent: DirectoryEvent) = apply { - connectionId = directoryEvent.connectionId - companyId = directoryEvent.companyId accountId = directoryEvent.accountId - eventType = directoryEvent.eventType + companyId = directoryEvent.companyId + connectionId = directoryEvent.connectionId data = directoryEvent.data + eventType = directoryEvent.eventType additionalProperties = directoryEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): DirectoryEvent = DirectoryEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -362,15 +362,15 @@ private constructor( return true } - return /* spotless:off */ other is DirectoryEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is DirectoryEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "DirectoryEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "DirectoryEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index 39eff3b5..9bff5116 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt @@ -23,58 +23,58 @@ class EmploymentData @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("first_name") - @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") + @JsonProperty("class_code") @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), - @JsonProperty("manager") + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("custom_fields") @ExcludeMissing - private val manager: JsonField = JsonMissing.of(), + private val customFields: JsonField> = JsonMissing.of(), @JsonProperty("department") @ExcludeMissing private val department: JsonField = JsonMissing.of(), @JsonProperty("employment") @ExcludeMissing private val employment: JsonField = JsonMissing.of(), - @JsonProperty("start_date") + @JsonProperty("employment_status") @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), + private val employmentStatus: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), - @JsonProperty("latest_rehire_date") + @JsonProperty("first_name") @ExcludeMissing - private val latestRehireDate: JsonField = JsonMissing.of(), + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField> = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("employment_status") + @JsonProperty("last_name") @ExcludeMissing - private val employmentStatus: JsonField = JsonMissing.of(), - @JsonProperty("class_code") + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("latest_rehire_date") @ExcludeMissing - private val classCode: JsonField = JsonMissing.of(), + private val latestRehireDate: JsonField = JsonMissing.of(), @JsonProperty("location") @ExcludeMissing private val location: JsonField = JsonMissing.of(), - @JsonProperty("income") - @ExcludeMissing - private val income: JsonField = JsonMissing.of(), - @JsonProperty("income_history") + @JsonProperty("manager") @ExcludeMissing - private val incomeHistory: JsonField> = JsonMissing.of(), - @JsonProperty("custom_fields") + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") @ExcludeMissing - private val customFields: JsonField> = JsonMissing.of(), + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("source_id") @ExcludeMissing private val sourceId: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), @JsonProperty("work_id") @ExcludeMissing private val workId: JsonField = JsonMissing.of(), @@ -84,20 +84,15 @@ private constructor( /** string A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - /** The legal first name of the individual. */ - fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) - - /** The legal middle name of the individual. */ - fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) - - /** The legal last name of the individual. */ - fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) - - /** The current title of the individual. */ - fun title(): Optional = Optional.ofNullable(title.getNullable("title")) + /** Worker's compensation classification code for this employee */ + fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) - /** The manager object representing the manager of the individual within the org. */ - fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) + /** + * Custom fields for the individual. These are fields which are defined by the employer in the + * system. + */ + fun customFields(): Optional> = + Optional.ofNullable(customFields.getNullable("custom_fields")) /** The department object. */ fun department(): Optional = @@ -107,16 +102,6 @@ private constructor( fun employment(): Optional = Optional.ofNullable(employment.getNullable("employment")) - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) - - fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - - fun latestRehireDate(): Optional = - Optional.ofNullable(latestRehireDate.getNullable("latest_rehire_date")) - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) - /** * The detailed employment status of the individual. Available options: `active`, `deceased`, * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. @@ -124,10 +109,10 @@ private constructor( fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus.getNullable("employment_status")) - /** Worker's compensation classification code for this employee */ - fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) + fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - fun location(): Optional = Optional.ofNullable(location.getNullable("location")) + /** The legal first name of the individual. */ + fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) /** * The employee's income as reported by the provider. This may not always be annualized income, @@ -140,36 +125,45 @@ private constructor( fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory.getNullable("income_history")) - /** - * Custom fields for the individual. These are fields which are defined by the employer in the - * system. - */ - fun customFields(): Optional> = - Optional.ofNullable(customFields.getNullable("custom_fields")) + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + + /** The legal last name of the individual. */ + fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) + + fun latestRehireDate(): Optional = + Optional.ofNullable(latestRehireDate.getNullable("latest_rehire_date")) + + fun location(): Optional = Optional.ofNullable(location.getNullable("location")) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) + + /** The legal middle name of the individual. */ + fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) /** The source system's unique employment identifier for this individual */ fun sourceId(): Optional = Optional.ofNullable(sourceId.getNullable("source_id")) + fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) + + /** The current title of the individual. */ + fun title(): Optional = Optional.ofNullable(title.getNullable("title")) + /** This field is deprecated in favour of `source_id` */ fun workId(): Optional = Optional.ofNullable(workId.getNullable("work_id")) /** string A stable Finch `id` (UUID v4) for an individual in the company. */ @JsonProperty("id") @ExcludeMissing fun _id() = id - /** The legal first name of the individual. */ - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - - /** The legal middle name of the individual. */ - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName - - /** The legal last name of the individual. */ - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - - /** The current title of the individual. */ - @JsonProperty("title") @ExcludeMissing fun _title() = title + /** Worker's compensation classification code for this employee */ + @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode - /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + /** + * Custom fields for the individual. These are fields which are defined by the employer in the + * system. + */ + @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields /** The department object. */ @JsonProperty("department") @ExcludeMissing fun _department() = department @@ -177,25 +171,16 @@ private constructor( /** The employment object. */ @JsonProperty("employment") @ExcludeMissing fun _employment() = employment - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate - - @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate - - @JsonProperty("latest_rehire_date") @ExcludeMissing fun _latestRehireDate() = latestRehireDate - - /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - /** * The detailed employment status of the individual. Available options: `active`, `deceased`, * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. */ @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus - /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode + @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate - @JsonProperty("location") @ExcludeMissing fun _location() = location + /** The legal first name of the individual. */ + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName /** * The employee's income as reported by the provider. This may not always be annualized income, @@ -207,15 +192,30 @@ private constructor( /** The array of income history. */ @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory - /** - * Custom fields for the individual. These are fields which are defined by the employer in the - * system. - */ - @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields + /** `true` if the individual an an active employee or contractor at the company. */ + @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + + /** The legal last name of the individual. */ + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + + @JsonProperty("latest_rehire_date") @ExcludeMissing fun _latestRehireDate() = latestRehireDate + + @JsonProperty("location") @ExcludeMissing fun _location() = location + + /** The manager object representing the manager of the individual within the org. */ + @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName /** The source system's unique employment identifier for this individual */ @JsonProperty("source_id") @ExcludeMissing fun _sourceId() = sourceId + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + + /** The current title of the individual. */ + @JsonProperty("title") @ExcludeMissing fun _title() = title + /** This field is deprecated in favour of `source_id` */ @JsonProperty("work_id") @ExcludeMissing fun _workId() = workId @@ -228,24 +228,24 @@ private constructor( fun validate(): EmploymentData = apply { if (!validated) { id() - firstName() - middleName() - lastName() - title() - manager().map { it.validate() } + classCode() + customFields().map { it.forEach { it.validate() } } department().map { it.validate() } employment().map { it.validate() } - startDate() - endDate() - latestRehireDate() - isActive() employmentStatus() - classCode() - location().map { it.validate() } + endDate() + firstName() income().map { it.validate() } incomeHistory().map { it.forEach { it?.validate() } } - customFields().map { it.forEach { it.validate() } } + isActive() + lastName() + latestRehireDate() + location().map { it.validate() } + manager().map { it.validate() } + middleName() sourceId() + startDate() + title() workId() validated = true } @@ -261,48 +261,48 @@ private constructor( 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 title: JsonField = JsonMissing.of() - private var manager: JsonField = JsonMissing.of() + private var classCode: JsonField = JsonMissing.of() + private var customFields: JsonField> = JsonMissing.of() private var department: JsonField = JsonMissing.of() private var employment: JsonField = JsonMissing.of() - private var startDate: JsonField = JsonMissing.of() - private var endDate: JsonField = JsonMissing.of() - private var latestRehireDate: JsonField = JsonMissing.of() - private var isActive: JsonField = JsonMissing.of() private var employmentStatus: JsonField = JsonMissing.of() - private var classCode: JsonField = JsonMissing.of() - private var location: JsonField = JsonMissing.of() + private var endDate: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField> = JsonMissing.of() - private var customFields: JsonField> = JsonMissing.of() + private var isActive: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() + private var latestRehireDate: JsonField = JsonMissing.of() + private var location: JsonField = JsonMissing.of() + private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var sourceId: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() + private var title: JsonField = JsonMissing.of() private var workId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employmentData: EmploymentData) = apply { id = employmentData.id - firstName = employmentData.firstName - middleName = employmentData.middleName - lastName = employmentData.lastName - title = employmentData.title - manager = employmentData.manager + classCode = employmentData.classCode + customFields = employmentData.customFields department = employmentData.department employment = employmentData.employment - startDate = employmentData.startDate - endDate = employmentData.endDate - latestRehireDate = employmentData.latestRehireDate - isActive = employmentData.isActive employmentStatus = employmentData.employmentStatus - classCode = employmentData.classCode - location = employmentData.location + endDate = employmentData.endDate + firstName = employmentData.firstName income = employmentData.income incomeHistory = employmentData.incomeHistory - customFields = employmentData.customFields + isActive = employmentData.isActive + lastName = employmentData.lastName + latestRehireDate = employmentData.latestRehireDate + location = employmentData.location + manager = employmentData.manager + middleName = employmentData.middleName sourceId = employmentData.sourceId + startDate = employmentData.startDate + title = employmentData.title workId = employmentData.workId additionalProperties = employmentData.additionalProperties.toMutableMap() } @@ -313,35 +313,25 @@ private constructor( /** string A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(id: JsonField) = apply { this.id = id } - /** The legal first name of the individual. */ - fun firstName(firstName: String) = firstName(JsonField.of(firstName)) - - /** The legal first name of the individual. */ - fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = middleName(JsonField.of(middleName)) - - /** The legal middle name of the individual. */ - fun middleName(middleName: JsonField) = apply { this.middleName = middleName } - - /** The legal last name of the individual. */ - fun lastName(lastName: String) = lastName(JsonField.of(lastName)) - - /** The legal last name of the individual. */ - fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - - /** The current title of the individual. */ - fun title(title: String) = title(JsonField.of(title)) + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: String) = classCode(JsonField.of(classCode)) - /** The current title of the individual. */ - fun title(title: JsonField) = apply { this.title = title } + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: JsonField) = apply { this.classCode = classCode } - /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = manager(JsonField.of(manager)) + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. + */ + fun customFields(customFields: List) = customFields(JsonField.of(customFields)) - /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: JsonField) = apply { this.manager = manager } + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. + */ + fun customFields(customFields: JsonField>) = apply { + this.customFields = customFields + } /** The department object. */ fun department(department: Department) = department(JsonField.of(department)) @@ -355,27 +345,6 @@ private constructor( /** The employment object. */ fun employment(employment: JsonField) = apply { this.employment = employment } - fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - - fun startDate(startDate: JsonField) = apply { this.startDate = startDate } - - fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - - fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - - fun latestRehireDate(latestRehireDate: String) = - latestRehireDate(JsonField.of(latestRehireDate)) - - fun latestRehireDate(latestRehireDate: JsonField) = apply { - this.latestRehireDate = latestRehireDate - } - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: JsonField) = apply { this.isActive = isActive } - /** * The detailed employment status of the individual. Available options: `active`, * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. @@ -391,15 +360,15 @@ private constructor( this.employmentStatus = employmentStatus } - /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = classCode(JsonField.of(classCode)) + fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - /** Worker's compensation classification code for this employee */ - fun classCode(classCode: JsonField) = apply { this.classCode = classCode } + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - fun location(location: Location) = location(JsonField.of(location)) + /** The legal first name of the individual. */ + fun firstName(firstName: String) = firstName(JsonField.of(firstName)) - fun location(location: JsonField) = apply { this.location = location } + /** The legal first name of the individual. */ + fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** * The employee's income as reported by the provider. This may not always be annualized @@ -423,26 +392,57 @@ private constructor( this.incomeHistory = incomeHistory } - /** - * Custom fields for the individual. These are fields which are defined by the employer in - * the system. - */ - fun customFields(customFields: List) = customFields(JsonField.of(customFields)) + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - /** - * Custom fields for the individual. These are fields which are defined by the employer in - * the system. - */ - fun customFields(customFields: JsonField>) = apply { - this.customFields = customFields + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + + /** The legal last name of the individual. */ + fun lastName(lastName: String) = lastName(JsonField.of(lastName)) + + /** The legal last name of the individual. */ + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + + fun latestRehireDate(latestRehireDate: String) = + latestRehireDate(JsonField.of(latestRehireDate)) + + fun latestRehireDate(latestRehireDate: JsonField) = apply { + this.latestRehireDate = latestRehireDate } + fun location(location: Location) = location(JsonField.of(location)) + + fun location(location: JsonField) = apply { this.location = location } + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager) = manager(JsonField.of(manager)) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: JsonField) = apply { this.manager = manager } + + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = middleName(JsonField.of(middleName)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: JsonField) = apply { this.middleName = middleName } + /** The source system's unique employment identifier for this individual */ fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) /** The source system's unique employment identifier for this individual */ fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } + fun startDate(startDate: String) = startDate(JsonField.of(startDate)) + + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + /** The current title of the individual. */ + fun title(title: String) = title(JsonField.of(title)) + + /** The current title of the individual. */ + fun title(title: JsonField) = apply { this.title = title } + /** This field is deprecated in favour of `source_id` */ fun workId(workId: String) = workId(JsonField.of(workId)) @@ -471,24 +471,24 @@ private constructor( fun build(): EmploymentData = EmploymentData( id, - firstName, - middleName, - lastName, - title, - manager, + classCode, + customFields.map { it.toImmutable() }, department, employment, - startDate, - endDate, - latestRehireDate, - isActive, employmentStatus, - classCode, - location, + endDate, + firstName, income, incomeHistory.map { it.toImmutable() }, - customFields.map { it.toImmutable() }, + isActive, + lastName, + latestRehireDate, + location, + manager, + middleName, sourceId, + startDate, + title, workId, additionalProperties.toImmutable(), ) @@ -696,17 +696,14 @@ private constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The main employment type of the individual. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -714,7 +711,7 @@ private constructor( fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) /** The main employment type of the individual. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, @@ -722,6 +719,9 @@ private constructor( */ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + /** The main employment type of the individual. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -730,8 +730,8 @@ private constructor( fun validate(): Employment = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -745,23 +745,17 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - /** The main employment type of the individual. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The main employment type of the individual. */ - fun type(type: JsonField) = apply { this.type = type } - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -774,6 +768,12 @@ private constructor( */ fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + /** The main employment type of the individual. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The main employment type of the individual. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -795,8 +795,8 @@ private constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -944,17 +944,17 @@ private constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } class EmploymentStatus @@ -1141,15 +1141,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentData && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && workId == other.workId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentData && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && workId == other.workId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, workId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, workId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentData{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, workId=$workId, additionalProperties=$additionalProperties}" + "EmploymentData{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, workId=$workId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt index 03573473..dd49c42f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt @@ -20,28 +20,28 @@ import java.util.Optional class EmploymentDataResponse @JsonCreator private constructor( - @JsonProperty("individual_id") - @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + @JsonProperty("body") @ExcludeMissing fun _body() = body @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId @JsonAnyGetter @ExcludeMissing @@ -51,9 +51,9 @@ private constructor( fun validate(): EmploymentDataResponse = apply { if (!validated) { - individualId() - code() body().map { it.validate() } + code() + individualId() validated = true } } @@ -67,32 +67,32 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employmentDataResponse: EmploymentDataResponse) = apply { - individualId = employmentDataResponse.individualId - code = employmentDataResponse.code body = employmentDataResponse.body + code = employmentDataResponse.code + individualId = employmentDataResponse.individualId additionalProperties = employmentDataResponse.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun body(body: EmploymentData) = body(JsonField.of(body)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun body(body: JsonField) = apply { this.body = body } fun code(code: Long) = code(JsonField.of(code)) fun code(code: JsonField) = apply { this.code = code } - fun body(body: EmploymentData) = body(JsonField.of(body)) + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - fun body(body: JsonField) = apply { this.body = body } + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -115,9 +115,9 @@ private constructor( fun build(): EmploymentDataResponse = EmploymentDataResponse( - individualId, - code, body, + code, + individualId, additionalProperties.toImmutable(), ) } @@ -127,15 +127,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentDataResponse && individualId == other.individualId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentDataResponse && body == other.body && code == other.code && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, individualId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentDataResponse{individualId=$individualId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "EmploymentDataResponse{body=$body, code=$code, individualId=$individualId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt index 8de6d0a1..fa684380 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class EmploymentEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): EmploymentEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employmentEvent: EmploymentEvent) = apply { - connectionId = employmentEvent.connectionId - companyId = employmentEvent.companyId accountId = employmentEvent.accountId - eventType = employmentEvent.eventType + companyId = employmentEvent.companyId + connectionId = employmentEvent.connectionId data = employmentEvent.data + eventType = employmentEvent.eventType additionalProperties = employmentEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): EmploymentEvent = EmploymentEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -362,15 +362,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "EmploymentEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 12c10332..8ba37024 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt @@ -22,76 +22,74 @@ import java.util.Optional class EmploymentUpdateResponse @JsonCreator private constructor( - @JsonProperty("first_name") - @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("class_code") @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), - @JsonProperty("manager") + private val classCode: JsonField = JsonMissing.of(), + @JsonProperty("custom_fields") @ExcludeMissing - private val manager: JsonField = JsonMissing.of(), + private val customFields: JsonField> = JsonMissing.of(), @JsonProperty("department") @ExcludeMissing private val department: JsonField = JsonMissing.of(), @JsonProperty("employment") @ExcludeMissing private val employment: JsonField = JsonMissing.of(), - @JsonProperty("start_date") + @JsonProperty("employment_status") @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), + private val employmentStatus: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), - @JsonProperty("latest_rehire_date") + @JsonProperty("first_name") @ExcludeMissing - private val latestRehireDate: JsonField = JsonMissing.of(), + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("income") + @ExcludeMissing + private val income: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField> = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("employment_status") + @JsonProperty("last_name") @ExcludeMissing - private val employmentStatus: JsonField = JsonMissing.of(), - @JsonProperty("class_code") + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("latest_rehire_date") @ExcludeMissing - private val classCode: JsonField = JsonMissing.of(), + private val latestRehireDate: JsonField = JsonMissing.of(), @JsonProperty("location") @ExcludeMissing private val location: JsonField = JsonMissing.of(), - @JsonProperty("income") - @ExcludeMissing - private val income: JsonField = JsonMissing.of(), - @JsonProperty("income_history") + @JsonProperty("manager") @ExcludeMissing - private val incomeHistory: JsonField> = JsonMissing.of(), - @JsonProperty("custom_fields") + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") @ExcludeMissing - private val customFields: JsonField> = JsonMissing.of(), + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("source_id") @ExcludeMissing private val sourceId: JsonField = JsonMissing.of(), - @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The legal first name of the individual. */ - fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) - - /** The legal middle name of the individual. */ - fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) - - /** The legal last name of the individual. */ - fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - /** The current title of the individual. */ - fun title(): Optional = Optional.ofNullable(title.getNullable("title")) + /** Worker's compensation classification code for this employee */ + fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) - /** The manager object representing the manager of the individual within the org. */ - fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) + /** + * Custom fields for the individual. These are fields which are defined by the employer in the + * system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(): Optional> = + Optional.ofNullable(customFields.getNullable("custom_fields")) /** The department object. */ fun department(): Optional = @@ -101,24 +99,14 @@ private constructor( fun employment(): Optional = Optional.ofNullable(employment.getNullable("employment")) - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) - - fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - - fun latestRehireDate(): Optional = - Optional.ofNullable(latestRehireDate.getNullable("latest_rehire_date")) - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) - /** The detailed employment status of the individual. */ fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus.getNullable("employment_status")) - /** Worker's compensation classification code for this employee */ - fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) + fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - fun location(): Optional = Optional.ofNullable(location.getNullable("location")) + /** The legal first name of the individual. */ + fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) /** * The employee's income as reported by the provider. This may not always be annualized income, @@ -131,33 +119,42 @@ private constructor( fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory.getNullable("income_history")) - /** - * Custom fields for the individual. These are fields which are defined by the employer in the - * system. Custom fields are not currently supported for assisted connections. - */ - fun customFields(): Optional> = - Optional.ofNullable(customFields.getNullable("custom_fields")) + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) - /** The source system's unique employment identifier for this individual */ - fun sourceId(): Optional = Optional.ofNullable(sourceId.getNullable("source_id")) + /** The legal last name of the individual. */ + fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun latestRehireDate(): Optional = + Optional.ofNullable(latestRehireDate.getNullable("latest_rehire_date")) - /** The legal first name of the individual. */ - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + fun location(): Optional = Optional.ofNullable(location.getNullable("location")) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) /** The legal middle name of the individual. */ - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) - /** The legal last name of the individual. */ - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + /** The source system's unique employment identifier for this individual */ + fun sourceId(): Optional = Optional.ofNullable(sourceId.getNullable("source_id")) + + fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) /** The current title of the individual. */ - @JsonProperty("title") @ExcludeMissing fun _title() = title + fun title(): Optional = Optional.ofNullable(title.getNullable("title")) - /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** Worker's compensation classification code for this employee */ + @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode + + /** + * Custom fields for the individual. These are fields which are defined by the employer in the + * system. Custom fields are not currently supported for assisted connections. + */ + @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields /** The department object. */ @JsonProperty("department") @ExcludeMissing fun _department() = department @@ -165,22 +162,13 @@ private constructor( /** The employment object. */ @JsonProperty("employment") @ExcludeMissing fun _employment() = employment - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate - - @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate - - @JsonProperty("latest_rehire_date") @ExcludeMissing fun _latestRehireDate() = latestRehireDate - - /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - /** The detailed employment status of the individual. */ @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus - /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode + @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate - @JsonProperty("location") @ExcludeMissing fun _location() = location + /** The legal first name of the individual. */ + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName /** * The employee's income as reported by the provider. This may not always be annualized income, @@ -192,17 +180,29 @@ private constructor( /** The array of income history. */ @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory - /** - * Custom fields for the individual. These are fields which are defined by the employer in the - * system. Custom fields are not currently supported for assisted connections. - */ - @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields + /** `true` if the individual an an active employee or contractor at the company. */ + @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + + /** The legal last name of the individual. */ + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + + @JsonProperty("latest_rehire_date") @ExcludeMissing fun _latestRehireDate() = latestRehireDate + + @JsonProperty("location") @ExcludeMissing fun _location() = location + + /** The manager object representing the manager of the individual within the org. */ + @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName /** The source system's unique employment identifier for this individual */ @JsonProperty("source_id") @ExcludeMissing fun _sourceId() = sourceId - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + + /** The current title of the individual. */ + @JsonProperty("title") @ExcludeMissing fun _title() = title @JsonAnyGetter @ExcludeMissing @@ -212,25 +212,25 @@ private constructor( fun validate(): EmploymentUpdateResponse = apply { if (!validated) { - firstName() - middleName() - lastName() - title() - manager().map { it.validate() } + id() + classCode() + customFields().map { it.forEach { it.validate() } } department().map { it.validate() } employment().map { it.validate() } - startDate() - endDate() - latestRehireDate() - isActive() employmentStatus() - classCode() - location().map { it.validate() } + endDate() + firstName() income().map { it.validate() } incomeHistory().map { it.forEach { it?.validate() } } - customFields().map { it.forEach { it.validate() } } + isActive() + lastName() + latestRehireDate() + location().map { it.validate() } + manager().map { it.validate() } + middleName() sourceId() - id() + startDate() + title() validated = true } } @@ -244,80 +244,76 @@ private constructor( class Builder { - private var firstName: JsonField = JsonMissing.of() - private var middleName: JsonField = JsonMissing.of() - private var lastName: JsonField = JsonMissing.of() - private var title: JsonField = JsonMissing.of() - private var manager: JsonField = JsonMissing.of() + private var id: JsonField = JsonMissing.of() + private var classCode: JsonField = JsonMissing.of() + private var customFields: JsonField> = JsonMissing.of() private var department: JsonField = JsonMissing.of() private var employment: JsonField = JsonMissing.of() - private var startDate: JsonField = JsonMissing.of() - private var endDate: JsonField = JsonMissing.of() - private var latestRehireDate: JsonField = JsonMissing.of() - private var isActive: JsonField = JsonMissing.of() private var employmentStatus: JsonField = JsonMissing.of() - private var classCode: JsonField = JsonMissing.of() - private var location: JsonField = JsonMissing.of() + private var endDate: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField> = JsonMissing.of() - private var customFields: JsonField> = JsonMissing.of() + private var isActive: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() + private var latestRehireDate: JsonField = JsonMissing.of() + private var location: JsonField = JsonMissing.of() + private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var sourceId: JsonField = JsonMissing.of() - private var id: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() + private var title: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employmentUpdateResponse: EmploymentUpdateResponse) = apply { - firstName = employmentUpdateResponse.firstName - middleName = employmentUpdateResponse.middleName - lastName = employmentUpdateResponse.lastName - title = employmentUpdateResponse.title - manager = employmentUpdateResponse.manager + id = employmentUpdateResponse.id + classCode = employmentUpdateResponse.classCode + customFields = employmentUpdateResponse.customFields department = employmentUpdateResponse.department employment = employmentUpdateResponse.employment - startDate = employmentUpdateResponse.startDate - endDate = employmentUpdateResponse.endDate - latestRehireDate = employmentUpdateResponse.latestRehireDate - isActive = employmentUpdateResponse.isActive employmentStatus = employmentUpdateResponse.employmentStatus - classCode = employmentUpdateResponse.classCode - location = employmentUpdateResponse.location + endDate = employmentUpdateResponse.endDate + firstName = employmentUpdateResponse.firstName income = employmentUpdateResponse.income incomeHistory = employmentUpdateResponse.incomeHistory - customFields = employmentUpdateResponse.customFields + isActive = employmentUpdateResponse.isActive + lastName = employmentUpdateResponse.lastName + latestRehireDate = employmentUpdateResponse.latestRehireDate + location = employmentUpdateResponse.location + manager = employmentUpdateResponse.manager + middleName = employmentUpdateResponse.middleName sourceId = employmentUpdateResponse.sourceId - id = employmentUpdateResponse.id + startDate = employmentUpdateResponse.startDate + title = employmentUpdateResponse.title additionalProperties = employmentUpdateResponse.additionalProperties.toMutableMap() } - /** The legal first name of the individual. */ - fun firstName(firstName: String) = firstName(JsonField.of(firstName)) - - /** The legal first name of the individual. */ - fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = middleName(JsonField.of(middleName)) - - /** The legal middle name of the individual. */ - fun middleName(middleName: JsonField) = apply { this.middleName = middleName } - - /** The legal last name of the individual. */ - fun lastName(lastName: String) = lastName(JsonField.of(lastName)) + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: String) = id(JsonField.of(id)) - /** The legal last name of the individual. */ - fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: JsonField) = apply { this.id = id } - /** The current title of the individual. */ - fun title(title: String) = title(JsonField.of(title)) + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: String) = classCode(JsonField.of(classCode)) - /** The current title of the individual. */ - fun title(title: JsonField) = apply { this.title = title } + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: JsonField) = apply { this.classCode = classCode } - /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = manager(JsonField.of(manager)) + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: List) = customFields(JsonField.of(customFields)) - /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: JsonField) = apply { this.manager = manager } + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: JsonField>) = apply { + this.customFields = customFields + } /** The department object. */ fun department(department: Department) = department(JsonField.of(department)) @@ -331,27 +327,6 @@ private constructor( /** The employment object. */ fun employment(employment: JsonField) = apply { this.employment = employment } - fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - - fun startDate(startDate: JsonField) = apply { this.startDate = startDate } - - fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - - fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - - fun latestRehireDate(latestRehireDate: String) = - latestRehireDate(JsonField.of(latestRehireDate)) - - fun latestRehireDate(latestRehireDate: JsonField) = apply { - this.latestRehireDate = latestRehireDate - } - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: JsonField) = apply { this.isActive = isActive } - /** The detailed employment status of the individual. */ fun employmentStatus(employmentStatus: EmploymentStatus) = employmentStatus(JsonField.of(employmentStatus)) @@ -361,15 +336,15 @@ private constructor( this.employmentStatus = employmentStatus } - /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = classCode(JsonField.of(classCode)) + fun endDate(endDate: String) = endDate(JsonField.of(endDate)) - /** Worker's compensation classification code for this employee */ - fun classCode(classCode: JsonField) = apply { this.classCode = classCode } + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - fun location(location: Location) = location(JsonField.of(location)) + /** The legal first name of the individual. */ + fun firstName(firstName: String) = firstName(JsonField.of(firstName)) - fun location(location: JsonField) = apply { this.location = location } + /** The legal first name of the individual. */ + fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** * The employee's income as reported by the provider. This may not always be annualized @@ -393,31 +368,56 @@ private constructor( this.incomeHistory = incomeHistory } - /** - * Custom fields for the individual. These are fields which are defined by the employer in - * the system. Custom fields are not currently supported for assisted connections. - */ - fun customFields(customFields: List) = customFields(JsonField.of(customFields)) + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - /** - * Custom fields for the individual. These are fields which are defined by the employer in - * the system. Custom fields are not currently supported for assisted connections. - */ - fun customFields(customFields: JsonField>) = apply { - this.customFields = customFields + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + + /** The legal last name of the individual. */ + fun lastName(lastName: String) = lastName(JsonField.of(lastName)) + + /** The legal last name of the individual. */ + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + + fun latestRehireDate(latestRehireDate: String) = + latestRehireDate(JsonField.of(latestRehireDate)) + + fun latestRehireDate(latestRehireDate: JsonField) = apply { + this.latestRehireDate = latestRehireDate } + fun location(location: Location) = location(JsonField.of(location)) + + fun location(location: JsonField) = apply { this.location = location } + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager) = manager(JsonField.of(manager)) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: JsonField) = apply { this.manager = manager } + + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = middleName(JsonField.of(middleName)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: JsonField) = apply { this.middleName = middleName } + /** The source system's unique employment identifier for this individual */ fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) /** The source system's unique employment identifier for this individual */ fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: String) = id(JsonField.of(id)) + fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: JsonField) = apply { this.id = id } + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + + /** The current title of the individual. */ + fun title(title: String) = title(JsonField.of(title)) + + /** The current title of the individual. */ + fun title(title: JsonField) = apply { this.title = title } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -440,25 +440,25 @@ private constructor( fun build(): EmploymentUpdateResponse = EmploymentUpdateResponse( - firstName, - middleName, - lastName, - title, - manager, + id, + classCode, + customFields.map { it.toImmutable() }, department, employment, - startDate, - endDate, - latestRehireDate, - isActive, employmentStatus, - classCode, - location, + endDate, + firstName, income, incomeHistory.map { it.toImmutable() }, - customFields.map { it.toImmutable() }, + isActive, + lastName, + latestRehireDate, + location, + manager, + middleName, sourceId, - id, + startDate, + title, additionalProperties.toImmutable(), ) } @@ -665,17 +665,14 @@ private constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The main employment type of the individual. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -683,7 +680,7 @@ private constructor( fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) /** The main employment type of the individual. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, @@ -691,6 +688,9 @@ private constructor( */ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + /** The main employment type of the individual. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -699,8 +699,8 @@ private constructor( fun validate(): Employment = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -714,23 +714,17 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - /** The main employment type of the individual. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The main employment type of the individual. */ - fun type(type: JsonField) = apply { this.type = type } - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -743,6 +737,12 @@ private constructor( */ fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + /** The main employment type of the individual. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The main employment type of the individual. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -764,8 +764,8 @@ private constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -913,17 +913,17 @@ private constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } class EmploymentStatus @@ -1110,15 +1110,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentUpdateResponse && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentUpdateResponse && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, id, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentUpdateResponse{firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, id=$id, additionalProperties=$additionalProperties}" + "EmploymentUpdateResponse{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt index 1c43c4d6..03465d99 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt @@ -22,28 +22,28 @@ import java.util.Optional class EnrolledIndividual @JsonCreator private constructor( + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("individual_id") @ExcludeMissing private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), - @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) /** HTTP status code. Either 201 or 200 */ fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + @JsonProperty("body") @ExcludeMissing fun _body() = body /** HTTP status code. Either 201 or 200 */ @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId @JsonAnyGetter @ExcludeMissing @@ -53,9 +53,9 @@ private constructor( fun validate(): EnrolledIndividual = apply { if (!validated) { - individualId() - code() body().map { it.validate() } + code() + individualId() validated = true } } @@ -69,24 +69,22 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(enrolledIndividual: EnrolledIndividual) = apply { - individualId = enrolledIndividual.individualId - code = enrolledIndividual.code body = enrolledIndividual.body + code = enrolledIndividual.code + individualId = enrolledIndividual.individualId additionalProperties = enrolledIndividual.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun body(body: Body) = body(JsonField.of(body)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun body(body: JsonField) = apply { this.body = body } /** HTTP status code. Either 201 or 200 */ fun code(code: Code) = code(JsonField.of(code)) @@ -94,9 +92,11 @@ private constructor( /** HTTP status code. Either 201 or 200 */ fun code(code: JsonField) = apply { this.code = code } - fun body(body: Body) = body(JsonField.of(body)) + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - fun body(body: JsonField) = apply { this.body = body } + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -119,9 +119,9 @@ private constructor( fun build(): EnrolledIndividual = EnrolledIndividual( - individualId, - code, body, + code, + individualId, additionalProperties.toImmutable(), ) } @@ -130,22 +130,19 @@ private constructor( class Body @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("finch_code") @ExcludeMissing private val finchCode: JsonField = JsonMissing.of(), @JsonProperty("message") @ExcludeMissing private val message: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** A descriptive identifier for the response */ fun finchCode(): Optional = Optional.ofNullable(finchCode.getNullable("finch_code")) @@ -153,7 +150,7 @@ private constructor( fun message(): Optional = Optional.ofNullable(message.getNullable("message")) /** Identifier indicating whether the benefit was newly enrolled or updated. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** A descriptive identifier for the response */ @JsonProperty("finch_code") @ExcludeMissing fun _finchCode() = finchCode @@ -161,6 +158,9 @@ private constructor( /** Short description in English that provides more information about the response. */ @JsonProperty("message") @ExcludeMissing fun _message() = message + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -169,9 +169,9 @@ private constructor( fun validate(): Body = apply { if (!validated) { - name() finchCode() message() + name() validated = true } } @@ -185,25 +185,19 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var finchCode: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { - name = body.name finchCode = body.finchCode message = body.message + name = body.name additionalProperties = body.additionalProperties.toMutableMap() } - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(name: String) = name(JsonField.of(name)) - - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(name: JsonField) = apply { this.name = name } - /** A descriptive identifier for the response */ fun finchCode(finchCode: String) = finchCode(JsonField.of(finchCode)) @@ -216,6 +210,12 @@ private constructor( /** Short description in English that provides more information about the response. */ fun message(message: JsonField) = apply { this.message = message } + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + fun name(name: String) = name(JsonField.of(name)) + + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + fun name(name: JsonField) = apply { this.name = name } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -237,9 +237,9 @@ private constructor( fun build(): Body = Body( - name, finchCode, message, + name, additionalProperties.toImmutable(), ) } @@ -249,17 +249,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && name == other.name && finchCode == other.finchCode && message == other.message && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && finchCode == other.finchCode && message == other.message && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, finchCode, message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(finchCode, message, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Body{name=$name, finchCode=$finchCode, message=$message, additionalProperties=$additionalProperties}" + "Body{finchCode=$finchCode, message=$message, name=$name, additionalProperties=$additionalProperties}" } class Code @@ -336,15 +336,15 @@ private constructor( return true } - return /* spotless:off */ other is EnrolledIndividual && individualId == other.individualId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EnrolledIndividual && body == other.body && code == other.code && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, individualId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EnrolledIndividual{individualId=$individualId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "EnrolledIndividual{body=$body, code=$code, individualId=$individualId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt index 1d180b02..e646a11b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Income.kt @@ -27,7 +27,6 @@ import java.util.Optional class Income @JsonCreator private constructor( - @JsonProperty("unit") @ExcludeMissing private val unit: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing @@ -35,15 +34,10 @@ private constructor( @JsonProperty("effective_date") @ExcludeMissing private val effectiveDate: JsonField = JsonMissing.of(), + @JsonProperty("unit") @ExcludeMissing private val unit: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, - * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. - */ - fun unit(): Optional = Optional.ofNullable(unit.getNullable("unit")) - /** The income amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) @@ -58,7 +52,7 @@ private constructor( * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. */ - @JsonProperty("unit") @ExcludeMissing fun _unit() = unit + fun unit(): Optional = Optional.ofNullable(unit.getNullable("unit")) /** The income amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @@ -69,6 +63,12 @@ private constructor( /** The date the income amount went into effect. */ @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate + /** + * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, + * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + */ + @JsonProperty("unit") @ExcludeMissing fun _unit() = unit + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -77,10 +77,10 @@ private constructor( fun validate(): Income = apply { if (!validated) { - unit() amount() currency() effectiveDate() + unit() validated = true } } @@ -94,33 +94,21 @@ private constructor( class Builder { - private var unit: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var unit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(income: Income) = apply { - unit = income.unit amount = income.amount currency = income.currency effectiveDate = income.effectiveDate + unit = income.unit additionalProperties = income.additionalProperties.toMutableMap() } - /** - * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, - * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. - */ - fun unit(unit: Unit) = unit(JsonField.of(unit)) - - /** - * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, - * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. - */ - fun unit(unit: JsonField) = apply { this.unit = unit } - /** The income amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -141,6 +129,18 @@ private constructor( this.effectiveDate = effectiveDate } + /** + * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, + * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + */ + fun unit(unit: Unit) = unit(JsonField.of(unit)) + + /** + * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, + * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + */ + fun unit(unit: JsonField) = apply { this.unit = unit } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -162,10 +162,10 @@ private constructor( fun build(): Income = Income( - unit, amount, currency, effectiveDate, + unit, additionalProperties.toImmutable(), ) } @@ -274,15 +274,15 @@ private constructor( return true } - return /* spotless:off */ other is Income && unit == other.unit && amount == other.amount && currency == other.currency && effectiveDate == other.effectiveDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Income && amount == other.amount && currency == other.currency && effectiveDate == other.effectiveDate && unit == other.unit && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(unit, amount, currency, effectiveDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, effectiveDate, unit, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Income{unit=$unit, amount=$amount, currency=$currency, effectiveDate=$effectiveDate, additionalProperties=$additionalProperties}" + "Income{amount=$amount, currency=$currency, effectiveDate=$effectiveDate, unit=$unit, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index e3e4883c..da66f032 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt @@ -23,69 +23,77 @@ class Individual @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField> = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") + @JsonProperty("gender") @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), + private val gender: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("preferred_name") - @ExcludeMissing - private val preferredName: JsonField = JsonMissing.of(), - @JsonProperty("emails") + @JsonProperty("middle_name") @ExcludeMissing - private val emails: JsonField> = JsonMissing.of(), + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField> = JsonMissing.of(), - @JsonProperty("gender") - @ExcludeMissing - private val gender: JsonField = JsonMissing.of(), - @JsonProperty("ethnicity") + @JsonProperty("preferred_name") @ExcludeMissing - private val ethnicity: JsonField = JsonMissing.of(), - @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), + private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("residence") @ExcludeMissing private val residence: JsonField = JsonMissing.of(), @JsonProperty("ssn") @ExcludeMissing private val ssn: JsonField = JsonMissing.of(), - @JsonProperty("encrypted_ssn") - @ExcludeMissing - private val encryptedSsn: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) + + fun emails(): Optional> = Optional.ofNullable(emails.getNullable("emails")) + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in + * the body. + */ + fun encryptedSsn(): Optional = + Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(): Optional = Optional.ofNullable(ethnicity.getNullable("ethnicity")) + /** The legal first name of the individual. */ fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) - /** The legal middle name of the individual. */ - fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) + /** The gender of the individual. */ + fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) /** The legal last name of the individual. */ fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) - /** The preferred name of the individual. */ - fun preferredName(): Optional = - Optional.ofNullable(preferredName.getNullable("preferred_name")) - - fun emails(): Optional> = Optional.ofNullable(emails.getNullable("emails")) + /** The legal middle name of the individual. */ + fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers.getNullable("phone_numbers")) - /** The gender of the individual. */ - fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(): Optional = Optional.ofNullable(ethnicity.getNullable("ethnicity")) - - fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) + /** The preferred name of the individual. */ + fun preferredName(): Optional = + Optional.ofNullable(preferredName.getNullable("preferred_name")) fun residence(): Optional = Optional.ofNullable(residence.getNullable("residence")) @@ -96,40 +104,39 @@ private constructor( */ fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("dob") @ExcludeMissing fun _dob() = dob + + @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in * the body. */ - fun encryptedSsn(): Optional = - Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) + @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id + /** The EEOC-defined ethnicity of the individual. */ + @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity /** The legal first name of the individual. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - /** The legal middle name of the individual. */ - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + /** The gender of the individual. */ + @JsonProperty("gender") @ExcludeMissing fun _gender() = gender /** The legal last name of the individual. */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - /** The preferred name of the individual. */ - @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName - - @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers - /** The gender of the individual. */ - @JsonProperty("gender") @ExcludeMissing fun _gender() = gender - - /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity - - @JsonProperty("dob") @ExcludeMissing fun _dob() = dob + /** The preferred name of the individual. */ + @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName @JsonProperty("residence") @ExcludeMissing fun _residence() = residence @@ -140,13 +147,6 @@ private constructor( */ @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in - * the body. - */ - @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -156,18 +156,18 @@ private constructor( fun validate(): Individual = apply { if (!validated) { id() + dob() + emails().map { it.forEach { it.validate() } } + encryptedSsn() + ethnicity() firstName() - middleName() + gender() lastName() - preferredName() - emails().map { it.forEach { it.validate() } } + middleName() phoneNumbers().map { it.forEach { it?.validate() } } - gender() - ethnicity() - dob() + preferredName() residence().map { it.validate() } ssn() - encryptedSsn() validated = true } } @@ -182,35 +182,35 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var dob: JsonField = JsonMissing.of() + private var emails: JsonField> = JsonMissing.of() + private var encryptedSsn: JsonField = JsonMissing.of() + private var ethnicity: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() - private var middleName: JsonField = JsonMissing.of() + private var gender: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() - private var preferredName: JsonField = JsonMissing.of() - private var emails: JsonField> = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() - private var gender: JsonField = JsonMissing.of() - private var ethnicity: JsonField = JsonMissing.of() - private var dob: JsonField = JsonMissing.of() + private var preferredName: JsonField = JsonMissing.of() private var residence: JsonField = JsonMissing.of() private var ssn: JsonField = JsonMissing.of() - private var encryptedSsn: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individual: Individual) = apply { id = individual.id + dob = individual.dob + emails = individual.emails + encryptedSsn = individual.encryptedSsn + ethnicity = individual.ethnicity firstName = individual.firstName - middleName = individual.middleName + gender = individual.gender lastName = individual.lastName - preferredName = individual.preferredName - emails = individual.emails + middleName = individual.middleName phoneNumbers = individual.phoneNumbers - gender = individual.gender - ethnicity = individual.ethnicity - dob = individual.dob + preferredName = individual.preferredName residence = individual.residence ssn = individual.ssn - encryptedSsn = individual.encryptedSsn additionalProperties = individual.additionalProperties.toMutableMap() } @@ -220,17 +220,47 @@ private constructor( /** A stable Finch `id` (UUID v4) for an individual in the company. */ fun id(id: JsonField) = apply { this.id = id } + fun dob(dob: String) = dob(JsonField.of(dob)) + + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun emails(emails: List) = emails(JsonField.of(emails)) + + fun emails(emails: JsonField>) = apply { this.emails = emails } + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set + * in the body. + */ + fun encryptedSsn(encryptedSsn: String) = encryptedSsn(JsonField.of(encryptedSsn)) + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set + * in the body. + */ + fun encryptedSsn(encryptedSsn: JsonField) = apply { + this.encryptedSsn = encryptedSsn + } + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } + /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = middleName(JsonField.of(middleName)) + /** The gender of the individual. */ + fun gender(gender: Gender) = gender(JsonField.of(gender)) - /** The legal middle name of the individual. */ - fun middleName(middleName: JsonField) = apply { this.middleName = middleName } + /** The gender of the individual. */ + fun gender(gender: JsonField) = apply { this.gender = gender } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) @@ -238,17 +268,11 @@ private constructor( /** The legal last name of the individual. */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) - - /** The preferred name of the individual. */ - fun preferredName(preferredName: JsonField) = apply { - this.preferredName = preferredName - } - - fun emails(emails: List) = emails(JsonField.of(emails)) + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = middleName(JsonField.of(middleName)) - fun emails(emails: JsonField>) = apply { this.emails = emails } + /** The legal middle name of the individual. */ + fun middleName(middleName: JsonField) = apply { this.middleName = middleName } fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -257,21 +281,13 @@ private constructor( this.phoneNumbers = phoneNumbers } - /** The gender of the individual. */ - fun gender(gender: Gender) = gender(JsonField.of(gender)) - - /** The gender of the individual. */ - fun gender(gender: JsonField) = apply { this.gender = gender } - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } - - fun dob(dob: String) = dob(JsonField.of(dob)) + /** The preferred name of the individual. */ + fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) - fun dob(dob: JsonField) = apply { this.dob = dob } + /** The preferred name of the individual. */ + fun preferredName(preferredName: JsonField) = apply { + this.preferredName = preferredName + } fun residence(residence: Location) = residence(JsonField.of(residence)) @@ -291,22 +307,6 @@ private constructor( */ fun ssn(ssn: JsonField) = apply { this.ssn = ssn } - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set - * in the body. - */ - fun encryptedSsn(encryptedSsn: String) = encryptedSsn(JsonField.of(encryptedSsn)) - - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set - * in the body. - */ - fun encryptedSsn(encryptedSsn: JsonField) = apply { - this.encryptedSsn = encryptedSsn - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -329,18 +329,18 @@ private constructor( fun build(): Individual = Individual( id, + dob, + emails.map { it.toImmutable() }, + encryptedSsn, + ethnicity, firstName, - middleName, + gender, lastName, - preferredName, - emails.map { it.toImmutable() }, + middleName, phoneNumbers.map { it.toImmutable() }, - gender, - ethnicity, - dob, + preferredName, residence, ssn, - encryptedSsn, additionalProperties.toImmutable(), ) } @@ -841,15 +841,15 @@ private constructor( return true } - return /* spotless:off */ other is Individual && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && emails == other.emails && phoneNumbers == other.phoneNumbers && gender == other.gender && ethnicity == other.ethnicity && dob == other.dob && residence == other.residence && ssn == other.ssn && encryptedSsn == other.encryptedSsn && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Individual && id == other.id && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, preferredName, emails, phoneNumbers, gender, ethnicity, dob, residence, ssn, encryptedSsn, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Individual{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, emails=$emails, phoneNumbers=$phoneNumbers, gender=$gender, ethnicity=$ethnicity, dob=$dob, residence=$residence, ssn=$ssn, encryptedSsn=$encryptedSsn, additionalProperties=$additionalProperties}" + "Individual{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt index 816f98ce..5f0811f9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt @@ -22,26 +22,26 @@ import java.util.Optional class IndividualBenefit @JsonCreator private constructor( + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("individual_id") @ExcludeMissing private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), - @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + @JsonProperty("body") @ExcludeMissing fun _body() = body @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId @JsonAnyGetter @ExcludeMissing @@ -51,9 +51,9 @@ private constructor( fun validate(): IndividualBenefit = apply { if (!validated) { - individualId() - code() body().map { it.validate() } + code() + individualId() validated = true } } @@ -67,32 +67,32 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualBenefit: IndividualBenefit) = apply { - individualId = individualBenefit.individualId - code = individualBenefit.code body = individualBenefit.body + code = individualBenefit.code + individualId = individualBenefit.individualId additionalProperties = individualBenefit.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun body(body: Body) = body(JsonField.of(body)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun body(body: JsonField) = apply { this.body = body } fun code(code: Long) = code(JsonField.of(code)) fun code(code: JsonField) = apply { this.code = code } - fun body(body: Body) = body(JsonField.of(body)) + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - fun body(body: JsonField) = apply { this.body = body } + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -115,9 +115,9 @@ private constructor( fun build(): IndividualBenefit = IndividualBenefit( - individualId, - code, body, + code, + individualId, additionalProperties.toImmutable(), ) } @@ -126,18 +126,18 @@ private constructor( class Body @JsonCreator private constructor( - @JsonProperty("employee_deduction") - @ExcludeMissing - private val employeeDeduction: JsonField = JsonMissing.of(), - @JsonProperty("company_contribution") - @ExcludeMissing - private val companyContribution: JsonField = JsonMissing.of(), @JsonProperty("annual_maximum") @ExcludeMissing private val annualMaximum: JsonField = JsonMissing.of(), @JsonProperty("catch_up") @ExcludeMissing private val catchUp: JsonField = JsonMissing.of(), + @JsonProperty("company_contribution") + @ExcludeMissing + private val companyContribution: JsonField = JsonMissing.of(), + @JsonProperty("employee_deduction") + @ExcludeMissing + private val employeeDeduction: JsonField = JsonMissing.of(), @JsonProperty("hsa_contribution_limit") @ExcludeMissing private val hsaContributionLimit: JsonField = JsonMissing.of(), @@ -145,12 +145,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - fun employeeDeduction(): Optional = - Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) - - fun companyContribution(): Optional = - Optional.ofNullable(companyContribution.getNullable("company_contribution")) - /** If the benefit supports annual maximum, the amount in cents for this individual. */ fun annualMaximum(): Optional = Optional.ofNullable(annualMaximum.getNullable("annual_maximum")) @@ -161,18 +155,16 @@ private constructor( */ fun catchUp(): Optional = Optional.ofNullable(catchUp.getNullable("catch_up")) + fun companyContribution(): Optional = + Optional.ofNullable(companyContribution.getNullable("company_contribution")) + + fun employeeDeduction(): Optional = + Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) + /** Type for HSA contribution limit if the benefit is a HSA. */ fun hsaContributionLimit(): Optional = Optional.ofNullable(hsaContributionLimit.getNullable("hsa_contribution_limit")) - @JsonProperty("employee_deduction") - @ExcludeMissing - fun _employeeDeduction() = employeeDeduction - - @JsonProperty("company_contribution") - @ExcludeMissing - fun _companyContribution() = companyContribution - /** If the benefit supports annual maximum, the amount in cents for this individual. */ @JsonProperty("annual_maximum") @ExcludeMissing fun _annualMaximum() = annualMaximum @@ -182,6 +174,14 @@ private constructor( */ @JsonProperty("catch_up") @ExcludeMissing fun _catchUp() = catchUp + @JsonProperty("company_contribution") + @ExcludeMissing + fun _companyContribution() = companyContribution + + @JsonProperty("employee_deduction") + @ExcludeMissing + fun _employeeDeduction() = employeeDeduction + /** Type for HSA contribution limit if the benefit is a HSA. */ @JsonProperty("hsa_contribution_limit") @ExcludeMissing @@ -195,10 +195,10 @@ private constructor( fun validate(): Body = apply { if (!validated) { - employeeDeduction().map { it.validate() } - companyContribution().map { it.validate() } annualMaximum() catchUp() + companyContribution().map { it.validate() } + employeeDeduction().map { it.validate() } hsaContributionLimit() validated = true } @@ -213,37 +213,23 @@ private constructor( class Builder { - private var employeeDeduction: JsonField = JsonMissing.of() - private var companyContribution: JsonField = JsonMissing.of() private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() + private var companyContribution: JsonField = JsonMissing.of() + private var employeeDeduction: JsonField = JsonMissing.of() private var hsaContributionLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { - employeeDeduction = body.employeeDeduction - companyContribution = body.companyContribution annualMaximum = body.annualMaximum catchUp = body.catchUp + companyContribution = body.companyContribution + employeeDeduction = body.employeeDeduction hsaContributionLimit = body.hsaContributionLimit additionalProperties = body.additionalProperties.toMutableMap() } - fun employeeDeduction(employeeDeduction: BenefitContribution) = - employeeDeduction(JsonField.of(employeeDeduction)) - - fun employeeDeduction(employeeDeduction: JsonField) = apply { - this.employeeDeduction = employeeDeduction - } - - fun companyContribution(companyContribution: BenefitContribution) = - companyContribution(JsonField.of(companyContribution)) - - fun companyContribution(companyContribution: JsonField) = apply { - this.companyContribution = companyContribution - } - /** If the benefit supports annual maximum, the amount in cents for this individual. */ fun annualMaximum(annualMaximum: Long) = annualMaximum(JsonField.of(annualMaximum)) @@ -264,6 +250,20 @@ private constructor( */ fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } + fun companyContribution(companyContribution: BenefitContribution) = + companyContribution(JsonField.of(companyContribution)) + + fun companyContribution(companyContribution: JsonField) = apply { + this.companyContribution = companyContribution + } + + fun employeeDeduction(employeeDeduction: BenefitContribution) = + employeeDeduction(JsonField.of(employeeDeduction)) + + fun employeeDeduction(employeeDeduction: JsonField) = apply { + this.employeeDeduction = employeeDeduction + } + /** Type for HSA contribution limit if the benefit is a HSA. */ fun hsaContributionLimit(hsaContributionLimit: HsaContributionLimit) = hsaContributionLimit(JsonField.of(hsaContributionLimit)) @@ -295,10 +295,10 @@ private constructor( fun build(): Body = Body( - employeeDeduction, - companyContribution, annualMaximum, catchUp, + companyContribution, + employeeDeduction, hsaContributionLimit, additionalProperties.toImmutable(), ) @@ -366,17 +366,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && employeeDeduction == other.employeeDeduction && companyContribution == other.companyContribution && annualMaximum == other.annualMaximum && catchUp == other.catchUp && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && annualMaximum == other.annualMaximum && catchUp == other.catchUp && companyContribution == other.companyContribution && employeeDeduction == other.employeeDeduction && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(employeeDeduction, companyContribution, annualMaximum, catchUp, hsaContributionLimit, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(annualMaximum, catchUp, companyContribution, employeeDeduction, hsaContributionLimit, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Body{employeeDeduction=$employeeDeduction, companyContribution=$companyContribution, annualMaximum=$annualMaximum, catchUp=$catchUp, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}" + "Body{annualMaximum=$annualMaximum, catchUp=$catchUp, companyContribution=$companyContribution, employeeDeduction=$employeeDeduction, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -384,15 +384,15 @@ private constructor( return true } - return /* spotless:off */ other is IndividualBenefit && individualId == other.individualId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualBenefit && body == other.body && code == other.code && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, individualId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualBenefit{individualId=$individualId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "IndividualBenefit{body=$body, code=$code, individualId=$individualId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt index 3f8e2191..9d4bf162 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class IndividualEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): IndividualEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualEvent: IndividualEvent) = apply { - connectionId = individualEvent.connectionId - companyId = individualEvent.companyId accountId = individualEvent.accountId - eventType = individualEvent.eventType + companyId = individualEvent.companyId + connectionId = individualEvent.connectionId data = individualEvent.data + eventType = individualEvent.eventType additionalProperties = individualEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): IndividualEvent = IndividualEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -362,15 +362,15 @@ private constructor( return true } - return /* spotless:off */ other is IndividualEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "IndividualEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt index 0d82062f..a985108a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualInDirectory.kt @@ -21,35 +21,39 @@ class IndividualInDirectory @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") + @JsonProperty("is_active") @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), + private val isActive: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing private val lastName: JsonField = JsonMissing.of(), @JsonProperty("manager") @ExcludeMissing private val manager: JsonField = JsonMissing.of(), - @JsonProperty("department") - @ExcludeMissing - private val department: JsonField = JsonMissing.of(), - @JsonProperty("is_active") + @JsonProperty("middle_name") @ExcludeMissing - private val isActive: JsonField = JsonMissing.of(), + private val middleName: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A stable Finch id (UUID v4) for an individual in the company. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + /** The department object. */ + fun department(): Optional = + Optional.ofNullable(department.getNullable("department")) + /** The legal first name of the individual. */ fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) - /** The legal middle name of the individual. */ - fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) + /** `true` if the individual is an active employee or contractor at the company. */ + fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) /** The legal last name of the individual. */ fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) @@ -57,21 +61,20 @@ private constructor( /** The manager object. */ fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) - /** The department object. */ - fun department(): Optional = - Optional.ofNullable(department.getNullable("department")) - - /** `true` if the individual is an active employee or contractor at the company. */ - fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + /** The legal middle name of the individual. */ + fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) /** A stable Finch id (UUID v4) for an individual in the company. */ @JsonProperty("id") @ExcludeMissing fun _id() = id + /** The department object. */ + @JsonProperty("department") @ExcludeMissing fun _department() = department + /** The legal first name of the individual. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - /** The legal middle name of the individual. */ - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + /** `true` if the individual is an active employee or contractor at the company. */ + @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive /** The legal last name of the individual. */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName @@ -79,11 +82,8 @@ private constructor( /** The manager object. */ @JsonProperty("manager") @ExcludeMissing fun _manager() = manager - /** The department object. */ - @JsonProperty("department") @ExcludeMissing fun _department() = department - - /** `true` if the individual is an active employee or contractor at the company. */ - @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName @JsonAnyGetter @ExcludeMissing @@ -94,12 +94,12 @@ private constructor( fun validate(): IndividualInDirectory = apply { if (!validated) { id() + department().map { it.validate() } firstName() - middleName() + isActive() lastName() manager().map { it.validate() } - department().map { it.validate() } - isActive() + middleName() validated = true } } @@ -114,23 +114,23 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var department: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() - private var middleName: JsonField = JsonMissing.of() + private var isActive: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() - private var department: JsonField = JsonMissing.of() - private var isActive: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualInDirectory: IndividualInDirectory) = apply { id = individualInDirectory.id + department = individualInDirectory.department firstName = individualInDirectory.firstName - middleName = individualInDirectory.middleName + isActive = individualInDirectory.isActive lastName = individualInDirectory.lastName manager = individualInDirectory.manager - department = individualInDirectory.department - isActive = individualInDirectory.isActive + middleName = individualInDirectory.middleName additionalProperties = individualInDirectory.additionalProperties.toMutableMap() } @@ -140,17 +140,23 @@ private constructor( /** A stable Finch id (UUID v4) for an individual in the company. */ fun id(id: JsonField) = apply { this.id = id } + /** The department object. */ + fun department(department: Department) = department(JsonField.of(department)) + + /** The department object. */ + fun department(department: JsonField) = apply { this.department = department } + /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = middleName(JsonField.of(middleName)) + /** `true` if the individual is an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - /** The legal middle name of the individual. */ - fun middleName(middleName: JsonField) = apply { this.middleName = middleName } + /** `true` if the individual is an active employee or contractor at the company. */ + fun isActive(isActive: JsonField) = apply { this.isActive = isActive } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) @@ -164,17 +170,11 @@ private constructor( /** The manager object. */ fun manager(manager: JsonField) = apply { this.manager = manager } - /** The department object. */ - fun department(department: Department) = department(JsonField.of(department)) - - /** The department object. */ - fun department(department: JsonField) = apply { this.department = department } - - /** `true` if the individual is an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = middleName(JsonField.of(middleName)) - /** `true` if the individual is an active employee or contractor at the company. */ - fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** The legal middle name of the individual. */ + fun middleName(middleName: JsonField) = apply { this.middleName = middleName } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -198,12 +198,12 @@ private constructor( fun build(): IndividualInDirectory = IndividualInDirectory( id, + department, firstName, - middleName, + isActive, lastName, manager, - department, - isActive, + middleName, additionalProperties.toImmutable(), ) } @@ -400,15 +400,15 @@ private constructor( return true } - return /* spotless:off */ other is IndividualInDirectory && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && manager == other.manager && department == other.department && isActive == other.isActive && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualInDirectory && id == other.id && department == other.department && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && manager == other.manager && middleName == other.middleName && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, manager, department, isActive, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, department, firstName, isActive, lastName, manager, middleName, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualInDirectory{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, manager=$manager, department=$department, isActive=$isActive, additionalProperties=$additionalProperties}" + "IndividualInDirectory{id=$id, department=$department, firstName=$firstName, isActive=$isActive, lastName=$lastName, manager=$manager, middleName=$middleName, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt index 21ff4f53..d40abc77 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt @@ -20,28 +20,28 @@ import java.util.Optional class IndividualResponse @JsonCreator private constructor( - @JsonProperty("individual_id") - @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + @JsonProperty("body") @ExcludeMissing fun _body() = body @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId @JsonAnyGetter @ExcludeMissing @@ -51,9 +51,9 @@ private constructor( fun validate(): IndividualResponse = apply { if (!validated) { - individualId() - code() body().map { it.validate() } + code() + individualId() validated = true } } @@ -67,32 +67,32 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualResponse: IndividualResponse) = apply { - individualId = individualResponse.individualId - code = individualResponse.code body = individualResponse.body + code = individualResponse.code + individualId = individualResponse.individualId additionalProperties = individualResponse.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun body(body: Individual) = body(JsonField.of(body)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun body(body: JsonField) = apply { this.body = body } fun code(code: Long) = code(JsonField.of(code)) fun code(code: JsonField) = apply { this.code = code } - fun body(body: Individual) = body(JsonField.of(body)) + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - fun body(body: JsonField) = apply { this.body = body } + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -115,9 +115,9 @@ private constructor( fun build(): IndividualResponse = IndividualResponse( - individualId, - code, body, + code, + individualId, additionalProperties.toImmutable(), ) } @@ -127,15 +127,15 @@ private constructor( return true } - return /* spotless:off */ other is IndividualResponse && individualId == other.individualId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualResponse && body == other.body && code == other.code && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, individualId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualResponse{individualId=$individualId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "IndividualResponse{body=$body, code=$code, individualId=$individualId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt index 540c4b65..37ecff50 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt @@ -22,67 +22,80 @@ import java.util.Optional class IndividualUpdateResponse @JsonCreator private constructor( + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), + @JsonProperty("emails") + @ExcludeMissing + private val emails: JsonField> = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), + @JsonProperty("ethnicity") + @ExcludeMissing + private val ethnicity: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") + @JsonProperty("gender") @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), + private val gender: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("preferred_name") - @ExcludeMissing - private val preferredName: JsonField = JsonMissing.of(), - @JsonProperty("emails") + @JsonProperty("middle_name") @ExcludeMissing - private val emails: JsonField> = JsonMissing.of(), + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField> = JsonMissing.of(), - @JsonProperty("gender") - @ExcludeMissing - private val gender: JsonField = JsonMissing.of(), - @JsonProperty("ethnicity") - @ExcludeMissing - private val ethnicity: JsonField = JsonMissing.of(), - @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), - @JsonProperty("ssn") @ExcludeMissing private val ssn: JsonField = JsonMissing.of(), - @JsonProperty("encrypted_ssn") + @JsonProperty("preferred_name") @ExcludeMissing - private val encryptedSsn: JsonField = JsonMissing.of(), + private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("residence") @ExcludeMissing private val residence: JsonField = JsonMissing.of(), - @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("ssn") @ExcludeMissing private val ssn: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + + fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) + + fun emails(): Optional> = Optional.ofNullable(emails.getNullable("emails")) + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in + * the body. + */ + fun encryptedSsn(): Optional = + Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(): Optional = Optional.ofNullable(ethnicity.getNullable("ethnicity")) + /** The legal first name of the individual. */ fun firstName(): Optional = Optional.ofNullable(firstName.getNullable("first_name")) - /** The legal middle name of the individual. */ - fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) + /** The gender of the individual. */ + fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) /** The legal last name of the individual. */ fun lastName(): Optional = Optional.ofNullable(lastName.getNullable("last_name")) - /** The preferred name of the individual. */ - fun preferredName(): Optional = - Optional.ofNullable(preferredName.getNullable("preferred_name")) - - fun emails(): Optional> = Optional.ofNullable(emails.getNullable("emails")) + /** The legal middle name of the individual. */ + fun middleName(): Optional = Optional.ofNullable(middleName.getNullable("middle_name")) fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers.getNullable("phone_numbers")) - /** The gender of the individual. */ - fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(): Optional = Optional.ofNullable(ethnicity.getNullable("ethnicity")) + /** The preferred name of the individual. */ + fun preferredName(): Optional = + Optional.ofNullable(preferredName.getNullable("preferred_name")) - fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) + fun residence(): Optional = Optional.ofNullable(residence.getNullable("residence")) /** * Social Security Number of the individual. This field is only available with the `ssn` scope @@ -91,42 +104,41 @@ private constructor( */ fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("dob") @ExcludeMissing fun _dob() = dob + + @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in * the body. */ - fun encryptedSsn(): Optional = - Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) - - fun residence(): Optional = Optional.ofNullable(residence.getNullable("residence")) + @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + /** The EEOC-defined ethnicity of the individual. */ + @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity /** The legal first name of the individual. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - /** The legal middle name of the individual. */ - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + /** The gender of the individual. */ + @JsonProperty("gender") @ExcludeMissing fun _gender() = gender /** The legal last name of the individual. */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - /** The preferred name of the individual. */ - @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName - - @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers - /** The gender of the individual. */ - @JsonProperty("gender") @ExcludeMissing fun _gender() = gender - - /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity + /** The preferred name of the individual. */ + @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName - @JsonProperty("dob") @ExcludeMissing fun _dob() = dob + @JsonProperty("residence") @ExcludeMissing fun _residence() = residence /** * Social Security Number of the individual. This field is only available with the `ssn` scope @@ -135,18 +147,6 @@ private constructor( */ @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in - * the body. - */ - @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn - - @JsonProperty("residence") @ExcludeMissing fun _residence() = residence - - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -155,19 +155,19 @@ private constructor( fun validate(): IndividualUpdateResponse = apply { if (!validated) { + id() + dob() + emails().map { it.forEach { it.validate() } } + encryptedSsn() + ethnicity() firstName() - middleName() + gender() lastName() - preferredName() - emails().map { it.forEach { it.validate() } } + middleName() phoneNumbers().map { it.forEach { it?.validate() } } - gender() - ethnicity() - dob() - ssn() - encryptedSsn() + preferredName() residence().map { it.validate() } - id() + ssn() validated = true } } @@ -181,50 +181,86 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var dob: JsonField = JsonMissing.of() + private var emails: JsonField> = JsonMissing.of() + private var encryptedSsn: JsonField = JsonMissing.of() + private var ethnicity: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() - private var middleName: JsonField = JsonMissing.of() + private var gender: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() - private var preferredName: JsonField = JsonMissing.of() - private var emails: JsonField> = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() - private var gender: JsonField = JsonMissing.of() - private var ethnicity: JsonField = JsonMissing.of() - private var dob: JsonField = JsonMissing.of() - private var ssn: JsonField = JsonMissing.of() - private var encryptedSsn: JsonField = JsonMissing.of() + private var preferredName: JsonField = JsonMissing.of() private var residence: JsonField = JsonMissing.of() - private var id: JsonField = JsonMissing.of() + private var ssn: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualUpdateResponse: IndividualUpdateResponse) = apply { + id = individualUpdateResponse.id + dob = individualUpdateResponse.dob + emails = individualUpdateResponse.emails + encryptedSsn = individualUpdateResponse.encryptedSsn + ethnicity = individualUpdateResponse.ethnicity firstName = individualUpdateResponse.firstName - middleName = individualUpdateResponse.middleName + gender = individualUpdateResponse.gender lastName = individualUpdateResponse.lastName - preferredName = individualUpdateResponse.preferredName - emails = individualUpdateResponse.emails + middleName = individualUpdateResponse.middleName phoneNumbers = individualUpdateResponse.phoneNumbers - gender = individualUpdateResponse.gender - ethnicity = individualUpdateResponse.ethnicity - dob = individualUpdateResponse.dob - ssn = individualUpdateResponse.ssn - encryptedSsn = individualUpdateResponse.encryptedSsn + preferredName = individualUpdateResponse.preferredName residence = individualUpdateResponse.residence - id = individualUpdateResponse.id + ssn = individualUpdateResponse.ssn additionalProperties = individualUpdateResponse.additionalProperties.toMutableMap() } + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: String) = id(JsonField.of(id)) + + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: JsonField) = apply { this.id = id } + + fun dob(dob: String) = dob(JsonField.of(dob)) + + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun emails(emails: List) = emails(JsonField.of(emails)) + + fun emails(emails: JsonField>) = apply { this.emails = emails } + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set + * in the body. + */ + fun encryptedSsn(encryptedSsn: String) = encryptedSsn(JsonField.of(encryptedSsn)) + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set + * in the body. + */ + fun encryptedSsn(encryptedSsn: JsonField) = apply { + this.encryptedSsn = encryptedSsn + } + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } + /** The legal first name of the individual. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** The legal first name of the individual. */ fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = middleName(JsonField.of(middleName)) + /** The gender of the individual. */ + fun gender(gender: Gender) = gender(JsonField.of(gender)) - /** The legal middle name of the individual. */ - fun middleName(middleName: JsonField) = apply { this.middleName = middleName } + /** The gender of the individual. */ + fun gender(gender: JsonField) = apply { this.gender = gender } /** The legal last name of the individual. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) @@ -232,17 +268,11 @@ private constructor( /** The legal last name of the individual. */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) - - /** The preferred name of the individual. */ - fun preferredName(preferredName: JsonField) = apply { - this.preferredName = preferredName - } - - fun emails(emails: List) = emails(JsonField.of(emails)) + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = middleName(JsonField.of(middleName)) - fun emails(emails: JsonField>) = apply { this.emails = emails } + /** The legal middle name of the individual. */ + fun middleName(middleName: JsonField) = apply { this.middleName = middleName } fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -251,21 +281,17 @@ private constructor( this.phoneNumbers = phoneNumbers } - /** The gender of the individual. */ - fun gender(gender: Gender) = gender(JsonField.of(gender)) - - /** The gender of the individual. */ - fun gender(gender: JsonField) = apply { this.gender = gender } - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = ethnicity(JsonField.of(ethnicity)) + /** The preferred name of the individual. */ + fun preferredName(preferredName: String) = preferredName(JsonField.of(preferredName)) - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: JsonField) = apply { this.ethnicity = ethnicity } + /** The preferred name of the individual. */ + fun preferredName(preferredName: JsonField) = apply { + this.preferredName = preferredName + } - fun dob(dob: String) = dob(JsonField.of(dob)) + fun residence(residence: Location) = residence(JsonField.of(residence)) - fun dob(dob: JsonField) = apply { this.dob = dob } + fun residence(residence: JsonField) = apply { this.residence = residence } /** * Social Security Number of the individual. This field is only available with the `ssn` @@ -281,32 +307,6 @@ private constructor( */ fun ssn(ssn: JsonField) = apply { this.ssn = ssn } - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set - * in the body. - */ - fun encryptedSsn(encryptedSsn: String) = encryptedSsn(JsonField.of(encryptedSsn)) - - /** - * Social Security Number of the individual in **encrypted** format. This field is only - * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set - * in the body. - */ - fun encryptedSsn(encryptedSsn: JsonField) = apply { - this.encryptedSsn = encryptedSsn - } - - fun residence(residence: Location) = residence(JsonField.of(residence)) - - fun residence(residence: JsonField) = apply { this.residence = residence } - - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: String) = id(JsonField.of(id)) - - /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: JsonField) = apply { this.id = id } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -328,19 +328,19 @@ private constructor( fun build(): IndividualUpdateResponse = IndividualUpdateResponse( + id, + dob, + emails.map { it.toImmutable() }, + encryptedSsn, + ethnicity, firstName, - middleName, + gender, lastName, - preferredName, - emails.map { it.toImmutable() }, + middleName, phoneNumbers.map { it.toImmutable() }, - gender, - ethnicity, - dob, - ssn, - encryptedSsn, + preferredName, residence, - id, + ssn, additionalProperties.toImmutable(), ) } @@ -841,15 +841,15 @@ private constructor( return true } - return /* spotless:off */ other is IndividualUpdateResponse && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && emails == other.emails && phoneNumbers == other.phoneNumbers && gender == other.gender && ethnicity == other.ethnicity && dob == other.dob && ssn == other.ssn && encryptedSsn == other.encryptedSsn && residence == other.residence && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualUpdateResponse && id == other.id && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, preferredName, emails, phoneNumbers, gender, ethnicity, dob, ssn, encryptedSsn, residence, id, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualUpdateResponse{firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, emails=$emails, phoneNumbers=$phoneNumbers, gender=$gender, ethnicity=$ethnicity, dob=$dob, ssn=$ssn, encryptedSsn=$encryptedSsn, residence=$residence, id=$id, additionalProperties=$additionalProperties}" + "IndividualUpdateResponse{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt index 999ecab4..fe29212c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt @@ -22,61 +22,65 @@ import java.util.Optional class Introspection @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), - @JsonProperty("connection_status") + private val accountId: JsonField = JsonMissing.of(), + @JsonProperty("authentication_methods") @ExcludeMissing - private val connectionStatus: JsonField = JsonMissing.of(), + private val authenticationMethods: JsonField> = JsonMissing.of(), @JsonProperty("client_id") @ExcludeMissing private val clientId: JsonField = JsonMissing.of(), @JsonProperty("client_type") @ExcludeMissing private val clientType: JsonField = JsonMissing.of(), - @JsonProperty("connection_type") - @ExcludeMissing - private val connectionType: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("connection_status") + @ExcludeMissing + private val connectionStatus: JsonField = JsonMissing.of(), + @JsonProperty("connection_type") + @ExcludeMissing + private val connectionType: JsonField = JsonMissing.of(), + @JsonProperty("customer_email") + @ExcludeMissing + private val customerEmail: JsonField = JsonMissing.of(), @JsonProperty("customer_id") @ExcludeMissing private val customerId: JsonField = JsonMissing.of(), @JsonProperty("customer_name") @ExcludeMissing private val customerName: JsonField = JsonMissing.of(), - @JsonProperty("customer_email") + @JsonProperty("manual") @ExcludeMissing - private val customerEmail: JsonField = JsonMissing.of(), - @JsonProperty("authentication_methods") + private val manual: JsonField = JsonMissing.of(), + @JsonProperty("payroll_provider_id") @ExcludeMissing - private val authenticationMethods: JsonField> = JsonMissing.of(), + private val payrollProviderId: JsonField = JsonMissing.of(), @JsonProperty("products") @ExcludeMissing private val products: JsonField> = JsonMissing.of(), - @JsonProperty("username") - @ExcludeMissing - private val username: JsonField = JsonMissing.of(), @JsonProperty("provider_id") @ExcludeMissing private val providerId: JsonField = JsonMissing.of(), - @JsonProperty("payroll_provider_id") - @ExcludeMissing - private val payrollProviderId: JsonField = JsonMissing.of(), - @JsonProperty("manual") + @JsonProperty("username") @ExcludeMissing - private val manual: JsonField = JsonMissing.of(), + private val username: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(): String = connectionId.getRequired("connection_id") + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this + * account ID. + */ + fun accountId(): String = accountId.getRequired("account_id") - fun connectionStatus(): ConnectionStatus = connectionStatus.getRequired("connection_status") + fun authenticationMethods(): List = + authenticationMethods.getRequired("authentication_methods") /** The client ID of the application associated with the `access_token`. */ fun clientId(): String = clientId.getRequired("client_id") @@ -84,6 +88,17 @@ private constructor( /** The type of application associated with a token. */ fun clientType(): ClientType = clientType.getRequired("client_type") + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this + * company ID. + */ + fun companyId(): String = companyId.getRequired("company_id") + + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(): String = connectionId.getRequired("connection_id") + + fun connectionStatus(): ConnectionStatus = connectionStatus.getRequired("connection_status") + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -92,16 +107,11 @@ private constructor( fun connectionType(): ConnectionType = connectionType.getRequired("connection_type") /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this - * company ID. - */ - fun companyId(): String = companyId.getRequired("company_id") - - /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this - * account ID. + * The email of your customer you provided to Finch when a connect session was created for this + * connection. */ - fun accountId(): String = accountId.getRequired("account_id") + fun customerEmail(): Optional = + Optional.ofNullable(customerEmail.getNullable("customer_email")) /** * The ID of your customer you provided to Finch when a connect session was created for this @@ -117,39 +127,34 @@ private constructor( Optional.ofNullable(customerName.getNullable("customer_name")) /** - * The email of your customer you provided to Finch when a connect session was created for this - * connection. + * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. + * (`true` if using Assisted Connect, `false` if connection is automated) */ - fun customerEmail(): Optional = - Optional.ofNullable(customerEmail.getNullable("customer_email")) + fun manual(): Boolean = manual.getRequired("manual") - fun authenticationMethods(): List = - authenticationMethods.getRequired("authentication_methods") + /** + * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. + */ + fun payrollProviderId(): String = payrollProviderId.getRequired("payroll_provider_id") /** An array of the authorized products associated with the `access_token`. */ fun products(): List = products.getRequired("products") - /** The account username used for login associated with the `access_token`. */ - fun username(): String = username.getRequired("username") - /** The ID of the provider associated with the `access_token`. */ fun providerId(): String = providerId.getRequired("provider_id") - /** - * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. - */ - fun payrollProviderId(): String = payrollProviderId.getRequired("payroll_provider_id") + /** The account username used for login associated with the `access_token`. */ + fun username(): String = username.getRequired("username") /** - * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. - * (`true` if using Assisted Connect, `false` if connection is automated) + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this + * account ID. */ - fun manual(): Boolean = manual.getRequired("manual") - - /** The Finch UUID of the connection associated with the `access_token`. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId - @JsonProperty("connection_status") @ExcludeMissing fun _connectionStatus() = connectionStatus + @JsonProperty("authentication_methods") + @ExcludeMissing + fun _authenticationMethods() = authenticationMethods /** The client ID of the application associated with the `access_token`. */ @JsonProperty("client_id") @ExcludeMissing fun _clientId() = clientId @@ -157,6 +162,17 @@ private constructor( /** The type of application associated with a token. */ @JsonProperty("client_type") @ExcludeMissing fun _clientType() = clientType + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this + * company ID. + */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + + /** The Finch UUID of the connection associated with the `access_token`. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + + @JsonProperty("connection_status") @ExcludeMissing fun _connectionStatus() = connectionStatus + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -165,16 +181,10 @@ private constructor( @JsonProperty("connection_type") @ExcludeMissing fun _connectionType() = connectionType /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this - * company ID. - */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - - /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this - * account ID. + * The email of your customer you provided to Finch when a connect session was created for this + * connection. */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("customer_email") @ExcludeMissing fun _customerEmail() = customerEmail /** * The ID of your customer you provided to Finch when a connect session was created for this @@ -189,36 +199,26 @@ private constructor( @JsonProperty("customer_name") @ExcludeMissing fun _customerName() = customerName /** - * The email of your customer you provided to Finch when a connect session was created for this - * connection. + * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. + * (`true` if using Assisted Connect, `false` if connection is automated) */ - @JsonProperty("customer_email") @ExcludeMissing fun _customerEmail() = customerEmail + @JsonProperty("manual") @ExcludeMissing fun _manual() = manual - @JsonProperty("authentication_methods") + /** + * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. + */ + @JsonProperty("payroll_provider_id") @ExcludeMissing - fun _authenticationMethods() = authenticationMethods + fun _payrollProviderId() = payrollProviderId /** An array of the authorized products associated with the `access_token`. */ @JsonProperty("products") @ExcludeMissing fun _products() = products - /** The account username used for login associated with the `access_token`. */ - @JsonProperty("username") @ExcludeMissing fun _username() = username - /** The ID of the provider associated with the `access_token`. */ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId - /** - * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. - */ - @JsonProperty("payroll_provider_id") - @ExcludeMissing - fun _payrollProviderId() = payrollProviderId - - /** - * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. - * (`true` if using Assisted Connect, `false` if connection is automated) - */ - @JsonProperty("manual") @ExcludeMissing fun _manual() = manual + /** The account username used for login associated with the `access_token`. */ + @JsonProperty("username") @ExcludeMissing fun _username() = username @JsonAnyGetter @ExcludeMissing @@ -228,22 +228,22 @@ private constructor( fun validate(): Introspection = apply { if (!validated) { - connectionId() - connectionStatus().validate() + accountId() + authenticationMethods().forEach { it.validate() } clientId() clientType() - connectionType() companyId() - accountId() + connectionId() + connectionStatus().validate() + connectionType() + customerEmail() customerId() customerName() - customerEmail() - authenticationMethods().forEach { it.validate() } + manual() + payrollProviderId() products() - username() providerId() - payrollProviderId() - manual() + username() validated = true } } @@ -257,59 +257,64 @@ private constructor( class Builder { - private var connectionId: JsonField = JsonMissing.of() - private var connectionStatus: JsonField = JsonMissing.of() + private var accountId: JsonField = JsonMissing.of() + private var authenticationMethods: JsonField> = JsonMissing.of() private var clientId: JsonField = JsonMissing.of() private var clientType: JsonField = JsonMissing.of() - private var connectionType: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() - private var accountId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() + private var connectionStatus: JsonField = JsonMissing.of() + private var connectionType: JsonField = JsonMissing.of() + private var customerEmail: JsonField = JsonMissing.of() private var customerId: JsonField = JsonMissing.of() private var customerName: JsonField = JsonMissing.of() - private var customerEmail: JsonField = JsonMissing.of() - private var authenticationMethods: JsonField> = JsonMissing.of() + private var manual: JsonField = JsonMissing.of() + private var payrollProviderId: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() - private var username: JsonField = JsonMissing.of() private var providerId: JsonField = JsonMissing.of() - private var payrollProviderId: JsonField = JsonMissing.of() - private var manual: JsonField = JsonMissing.of() + private var username: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(introspection: Introspection) = apply { - connectionId = introspection.connectionId - connectionStatus = introspection.connectionStatus + accountId = introspection.accountId + authenticationMethods = introspection.authenticationMethods clientId = introspection.clientId clientType = introspection.clientType - connectionType = introspection.connectionType companyId = introspection.companyId - accountId = introspection.accountId + connectionId = introspection.connectionId + connectionStatus = introspection.connectionStatus + connectionType = introspection.connectionType + customerEmail = introspection.customerEmail customerId = introspection.customerId customerName = introspection.customerName - customerEmail = introspection.customerEmail - authenticationMethods = introspection.authenticationMethods + manual = introspection.manual + payrollProviderId = introspection.payrollProviderId products = introspection.products - username = introspection.username providerId = introspection.providerId - payrollProviderId = introspection.payrollProviderId - manual = introspection.manual + username = introspection.username additionalProperties = introspection.additionalProperties.toMutableMap() } - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of + * this account ID. + */ + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) - /** The Finch UUID of the connection associated with the `access_token`. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of + * this account ID. + */ + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } - fun connectionStatus(connectionStatus: ConnectionStatus) = - connectionStatus(JsonField.of(connectionStatus)) + fun authenticationMethods(authenticationMethods: List) = + authenticationMethods(JsonField.of(authenticationMethods)) - fun connectionStatus(connectionStatus: JsonField) = apply { - this.connectionStatus = connectionStatus - } + fun authenticationMethods(authenticationMethods: JsonField>) = + apply { + this.authenticationMethods = authenticationMethods + } /** The client ID of the application associated with the `access_token`. */ fun clientId(clientId: String) = clientId(JsonField.of(clientId)) @@ -323,6 +328,33 @@ private constructor( /** The type of application associated with a token. */ fun clientType(clientType: JsonField) = apply { this.clientType = clientType } + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of + * this company ID. + */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** + * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of + * this company ID. + */ + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) + + /** The Finch UUID of the connection associated with the `access_token`. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + + fun connectionStatus(connectionStatus: ConnectionStatus) = + connectionStatus(JsonField.of(connectionStatus)) + + fun connectionStatus(connectionStatus: JsonField) = apply { + this.connectionStatus = connectionStatus + } + /** * The type of the connection associated with the token. * - `provider` - connection to an external provider @@ -341,28 +373,18 @@ private constructor( } /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of - * this company ID. - */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) - - /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of - * this company ID. - */ - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - - /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of - * this account ID. + * The email of your customer you provided to Finch when a connect session was created for + * this connection. */ - fun accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun customerEmail(customerEmail: String) = customerEmail(JsonField.of(customerEmail)) /** - * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of - * this account ID. + * The email of your customer you provided to Finch when a connect session was created for + * this connection. */ - fun accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun customerEmail(customerEmail: JsonField) = apply { + this.customerEmail = customerEmail + } /** * The ID of your customer you provided to Finch when a connect session was created for this @@ -391,44 +413,16 @@ private constructor( } /** - * The email of your customer you provided to Finch when a connect session was created for - * this connection. + * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. + * (`true` if using Assisted Connect, `false` if connection is automated) */ - fun customerEmail(customerEmail: String) = customerEmail(JsonField.of(customerEmail)) + fun manual(manual: Boolean) = manual(JsonField.of(manual)) /** - * The email of your customer you provided to Finch when a connect session was created for - * this connection. + * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. + * (`true` if using Assisted Connect, `false` if connection is automated) */ - fun customerEmail(customerEmail: JsonField) = apply { - this.customerEmail = customerEmail - } - - fun authenticationMethods(authenticationMethods: List) = - authenticationMethods(JsonField.of(authenticationMethods)) - - fun authenticationMethods(authenticationMethods: JsonField>) = - apply { - this.authenticationMethods = authenticationMethods - } - - /** An array of the authorized products associated with the `access_token`. */ - fun products(products: List) = products(JsonField.of(products)) - - /** An array of the authorized products associated with the `access_token`. */ - fun products(products: JsonField>) = apply { this.products = products } - - /** The account username used for login associated with the `access_token`. */ - fun username(username: String) = username(JsonField.of(username)) - - /** The account username used for login associated with the `access_token`. */ - fun username(username: JsonField) = apply { this.username = username } - - /** The ID of the provider associated with the `access_token`. */ - fun providerId(providerId: String) = providerId(JsonField.of(providerId)) - - /** The ID of the provider associated with the `access_token`. */ - fun providerId(providerId: JsonField) = apply { this.providerId = providerId } + fun manual(manual: JsonField) = apply { this.manual = manual } /** * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider @@ -445,17 +439,23 @@ private constructor( this.payrollProviderId = payrollProviderId } - /** - * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. - * (`true` if using Assisted Connect, `false` if connection is automated) - */ - fun manual(manual: Boolean) = manual(JsonField.of(manual)) + /** An array of the authorized products associated with the `access_token`. */ + fun products(products: List) = products(JsonField.of(products)) - /** - * Whether the connection associated with the `access_token` uses the Assisted Connect Flow. - * (`true` if using Assisted Connect, `false` if connection is automated) - */ - fun manual(manual: JsonField) = apply { this.manual = manual } + /** An array of the authorized products associated with the `access_token`. */ + fun products(products: JsonField>) = apply { this.products = products } + + /** The ID of the provider associated with the `access_token`. */ + fun providerId(providerId: String) = providerId(JsonField.of(providerId)) + + /** The ID of the provider associated with the `access_token`. */ + fun providerId(providerId: JsonField) = apply { this.providerId = providerId } + + /** The account username used for login associated with the `access_token`. */ + fun username(username: String) = username(JsonField.of(username)) + + /** The account username used for login associated with the `access_token`. */ + fun username(username: JsonField) = apply { this.username = username } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -478,22 +478,22 @@ private constructor( fun build(): Introspection = Introspection( - connectionId, - connectionStatus, + accountId, + authenticationMethods.map { it.toImmutable() }, clientId, clientType, - connectionType, companyId, - accountId, + connectionId, + connectionStatus, + connectionType, + customerEmail, customerId, customerName, - customerEmail, - authenticationMethods.map { it.toImmutable() }, + manual, + payrollProviderId, products.map { it.toImmutable() }, - username, providerId, - payrollProviderId, - manual, + username, additionalProperties.toImmutable(), ) } @@ -502,20 +502,17 @@ private constructor( class AuthenticationMethod @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("connection_status") @ExcludeMissing private val connectionStatus: JsonField = JsonMissing.of(), @JsonProperty("products") @ExcludeMissing private val products: JsonField> = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of authentication method. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - fun connectionStatus(): Optional = Optional.ofNullable(connectionStatus.getNullable("connection_status")) @@ -524,7 +521,7 @@ private constructor( Optional.ofNullable(products.getNullable("products")) /** The type of authentication method. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @JsonProperty("connection_status") @ExcludeMissing @@ -533,6 +530,9 @@ private constructor( /** An array of the authorized products associated with the `access_token`. */ @JsonProperty("products") @ExcludeMissing fun _products() = products + /** The type of authentication method. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -541,9 +541,9 @@ private constructor( fun validate(): AuthenticationMethod = apply { if (!validated) { - type() connectionStatus().map { it.validate() } products() + type() validated = true } } @@ -557,25 +557,19 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var connectionStatus: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - type = authenticationMethod.type connectionStatus = authenticationMethod.connectionStatus products = authenticationMethod.products + type = authenticationMethod.type additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } - /** The type of authentication method. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The type of authentication method. */ - fun type(type: JsonField) = apply { this.type = type } - fun connectionStatus(connectionStatus: ConnectionStatus) = connectionStatus(JsonField.of(connectionStatus)) @@ -589,6 +583,12 @@ private constructor( /** An array of the authorized products associated with the `access_token`. */ fun products(products: JsonField>) = apply { this.products = products } + /** The type of authentication method. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The type of authentication method. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -610,9 +610,9 @@ private constructor( fun build(): AuthenticationMethod = AuthenticationMethod( - type, connectionStatus, products.map { it.toImmutable() }, + type, additionalProperties.toImmutable(), ) } @@ -621,25 +621,25 @@ private constructor( class ConnectionStatus @JsonCreator private constructor( - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), @JsonProperty("message") @ExcludeMissing private val message: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun message(): Optional = Optional.ofNullable(message.getNullable("message")) + fun status(): Optional = Optional.ofNullable(status.getNullable("status")) - fun message(): Optional = Optional.ofNullable(message.getNullable("message")) + @JsonProperty("message") @ExcludeMissing fun _message() = message @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("message") @ExcludeMissing fun _message() = message - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -648,8 +648,8 @@ private constructor( fun validate(): ConnectionStatus = apply { if (!validated) { - status() message() + status() validated = true } } @@ -663,25 +663,25 @@ private constructor( class Builder { - private var status: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(connectionStatus: ConnectionStatus) = apply { - status = connectionStatus.status message = connectionStatus.message + status = connectionStatus.status additionalProperties = connectionStatus.additionalProperties.toMutableMap() } - fun status(status: ConnectionStatusType) = status(JsonField.of(status)) - - fun status(status: JsonField) = apply { this.status = status } - fun message(message: String) = message(JsonField.of(message)) fun message(message: JsonField) = apply { this.message = message } + fun status(status: ConnectionStatusType) = status(JsonField.of(status)) + + fun status(status: JsonField) = apply { this.status = status } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -706,8 +706,8 @@ private constructor( fun build(): ConnectionStatus = ConnectionStatus( - status, message, + status, additionalProperties.toImmutable(), ) } @@ -717,17 +717,17 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionStatus && status == other.status && message == other.message && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ConnectionStatus && message == other.message && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(status, message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(message, status, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ConnectionStatus{status=$status, message=$message, additionalProperties=$additionalProperties}" + "ConnectionStatus{message=$message, status=$status, additionalProperties=$additionalProperties}" } class Type @@ -810,17 +810,17 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationMethod && type == other.type && connectionStatus == other.connectionStatus && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AuthenticationMethod && connectionStatus == other.connectionStatus && products == other.products && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, connectionStatus, products, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(connectionStatus, products, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AuthenticationMethod{type=$type, connectionStatus=$connectionStatus, products=$products, additionalProperties=$additionalProperties}" + "AuthenticationMethod{connectionStatus=$connectionStatus, products=$products, type=$type, additionalProperties=$additionalProperties}" } class ClientType @@ -890,25 +890,25 @@ private constructor( class ConnectionStatus @JsonCreator private constructor( - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), @JsonProperty("message") @ExcludeMissing private val message: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun message(): Optional = Optional.ofNullable(message.getNullable("message")) + fun status(): Optional = Optional.ofNullable(status.getNullable("status")) - fun message(): Optional = Optional.ofNullable(message.getNullable("message")) + @JsonProperty("message") @ExcludeMissing fun _message() = message @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("message") @ExcludeMissing fun _message() = message - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -917,8 +917,8 @@ private constructor( fun validate(): ConnectionStatus = apply { if (!validated) { - status() message() + status() validated = true } } @@ -932,25 +932,25 @@ private constructor( class Builder { - private var status: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(connectionStatus: ConnectionStatus) = apply { - status = connectionStatus.status message = connectionStatus.message + status = connectionStatus.status additionalProperties = connectionStatus.additionalProperties.toMutableMap() } - fun status(status: ConnectionStatusType) = status(JsonField.of(status)) - - fun status(status: JsonField) = apply { this.status = status } - fun message(message: String) = message(JsonField.of(message)) fun message(message: JsonField) = apply { this.message = message } + fun status(status: ConnectionStatusType) = status(JsonField.of(status)) + + fun status(status: JsonField) = apply { this.status = status } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -972,8 +972,8 @@ private constructor( fun build(): ConnectionStatus = ConnectionStatus( - status, message, + status, additionalProperties.toImmutable(), ) } @@ -983,17 +983,17 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionStatus && status == other.status && message == other.message && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ConnectionStatus && message == other.message && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(status, message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(message, status, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ConnectionStatus{status=$status, message=$message, additionalProperties=$additionalProperties}" + "ConnectionStatus{message=$message, status=$status, additionalProperties=$additionalProperties}" } class ConnectionType @@ -1058,15 +1058,15 @@ private constructor( return true } - return /* spotless:off */ other is Introspection && connectionId == other.connectionId && connectionStatus == other.connectionStatus && clientId == other.clientId && clientType == other.clientType && connectionType == other.connectionType && companyId == other.companyId && accountId == other.accountId && customerId == other.customerId && customerName == other.customerName && customerEmail == other.customerEmail && authenticationMethods == other.authenticationMethods && products == other.products && username == other.username && providerId == other.providerId && payrollProviderId == other.payrollProviderId && manual == other.manual && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Introspection && accountId == other.accountId && authenticationMethods == other.authenticationMethods && clientId == other.clientId && clientType == other.clientType && companyId == other.companyId && connectionId == other.connectionId && connectionStatus == other.connectionStatus && connectionType == other.connectionType && customerEmail == other.customerEmail && customerId == other.customerId && customerName == other.customerName && manual == other.manual && payrollProviderId == other.payrollProviderId && products == other.products && providerId == other.providerId && username == other.username && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, connectionStatus, clientId, clientType, connectionType, companyId, accountId, customerId, customerName, customerEmail, authenticationMethods, products, username, providerId, payrollProviderId, manual, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, authenticationMethods, clientId, clientType, companyId, connectionId, connectionStatus, connectionType, customerEmail, customerId, customerName, manual, payrollProviderId, products, providerId, username, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Introspection{connectionId=$connectionId, connectionStatus=$connectionStatus, clientId=$clientId, clientType=$clientType, connectionType=$connectionType, companyId=$companyId, accountId=$accountId, customerId=$customerId, customerName=$customerName, customerEmail=$customerEmail, authenticationMethods=$authenticationMethods, products=$products, username=$username, providerId=$providerId, payrollProviderId=$payrollProviderId, manual=$manual, additionalProperties=$additionalProperties}" + "Introspection{accountId=$accountId, authenticationMethods=$authenticationMethods, clientId=$clientId, clientType=$clientType, companyId=$companyId, connectionId=$connectionId, connectionStatus=$connectionStatus, connectionType=$connectionType, customerEmail=$customerEmail, customerId=$customerId, customerName=$customerName, manual=$manual, payrollProviderId=$payrollProviderId, products=$products, providerId=$providerId, username=$username, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index d7eadaff..a4a8f5ea 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt @@ -438,18 +438,18 @@ constructor( class W4FormEmployeeSync @JsonCreator private constructor( - @JsonProperty("type") private val type: Type, @JsonProperty("individual_id") private val individualId: String, + @JsonProperty("type") private val type: Type, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of job to start. */ - @JsonProperty("type") fun type(): Type = type - /** The unique ID of the individual for W-4 data sync. */ @JsonProperty("individual_id") fun individualId(): String = individualId + /** The type of job to start. */ + @JsonProperty("type") fun type(): Type = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -463,23 +463,23 @@ constructor( class Builder { - private var type: Type? = null private var individualId: String? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - type = w4FormEmployeeSync.type individualId = w4FormEmployeeSync.individualId + type = w4FormEmployeeSync.type additionalProperties = w4FormEmployeeSync.additionalProperties.toMutableMap() } - /** The type of job to start. */ - fun type(type: Type) = apply { this.type = type } - /** The unique ID of the individual for W-4 data sync. */ fun individualId(individualId: String) = apply { this.individualId = individualId } + /** The type of job to start. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -501,8 +501,8 @@ constructor( fun build(): W4FormEmployeeSync = W4FormEmployeeSync( - checkNotNull(type) { "`type` is required but was not set" }, checkNotNull(individualId) { "`individualId` is required but was not set" }, + checkNotNull(type) { "`type` is required but was not set" }, additionalProperties.toImmutable(), ) } @@ -563,17 +563,17 @@ constructor( return true } - return /* spotless:off */ other is W4FormEmployeeSync && type == other.type && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is W4FormEmployeeSync && individualId == other.individualId && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, individualId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(individualId, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "W4FormEmployeeSync{type=$type, individualId=$individualId, additionalProperties=$additionalProperties}" + "W4FormEmployeeSync{individualId=$individualId, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt index 2f36822a..16487802 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCompletionEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class JobCompletionEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): JobCompletionEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(jobCompletionEvent: JobCompletionEvent) = apply { - connectionId = jobCompletionEvent.connectionId - companyId = jobCompletionEvent.companyId accountId = jobCompletionEvent.accountId - eventType = jobCompletionEvent.eventType + companyId = jobCompletionEvent.companyId + connectionId = jobCompletionEvent.connectionId data = jobCompletionEvent.data + eventType = jobCompletionEvent.eventType additionalProperties = jobCompletionEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): JobCompletionEvent = JobCompletionEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -400,15 +400,15 @@ private constructor( return true } - return /* spotless:off */ other is JobCompletionEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is JobCompletionEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "JobCompletionEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "JobCompletionEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt index 06e6caba..595a71c7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobCreateResponse.kt @@ -19,40 +19,40 @@ import java.util.Objects class JobCreateResponse @JsonCreator private constructor( + @JsonProperty("allowed_refreshes") + @ExcludeMissing + private val allowedRefreshes: JsonField = JsonMissing.of(), @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), @JsonProperty("job_url") @ExcludeMissing private val jobUrl: JsonField = JsonMissing.of(), - @JsonProperty("allowed_refreshes") - @ExcludeMissing - private val allowedRefreshes: JsonField = JsonMissing.of(), @JsonProperty("remaining_refreshes") @ExcludeMissing private val remainingRefreshes: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(): Long = allowedRefreshes.getRequired("allowed_refreshes") + /** The id of the job that has been created. */ fun jobId(): String = jobId.getRequired("job_id") /** The url that can be used to retrieve the job status */ fun jobUrl(): String = jobUrl.getRequired("job_url") - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(): Long = allowedRefreshes.getRequired("allowed_refreshes") - /** The number of remaining refreshes available (per hour, fixed window) */ fun remainingRefreshes(): Long = remainingRefreshes.getRequired("remaining_refreshes") + /** The number of allowed refreshes per hour (per hour, fixed window) */ + @JsonProperty("allowed_refreshes") @ExcludeMissing fun _allowedRefreshes() = allowedRefreshes + /** The id of the job that has been created. */ @JsonProperty("job_id") @ExcludeMissing fun _jobId() = jobId /** The url that can be used to retrieve the job status */ @JsonProperty("job_url") @ExcludeMissing fun _jobUrl() = jobUrl - /** The number of allowed refreshes per hour (per hour, fixed window) */ - @JsonProperty("allowed_refreshes") @ExcludeMissing fun _allowedRefreshes() = allowedRefreshes - /** The number of remaining refreshes available (per hour, fixed window) */ @JsonProperty("remaining_refreshes") @ExcludeMissing @@ -66,9 +66,9 @@ private constructor( fun validate(): JobCreateResponse = apply { if (!validated) { + allowedRefreshes() jobId() jobUrl() - allowedRefreshes() remainingRefreshes() validated = true } @@ -83,21 +83,30 @@ private constructor( class Builder { + private var allowedRefreshes: JsonField = JsonMissing.of() private var jobId: JsonField = JsonMissing.of() private var jobUrl: JsonField = JsonMissing.of() - private var allowedRefreshes: JsonField = JsonMissing.of() private var remainingRefreshes: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(jobCreateResponse: JobCreateResponse) = apply { + allowedRefreshes = jobCreateResponse.allowedRefreshes jobId = jobCreateResponse.jobId jobUrl = jobCreateResponse.jobUrl - allowedRefreshes = jobCreateResponse.allowedRefreshes remainingRefreshes = jobCreateResponse.remainingRefreshes additionalProperties = jobCreateResponse.additionalProperties.toMutableMap() } + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(allowedRefreshes: Long) = + allowedRefreshes(JsonField.of(allowedRefreshes)) + + /** The number of allowed refreshes per hour (per hour, fixed window) */ + fun allowedRefreshes(allowedRefreshes: JsonField) = apply { + this.allowedRefreshes = allowedRefreshes + } + /** The id of the job that has been created. */ fun jobId(jobId: String) = jobId(JsonField.of(jobId)) @@ -110,15 +119,6 @@ private constructor( /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(allowedRefreshes: Long) = - allowedRefreshes(JsonField.of(allowedRefreshes)) - - /** The number of allowed refreshes per hour (per hour, fixed window) */ - fun allowedRefreshes(allowedRefreshes: JsonField) = apply { - this.allowedRefreshes = allowedRefreshes - } - /** The number of remaining refreshes available (per hour, fixed window) */ fun remainingRefreshes(remainingRefreshes: Long) = remainingRefreshes(JsonField.of(remainingRefreshes)) @@ -149,9 +149,9 @@ private constructor( fun build(): JobCreateResponse = JobCreateResponse( + allowedRefreshes, jobId, jobUrl, - allowedRefreshes, remainingRefreshes, additionalProperties.toImmutable(), ) @@ -162,15 +162,15 @@ private constructor( return true } - return /* spotless:off */ other is JobCreateResponse && jobId == other.jobId && jobUrl == other.jobUrl && allowedRefreshes == other.allowedRefreshes && remainingRefreshes == other.remainingRefreshes && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is JobCreateResponse && allowedRefreshes == other.allowedRefreshes && jobId == other.jobId && jobUrl == other.jobUrl && remainingRefreshes == other.remainingRefreshes && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(jobId, jobUrl, allowedRefreshes, remainingRefreshes, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(allowedRefreshes, jobId, jobUrl, remainingRefreshes, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "JobCreateResponse{jobId=$jobId, jobUrl=$jobUrl, allowedRefreshes=$allowedRefreshes, remainingRefreshes=$remainingRefreshes, additionalProperties=$additionalProperties}" + "JobCreateResponse{allowedRefreshes=$allowedRefreshes, jobId=$jobId, jobUrl=$jobUrl, remainingRefreshes=$remainingRefreshes, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt index 3c6f51a9..1ec9a5cb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Location.kt @@ -20,44 +20,50 @@ import java.util.Optional class Location @JsonCreator private constructor( - @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), - @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("postal_code") - @ExcludeMissing - private val postalCode: JsonField = JsonMissing.of(), @JsonProperty("country") @ExcludeMissing private val country: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), @JsonProperty("source_id") @ExcludeMissing private val sourceId: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** City, district, suburb, town, or village. */ + fun city(): Optional = Optional.ofNullable(city.getNullable("city")) + + /** The 2-letter ISO 3166 country code. */ + fun country(): Optional = Optional.ofNullable(country.getNullable("country")) + /** Street address or PO box. */ fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) /** Apartment, suite, unit, or building. */ fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2")) - /** City, district, suburb, town, or village. */ - fun city(): Optional = Optional.ofNullable(city.getNullable("city")) - - /** The state code. */ - fun state(): Optional = Optional.ofNullable(state.getNullable("state")) + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** The postal code or zip code. */ fun postalCode(): Optional = Optional.ofNullable(postalCode.getNullable("postal_code")) - /** The 2-letter ISO 3166 country code. */ - fun country(): Optional = Optional.ofNullable(country.getNullable("country")) + fun sourceId(): Optional = Optional.ofNullable(sourceId.getNullable("source_id")) - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + /** The state code. */ + fun state(): Optional = Optional.ofNullable(state.getNullable("state")) - fun sourceId(): Optional = Optional.ofNullable(sourceId.getNullable("source_id")) + /** City, district, suburb, town, or village. */ + @JsonProperty("city") @ExcludeMissing fun _city() = city + + /** The 2-letter ISO 3166 country code. */ + @JsonProperty("country") @ExcludeMissing fun _country() = country /** Street address or PO box. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 @@ -65,22 +71,16 @@ private constructor( /** Apartment, suite, unit, or building. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 - /** City, district, suburb, town, or village. */ - @JsonProperty("city") @ExcludeMissing fun _city() = city - - /** The state code. */ - @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonProperty("name") @ExcludeMissing fun _name() = name /** The postal code or zip code. */ @JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode - /** The 2-letter ISO 3166 country code. */ - @JsonProperty("country") @ExcludeMissing fun _country() = country - - @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("source_id") @ExcludeMissing fun _sourceId() = sourceId + /** The state code. */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -89,14 +89,14 @@ private constructor( fun validate(): Location = apply { if (!validated) { - line1() - line2() city() - state() - postalCode() country() + line1() + line2() name() + postalCode() sourceId() + state() validated = true } } @@ -110,29 +110,41 @@ private constructor( 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 line1: JsonField = JsonMissing.of() + private var line2: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var postalCode: JsonField = JsonMissing.of() private var sourceId: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(location: Location) = apply { - line1 = location.line1 - line2 = location.line2 city = location.city - state = location.state - postalCode = location.postalCode country = location.country + line1 = location.line1 + line2 = location.line2 name = location.name + postalCode = location.postalCode sourceId = location.sourceId + state = location.state additionalProperties = location.additionalProperties.toMutableMap() } + /** City, district, suburb, town, or village. */ + fun city(city: String) = city(JsonField.of(city)) + + /** City, district, suburb, town, or village. */ + fun city(city: JsonField) = apply { this.city = city } + + /** The 2-letter ISO 3166 country code. */ + fun country(country: String) = country(JsonField.of(country)) + + /** The 2-letter ISO 3166 country code. */ + fun country(country: JsonField) = apply { this.country = country } + /** Street address or PO box. */ fun line1(line1: String) = line1(JsonField.of(line1)) @@ -145,17 +157,9 @@ private constructor( /** Apartment, suite, unit, or building. */ fun line2(line2: JsonField) = apply { this.line2 = line2 } - /** City, district, suburb, town, or village. */ - fun city(city: String) = city(JsonField.of(city)) - - /** City, district, suburb, town, or village. */ - fun city(city: JsonField) = apply { this.city = city } - - /** The state code. */ - fun state(state: String) = state(JsonField.of(state)) + fun name(name: String) = name(JsonField.of(name)) - /** The state code. */ - fun state(state: JsonField) = apply { this.state = state } + fun name(name: JsonField) = apply { this.name = name } /** The postal code or zip code. */ fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) @@ -163,20 +167,16 @@ private constructor( /** The postal code or zip code. */ fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - /** The 2-letter ISO 3166 country code. */ - fun country(country: String) = country(JsonField.of(country)) - - /** The 2-letter ISO 3166 country code. */ - fun country(country: JsonField) = apply { this.country = country } - - fun name(name: String) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId)) fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId } + /** The state code. */ + fun state(state: String) = state(JsonField.of(state)) + + /** The state code. */ + fun state(state: JsonField) = apply { this.state = state } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -198,14 +198,14 @@ private constructor( fun build(): Location = Location( - line1, - line2, city, - state, - postalCode, country, + line1, + line2, name, + postalCode, sourceId, + state, additionalProperties.toImmutable(), ) } @@ -215,15 +215,15 @@ private constructor( return true } - return /* spotless:off */ other is Location && line1 == other.line1 && line2 == other.line2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && name == other.name && sourceId == other.sourceId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Location && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && name == other.name && postalCode == other.postalCode && sourceId == other.sourceId && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(line1, line2, city, state, postalCode, country, name, sourceId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, name, postalCode, sourceId, state, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Location{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, name=$name, sourceId=$sourceId, additionalProperties=$additionalProperties}" + "Location{city=$city, country=$country, line1=$line1, line2=$line2, name=$name, postalCode=$postalCode, sourceId=$sourceId, state=$state, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt index 5799ba8e..e5969d97 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt @@ -22,30 +22,30 @@ import java.util.Optional class ManualAsyncJob @JsonCreator private constructor( + @JsonProperty("body") + @ExcludeMissing + private val body: JsonField> = JsonMissing.of(), @JsonProperty("job_id") @ExcludeMissing private val jobId: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("body") - @ExcludeMissing - private val body: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Specific information about the job, such as individual statuses for batch jobs. */ + fun body(): Optional> = Optional.ofNullable(body.getNullable("body")) + fun jobId(): String = jobId.getRequired("job_id") fun status(): Status = status.getRequired("status") /** Specific information about the job, such as individual statuses for batch jobs. */ - fun body(): Optional> = Optional.ofNullable(body.getNullable("body")) + @JsonProperty("body") @ExcludeMissing fun _body() = body @JsonProperty("job_id") @ExcludeMissing fun _jobId() = jobId @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Specific information about the job, such as individual statuses for batch jobs. */ - @JsonProperty("body") @ExcludeMissing fun _body() = body - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -54,9 +54,9 @@ private constructor( fun validate(): ManualAsyncJob = apply { if (!validated) { + body() jobId() status() - body() validated = true } } @@ -70,19 +70,25 @@ private constructor( class Builder { + private var body: JsonField> = JsonMissing.of() private var jobId: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var body: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(manualAsyncJob: ManualAsyncJob) = apply { + body = manualAsyncJob.body jobId = manualAsyncJob.jobId status = manualAsyncJob.status - body = manualAsyncJob.body additionalProperties = manualAsyncJob.additionalProperties.toMutableMap() } + /** Specific information about the job, such as individual statuses for batch jobs. */ + fun body(body: List) = body(JsonField.of(body)) + + /** Specific information about the job, such as individual statuses for batch jobs. */ + fun body(body: JsonField>) = apply { this.body = body } + fun jobId(jobId: String) = jobId(JsonField.of(jobId)) fun jobId(jobId: JsonField) = apply { this.jobId = jobId } @@ -91,12 +97,6 @@ private constructor( fun status(status: JsonField) = apply { this.status = status } - /** Specific information about the job, such as individual statuses for batch jobs. */ - fun body(body: List) = body(JsonField.of(body)) - - /** Specific information about the job, such as individual statuses for batch jobs. */ - fun body(body: JsonField>) = apply { this.body = body } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -118,9 +118,9 @@ private constructor( fun build(): ManualAsyncJob = ManualAsyncJob( + body.map { it.toImmutable() }, jobId, status, - body.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -199,15 +199,15 @@ private constructor( return true } - return /* spotless:off */ other is ManualAsyncJob && jobId == other.jobId && status == other.status && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ManualAsyncJob && body == other.body && jobId == other.jobId && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(jobId, status, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, jobId, status, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ManualAsyncJob{jobId=$jobId, status=$status, body=$body, additionalProperties=$additionalProperties}" + "ManualAsyncJob{body=$body, jobId=$jobId, status=$status, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt index 527f4708..2e2ed02d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt @@ -23,15 +23,15 @@ private constructor( @JsonProperty("create") @ExcludeMissing private val create: JsonField = JsonMissing.of(), - @JsonProperty("update") - @ExcludeMissing - private val update: JsonField = JsonMissing.of(), @JsonProperty("delete") @ExcludeMissing private val delete: JsonField = JsonMissing.of(), @JsonProperty("read") @ExcludeMissing private val read: JsonField = JsonMissing.of(), + @JsonProperty("update") + @ExcludeMissing + private val update: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -55,7 +55,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - fun update(): Optional = Optional.ofNullable(update.getNullable("update")) + fun delete(): Optional = Optional.ofNullable(delete.getNullable("delete")) /** * - `supported`: This operation is supported by both the provider and Finch @@ -66,7 +66,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - fun delete(): Optional = Optional.ofNullable(delete.getNullable("delete")) + fun read(): Optional = Optional.ofNullable(read.getNullable("read")) /** * - `supported`: This operation is supported by both the provider and Finch @@ -77,7 +77,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - fun read(): Optional = Optional.ofNullable(read.getNullable("read")) + fun update(): Optional = Optional.ofNullable(update.getNullable("update")) /** * - `supported`: This operation is supported by both the provider and Finch @@ -99,7 +99,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - @JsonProperty("update") @ExcludeMissing fun _update() = update + @JsonProperty("delete") @ExcludeMissing fun _delete() = delete /** * - `supported`: This operation is supported by both the provider and Finch @@ -110,7 +110,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - @JsonProperty("delete") @ExcludeMissing fun _delete() = delete + @JsonProperty("read") @ExcludeMissing fun _read() = read /** * - `supported`: This operation is supported by both the provider and Finch @@ -121,7 +121,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to the * client and not to Finch */ - @JsonProperty("read") @ExcludeMissing fun _read() = read + @JsonProperty("update") @ExcludeMissing fun _update() = update @JsonAnyGetter @ExcludeMissing @@ -132,9 +132,9 @@ private constructor( fun validate(): OperationSupportMatrix = apply { if (!validated) { create() - update() delete() read() + update() validated = true } } @@ -149,17 +149,17 @@ private constructor( class Builder { private var create: JsonField = JsonMissing.of() - private var update: JsonField = JsonMissing.of() private var delete: JsonField = JsonMissing.of() private var read: JsonField = JsonMissing.of() + private var update: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(operationSupportMatrix: OperationSupportMatrix) = apply { create = operationSupportMatrix.create - update = operationSupportMatrix.update delete = operationSupportMatrix.delete read = operationSupportMatrix.read + update = operationSupportMatrix.update additionalProperties = operationSupportMatrix.additionalProperties.toMutableMap() } @@ -194,7 +194,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun update(update: OperationSupport) = update(JsonField.of(update)) + fun delete(delete: OperationSupport) = delete(JsonField.of(delete)) /** * - `supported`: This operation is supported by both the provider and Finch @@ -205,7 +205,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun update(update: JsonField) = apply { this.update = update } + fun delete(delete: JsonField) = apply { this.delete = delete } /** * - `supported`: This operation is supported by both the provider and Finch @@ -216,7 +216,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun delete(delete: OperationSupport) = delete(JsonField.of(delete)) + fun read(read: OperationSupport) = read(JsonField.of(read)) /** * - `supported`: This operation is supported by both the provider and Finch @@ -227,7 +227,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun delete(delete: JsonField) = apply { this.delete = delete } + fun read(read: JsonField) = apply { this.read = read } /** * - `supported`: This operation is supported by both the provider and Finch @@ -238,7 +238,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun read(read: OperationSupport) = read(JsonField.of(read)) + fun update(update: OperationSupport) = update(JsonField.of(update)) /** * - `supported`: This operation is supported by both the provider and Finch @@ -249,7 +249,7 @@ private constructor( * - `client_access_only`: This behavior is supported by the provider, but only available to * the client and not to Finch */ - fun read(read: JsonField) = apply { this.read = read } + fun update(update: JsonField) = apply { this.update = update } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -273,9 +273,9 @@ private constructor( fun build(): OperationSupportMatrix = OperationSupportMatrix( create, - update, delete, read, + update, additionalProperties.toImmutable(), ) } @@ -285,15 +285,15 @@ private constructor( return true } - return /* spotless:off */ other is OperationSupportMatrix && create == other.create && update == other.update && delete == other.delete && read == other.read && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is OperationSupportMatrix && create == other.create && delete == other.delete && read == other.read && update == other.update && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(create, update, delete, read, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(create, delete, read, update, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "OperationSupportMatrix{create=$create, update=$update, delete=$delete, read=$read, additionalProperties=$additionalProperties}" + "OperationSupportMatrix{create=$create, delete=$delete, read=$read, update=$update, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt index 390bd017..583c9ac3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt @@ -22,38 +22,38 @@ class PayGroupRetrieveResponse @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField> = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("pay_frequencies") @ExcludeMissing private val payFrequencies: JsonField> = JsonMissing.of(), - @JsonProperty("individual_ids") - @ExcludeMissing - private val individualIds: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Finch id (uuidv4) for the pay group */ fun id(): String = id.getRequired("id") + fun individualIds(): List = individualIds.getRequired("individual_ids") + /** Name of the pay group */ fun name(): String = name.getRequired("name") /** List of pay frequencies associated with this pay group */ fun payFrequencies(): List = payFrequencies.getRequired("pay_frequencies") - fun individualIds(): List = individualIds.getRequired("individual_ids") - /** Finch id (uuidv4) for the pay group */ @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds + /** Name of the pay group */ @JsonProperty("name") @ExcludeMissing fun _name() = name /** List of pay frequencies associated with this pay group */ @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies - @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -63,9 +63,9 @@ private constructor( fun validate(): PayGroupRetrieveResponse = apply { if (!validated) { id() + individualIds() name() payFrequencies() - individualIds() validated = true } } @@ -80,17 +80,17 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var individualIds: JsonField> = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var payFrequencies: JsonField> = JsonMissing.of() - private var individualIds: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payGroupRetrieveResponse: PayGroupRetrieveResponse) = apply { id = payGroupRetrieveResponse.id + individualIds = payGroupRetrieveResponse.individualIds name = payGroupRetrieveResponse.name payFrequencies = payGroupRetrieveResponse.payFrequencies - individualIds = payGroupRetrieveResponse.individualIds additionalProperties = payGroupRetrieveResponse.additionalProperties.toMutableMap() } @@ -100,6 +100,12 @@ private constructor( /** Finch id (uuidv4) for the pay group */ fun id(id: JsonField) = apply { this.id = id } + fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) + + fun individualIds(individualIds: JsonField>) = apply { + this.individualIds = individualIds + } + /** Name of the pay group */ fun name(name: String) = name(JsonField.of(name)) @@ -115,12 +121,6 @@ private constructor( this.payFrequencies = payFrequencies } - fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) - - fun individualIds(individualIds: JsonField>) = apply { - this.individualIds = individualIds - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -143,9 +143,9 @@ private constructor( fun build(): PayGroupRetrieveResponse = PayGroupRetrieveResponse( id, + individualIds.map { it.toImmutable() }, name, payFrequencies.map { it.toImmutable() }, - individualIds.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -254,15 +254,15 @@ private constructor( return true } - return /* spotless:off */ other is PayGroupRetrieveResponse && id == other.id && name == other.name && payFrequencies == other.payFrequencies && individualIds == other.individualIds && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayGroupRetrieveResponse && id == other.id && individualIds == other.individualIds && name == other.name && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, payFrequencies, individualIds, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, individualIds, name, payFrequencies, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayGroupRetrieveResponse{id=$id, name=$name, payFrequencies=$payFrequencies, individualIds=$individualIds, additionalProperties=$additionalProperties}" + "PayGroupRetrieveResponse{id=$id, individualIds=$individualIds, name=$name, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt index 76a86f01..a39df463 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt @@ -22,61 +22,40 @@ import java.util.Optional class PayStatement @JsonCreator private constructor( - @JsonProperty("individual_id") + @JsonProperty("earnings") @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("payment_method") + private val earnings: JsonField> = JsonMissing.of(), + @JsonProperty("employee_deductions") @ExcludeMissing - private val paymentMethod: JsonField = JsonMissing.of(), - @JsonProperty("total_hours") + private val employeeDeductions: JsonField> = JsonMissing.of(), + @JsonProperty("employer_contributions") @ExcludeMissing - private val totalHours: JsonField = JsonMissing.of(), + private val employerContributions: JsonField> = JsonMissing.of(), @JsonProperty("gross_pay") @ExcludeMissing private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), @JsonProperty("net_pay") @ExcludeMissing private val netPay: JsonField = JsonMissing.of(), - @JsonProperty("earnings") + @JsonProperty("payment_method") @ExcludeMissing - private val earnings: JsonField> = JsonMissing.of(), + private val paymentMethod: JsonField = JsonMissing.of(), @JsonProperty("taxes") @ExcludeMissing private val taxes: JsonField> = JsonMissing.of(), - @JsonProperty("employee_deductions") - @ExcludeMissing - private val employeeDeductions: JsonField> = JsonMissing.of(), - @JsonProperty("employer_contributions") + @JsonProperty("total_hours") @ExcludeMissing - private val employerContributions: JsonField> = JsonMissing.of(), + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** A stable Finch `id` (UUID v4) for an individual in the company */ - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) - - /** The type of the payment associated with the pay statement. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - - /** The payment method. */ - fun paymentMethod(): Optional = - Optional.ofNullable(paymentMethod.getNullable("payment_method")) - - /** The number of hours worked for this pay period */ - fun totalHours(): Optional = Optional.ofNullable(totalHours.getNullable("total_hours")) - - fun grossPay(): Optional = Optional.ofNullable(grossPay.getNullable("gross_pay")) - - fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) - /** The array of earnings objects associated with this pay statement */ fun earnings(): Optional> = Optional.ofNullable(earnings.getNullable("earnings")) - /** The array of taxes objects associated with this pay statement. */ - fun taxes(): Optional> = Optional.ofNullable(taxes.getNullable("taxes")) - /** The array of deductions objects associated with this pay statement. */ fun employeeDeductions(): Optional> = Optional.ofNullable(employeeDeductions.getNullable("employee_deductions")) @@ -84,28 +63,30 @@ private constructor( fun employerContributions(): Optional> = Optional.ofNullable(employerContributions.getNullable("employer_contributions")) + fun grossPay(): Optional = Optional.ofNullable(grossPay.getNullable("gross_pay")) + /** A stable Finch `id` (UUID v4) for an individual in the company */ - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - /** The type of the payment associated with the pay statement. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) /** The payment method. */ - @JsonProperty("payment_method") @ExcludeMissing fun _paymentMethod() = paymentMethod + fun paymentMethod(): Optional = + Optional.ofNullable(paymentMethod.getNullable("payment_method")) - /** The number of hours worked for this pay period */ - @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + /** The array of taxes objects associated with this pay statement. */ + fun taxes(): Optional> = Optional.ofNullable(taxes.getNullable("taxes")) - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + /** The number of hours worked for this pay period */ + fun totalHours(): Optional = Optional.ofNullable(totalHours.getNullable("total_hours")) - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + /** The type of the payment associated with the pay statement. */ + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** The array of earnings objects associated with this pay statement */ @JsonProperty("earnings") @ExcludeMissing fun _earnings() = earnings - /** The array of taxes objects associated with this pay statement. */ - @JsonProperty("taxes") @ExcludeMissing fun _taxes() = taxes - /** The array of deductions objects associated with this pay statement. */ @JsonProperty("employee_deductions") @ExcludeMissing @@ -115,6 +96,25 @@ private constructor( @ExcludeMissing fun _employerContributions() = employerContributions + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + + /** A stable Finch `id` (UUID v4) for an individual in the company */ + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + + /** The payment method. */ + @JsonProperty("payment_method") @ExcludeMissing fun _paymentMethod() = paymentMethod + + /** The array of taxes objects associated with this pay statement. */ + @JsonProperty("taxes") @ExcludeMissing fun _taxes() = taxes + + /** The number of hours worked for this pay period */ + @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + + /** The type of the payment associated with the pay statement. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -123,16 +123,16 @@ private constructor( fun validate(): PayStatement = apply { if (!validated) { - individualId() - type() - paymentMethod() - totalHours() - grossPay().map { it.validate() } - netPay().map { it.validate() } earnings().map { it.forEach { it?.validate() } } - taxes().map { it.forEach { it?.validate() } } employeeDeductions().map { it.forEach { it?.validate() } } employerContributions().map { it.forEach { it?.validate() } } + grossPay().map { it.validate() } + individualId() + netPay().map { it.validate() } + paymentMethod() + taxes().map { it.forEach { it?.validate() } } + totalHours() + type() validated = true } } @@ -146,33 +146,60 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var paymentMethod: JsonField = JsonMissing.of() - private var totalHours: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() private var earnings: JsonField> = JsonMissing.of() - private var taxes: JsonField> = JsonMissing.of() private var employeeDeductions: JsonField> = JsonMissing.of() private var employerContributions: JsonField> = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var paymentMethod: JsonField = JsonMissing.of() + private var taxes: JsonField> = JsonMissing.of() + private var totalHours: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatement: PayStatement) = apply { - individualId = payStatement.individualId - type = payStatement.type - paymentMethod = payStatement.paymentMethod - totalHours = payStatement.totalHours - grossPay = payStatement.grossPay - netPay = payStatement.netPay earnings = payStatement.earnings - taxes = payStatement.taxes employeeDeductions = payStatement.employeeDeductions employerContributions = payStatement.employerContributions + grossPay = payStatement.grossPay + individualId = payStatement.individualId + netPay = payStatement.netPay + paymentMethod = payStatement.paymentMethod + taxes = payStatement.taxes + totalHours = payStatement.totalHours + type = payStatement.type additionalProperties = payStatement.additionalProperties.toMutableMap() } + /** The array of earnings objects associated with this pay statement */ + fun earnings(earnings: List) = earnings(JsonField.of(earnings)) + + /** The array of earnings objects associated with this pay statement */ + fun earnings(earnings: JsonField>) = apply { this.earnings = earnings } + + /** The array of deductions objects associated with this pay statement. */ + fun employeeDeductions(employeeDeductions: List) = + employeeDeductions(JsonField.of(employeeDeductions)) + + /** The array of deductions objects associated with this pay statement. */ + fun employeeDeductions(employeeDeductions: JsonField>) = apply { + this.employeeDeductions = employeeDeductions + } + + fun employerContributions(employerContributions: List) = + employerContributions(JsonField.of(employerContributions)) + + fun employerContributions(employerContributions: JsonField>) = + apply { + this.employerContributions = employerContributions + } + + fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) + + fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } + /** A stable Finch `id` (UUID v4) for an individual in the company */ fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -181,11 +208,9 @@ private constructor( this.individualId = individualId } - /** The type of the payment associated with the pay statement. */ - fun type(type: Type) = type(JsonField.of(type)) + fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) - /** The type of the payment associated with the pay statement. */ - fun type(type: JsonField) = apply { this.type = type } + fun netPay(netPay: JsonField) = apply { this.netPay = netPay } /** The payment method. */ fun paymentMethod(paymentMethod: PaymentMethod) = paymentMethod(JsonField.of(paymentMethod)) @@ -195,48 +220,23 @@ private constructor( this.paymentMethod = paymentMethod } - /** The number of hours worked for this pay period */ - fun totalHours(totalHours: Double) = totalHours(JsonField.of(totalHours)) - - /** The number of hours worked for this pay period */ - fun totalHours(totalHours: JsonField) = apply { this.totalHours = totalHours } - - fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) - - fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } - - fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) - - fun netPay(netPay: JsonField) = apply { this.netPay = netPay } - - /** The array of earnings objects associated with this pay statement */ - fun earnings(earnings: List) = earnings(JsonField.of(earnings)) - - /** The array of earnings objects associated with this pay statement */ - fun earnings(earnings: JsonField>) = apply { this.earnings = earnings } - /** The array of taxes objects associated with this pay statement. */ fun taxes(taxes: List) = taxes(JsonField.of(taxes)) /** The array of taxes objects associated with this pay statement. */ fun taxes(taxes: JsonField>) = apply { this.taxes = taxes } - /** The array of deductions objects associated with this pay statement. */ - fun employeeDeductions(employeeDeductions: List) = - employeeDeductions(JsonField.of(employeeDeductions)) + /** The number of hours worked for this pay period */ + fun totalHours(totalHours: Double) = totalHours(JsonField.of(totalHours)) - /** The array of deductions objects associated with this pay statement. */ - fun employeeDeductions(employeeDeductions: JsonField>) = apply { - this.employeeDeductions = employeeDeductions - } + /** The number of hours worked for this pay period */ + fun totalHours(totalHours: JsonField) = apply { this.totalHours = totalHours } - fun employerContributions(employerContributions: List) = - employerContributions(JsonField.of(employerContributions)) + /** The type of the payment associated with the pay statement. */ + fun type(type: Type) = type(JsonField.of(type)) - fun employerContributions(employerContributions: JsonField>) = - apply { - this.employerContributions = employerContributions - } + /** The type of the payment associated with the pay statement. */ + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -259,16 +259,16 @@ private constructor( fun build(): PayStatement = PayStatement( - individualId, - type, - paymentMethod, - totalHours, - grossPay, - netPay, earnings.map { it.toImmutable() }, - taxes.map { it.toImmutable() }, employeeDeductions.map { it.toImmutable() }, employerContributions.map { it.toImmutable() }, + grossPay, + individualId, + netPay, + paymentMethod, + taxes.map { it.toImmutable() }, + totalHours, + type, additionalProperties.toImmutable(), ) } @@ -277,10 +277,6 @@ private constructor( class Earning @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @@ -290,16 +286,14 @@ private constructor( @JsonProperty("hours") @ExcludeMissing private val hours: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of earning. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - - /** The exact name of the deduction from the pay statement. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** The earnings amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) @@ -312,11 +306,11 @@ private constructor( */ fun hours(): Optional = Optional.ofNullable(hours.getNullable("hours")) - /** The type of earning. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - /** The exact name of the deduction from the pay statement. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + + /** The type of earning. */ + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** The earnings amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @@ -330,6 +324,12 @@ private constructor( */ @JsonProperty("hours") @ExcludeMissing fun _hours() = hours + /** The exact name of the deduction from the pay statement. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The type of earning. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -338,11 +338,11 @@ private constructor( fun validate(): Earning = apply { if (!validated) { - type() - name() amount() currency() hours() + name() + type() validated = true } } @@ -356,35 +356,23 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var hours: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(earning: Earning) = apply { - type = earning.type - name = earning.name amount = earning.amount currency = earning.currency hours = earning.hours + name = earning.name + type = earning.type additionalProperties = earning.additionalProperties.toMutableMap() } - /** The type of earning. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The type of earning. */ - fun type(type: JsonField) = apply { this.type = type } - - /** The exact name of the deduction from the pay statement. */ - fun name(name: String) = name(JsonField.of(name)) - - /** The exact name of the deduction from the pay statement. */ - fun name(name: JsonField) = apply { this.name = name } - /** The earnings amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -409,6 +397,18 @@ private constructor( */ fun hours(hours: JsonField) = apply { this.hours = hours } + /** The exact name of the deduction from the pay statement. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The exact name of the deduction from the pay statement. */ + fun name(name: JsonField) = apply { this.name = name } + + /** The type of earning. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The type of earning. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -430,11 +430,11 @@ private constructor( fun build(): Earning = Earning( - type, - name, amount, currency, hours, + name, + type, additionalProperties.toImmutable(), ) } @@ -567,32 +567,32 @@ private constructor( return true } - return /* spotless:off */ other is Earning && type == other.type && name == other.name && amount == other.amount && currency == other.currency && hours == other.hours && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earning && amount == other.amount && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, amount, currency, hours, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, hours, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earning{type=$type, name=$name, amount=$amount, currency=$currency, hours=$hours, additionalProperties=$additionalProperties}" + "Earning{amount=$amount, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployeeDeduction @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonProperty("pre_tax") @ExcludeMissing private val preTax: JsonField = JsonMissing.of(), @@ -603,30 +603,30 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The deduction name from the pay statement. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** The deduction amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) /** The deduction currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) + /** The deduction name from the pay statement. */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + /** Boolean indicating if the deduction is pre-tax. */ fun preTax(): Optional = Optional.ofNullable(preTax.getNullable("pre_tax")) /** Type of benefit. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** The deduction name from the pay statement. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name - /** The deduction amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount /** The deduction currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The deduction name from the pay statement. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Boolean indicating if the deduction is pre-tax. */ @JsonProperty("pre_tax") @ExcludeMissing fun _preTax() = preTax @@ -641,9 +641,9 @@ private constructor( fun validate(): EmployeeDeduction = apply { if (!validated) { - name() amount() currency() + name() preTax() type() validated = true @@ -659,29 +659,23 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var preTax: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { - name = employeeDeduction.name amount = employeeDeduction.amount currency = employeeDeduction.currency + name = employeeDeduction.name preTax = employeeDeduction.preTax type = employeeDeduction.type additionalProperties = employeeDeduction.additionalProperties.toMutableMap() } - /** The deduction name from the pay statement. */ - fun name(name: String) = name(JsonField.of(name)) - - /** The deduction name from the pay statement. */ - fun name(name: JsonField) = apply { this.name = name } - /** The deduction amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -694,6 +688,12 @@ private constructor( /** The deduction currency. */ fun currency(currency: JsonField) = apply { this.currency = currency } + /** The deduction name from the pay statement. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The deduction name from the pay statement. */ + fun name(name: JsonField) = apply { this.name = name } + /** Boolean indicating if the deduction is pre-tax. */ fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) @@ -727,9 +727,9 @@ private constructor( fun build(): EmployeeDeduction = EmployeeDeduction( - name, amount, currency, + name, preTax, type, additionalProperties.toImmutable(), @@ -741,32 +741,32 @@ private constructor( return true } - return /* spotless:off */ other is EmployeeDeduction && name == other.name && amount == other.amount && currency == other.currency && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, preTax, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeduction{name=$name, amount=$amount, currency=$currency, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" + "EmployeeDeduction{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployerContribution @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @@ -774,27 +774,27 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The contribution name from the pay statement. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** The contribution amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) /** The contribution currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) + /** The contribution name from the pay statement. */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + /** Type of benefit. */ fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - /** The contribution name from the pay statement. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name - /** The contribution amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount /** The contribution currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The contribution name from the pay statement. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Type of benefit. */ @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -806,9 +806,9 @@ private constructor( fun validate(): EmployerContribution = apply { if (!validated) { - name() amount() currency() + name() type() validated = true } @@ -823,27 +823,21 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { - name = employerContribution.name amount = employerContribution.amount currency = employerContribution.currency + name = employerContribution.name type = employerContribution.type additionalProperties = employerContribution.additionalProperties.toMutableMap() } - /** The contribution name from the pay statement. */ - fun name(name: String) = name(JsonField.of(name)) - - /** The contribution name from the pay statement. */ - fun name(name: JsonField) = apply { this.name = name } - /** The contribution amount in cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -856,6 +850,12 @@ private constructor( /** The contribution currency. */ fun currency(currency: JsonField) = apply { this.currency = currency } + /** The contribution name from the pay statement. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The contribution name from the pay statement. */ + fun name(name: JsonField) = apply { this.name = name } + /** Type of benefit. */ fun type(type: BenefitType) = type(JsonField.of(type)) @@ -883,9 +883,9 @@ private constructor( fun build(): EmployerContribution = EmployerContribution( - name, amount, currency, + name, type, additionalProperties.toImmutable(), ) @@ -896,17 +896,17 @@ private constructor( return true } - return /* spotless:off */ other is EmployerContribution && name == other.name && amount == other.amount && currency == other.currency && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContribution && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContribution{name=$name, amount=$amount, currency=$currency, type=$type, additionalProperties=$additionalProperties}" + "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } class PaymentMethod @@ -970,46 +970,37 @@ private constructor( class Tax @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), - @JsonProperty("employer") - @ExcludeMissing - private val employer: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("employer") + @ExcludeMissing + private val employer: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of taxes. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - - /** The exact name of tax from the pay statement. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - - /** `true` if the amount is paid by the employers. */ - fun employer(): Optional = Optional.ofNullable(employer.getNullable("employer")) - /** The tax amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) /** The currency code. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - /** The type of taxes. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** `true` if the amount is paid by the employers. */ + fun employer(): Optional = Optional.ofNullable(employer.getNullable("employer")) /** The exact name of tax from the pay statement. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** `true` if the amount is paid by the employers. */ - @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + /** The type of taxes. */ + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** The tax amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @@ -1017,6 +1008,15 @@ private constructor( /** The currency code. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** `true` if the amount is paid by the employers. */ + @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + + /** The exact name of tax from the pay statement. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The type of taxes. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1025,11 +1025,11 @@ private constructor( fun validate(): Tax = apply { if (!validated) { - type() - name() - employer() amount() currency() + employer() + name() + type() validated = true } } @@ -1043,34 +1043,34 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var employer: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var employer: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(tax: Tax) = apply { - type = tax.type - name = tax.name - employer = tax.employer amount = tax.amount currency = tax.currency + employer = tax.employer + name = tax.name + type = tax.type additionalProperties = tax.additionalProperties.toMutableMap() } - /** The type of taxes. */ - fun type(type: Type) = type(JsonField.of(type)) + /** The tax amount in cents. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) - /** The type of taxes. */ - fun type(type: JsonField) = apply { this.type = type } + /** The tax amount in cents. */ + fun amount(amount: JsonField) = apply { this.amount = amount } - /** The exact name of tax from the pay statement. */ - fun name(name: String) = name(JsonField.of(name)) + /** The currency code. */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** The exact name of tax from the pay statement. */ - fun name(name: JsonField) = apply { this.name = name } + /** The currency code. */ + fun currency(currency: JsonField) = apply { this.currency = currency } /** `true` if the amount is paid by the employers. */ fun employer(employer: Boolean) = employer(JsonField.of(employer)) @@ -1078,17 +1078,17 @@ private constructor( /** `true` if the amount is paid by the employers. */ fun employer(employer: JsonField) = apply { this.employer = employer } - /** The tax amount in cents. */ - fun amount(amount: Long) = amount(JsonField.of(amount)) + /** The exact name of tax from the pay statement. */ + fun name(name: String) = name(JsonField.of(name)) - /** The tax amount in cents. */ - fun amount(amount: JsonField) = apply { this.amount = amount } + /** The exact name of tax from the pay statement. */ + fun name(name: JsonField) = apply { this.name = name } - /** The currency code. */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The type of taxes. */ + fun type(type: Type) = type(JsonField.of(type)) - /** The currency code. */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The type of taxes. */ + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1111,11 +1111,11 @@ private constructor( fun build(): Tax = Tax( - type, - name, - employer, amount, currency, + employer, + name, + type, additionalProperties.toImmutable(), ) } @@ -1194,17 +1194,17 @@ private constructor( return true } - return /* spotless:off */ other is Tax && type == other.type && name == other.name && employer == other.employer && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tax && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, employer, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tax{type=$type, name=$name, employer=$employer, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } class Type @@ -1275,15 +1275,15 @@ private constructor( return true } - return /* spotless:off */ other is PayStatement && individualId == other.individualId && type == other.type && paymentMethod == other.paymentMethod && totalHours == other.totalHours && grossPay == other.grossPay && netPay == other.netPay && earnings == other.earnings && taxes == other.taxes && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatement && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && grossPay == other.grossPay && individualId == other.individualId && netPay == other.netPay && paymentMethod == other.paymentMethod && taxes == other.taxes && totalHours == other.totalHours && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, type, paymentMethod, totalHours, grossPay, netPay, earnings, taxes, employeeDeductions, employerContributions, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(earnings, employeeDeductions, employerContributions, grossPay, individualId, netPay, paymentMethod, taxes, totalHours, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatement{individualId=$individualId, type=$type, paymentMethod=$paymentMethod, totalHours=$totalHours, grossPay=$grossPay, netPay=$netPay, earnings=$earnings, taxes=$taxes, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, additionalProperties=$additionalProperties}" + "PayStatement{earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, grossPay=$grossPay, individualId=$individualId, netPay=$netPay, paymentMethod=$paymentMethod, taxes=$taxes, totalHours=$totalHours, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt index 2729b01a..46c7db05 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt @@ -22,81 +22,81 @@ import java.util.Optional class PayStatementEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") + @JsonProperty("connection_id") @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): PayStatementEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -110,63 +110,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatementEvent: PayStatementEvent) = apply { - connectionId = payStatementEvent.connectionId - companyId = payStatementEvent.companyId accountId = payStatementEvent.accountId - eventType = payStatementEvent.eventType + companyId = payStatementEvent.companyId + connectionId = payStatementEvent.connectionId data = payStatementEvent.data + eventType = payStatementEvent.eventType additionalProperties = payStatementEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: Data) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -188,11 +188,11 @@ private constructor( fun build(): PayStatementEvent = PayStatementEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -201,29 +201,29 @@ private constructor( class Data @JsonCreator private constructor( - @JsonProperty("payment_id") - @ExcludeMissing - private val paymentId: JsonField = JsonMissing.of(), @JsonProperty("individual_id") @ExcludeMissing private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the payment associated with the pay statement. */ - fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) - /** The ID of the individual associated with the pay statement. */ fun individualId(): Optional = Optional.ofNullable(individualId.getNullable("individual_id")) /** The ID of the payment associated with the pay statement. */ - @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) /** The ID of the individual associated with the pay statement. */ @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + /** The ID of the payment associated with the pay statement. */ + @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -232,8 +232,8 @@ private constructor( fun validate(): Data = apply { if (!validated) { - paymentId() individualId() + paymentId() validated = true } } @@ -247,23 +247,17 @@ private constructor( class Builder { - private var paymentId: JsonField = JsonMissing.of() private var individualId: JsonField = JsonMissing.of() + private var paymentId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(data: Data) = apply { - paymentId = data.paymentId individualId = data.individualId + paymentId = data.paymentId additionalProperties = data.additionalProperties.toMutableMap() } - /** The ID of the payment associated with the pay statement. */ - fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) - - /** The ID of the payment associated with the pay statement. */ - fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } - /** The ID of the individual associated with the pay statement. */ fun individualId(individualId: String) = individualId(JsonField.of(individualId)) @@ -272,6 +266,12 @@ private constructor( this.individualId = individualId } + /** The ID of the payment associated with the pay statement. */ + fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) + + /** The ID of the payment associated with the pay statement. */ + fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -293,8 +293,8 @@ private constructor( fun build(): Data = Data( - paymentId, individualId, + paymentId, additionalProperties.toImmutable(), ) } @@ -304,17 +304,17 @@ private constructor( return true } - return /* spotless:off */ other is Data && paymentId == other.paymentId && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Data && individualId == other.individualId && paymentId == other.paymentId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paymentId, individualId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(individualId, paymentId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Data{paymentId=$paymentId, individualId=$individualId, additionalProperties=$additionalProperties}" + "Data{individualId=$individualId, paymentId=$paymentId, additionalProperties=$additionalProperties}" } class EventType @@ -385,15 +385,15 @@ private constructor( return true } - return /* spotless:off */ other is PayStatementEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatementEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatementEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "PayStatementEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt index 733debfa..5d77697f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt @@ -20,27 +20,27 @@ import java.util.Optional class PayStatementResponse @JsonCreator private constructor( - @JsonProperty("payment_id") - @ExcludeMissing - private val paymentId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun paymentId(): Optional = Optional.ofNullable(paymentId.getNullable("payment_id")) - @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + @JsonProperty("body") @ExcludeMissing fun _body() = body @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId @JsonAnyGetter @ExcludeMissing @@ -50,9 +50,9 @@ private constructor( fun validate(): PayStatementResponse = apply { if (!validated) { - paymentId() - code() body().map { it.validate() } + code() + paymentId() validated = true } } @@ -66,30 +66,30 @@ private constructor( class Builder { - private var paymentId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var paymentId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatementResponse: PayStatementResponse) = apply { - paymentId = payStatementResponse.paymentId - code = payStatementResponse.code body = payStatementResponse.body + code = payStatementResponse.code + paymentId = payStatementResponse.paymentId additionalProperties = payStatementResponse.additionalProperties.toMutableMap() } - fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) + fun body(body: PayStatementResponseBody) = body(JsonField.of(body)) - fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } + fun body(body: JsonField) = apply { this.body = body } fun code(code: Long) = code(JsonField.of(code)) fun code(code: JsonField) = apply { this.code = code } - fun body(body: PayStatementResponseBody) = body(JsonField.of(body)) + fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) - fun body(body: JsonField) = apply { this.body = body } + fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -112,9 +112,9 @@ private constructor( fun build(): PayStatementResponse = PayStatementResponse( - paymentId, - code, body, + code, + paymentId, additionalProperties.toImmutable(), ) } @@ -124,15 +124,15 @@ private constructor( return true } - return /* spotless:off */ other is PayStatementResponse && paymentId == other.paymentId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatementResponse && body == other.body && code == other.code && paymentId == other.paymentId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paymentId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, paymentId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatementResponse{paymentId=$paymentId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "PayStatementResponse{body=$body, code=$code, paymentId=$paymentId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt index 7dca54c0..a5b93d14 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Payment.kt @@ -23,106 +23,106 @@ class Payment @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("pay_period") - @ExcludeMissing - private val payPeriod: JsonField = JsonMissing.of(), - @JsonProperty("pay_date") + @JsonProperty("company_debit") @ExcludeMissing - private val payDate: JsonField = JsonMissing.of(), + private val companyDebit: JsonField = JsonMissing.of(), @JsonProperty("debit_date") @ExcludeMissing private val debitDate: JsonField = JsonMissing.of(), - @JsonProperty("company_debit") + @JsonProperty("employee_taxes") @ExcludeMissing - private val companyDebit: JsonField = JsonMissing.of(), + private val employeeTaxes: JsonField = JsonMissing.of(), + @JsonProperty("employer_taxes") + @ExcludeMissing + private val employerTaxes: JsonField = JsonMissing.of(), @JsonProperty("gross_pay") @ExcludeMissing private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField> = JsonMissing.of(), @JsonProperty("net_pay") @ExcludeMissing private val netPay: JsonField = JsonMissing.of(), - @JsonProperty("employer_taxes") - @ExcludeMissing - private val employerTaxes: JsonField = JsonMissing.of(), - @JsonProperty("employee_taxes") + @JsonProperty("pay_date") @ExcludeMissing - private val employeeTaxes: JsonField = JsonMissing.of(), - @JsonProperty("individual_ids") + private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("pay_frequencies") @ExcludeMissing - private val individualIds: JsonField> = JsonMissing.of(), + private val payFrequencies: JsonField> = JsonMissing.of(), @JsonProperty("pay_group_ids") @ExcludeMissing private val payGroupIds: JsonField> = JsonMissing.of(), - @JsonProperty("pay_frequencies") + @JsonProperty("pay_period") @ExcludeMissing - private val payFrequencies: JsonField> = JsonMissing.of(), + private val payPeriod: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The unique id for the payment. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - /** The pay period object. */ - fun payPeriod(): Optional = Optional.ofNullable(payPeriod.getNullable("pay_period")) - - fun payDate(): Optional = Optional.ofNullable(payDate.getNullable("pay_date")) - - fun debitDate(): Optional = Optional.ofNullable(debitDate.getNullable("debit_date")) - fun companyDebit(): Optional = Optional.ofNullable(companyDebit.getNullable("company_debit")) - fun grossPay(): Optional = Optional.ofNullable(grossPay.getNullable("gross_pay")) + fun debitDate(): Optional = Optional.ofNullable(debitDate.getNullable("debit_date")) - fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) + fun employeeTaxes(): Optional = + Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) fun employerTaxes(): Optional = Optional.ofNullable(employerTaxes.getNullable("employer_taxes")) - fun employeeTaxes(): Optional = - Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) + fun grossPay(): Optional = Optional.ofNullable(grossPay.getNullable("gross_pay")) /** Array of every individual on this payment. */ fun individualIds(): Optional> = Optional.ofNullable(individualIds.getNullable("individual_ids")) - /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ - fun payGroupIds(): Optional> = - Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) + fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) + + fun payDate(): Optional = Optional.ofNullable(payDate.getNullable("pay_date")) /** List of pay frequencies associated with this payment. */ fun payFrequencies(): Optional> = Optional.ofNullable(payFrequencies.getNullable("pay_frequencies")) - /** The unique id for the payment. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id + /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ + fun payGroupIds(): Optional> = + Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) /** The pay period object. */ - @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod - - @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate + fun payPeriod(): Optional = Optional.ofNullable(payPeriod.getNullable("pay_period")) - @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate + /** The unique id for the payment. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id @JsonProperty("company_debit") @ExcludeMissing fun _companyDebit() = companyDebit - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + @JsonProperty("employee_taxes") @ExcludeMissing fun _employeeTaxes() = employeeTaxes @JsonProperty("employer_taxes") @ExcludeMissing fun _employerTaxes() = employerTaxes - @JsonProperty("employee_taxes") @ExcludeMissing fun _employeeTaxes() = employeeTaxes + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay /** Array of every individual on this payment. */ @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds - /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ - @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + + @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate /** List of pay frequencies associated with this payment. */ @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies + /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ + @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + + /** The pay period object. */ + @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -132,17 +132,17 @@ private constructor( fun validate(): Payment = apply { if (!validated) { id() - payPeriod().map { it.validate() } - payDate() - debitDate() companyDebit().map { it.validate() } - grossPay().map { it.validate() } - netPay().map { it.validate() } - employerTaxes().map { it.validate() } + debitDate() employeeTaxes().map { it.validate() } + employerTaxes().map { it.validate() } + grossPay().map { it.validate() } individualIds() - payGroupIds() + netPay().map { it.validate() } + payDate() payFrequencies() + payGroupIds() + payPeriod().map { it.validate() } validated = true } } @@ -157,33 +157,33 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() - private var payPeriod: JsonField = JsonMissing.of() - private var payDate: JsonField = JsonMissing.of() - private var debitDate: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() - private var employerTaxes: JsonField = JsonMissing.of() + private var debitDate: JsonField = JsonMissing.of() private var employeeTaxes: JsonField = JsonMissing.of() + private var employerTaxes: JsonField = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() private var individualIds: JsonField> = JsonMissing.of() - private var payGroupIds: JsonField> = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var payDate: JsonField = JsonMissing.of() private var payFrequencies: JsonField> = JsonMissing.of() + private var payGroupIds: JsonField> = JsonMissing.of() + private var payPeriod: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payment: Payment) = apply { id = payment.id - payPeriod = payment.payPeriod - payDate = payment.payDate - debitDate = payment.debitDate companyDebit = payment.companyDebit - grossPay = payment.grossPay - netPay = payment.netPay - employerTaxes = payment.employerTaxes + debitDate = payment.debitDate employeeTaxes = payment.employeeTaxes + employerTaxes = payment.employerTaxes + grossPay = payment.grossPay individualIds = payment.individualIds - payGroupIds = payment.payGroupIds + netPay = payment.netPay + payDate = payment.payDate payFrequencies = payment.payFrequencies + payGroupIds = payment.payGroupIds + payPeriod = payment.payPeriod additionalProperties = payment.additionalProperties.toMutableMap() } @@ -193,33 +193,21 @@ private constructor( /** The unique id for the payment. */ fun id(id: JsonField) = apply { this.id = id } - /** The pay period object. */ - fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) - - /** The pay period object. */ - fun payPeriod(payPeriod: JsonField) = apply { this.payPeriod = payPeriod } - - fun payDate(payDate: String) = payDate(JsonField.of(payDate)) - - fun payDate(payDate: JsonField) = apply { this.payDate = payDate } - - fun debitDate(debitDate: String) = debitDate(JsonField.of(debitDate)) - - fun debitDate(debitDate: JsonField) = apply { this.debitDate = debitDate } - fun companyDebit(companyDebit: Money) = companyDebit(JsonField.of(companyDebit)) fun companyDebit(companyDebit: JsonField) = apply { this.companyDebit = companyDebit } - fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) + fun debitDate(debitDate: String) = debitDate(JsonField.of(debitDate)) - fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } + fun debitDate(debitDate: JsonField) = apply { this.debitDate = debitDate } - fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) + fun employeeTaxes(employeeTaxes: Money) = employeeTaxes(JsonField.of(employeeTaxes)) - fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + fun employeeTaxes(employeeTaxes: JsonField) = apply { + this.employeeTaxes = employeeTaxes + } fun employerTaxes(employerTaxes: Money) = employerTaxes(JsonField.of(employerTaxes)) @@ -227,11 +215,9 @@ private constructor( this.employerTaxes = employerTaxes } - fun employeeTaxes(employeeTaxes: Money) = employeeTaxes(JsonField.of(employeeTaxes)) + fun grossPay(grossPay: Money) = grossPay(JsonField.of(grossPay)) - fun employeeTaxes(employeeTaxes: JsonField) = apply { - this.employeeTaxes = employeeTaxes - } + fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } /** Array of every individual on this payment. */ fun individualIds(individualIds: List) = individualIds(JsonField.of(individualIds)) @@ -241,13 +227,13 @@ private constructor( this.individualIds = individualIds } - /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ - fun payGroupIds(payGroupIds: List) = payGroupIds(JsonField.of(payGroupIds)) + fun netPay(netPay: Money) = netPay(JsonField.of(netPay)) - /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ - fun payGroupIds(payGroupIds: JsonField>) = apply { - this.payGroupIds = payGroupIds - } + fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + + fun payDate(payDate: String) = payDate(JsonField.of(payDate)) + + fun payDate(payDate: JsonField) = apply { this.payDate = payDate } /** List of pay frequencies associated with this payment. */ fun payFrequencies(payFrequencies: List) = @@ -258,6 +244,20 @@ private constructor( this.payFrequencies = payFrequencies } + /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ + fun payGroupIds(payGroupIds: List) = payGroupIds(JsonField.of(payGroupIds)) + + /** Array of the Finch id (uuidv4) of every pay group associated with this payment. */ + fun payGroupIds(payGroupIds: JsonField>) = apply { + this.payGroupIds = payGroupIds + } + + /** The pay period object. */ + fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) + + /** The pay period object. */ + fun payPeriod(payPeriod: JsonField) = apply { this.payPeriod = payPeriod } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -280,17 +280,17 @@ private constructor( fun build(): Payment = Payment( id, - payPeriod, - payDate, - debitDate, companyDebit, - grossPay, - netPay, - employerTaxes, + debitDate, employeeTaxes, + employerTaxes, + grossPay, individualIds.map { it.toImmutable() }, - payGroupIds.map { it.toImmutable() }, + netPay, + payDate, payFrequencies.map { it.toImmutable() }, + payGroupIds.map { it.toImmutable() }, + payPeriod, additionalProperties.toImmutable(), ) } @@ -399,24 +399,24 @@ private constructor( class PayPeriod @JsonCreator private constructor( - @JsonProperty("start_date") - @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) - fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + fun startDate(): Optional = Optional.ofNullable(startDate.getNullable("start_date")) @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -425,8 +425,8 @@ private constructor( fun validate(): PayPeriod = apply { if (!validated) { - startDate() endDate() + startDate() validated = true } } @@ -440,25 +440,25 @@ private constructor( class Builder { - private var startDate: JsonField = JsonMissing.of() private var endDate: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - startDate = payPeriod.startDate endDate = payPeriod.endDate + startDate = payPeriod.startDate additionalProperties = payPeriod.additionalProperties.toMutableMap() } - fun startDate(startDate: String) = startDate(JsonField.of(startDate)) - - fun startDate(startDate: JsonField) = apply { this.startDate = startDate } - fun endDate(endDate: String) = endDate(JsonField.of(endDate)) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + fun startDate(startDate: String) = startDate(JsonField.of(startDate)) + + fun startDate(startDate: JsonField) = apply { this.startDate = startDate } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -480,8 +480,8 @@ private constructor( fun build(): PayPeriod = PayPeriod( - startDate, endDate, + startDate, additionalProperties.toImmutable(), ) } @@ -491,17 +491,17 @@ private constructor( return true } - return /* spotless:off */ other is PayPeriod && startDate == other.startDate && endDate == other.endDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayPeriod && endDate == other.endDate && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(startDate, endDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(endDate, startDate, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayPeriod{startDate=$startDate, endDate=$endDate, additionalProperties=$additionalProperties}" + "PayPeriod{endDate=$endDate, startDate=$startDate, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -509,15 +509,15 @@ private constructor( return true } - return /* spotless:off */ other is Payment && id == other.id && payPeriod == other.payPeriod && payDate == other.payDate && debitDate == other.debitDate && companyDebit == other.companyDebit && grossPay == other.grossPay && netPay == other.netPay && employerTaxes == other.employerTaxes && employeeTaxes == other.employeeTaxes && individualIds == other.individualIds && payGroupIds == other.payGroupIds && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Payment && id == other.id && companyDebit == other.companyDebit && debitDate == other.debitDate && employeeTaxes == other.employeeTaxes && employerTaxes == other.employerTaxes && grossPay == other.grossPay && individualIds == other.individualIds && netPay == other.netPay && payDate == other.payDate && payFrequencies == other.payFrequencies && payGroupIds == other.payGroupIds && payPeriod == other.payPeriod && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, payPeriod, payDate, debitDate, companyDebit, grossPay, netPay, employerTaxes, employeeTaxes, individualIds, payGroupIds, payFrequencies, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, companyDebit, debitDate, employeeTaxes, employerTaxes, grossPay, individualIds, netPay, payDate, payFrequencies, payGroupIds, payPeriod, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Payment{id=$id, payPeriod=$payPeriod, payDate=$payDate, debitDate=$debitDate, companyDebit=$companyDebit, grossPay=$grossPay, netPay=$netPay, employerTaxes=$employerTaxes, employeeTaxes=$employeeTaxes, individualIds=$individualIds, payGroupIds=$payGroupIds, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" + "Payment{id=$id, companyDebit=$companyDebit, debitDate=$debitDate, employeeTaxes=$employeeTaxes, employerTaxes=$employerTaxes, grossPay=$grossPay, individualIds=$individualIds, netPay=$netPay, payDate=$payDate, payFrequencies=$payFrequencies, payGroupIds=$payGroupIds, payPeriod=$payPeriod, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt index b1be775c..06534456 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentCreateResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class PaymentCreateResponse @JsonCreator private constructor( - @JsonProperty("payment_id") - @ExcludeMissing - private val paymentId: JsonField = JsonMissing.of(), @JsonProperty("pay_date") @ExcludeMissing private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the payment. */ - fun paymentId(): String = paymentId.getRequired("payment_id") - /** The date of the payment. */ fun payDate(): String = payDate.getRequired("pay_date") /** The ID of the payment. */ - @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + fun paymentId(): String = paymentId.getRequired("payment_id") /** The date of the payment. */ @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate + /** The ID of the payment. */ + @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): PaymentCreateResponse = apply { if (!validated) { - paymentId() payDate() + paymentId() validated = true } } @@ -63,29 +63,29 @@ private constructor( class Builder { - private var paymentId: JsonField = JsonMissing.of() private var payDate: JsonField = JsonMissing.of() + private var paymentId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentCreateResponse: PaymentCreateResponse) = apply { - paymentId = paymentCreateResponse.paymentId payDate = paymentCreateResponse.payDate + paymentId = paymentCreateResponse.paymentId additionalProperties = paymentCreateResponse.additionalProperties.toMutableMap() } - /** The ID of the payment. */ - fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) - - /** The ID of the payment. */ - fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } - /** The date of the payment. */ fun payDate(payDate: String) = payDate(JsonField.of(payDate)) /** The date of the payment. */ fun payDate(payDate: JsonField) = apply { this.payDate = payDate } + /** The ID of the payment. */ + fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) + + /** The ID of the payment. */ + fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -107,8 +107,8 @@ private constructor( fun build(): PaymentCreateResponse = PaymentCreateResponse( - paymentId, payDate, + paymentId, additionalProperties.toImmutable(), ) } @@ -118,15 +118,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentCreateResponse && paymentId == other.paymentId && payDate == other.payDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentCreateResponse && payDate == other.payDate && paymentId == other.paymentId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paymentId, payDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(payDate, paymentId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentCreateResponse{paymentId=$paymentId, payDate=$payDate, additionalProperties=$additionalProperties}" + "PaymentCreateResponse{payDate=$payDate, paymentId=$paymentId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt index efa267c6..19777058 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PaymentEvent.kt @@ -22,83 +22,83 @@ import java.util.Optional class PaymentEvent @JsonCreator private constructor( - @JsonProperty("connection_id") + @JsonProperty("account_id") @ExcludeMissing - private val connectionId: JsonField = JsonMissing.of(), + private val accountId: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), - @JsonProperty("account_id") - @ExcludeMissing - private val accountId: JsonField = JsonMissing.of(), - @JsonProperty("event_type") + @JsonProperty("connection_id") @ExcludeMissing - private val eventType: JsonField = JsonMissing.of(), + private val connectionId: JsonField = JsonMissing.of(), @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonProperty("event_type") + @ExcludeMissing + private val eventType: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 + * [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 companyId(): String = companyId.getRequired("company_id") + fun accountId(): String = accountId.getRequired("account_id") /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(): String = accountId.getRequired("account_id") + fun companyId(): String = companyId.getRequired("company_id") - fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(): Optional = + Optional.ofNullable(connectionId.getNullable("connection_id")) fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - /** Unique Finch ID of the connection associated with the webhook event. */ - @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId + fun eventType(): Optional = Optional.ofNullable(eventType.getNullable("event_type")) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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("company_id") @ExcludeMissing fun _companyId() = companyId + @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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("account_id") @ExcludeMissing fun _accountId() = accountId + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Unique Finch ID of the connection associated with the webhook event. */ + @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @JsonProperty("data") @ExcludeMissing fun _data() = data + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBaseWebhookEvent(): BaseWebhookEvent = BaseWebhookEvent.builder() - .connectionId(connectionId) - .companyId(companyId) .accountId(accountId) + .companyId(companyId) + .connectionId(connectionId) .build() private var validated: Boolean = false fun validate(): PaymentEvent = apply { if (!validated) { - connectionId() - companyId() accountId() - eventType() + companyId() + connectionId() data().map { it.validate() } + eventType() validated = true } } @@ -112,63 +112,63 @@ private constructor( 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 companyId: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentEvent: PaymentEvent) = apply { - connectionId = paymentEvent.connectionId - companyId = paymentEvent.companyId accountId = paymentEvent.accountId - eventType = paymentEvent.eventType + companyId = paymentEvent.companyId + connectionId = paymentEvent.connectionId data = paymentEvent.data + eventType = paymentEvent.eventType additionalProperties = paymentEvent.additionalProperties.toMutableMap() } - /** 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. */ - fun connectionId(connectionId: JsonField) = apply { - this.connectionId = connectionId - } - /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** - * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + * [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 companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: String) = accountId(JsonField.of(accountId)) + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** - * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use + * [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 accountId(accountId: JsonField) = apply { this.accountId = accountId } + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) - fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + /** Unique Finch ID of the connection associated with the webhook event. */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } fun data(data: PaymentIdentifiers) = data(JsonField.of(data)) fun data(data: JsonField) = apply { this.data = data } + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { this.eventType = eventType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -190,11 +190,11 @@ private constructor( fun build(): PaymentEvent = PaymentEvent( - connectionId, - companyId, accountId, - eventType, + companyId, + connectionId, data, + eventType, additionalProperties.toImmutable(), ) } @@ -203,28 +203,28 @@ private constructor( class PaymentIdentifiers @JsonCreator private constructor( - @JsonProperty("payment_id") - @ExcludeMissing - private val paymentId: JsonField = JsonMissing.of(), @JsonProperty("pay_date") @ExcludeMissing private val payDate: JsonField = JsonMissing.of(), + @JsonProperty("payment_id") + @ExcludeMissing + private val paymentId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The ID of the payment. */ - fun paymentId(): String = paymentId.getRequired("payment_id") - /** The date of the payment. */ fun payDate(): String = payDate.getRequired("pay_date") /** The ID of the payment. */ - @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + fun paymentId(): String = paymentId.getRequired("payment_id") /** The date of the payment. */ @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate + /** The ID of the payment. */ + @JsonProperty("payment_id") @ExcludeMissing fun _paymentId() = paymentId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -233,8 +233,8 @@ private constructor( fun validate(): PaymentIdentifiers = apply { if (!validated) { - paymentId() payDate() + paymentId() validated = true } } @@ -248,29 +248,29 @@ private constructor( class Builder { - private var paymentId: JsonField = JsonMissing.of() private var payDate: JsonField = JsonMissing.of() + private var paymentId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentIdentifiers: PaymentIdentifiers) = apply { - paymentId = paymentIdentifiers.paymentId payDate = paymentIdentifiers.payDate + paymentId = paymentIdentifiers.paymentId additionalProperties = paymentIdentifiers.additionalProperties.toMutableMap() } - /** The ID of the payment. */ - fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) - - /** The ID of the payment. */ - fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } - /** The date of the payment. */ fun payDate(payDate: String) = payDate(JsonField.of(payDate)) /** The date of the payment. */ fun payDate(payDate: JsonField) = apply { this.payDate = payDate } + /** The ID of the payment. */ + fun paymentId(paymentId: String) = paymentId(JsonField.of(paymentId)) + + /** The ID of the payment. */ + fun paymentId(paymentId: JsonField) = apply { this.paymentId = paymentId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -292,8 +292,8 @@ private constructor( fun build(): PaymentIdentifiers = PaymentIdentifiers( - paymentId, payDate, + paymentId, additionalProperties.toImmutable(), ) } @@ -303,17 +303,17 @@ private constructor( return true } - return /* spotless:off */ other is PaymentIdentifiers && paymentId == other.paymentId && payDate == other.payDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentIdentifiers && payDate == other.payDate && paymentId == other.paymentId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paymentId, payDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(payDate, paymentId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentIdentifiers{paymentId=$paymentId, payDate=$payDate, additionalProperties=$additionalProperties}" + "PaymentIdentifiers{payDate=$payDate, paymentId=$paymentId, additionalProperties=$additionalProperties}" } class EventType @@ -384,15 +384,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentEvent && connectionId == other.connectionId && companyId == other.companyId && accountId == other.accountId && eventType == other.eventType && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, accountId, eventType, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentEvent{connectionId=$connectionId, companyId=$companyId, accountId=$accountId, eventType=$eventType, data=$data, additionalProperties=$additionalProperties}" + "PaymentEvent{accountId=$accountId, companyId=$companyId, connectionId=$connectionId, data=$data, eventType=$eventType, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt index 0dae0587..364184d0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Provider.kt @@ -23,46 +23,57 @@ class Provider @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("authentication_methods") + @ExcludeMissing + private val authenticationMethods: JsonField> = JsonMissing.of(), + @JsonProperty("beta") @ExcludeMissing private val beta: JsonField = JsonMissing.of(), @JsonProperty("display_name") @ExcludeMissing private val displayName: JsonField = JsonMissing.of(), - @JsonProperty("products") - @ExcludeMissing - private val products: JsonField> = JsonMissing.of(), @JsonProperty("icon") @ExcludeMissing private val icon: JsonField = JsonMissing.of(), @JsonProperty("logo") @ExcludeMissing private val logo: JsonField = JsonMissing.of(), + @JsonProperty("manual") + @ExcludeMissing + private val manual: JsonField = JsonMissing.of(), @JsonProperty("mfa_required") @ExcludeMissing private val mfaRequired: JsonField = JsonMissing.of(), @JsonProperty("primary_color") @ExcludeMissing private val primaryColor: JsonField = JsonMissing.of(), - @JsonProperty("manual") - @ExcludeMissing - private val manual: JsonField = JsonMissing.of(), - @JsonProperty("beta") @ExcludeMissing private val beta: JsonField = JsonMissing.of(), - @JsonProperty("authentication_methods") + @JsonProperty("products") @ExcludeMissing - private val authenticationMethods: JsonField> = JsonMissing.of(), + private val products: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** The id of the payroll provider used in Connect. */ fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + /** The list of authentication methods supported by the provider. */ + fun authenticationMethods(): Optional> = + Optional.ofNullable(authenticationMethods.getNullable("authentication_methods")) + + /** `true` if the integration is in a beta state, `false` otherwise */ + fun beta(): Optional = Optional.ofNullable(beta.getNullable("beta")) + /** The display name of the payroll provider. */ fun displayName(): Optional = Optional.ofNullable(displayName.getNullable("display_name")) - /** The list of Finch products supported on this payroll provider. */ - fun products(): Optional> = Optional.ofNullable(products.getNullable("products")) - /** The url to the official icon of the payroll provider. */ fun icon(): Optional = Optional.ofNullable(icon.getNullable("icon")) /** The url to the official logo of the payroll provider. */ fun logo(): Optional = Optional.ofNullable(logo.getNullable("logo")) + /** + * [DEPRECATED] Whether the Finch integration with this provider uses the Assisted Connect Flow + * by default. This field is now deprecated. Please check for a `type` of `assisted` in the + * `authentication_methods` field instead. + */ + fun manual(): Optional = Optional.ofNullable(manual.getNullable("manual")) + /** whether MFA is required for the provider. */ fun mfaRequired(): Optional = Optional.ofNullable(mfaRequired.getNullable("mfa_required")) @@ -71,41 +82,29 @@ private constructor( fun primaryColor(): Optional = Optional.ofNullable(primaryColor.getNullable("primary_color")) - /** - * [DEPRECATED] Whether the Finch integration with this provider uses the Assisted Connect Flow - * by default. This field is now deprecated. Please check for a `type` of `assisted` in the - * `authentication_methods` field instead. - */ - fun manual(): Optional = Optional.ofNullable(manual.getNullable("manual")) + /** The list of Finch products supported on this payroll provider. */ + fun products(): Optional> = Optional.ofNullable(products.getNullable("products")) - /** `true` if the integration is in a beta state, `false` otherwise */ - fun beta(): Optional = Optional.ofNullable(beta.getNullable("beta")) + /** The id of the payroll provider used in Connect. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id /** The list of authentication methods supported by the provider. */ - fun authenticationMethods(): Optional> = - Optional.ofNullable(authenticationMethods.getNullable("authentication_methods")) + @JsonProperty("authentication_methods") + @ExcludeMissing + fun _authenticationMethods() = authenticationMethods - /** The id of the payroll provider used in Connect. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id + /** `true` if the integration is in a beta state, `false` otherwise */ + @JsonProperty("beta") @ExcludeMissing fun _beta() = beta /** The display name of the payroll provider. */ @JsonProperty("display_name") @ExcludeMissing fun _displayName() = displayName - /** The list of Finch products supported on this payroll provider. */ - @JsonProperty("products") @ExcludeMissing fun _products() = products - /** The url to the official icon of the payroll provider. */ @JsonProperty("icon") @ExcludeMissing fun _icon() = icon /** The url to the official logo of the payroll provider. */ @JsonProperty("logo") @ExcludeMissing fun _logo() = logo - /** whether MFA is required for the provider. */ - @JsonProperty("mfa_required") @ExcludeMissing fun _mfaRequired() = mfaRequired - - /** The hex code for the primary color of the payroll provider. */ - @JsonProperty("primary_color") @ExcludeMissing fun _primaryColor() = primaryColor - /** * [DEPRECATED] Whether the Finch integration with this provider uses the Assisted Connect Flow * by default. This field is now deprecated. Please check for a `type` of `assisted` in the @@ -113,13 +112,14 @@ private constructor( */ @JsonProperty("manual") @ExcludeMissing fun _manual() = manual - /** `true` if the integration is in a beta state, `false` otherwise */ - @JsonProperty("beta") @ExcludeMissing fun _beta() = beta + /** whether MFA is required for the provider. */ + @JsonProperty("mfa_required") @ExcludeMissing fun _mfaRequired() = mfaRequired - /** The list of authentication methods supported by the provider. */ - @JsonProperty("authentication_methods") - @ExcludeMissing - fun _authenticationMethods() = authenticationMethods + /** The hex code for the primary color of the payroll provider. */ + @JsonProperty("primary_color") @ExcludeMissing fun _primaryColor() = primaryColor + + /** The list of Finch products supported on this payroll provider. */ + @JsonProperty("products") @ExcludeMissing fun _products() = products @JsonAnyGetter @ExcludeMissing @@ -130,15 +130,15 @@ private constructor( fun validate(): Provider = apply { if (!validated) { id() + authenticationMethods().map { it.forEach { it.validate() } } + beta() displayName() - products() icon() logo() + manual() mfaRequired() primaryColor() - manual() - beta() - authenticationMethods().map { it.forEach { it.validate() } } + products() validated = true } } @@ -153,29 +153,29 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var authenticationMethods: JsonField> = JsonMissing.of() + private var beta: JsonField = JsonMissing.of() private var displayName: JsonField = JsonMissing.of() - private var products: JsonField> = JsonMissing.of() private var icon: JsonField = JsonMissing.of() private var logo: JsonField = JsonMissing.of() + private var manual: JsonField = JsonMissing.of() private var mfaRequired: JsonField = JsonMissing.of() private var primaryColor: JsonField = JsonMissing.of() - private var manual: JsonField = JsonMissing.of() - private var beta: JsonField = JsonMissing.of() - private var authenticationMethods: JsonField> = JsonMissing.of() + private var products: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(provider: Provider) = apply { id = provider.id + authenticationMethods = provider.authenticationMethods + beta = provider.beta displayName = provider.displayName - products = provider.products icon = provider.icon logo = provider.logo + manual = provider.manual mfaRequired = provider.mfaRequired primaryColor = provider.primaryColor - manual = provider.manual - beta = provider.beta - authenticationMethods = provider.authenticationMethods + products = provider.products additionalProperties = provider.additionalProperties.toMutableMap() } @@ -185,18 +185,28 @@ private constructor( /** The id of the payroll provider used in Connect. */ fun id(id: JsonField) = apply { this.id = id } + /** The list of authentication methods supported by the provider. */ + fun authenticationMethods(authenticationMethods: List) = + authenticationMethods(JsonField.of(authenticationMethods)) + + /** The list of authentication methods supported by the provider. */ + fun authenticationMethods(authenticationMethods: JsonField>) = + apply { + this.authenticationMethods = authenticationMethods + } + + /** `true` if the integration is in a beta state, `false` otherwise */ + fun beta(beta: Boolean) = beta(JsonField.of(beta)) + + /** `true` if the integration is in a beta state, `false` otherwise */ + fun beta(beta: JsonField) = apply { this.beta = beta } + /** The display name of the payroll provider. */ fun displayName(displayName: String) = displayName(JsonField.of(displayName)) /** The display name of the payroll provider. */ fun displayName(displayName: JsonField) = apply { this.displayName = displayName } - /** The list of Finch products supported on this payroll provider. */ - fun products(products: List) = products(JsonField.of(products)) - - /** The list of Finch products supported on this payroll provider. */ - fun products(products: JsonField>) = apply { this.products = products } - /** The url to the official icon of the payroll provider. */ fun icon(icon: String) = icon(JsonField.of(icon)) @@ -209,20 +219,6 @@ private constructor( /** The url to the official logo of the payroll provider. */ fun logo(logo: JsonField) = apply { this.logo = logo } - /** whether MFA is required for the provider. */ - fun mfaRequired(mfaRequired: Boolean) = mfaRequired(JsonField.of(mfaRequired)) - - /** whether MFA is required for the provider. */ - fun mfaRequired(mfaRequired: JsonField) = apply { this.mfaRequired = mfaRequired } - - /** The hex code for the primary color of the payroll provider. */ - fun primaryColor(primaryColor: String) = primaryColor(JsonField.of(primaryColor)) - - /** The hex code for the primary color of the payroll provider. */ - fun primaryColor(primaryColor: JsonField) = apply { - this.primaryColor = primaryColor - } - /** * [DEPRECATED] Whether the Finch integration with this provider uses the Assisted Connect * Flow by default. This field is now deprecated. Please check for a `type` of `assisted` in @@ -237,21 +233,25 @@ private constructor( */ fun manual(manual: JsonField) = apply { this.manual = manual } - /** `true` if the integration is in a beta state, `false` otherwise */ - fun beta(beta: Boolean) = beta(JsonField.of(beta)) + /** whether MFA is required for the provider. */ + fun mfaRequired(mfaRequired: Boolean) = mfaRequired(JsonField.of(mfaRequired)) - /** `true` if the integration is in a beta state, `false` otherwise */ - fun beta(beta: JsonField) = apply { this.beta = beta } + /** whether MFA is required for the provider. */ + fun mfaRequired(mfaRequired: JsonField) = apply { this.mfaRequired = mfaRequired } - /** The list of authentication methods supported by the provider. */ - fun authenticationMethods(authenticationMethods: List) = - authenticationMethods(JsonField.of(authenticationMethods)) + /** The hex code for the primary color of the payroll provider. */ + fun primaryColor(primaryColor: String) = primaryColor(JsonField.of(primaryColor)) - /** The list of authentication methods supported by the provider. */ - fun authenticationMethods(authenticationMethods: JsonField>) = - apply { - this.authenticationMethods = authenticationMethods - } + /** The hex code for the primary color of the payroll provider. */ + fun primaryColor(primaryColor: JsonField) = apply { + this.primaryColor = primaryColor + } + + /** The list of Finch products supported on this payroll provider. */ + fun products(products: List) = products(JsonField.of(products)) + + /** The list of Finch products supported on this payroll provider. */ + fun products(products: JsonField>) = apply { this.products = products } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -275,15 +275,15 @@ private constructor( fun build(): Provider = Provider( id, + authenticationMethods.map { it.toImmutable() }, + beta, displayName, - products.map { it.toImmutable() }, icon, logo, + manual, mfaRequired, primaryColor, - manual, - beta, - authenticationMethods.map { it.toImmutable() }, + products.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -292,20 +292,17 @@ private constructor( class AuthenticationMethod @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("benefits_support") @ExcludeMissing private val benefitsSupport: JsonField = JsonMissing.of(), @JsonProperty("supported_fields") @ExcludeMissing private val supportedFields: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 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 @@ -318,7 +315,7 @@ private constructor( Optional.ofNullable(supportedFields.getNullable("supported_fields")) /** The type of authentication method. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** * Each benefit type and their supported features. If the benefit type is not supported, the @@ -329,6 +326,9 @@ private constructor( /** The supported data fields returned by our HR and payroll endpoints */ @JsonProperty("supported_fields") @ExcludeMissing fun _supportedFields() = supportedFields + /** The type of authentication method. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -337,9 +337,9 @@ private constructor( fun validate(): AuthenticationMethod = apply { if (!validated) { - type() benefitsSupport().map { it.validate() } supportedFields().map { it.validate() } + type() validated = true } } @@ -353,25 +353,19 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var benefitsSupport: JsonField = JsonMissing.of() private var supportedFields: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(authenticationMethod: AuthenticationMethod) = apply { - type = authenticationMethod.type benefitsSupport = authenticationMethod.benefitsSupport supportedFields = authenticationMethod.supportedFields + type = authenticationMethod.type additionalProperties = authenticationMethod.additionalProperties.toMutableMap() } - /** The type of authentication method. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** The type of authentication method. */ - 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 @@ -396,6 +390,12 @@ private constructor( this.supportedFields = supportedFields } + /** The type of authentication method. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** The type of authentication method. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -417,9 +417,9 @@ private constructor( fun build(): AuthenticationMethod = AuthenticationMethod( - type, benefitsSupport, supportedFields, + type, additionalProperties.toImmutable(), ) } @@ -435,21 +435,21 @@ private constructor( @JsonProperty("directory") @ExcludeMissing private val directory: JsonField = JsonMissing.of(), - @JsonProperty("individual") - @ExcludeMissing - private val individual: JsonField = JsonMissing.of(), @JsonProperty("employment") @ExcludeMissing private val employment: JsonField = JsonMissing.of(), - @JsonProperty("payment") + @JsonProperty("individual") @ExcludeMissing - private val payment: JsonField = JsonMissing.of(), + private val individual: JsonField = JsonMissing.of(), + @JsonProperty("pay_group") + @ExcludeMissing + private val payGroup: JsonField = JsonMissing.of(), @JsonProperty("pay_statement") @ExcludeMissing private val payStatement: JsonField = JsonMissing.of(), - @JsonProperty("pay_group") + @JsonProperty("payment") @ExcludeMissing - private val payGroup: JsonField = JsonMissing.of(), + private val payment: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -460,34 +460,34 @@ private constructor( 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 individual(): Optional = + Optional.ofNullable(individual.getNullable("individual")) + + fun payGroup(): Optional = + Optional.ofNullable(payGroup.getNullable("pay_group")) fun payStatement(): Optional = Optional.ofNullable(payStatement.getNullable("pay_statement")) - fun payGroup(): Optional = - Optional.ofNullable(payGroup.getNullable("pay_group")) + fun payment(): Optional = + Optional.ofNullable(payment.getNullable("payment")) @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("individual") @ExcludeMissing fun _individual() = individual + + @JsonProperty("pay_group") @ExcludeMissing fun _payGroup() = payGroup @JsonProperty("pay_statement") @ExcludeMissing fun _payStatement() = payStatement - @JsonProperty("pay_group") @ExcludeMissing fun _payGroup() = payGroup + @JsonProperty("payment") @ExcludeMissing fun _payment() = payment @JsonAnyGetter @ExcludeMissing @@ -499,11 +499,11 @@ private constructor( 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() } + individual().map { it.validate() } payGroup().map { it.validate() } + payStatement().map { it.validate() } + payment().map { it.validate() } validated = true } } @@ -519,22 +519,22 @@ private constructor( 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 individual: JsonField = JsonMissing.of() private var payGroup: JsonField = JsonMissing.of() + private var payStatement: JsonField = JsonMissing.of() + private var payment: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedFields: SupportedFields) = apply { company = supportedFields.company directory = supportedFields.directory - individual = supportedFields.individual employment = supportedFields.employment - payment = supportedFields.payment - payStatement = supportedFields.payStatement + individual = supportedFields.individual payGroup = supportedFields.payGroup + payStatement = supportedFields.payStatement + payment = supportedFields.payment additionalProperties = supportedFields.additionalProperties.toMutableMap() } @@ -551,13 +551,6 @@ private constructor( this.directory = directory } - fun individual(individual: SupportedIndividualFields) = - individual(JsonField.of(individual)) - - fun individual(individual: JsonField) = apply { - this.individual = individual - } - fun employment(employment: SupportedEmploymentFields) = employment(JsonField.of(employment)) @@ -565,10 +558,17 @@ private constructor( this.employment = employment } - fun payment(payment: SupportedPaymentFields) = payment(JsonField.of(payment)) + fun individual(individual: SupportedIndividualFields) = + individual(JsonField.of(individual)) - fun payment(payment: JsonField) = apply { - this.payment = payment + fun individual(individual: JsonField) = apply { + this.individual = individual + } + + fun payGroup(payGroup: SupportedPayGroupFields) = payGroup(JsonField.of(payGroup)) + + fun payGroup(payGroup: JsonField) = apply { + this.payGroup = payGroup } fun payStatement(payStatement: SupportedPayStatementFields) = @@ -578,10 +578,10 @@ private constructor( this.payStatement = payStatement } - fun payGroup(payGroup: SupportedPayGroupFields) = payGroup(JsonField.of(payGroup)) + fun payment(payment: SupportedPaymentFields) = payment(JsonField.of(payment)) - fun payGroup(payGroup: JsonField) = apply { - this.payGroup = payGroup + fun payment(payment: JsonField) = apply { + this.payment = payment } fun additionalProperties(additionalProperties: Map) = apply { @@ -610,11 +610,11 @@ private constructor( SupportedFields( company, directory, - individual, employment, - payment, - payStatement, + individual, payGroup, + payStatement, + payment, additionalProperties.toImmutable(), ) } @@ -626,40 +626,51 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("legal_name") - @ExcludeMissing - private val legalName: JsonField = JsonMissing.of(), - @JsonProperty("entity") - @ExcludeMissing - private val entity: JsonField = JsonMissing.of(), - @JsonProperty("primary_email") + @JsonProperty("accounts") @ExcludeMissing - private val primaryEmail: JsonField = JsonMissing.of(), - @JsonProperty("primary_phone_number") + private val accounts: JsonField = JsonMissing.of(), + @JsonProperty("departments") @ExcludeMissing - private val primaryPhoneNumber: JsonField = JsonMissing.of(), + private val departments: JsonField = JsonMissing.of(), @JsonProperty("ein") @ExcludeMissing private val ein: JsonField = JsonMissing.of(), - @JsonProperty("accounts") + @JsonProperty("entity") @ExcludeMissing - private val accounts: JsonField = JsonMissing.of(), - @JsonProperty("departments") + private val entity: JsonField = JsonMissing.of(), + @JsonProperty("legal_name") @ExcludeMissing - private val departments: JsonField = JsonMissing.of(), + private val legalName: JsonField = JsonMissing.of(), @JsonProperty("locations") @ExcludeMissing private val locations: JsonField = JsonMissing.of(), + @JsonProperty("primary_email") + @ExcludeMissing + private val primaryEmail: JsonField = JsonMissing.of(), + @JsonProperty("primary_phone_number") + @ExcludeMissing + private val primaryPhoneNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun accounts(): Optional = + Optional.ofNullable(accounts.getNullable("accounts")) + + fun departments(): Optional = + Optional.ofNullable(departments.getNullable("departments")) + + fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) + + fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity")) + fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name")) - fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity")) + fun locations(): Optional = + Optional.ofNullable(locations.getNullable("locations")) fun primaryEmail(): Optional = Optional.ofNullable(primaryEmail.getNullable("primary_email")) @@ -667,22 +678,19 @@ private constructor( fun primaryPhoneNumber(): Optional = Optional.ofNullable(primaryPhoneNumber.getNullable("primary_phone_number")) - fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein")) + @JsonProperty("id") @ExcludeMissing fun _id() = id - fun accounts(): Optional = - Optional.ofNullable(accounts.getNullable("accounts")) + @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts - fun departments(): Optional = - Optional.ofNullable(departments.getNullable("departments")) + @JsonProperty("departments") @ExcludeMissing fun _departments() = departments - fun locations(): Optional = - Optional.ofNullable(locations.getNullable("locations")) + @JsonProperty("ein") @ExcludeMissing fun _ein() = ein - @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("entity") @ExcludeMissing fun _entity() = entity @JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName - @JsonProperty("entity") @ExcludeMissing fun _entity() = entity + @JsonProperty("locations") @ExcludeMissing fun _locations() = locations @JsonProperty("primary_email") @ExcludeMissing fun _primaryEmail() = primaryEmail @@ -690,14 +698,6 @@ private constructor( @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 @@ -707,14 +707,14 @@ private constructor( fun validate(): SupportedCompanyFields = apply { if (!validated) { id() - legalName() - entity().map { it.validate() } - primaryEmail() - primaryPhoneNumber() - ein() accounts().map { it.validate() } departments().map { it.validate() } + ein() + entity().map { it.validate() } + legalName() locations().map { it.validate() } + primaryEmail() + primaryPhoneNumber() validated = true } } @@ -729,27 +729,27 @@ private constructor( 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 ein: JsonField = JsonMissing.of() + private var entity: JsonField = JsonMissing.of() + private var legalName: JsonField = JsonMissing.of() private var locations: JsonField = JsonMissing.of() + private var primaryEmail: JsonField = JsonMissing.of() + private var primaryPhoneNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedCompanyFields: SupportedCompanyFields) = apply { id = supportedCompanyFields.id - legalName = supportedCompanyFields.legalName - entity = supportedCompanyFields.entity - primaryEmail = supportedCompanyFields.primaryEmail - primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber - ein = supportedCompanyFields.ein accounts = supportedCompanyFields.accounts departments = supportedCompanyFields.departments + ein = supportedCompanyFields.ein + entity = supportedCompanyFields.entity + legalName = supportedCompanyFields.legalName locations = supportedCompanyFields.locations + primaryEmail = supportedCompanyFields.primaryEmail + primaryPhoneNumber = supportedCompanyFields.primaryPhoneNumber additionalProperties = supportedCompanyFields.additionalProperties.toMutableMap() } @@ -758,15 +758,36 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } + fun accounts(accounts: Accounts) = accounts(JsonField.of(accounts)) + + fun accounts(accounts: JsonField) = apply { this.accounts = accounts } + + fun departments(departments: Departments) = + departments(JsonField.of(departments)) + + fun departments(departments: JsonField) = apply { + this.departments = departments + } + + fun ein(ein: Boolean) = ein(JsonField.of(ein)) + + fun ein(ein: JsonField) = apply { this.ein = ein } + + fun entity(entity: Entity) = entity(JsonField.of(entity)) + + fun entity(entity: JsonField) = apply { this.entity = entity } + fun legalName(legalName: Boolean) = legalName(JsonField.of(legalName)) fun legalName(legalName: JsonField) = apply { this.legalName = legalName } - fun entity(entity: Entity) = entity(JsonField.of(entity)) + fun locations(locations: Locations) = locations(JsonField.of(locations)) - fun entity(entity: JsonField) = apply { this.entity = entity } + fun locations(locations: JsonField) = apply { + this.locations = locations + } fun primaryEmail(primaryEmail: Boolean) = primaryEmail(JsonField.of(primaryEmail)) @@ -782,27 +803,6 @@ private constructor( this.primaryPhoneNumber = primaryPhoneNumber } - fun ein(ein: Boolean) = ein(JsonField.of(ein)) - - fun ein(ein: JsonField) = apply { this.ein = ein } - - fun accounts(accounts: Accounts) = accounts(JsonField.of(accounts)) - - fun accounts(accounts: JsonField) = apply { this.accounts = accounts } - - fun departments(departments: Departments) = - departments(JsonField.of(departments)) - - fun departments(departments: JsonField) = apply { - this.departments = departments - } - - fun locations(locations: Locations) = locations(JsonField.of(locations)) - - fun locations(locations: JsonField) = apply { - this.locations = locations - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -828,14 +828,14 @@ private constructor( fun build(): SupportedCompanyFields = SupportedCompanyFields( id, - legalName, - entity, - primaryEmail, - primaryPhoneNumber, - ein, accounts, departments, + ein, + entity, + legalName, locations, + primaryEmail, + primaryPhoneNumber, additionalProperties.toImmutable(), ) } @@ -844,55 +844,55 @@ private constructor( class Accounts @JsonCreator private constructor( - @JsonProperty("routing_number") - @ExcludeMissing - private val routingNumber: JsonField = JsonMissing.of(), @JsonProperty("account_name") @ExcludeMissing private val accountName: JsonField = JsonMissing.of(), - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - private val institutionName: JsonField = JsonMissing.of(), + private val accountNumber: JsonField = JsonMissing.of(), @JsonProperty("account_type") @ExcludeMissing private val accountType: JsonField = JsonMissing.of(), - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - private val accountNumber: JsonField = JsonMissing.of(), + private val institutionName: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + private val routingNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - 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 accountNumber(): Optional = + Optional.ofNullable(accountNumber.getNullable("account_number")) fun accountType(): Optional = Optional.ofNullable(accountType.getNullable("account_type")) - fun accountNumber(): Optional = - Optional.ofNullable(accountNumber.getNullable("account_number")) + fun institutionName(): Optional = + Optional.ofNullable(institutionName.getNullable("institution_name")) - @JsonProperty("routing_number") - @ExcludeMissing - fun _routingNumber() = routingNumber + fun routingNumber(): Optional = + Optional.ofNullable(routingNumber.getNullable("routing_number")) @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName - @JsonProperty("institution_name") + @JsonProperty("account_number") @ExcludeMissing - fun _institutionName() = institutionName + fun _accountNumber() = accountNumber @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType - @JsonProperty("account_number") + @JsonProperty("institution_name") @ExcludeMissing - fun _accountNumber() = accountNumber + fun _institutionName() = institutionName + + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber() = routingNumber @JsonAnyGetter @ExcludeMissing @@ -902,11 +902,11 @@ private constructor( fun validate(): Accounts = apply { if (!validated) { - routingNumber() accountName() - institutionName() - accountType() accountNumber() + accountType() + institutionName() + routingNumber() validated = true } } @@ -920,31 +920,24 @@ private constructor( 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 accountType: JsonField = JsonMissing.of() + private var institutionName: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accounts: Accounts) = apply { - routingNumber = accounts.routingNumber accountName = accounts.accountName - institutionName = accounts.institutionName - accountType = accounts.accountType accountNumber = accounts.accountNumber + accountType = accounts.accountType + institutionName = accounts.institutionName + routingNumber = accounts.routingNumber additionalProperties = accounts.additionalProperties.toMutableMap() } - fun routingNumber(routingNumber: Boolean) = - routingNumber(JsonField.of(routingNumber)) - - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } - fun accountName(accountName: Boolean) = accountName(JsonField.of(accountName)) @@ -952,11 +945,11 @@ private constructor( this.accountName = accountName } - fun institutionName(institutionName: Boolean) = - institutionName(JsonField.of(institutionName)) + fun accountNumber(accountNumber: Boolean) = + accountNumber(JsonField.of(accountNumber)) - fun institutionName(institutionName: JsonField) = apply { - this.institutionName = institutionName + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber } fun accountType(accountType: Boolean) = @@ -966,11 +959,18 @@ private constructor( this.accountType = accountType } - fun accountNumber(accountNumber: Boolean) = - accountNumber(JsonField.of(accountNumber)) + fun institutionName(institutionName: Boolean) = + institutionName(JsonField.of(institutionName)) - fun accountNumber(accountNumber: JsonField) = apply { - this.accountNumber = accountNumber + fun institutionName(institutionName: JsonField) = apply { + this.institutionName = institutionName + } + + fun routingNumber(routingNumber: Boolean) = + routingNumber(JsonField.of(routingNumber)) + + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } fun additionalProperties(additionalProperties: Map) = @@ -997,11 +997,11 @@ private constructor( fun build(): Accounts = Accounts( - routingNumber, accountName, - institutionName, - accountType, accountNumber, + accountType, + institutionName, + routingNumber, additionalProperties.toImmutable(), ) } @@ -1011,17 +1011,17 @@ private constructor( return true } - return /* spotless:off */ other is Accounts && routingNumber == other.routingNumber && accountName == other.accountName && institutionName == other.institutionName && accountType == other.accountType && accountNumber == other.accountNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Accounts && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(routingNumber, accountName, institutionName, accountType, accountNumber, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Accounts{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" + "Accounts{accountName=$accountName, accountNumber=$accountNumber, accountType=$accountType, institutionName=$institutionName, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1238,25 +1238,25 @@ private constructor( class Entity @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1265,8 +1265,8 @@ private constructor( fun validate(): Entity = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -1280,26 +1280,26 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(entity: Entity) = apply { - type = entity.type subtype = entity.subtype + type = entity.type additionalProperties = entity.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - fun subtype(subtype: Boolean) = subtype(JsonField.of(subtype)) fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1324,8 +1324,8 @@ private constructor( fun build(): Entity = Entity( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -1335,70 +1335,70 @@ private constructor( return true } - return /* spotless:off */ other is Entity && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Entity{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class Locations @JsonCreator private constructor( + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), - @JsonProperty("city") - @ExcludeMissing - private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), @JsonProperty("postal_code") @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) + fun city(): Optional = Optional.ofNullable(city.getNullable("city")) - fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2")) + fun country(): Optional = + Optional.ofNullable(country.getNullable("country")) - fun city(): Optional = Optional.ofNullable(city.getNullable("city")) + fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1")) - fun state(): Optional = Optional.ofNullable(state.getNullable("state")) + fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2")) fun postalCode(): Optional = Optional.ofNullable(postalCode.getNullable("postal_code")) - fun country(): Optional = - Optional.ofNullable(country.getNullable("country")) + fun state(): Optional = Optional.ofNullable(state.getNullable("state")) - @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 + @JsonProperty("city") @ExcludeMissing fun _city() = city - @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 + @JsonProperty("country") @ExcludeMissing fun _country() = country - @JsonProperty("city") @ExcludeMissing fun _city() = city + @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 - @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 @JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode - @JsonProperty("country") @ExcludeMissing fun _country() = country + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -1408,12 +1408,12 @@ private constructor( fun validate(): Locations = apply { if (!validated) { + city() + country() line1() line2() - city() - state() postalCode() - country() + state() validated = true } } @@ -1427,41 +1427,41 @@ private constructor( class Builder { + private var city: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() 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 state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(locations: Locations) = apply { + city = locations.city + country = locations.country line1 = locations.line1 line2 = locations.line2 - city = locations.city - state = locations.state postalCode = locations.postalCode - country = locations.country + state = locations.state additionalProperties = locations.additionalProperties.toMutableMap() } - fun line1(line1: Boolean) = line1(JsonField.of(line1)) + fun city(city: Boolean) = city(JsonField.of(city)) - fun line1(line1: JsonField) = apply { this.line1 = line1 } + fun city(city: JsonField) = apply { this.city = city } - fun line2(line2: Boolean) = line2(JsonField.of(line2)) + fun country(country: Boolean) = country(JsonField.of(country)) - fun line2(line2: JsonField) = apply { this.line2 = line2 } + fun country(country: JsonField) = apply { this.country = country } - fun city(city: Boolean) = city(JsonField.of(city)) + fun line1(line1: Boolean) = line1(JsonField.of(line1)) - fun city(city: JsonField) = apply { this.city = city } + fun line1(line1: JsonField) = apply { this.line1 = line1 } - fun state(state: Boolean) = state(JsonField.of(state)) + fun line2(line2: Boolean) = line2(JsonField.of(line2)) - fun state(state: JsonField) = apply { this.state = state } + fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) @@ -1469,9 +1469,9 @@ private constructor( this.postalCode = postalCode } - fun country(country: Boolean) = country(JsonField.of(country)) + fun state(state: Boolean) = state(JsonField.of(state)) - fun country(country: JsonField) = apply { this.country = country } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { @@ -1497,12 +1497,12 @@ private constructor( fun build(): Locations = Locations( + city, + country, line1, line2, - city, - state, postalCode, - country, + state, additionalProperties.toImmutable(), ) } @@ -1512,17 +1512,17 @@ private constructor( return true } - return /* spotless:off */ other is Locations && line1 == other.line1 && line2 == other.line2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Locations && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(line1, line2, city, state, postalCode, country, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Locations{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "Locations{city=$city, country=$country, line1=$line1, line2=$line2, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1530,42 +1530,42 @@ private constructor( return true } - return /* spotless:off */ other is SupportedCompanyFields && id == other.id && legalName == other.legalName && entity == other.entity && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && ein == other.ein && accounts == other.accounts && departments == other.departments && locations == other.locations && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedCompanyFields && id == other.id && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, legalName, entity, primaryEmail, primaryPhoneNumber, ein, accounts, departments, locations, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = 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}" + "SupportedCompanyFields{id=$id, accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect class SupportedDirectoryFields @JsonCreator private constructor( - @JsonProperty("paging") - @ExcludeMissing - private val paging: JsonField = JsonMissing.of(), @JsonProperty("individuals") @ExcludeMissing private val individuals: JsonField = JsonMissing.of(), + @JsonProperty("paging") + @ExcludeMissing + private val paging: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) - fun individuals(): Optional = Optional.ofNullable(individuals.getNullable("individuals")) - @JsonProperty("paging") @ExcludeMissing fun _paging() = paging + fun paging(): Optional = Optional.ofNullable(paging.getNullable("paging")) @JsonProperty("individuals") @ExcludeMissing fun _individuals() = individuals + @JsonProperty("paging") @ExcludeMissing fun _paging() = paging + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1574,8 +1574,8 @@ private constructor( fun validate(): SupportedDirectoryFields = apply { if (!validated) { - paging().map { it.validate() } individuals().map { it.validate() } + paging().map { it.validate() } validated = true } } @@ -1589,22 +1589,18 @@ private constructor( class Builder { - private var paging: JsonField = JsonMissing.of() private var individuals: JsonField = JsonMissing.of() + private var paging: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedDirectoryFields: SupportedDirectoryFields) = apply { - paging = supportedDirectoryFields.paging individuals = supportedDirectoryFields.individuals + paging = supportedDirectoryFields.paging additionalProperties = supportedDirectoryFields.additionalProperties.toMutableMap() } - fun paging(paging: Paging) = paging(JsonField.of(paging)) - - fun paging(paging: JsonField) = apply { this.paging = paging } - fun individuals(individuals: Individuals) = individuals(JsonField.of(individuals)) @@ -1612,6 +1608,10 @@ private constructor( this.individuals = individuals } + fun paging(paging: Paging) = paging(JsonField.of(paging)) + + fun paging(paging: JsonField) = apply { this.paging = paging } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1636,8 +1636,8 @@ private constructor( fun build(): SupportedDirectoryFields = SupportedDirectoryFields( - paging, individuals, + paging, additionalProperties.toImmutable(), ) } @@ -1649,62 +1649,62 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("department") + @ExcludeMissing + private val department: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") - @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("department") + @JsonProperty("last_name") @ExcludeMissing - private val department: JsonField = JsonMissing.of(), + private val lastName: JsonField = JsonMissing.of(), @JsonProperty("manager") @ExcludeMissing private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun department(): Optional = + Optional.ofNullable(department.getNullable("department")) + 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 lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonProperty("department") @ExcludeMissing fun _department() = department - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - @JsonProperty("department") @ExcludeMissing fun _department() = department + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1714,12 +1714,12 @@ private constructor( fun validate(): Individuals = apply { if (!validated) { id() + department() firstName() - middleName() - lastName() isActive() - department() + lastName() manager().map { it.validate() } + middleName() validated = true } } @@ -1734,24 +1734,24 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var department: 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 lastName: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individuals: Individuals) = apply { id = individuals.id + department = individuals.department firstName = individuals.firstName - middleName = individuals.middleName - lastName = individuals.lastName isActive = individuals.isActive - department = individuals.department + lastName = individuals.lastName manager = individuals.manager + middleName = individuals.middleName additionalProperties = individuals.additionalProperties.toMutableMap() } @@ -1759,16 +1759,22 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } + fun department(department: Boolean) = department(JsonField.of(department)) + + fun department(department: JsonField) = apply { + this.department = department + } + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName + fun isActive(isActive: JsonField) = apply { + this.isActive = isActive } fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) @@ -1777,22 +1783,16 @@ private constructor( this.lastName = lastName } - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) + fun manager(manager: Manager) = manager(JsonField.of(manager)) - fun isActive(isActive: JsonField) = apply { - this.isActive = isActive - } + fun manager(manager: JsonField) = apply { this.manager = manager } - fun department(department: Boolean) = department(JsonField.of(department)) + fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) - fun department(department: JsonField) = apply { - this.department = department + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName } - fun manager(manager: Manager) = manager(JsonField.of(manager)) - - fun manager(manager: JsonField) = apply { this.manager = manager } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1818,12 +1818,12 @@ private constructor( fun build(): Individuals = Individuals( id, + department, firstName, - middleName, - lastName, isActive, - department, + lastName, manager, + middleName, additionalProperties.toImmutable(), ) } @@ -1928,17 +1928,17 @@ private constructor( return true } - return /* spotless:off */ other is Individuals && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && isActive == other.isActive && department == other.department && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Individuals && id == other.id && department == other.department && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && manager == other.manager && middleName == other.middleName && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, isActive, department, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, department, firstName, isActive, lastName, manager, middleName, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Individuals{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, isActive=$isActive, department=$department, manager=$manager, additionalProperties=$additionalProperties}" + "Individuals{id=$id, department=$department, firstName=$firstName, isActive=$isActive, lastName=$lastName, manager=$manager, middleName=$middleName, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2060,17 +2060,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedDirectoryFields && paging == other.paging && individuals == other.individuals && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedDirectoryFields && individuals == other.individuals && paging == other.paging && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paging, individuals, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(individuals, paging, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedDirectoryFields{paging=$paging, individuals=$individuals, additionalProperties=$additionalProperties}" + "SupportedDirectoryFields{individuals=$individuals, paging=$paging, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2080,33 +2080,6 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("first_name") - @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") - @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("title") - @ExcludeMissing - private val title: JsonField = JsonMissing.of(), - @JsonProperty("start_date") - @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), - @JsonProperty("end_date") - @ExcludeMissing - private val endDate: JsonField = JsonMissing.of(), - @JsonProperty("is_active") - @ExcludeMissing - private val isActive: JsonField = JsonMissing.of(), - @JsonProperty("employment_status") - @ExcludeMissing - private val employmentStatus: JsonField = JsonMissing.of(), - @JsonProperty("income_history") - @ExcludeMissing - private val incomeHistory: JsonField = JsonMissing.of(), @JsonProperty("class_code") @ExcludeMissing private val classCode: JsonField = JsonMissing.of(), @@ -2119,46 +2092,47 @@ private constructor( @JsonProperty("employment") @ExcludeMissing private val employment: JsonField = JsonMissing.of(), + @JsonProperty("employment_status") + @ExcludeMissing + private val employmentStatus: JsonField = JsonMissing.of(), + @JsonProperty("end_date") + @ExcludeMissing + private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + private val firstName: JsonField = JsonMissing.of(), @JsonProperty("income") @ExcludeMissing private val income: JsonField = JsonMissing.of(), + @JsonProperty("income_history") + @ExcludeMissing + private val incomeHistory: JsonField = JsonMissing.of(), + @JsonProperty("is_active") + @ExcludeMissing + private val isActive: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + private val lastName: JsonField = JsonMissing.of(), @JsonProperty("location") @ExcludeMissing private val location: JsonField = JsonMissing.of(), @JsonProperty("manager") - @ExcludeMissing - private val manager: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - 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 title(): Optional = Optional.ofNullable(title.getNullable("title")) - - fun startDate(): Optional = - Optional.ofNullable(startDate.getNullable("start_date")) - - fun endDate(): Optional = - Optional.ofNullable(endDate.getNullable("end_date")) - - fun isActive(): Optional = - Optional.ofNullable(isActive.getNullable("is_active")) - - fun employmentStatus(): Optional = - Optional.ofNullable(employmentStatus.getNullable("employment_status")) + @ExcludeMissing + private val manager: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), + @JsonProperty("title") + @ExcludeMissing + private val title: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { - fun incomeHistory(): Optional = - Optional.ofNullable(incomeHistory.getNullable("income_history")) + fun id(): Optional = Optional.ofNullable(id.getNullable("id")) fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) @@ -2172,50 +2146,76 @@ private constructor( fun employment(): Optional = Optional.ofNullable(employment.getNullable("employment")) + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + + fun endDate(): Optional = + Optional.ofNullable(endDate.getNullable("end_date")) + + fun firstName(): Optional = + Optional.ofNullable(firstName.getNullable("first_name")) + fun income(): Optional = Optional.ofNullable(income.getNullable("income")) + fun incomeHistory(): Optional = + Optional.ofNullable(incomeHistory.getNullable("income_history")) + + fun isActive(): Optional = + Optional.ofNullable(isActive.getNullable("is_active")) + + fun lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) + fun location(): Optional = Optional.ofNullable(location.getNullable("location")) fun manager(): Optional = Optional.ofNullable(manager.getNullable("manager")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + fun startDate(): Optional = + Optional.ofNullable(startDate.getNullable("start_date")) - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + fun title(): Optional = Optional.ofNullable(title.getNullable("title")) - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("title") @ExcludeMissing fun _title() = title + @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields - @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + @JsonProperty("department") @ExcludeMissing fun _department() = department - @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + @JsonProperty("employment") @ExcludeMissing fun _employment() = employment @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus - @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory + @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate - @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - @JsonProperty("custom_fields") @ExcludeMissing fun _customFields() = customFields + @JsonProperty("income") @ExcludeMissing fun _income() = income - @JsonProperty("department") @ExcludeMissing fun _department() = department + @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory - @JsonProperty("employment") @ExcludeMissing fun _employment() = employment + @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive - @JsonProperty("income") @ExcludeMissing fun _income() = income + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName @JsonProperty("location") @ExcludeMissing fun _location() = location @JsonProperty("manager") @ExcludeMissing fun _manager() = manager + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + + @JsonProperty("title") @ExcludeMissing fun _title() = title + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2225,22 +2225,22 @@ private constructor( fun validate(): SupportedEmploymentFields = apply { if (!validated) { id() - firstName() - middleName() - lastName() - title() - startDate() - endDate() - isActive() - employmentStatus() - incomeHistory() classCode() customFields() department().map { it.validate() } employment().map { it.validate() } + employmentStatus() + endDate() + firstName() income().map { it.validate() } + incomeHistory() + isActive() + lastName() location().map { it.validate() } manager().map { it.validate() } + middleName() + startDate() + title() validated = true } } @@ -2255,44 +2255,44 @@ private constructor( 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 title: JsonField = JsonMissing.of() - private var startDate: JsonField = JsonMissing.of() - private var endDate: JsonField = JsonMissing.of() - private var isActive: JsonField = JsonMissing.of() - private var employmentStatus: JsonField = JsonMissing.of() - private var incomeHistory: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField = JsonMissing.of() private var department: JsonField = JsonMissing.of() private var employment: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() + private var endDate: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() + private var incomeHistory: JsonField = JsonMissing.of() + private var isActive: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() + private var title: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedEmploymentFields: SupportedEmploymentFields) = apply { id = supportedEmploymentFields.id - firstName = supportedEmploymentFields.firstName - middleName = supportedEmploymentFields.middleName - lastName = supportedEmploymentFields.lastName - title = supportedEmploymentFields.title - startDate = supportedEmploymentFields.startDate - endDate = supportedEmploymentFields.endDate - isActive = supportedEmploymentFields.isActive - employmentStatus = supportedEmploymentFields.employmentStatus - incomeHistory = supportedEmploymentFields.incomeHistory classCode = supportedEmploymentFields.classCode customFields = supportedEmploymentFields.customFields department = supportedEmploymentFields.department employment = supportedEmploymentFields.employment + employmentStatus = supportedEmploymentFields.employmentStatus + endDate = supportedEmploymentFields.endDate + firstName = supportedEmploymentFields.firstName income = supportedEmploymentFields.income + incomeHistory = supportedEmploymentFields.incomeHistory + isActive = supportedEmploymentFields.isActive + lastName = supportedEmploymentFields.lastName location = supportedEmploymentFields.location manager = supportedEmploymentFields.manager + middleName = supportedEmploymentFields.middleName + startDate = supportedEmploymentFields.startDate + title = supportedEmploymentFields.title additionalProperties = supportedEmploymentFields.additionalProperties.toMutableMap() } @@ -2301,46 +2301,51 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) + fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) - fun firstName(firstName: JsonField) = apply { - this.firstName = firstName + fun classCode(classCode: JsonField) = apply { + this.classCode = classCode } - fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) + fun customFields(customFields: Boolean) = + customFields(JsonField.of(customFields)) - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName + fun customFields(customFields: JsonField) = apply { + this.customFields = customFields } - fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) + fun department(department: Department) = department(JsonField.of(department)) - fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + fun department(department: JsonField) = apply { + this.department = department + } - fun title(title: Boolean) = title(JsonField.of(title)) + fun employment(employment: Employment) = employment(JsonField.of(employment)) - fun title(title: JsonField) = apply { this.title = title } + fun employment(employment: JsonField) = apply { + this.employment = employment + } - fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) + fun employmentStatus(employmentStatus: Boolean) = + employmentStatus(JsonField.of(employmentStatus)) - fun startDate(startDate: JsonField) = apply { - this.startDate = startDate + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus } fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName + } - fun employmentStatus(employmentStatus: Boolean) = - employmentStatus(JsonField.of(employmentStatus)) + fun income(income: Income) = income(JsonField.of(income)) - fun employmentStatus(employmentStatus: JsonField) = apply { - this.employmentStatus = employmentStatus - } + fun income(income: JsonField) = apply { this.income = income } fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) @@ -2349,42 +2354,37 @@ private constructor( this.incomeHistory = incomeHistory } - fun classCode(classCode: Boolean) = classCode(JsonField.of(classCode)) + fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive)) - fun classCode(classCode: JsonField) = apply { - this.classCode = classCode - } + fun isActive(isActive: JsonField) = apply { this.isActive = isActive } - fun customFields(customFields: Boolean) = - customFields(JsonField.of(customFields)) + fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - fun customFields(customFields: JsonField) = apply { - this.customFields = customFields - } + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - fun department(department: Department) = department(JsonField.of(department)) + fun location(location: Location) = location(JsonField.of(location)) - fun department(department: JsonField) = apply { - this.department = department - } + fun location(location: JsonField) = apply { this.location = location } - fun employment(employment: Employment) = employment(JsonField.of(employment)) + fun manager(manager: Manager) = manager(JsonField.of(manager)) - fun employment(employment: JsonField) = apply { - this.employment = employment - } + fun manager(manager: JsonField) = apply { this.manager = manager } - fun income(income: Income) = income(JsonField.of(income)) + fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) - fun income(income: JsonField) = apply { this.income = income } + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName + } - fun location(location: Location) = location(JsonField.of(location)) + fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) - fun location(location: JsonField) = apply { this.location = location } + fun startDate(startDate: JsonField) = apply { + this.startDate = startDate + } - fun manager(manager: Manager) = manager(JsonField.of(manager)) + fun title(title: Boolean) = title(JsonField.of(title)) - fun manager(manager: JsonField) = apply { this.manager = manager } + fun title(title: JsonField) = apply { this.title = title } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2411,22 +2411,22 @@ private constructor( fun build(): SupportedEmploymentFields = SupportedEmploymentFields( id, - firstName, - middleName, - lastName, - title, - startDate, - endDate, - isActive, - employmentStatus, - incomeHistory, classCode, customFields, department, employment, + employmentStatus, + endDate, + firstName, income, + incomeHistory, + isActive, + lastName, location, manager, + middleName, + startDate, + title, additionalProperties.toImmutable(), ) } @@ -2530,25 +2530,25 @@ private constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("subtype") @ExcludeMissing private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2557,8 +2557,8 @@ private constructor( fun validate(): Employment = apply { if (!validated) { - type() subtype() + type() validated = true } } @@ -2572,26 +2572,26 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - fun subtype(subtype: Boolean) = subtype(JsonField.of(subtype)) fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2616,8 +2616,8 @@ private constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -2627,17 +2627,17 @@ private constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2776,53 +2776,53 @@ private constructor( class Location @JsonCreator private constructor( + @JsonProperty("city") + @ExcludeMissing + private val city: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), @JsonProperty("line1") @ExcludeMissing private val line1: JsonField = JsonMissing.of(), @JsonProperty("line2") @ExcludeMissing private val line2: JsonField = JsonMissing.of(), - @JsonProperty("city") - @ExcludeMissing - private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), @JsonProperty("postal_code") @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun city(): Optional = Optional.ofNullable(city.getNullable("city")) + + fun country(): Optional = + Optional.ofNullable(country.getNullable("country")) + 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 postalCode(): Optional = + Optional.ofNullable(postalCode.getNullable("postal_code")) fun state(): Optional = Optional.ofNullable(state.getNullable("state")) - fun postalCode(): Optional = - Optional.ofNullable(postalCode.getNullable("postal_code")) + @JsonProperty("city") @ExcludeMissing fun _city() = city - fun country(): Optional = - Optional.ofNullable(country.getNullable("country")) + @JsonProperty("country") @ExcludeMissing fun _country() = 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 + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -2832,12 +2832,12 @@ private constructor( fun validate(): Location = apply { if (!validated) { + city() + country() line1() line2() - city() - state() postalCode() - country() + state() validated = true } } @@ -2851,41 +2851,41 @@ private constructor( class Builder { + private var city: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() 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 state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(location: Location) = apply { + city = location.city + country = location.country line1 = location.line1 line2 = location.line2 - city = location.city - state = location.state postalCode = location.postalCode - country = location.country + state = location.state additionalProperties = location.additionalProperties.toMutableMap() } - fun line1(line1: Boolean) = line1(JsonField.of(line1)) + fun city(city: Boolean) = city(JsonField.of(city)) - fun line1(line1: JsonField) = apply { this.line1 = line1 } + fun city(city: JsonField) = apply { this.city = city } - fun line2(line2: Boolean) = line2(JsonField.of(line2)) + fun country(country: Boolean) = country(JsonField.of(country)) - fun line2(line2: JsonField) = apply { this.line2 = line2 } + fun country(country: JsonField) = apply { this.country = country } - fun city(city: Boolean) = city(JsonField.of(city)) + fun line1(line1: Boolean) = line1(JsonField.of(line1)) - fun city(city: JsonField) = apply { this.city = city } + fun line1(line1: JsonField) = apply { this.line1 = line1 } - fun state(state: Boolean) = state(JsonField.of(state)) + fun line2(line2: Boolean) = line2(JsonField.of(line2)) - fun state(state: JsonField) = apply { this.state = state } + fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: Boolean) = postalCode(JsonField.of(postalCode)) @@ -2893,9 +2893,9 @@ private constructor( this.postalCode = postalCode } - fun country(country: Boolean) = country(JsonField.of(country)) + fun state(state: Boolean) = state(JsonField.of(state)) - fun country(country: JsonField) = apply { this.country = country } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { @@ -2921,12 +2921,12 @@ private constructor( fun build(): Location = Location( + city, + country, line1, line2, - city, - state, postalCode, - country, + state, additionalProperties.toImmutable(), ) } @@ -2936,17 +2936,17 @@ private constructor( return true } - return /* spotless:off */ other is Location && line1 == other.line1 && line2 == other.line2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Location && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(line1, line2, city, state, postalCode, country, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Location{line1=$line1, line2=$line2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "Location{city=$city, country=$country, line1=$line1, line2=$line2, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3048,17 +3048,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && employmentStatus == other.employmentStatus && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && location == other.location && manager == other.manager && middleName == other.middleName && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, employmentStatus, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, location, manager, middleName, startDate, title, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" + "SupportedEmploymentFields{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, location=$location, manager=$manager, middleName=$middleName, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3068,106 +3068,106 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("first_name") - @ExcludeMissing - private val firstName: JsonField = JsonMissing.of(), - @JsonProperty("middle_name") - @ExcludeMissing - private val middleName: JsonField = JsonMissing.of(), - @JsonProperty("last_name") - @ExcludeMissing - private val lastName: JsonField = JsonMissing.of(), - @JsonProperty("preferred_name") - @ExcludeMissing - private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), - @JsonProperty("gender") + @JsonProperty("emails") @ExcludeMissing - private val gender: JsonField = JsonMissing.of(), + private val emails: JsonField = JsonMissing.of(), + @JsonProperty("encrypted_ssn") + @ExcludeMissing + private val encryptedSsn: JsonField = JsonMissing.of(), @JsonProperty("ethnicity") @ExcludeMissing private val ethnicity: JsonField = JsonMissing.of(), - @JsonProperty("ssn") + @JsonProperty("first_name") @ExcludeMissing - private val ssn: JsonField = JsonMissing.of(), - @JsonProperty("encrypted_ssn") + private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("gender") @ExcludeMissing - private val encryptedSsn: JsonField = JsonMissing.of(), - @JsonProperty("emails") + private val gender: JsonField = JsonMissing.of(), + @JsonProperty("last_name") @ExcludeMissing - private val emails: JsonField = JsonMissing.of(), + private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("middle_name") + @ExcludeMissing + private val middleName: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField = JsonMissing.of(), + @JsonProperty("preferred_name") + @ExcludeMissing + private val preferredName: JsonField = JsonMissing.of(), @JsonProperty("residence") @ExcludeMissing private val residence: JsonField = JsonMissing.of(), + @JsonProperty("ssn") + @ExcludeMissing + private val ssn: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { 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 preferredName(): Optional = - Optional.ofNullable(preferredName.getNullable("preferred_name")) - fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) + fun emails(): Optional = Optional.ofNullable(emails.getNullable("emails")) + + fun encryptedSsn(): Optional = + Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) fun ethnicity(): Optional = Optional.ofNullable(ethnicity.getNullable("ethnicity")) - fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) + fun firstName(): Optional = + Optional.ofNullable(firstName.getNullable("first_name")) - fun encryptedSsn(): Optional = - Optional.ofNullable(encryptedSsn.getNullable("encrypted_ssn")) + fun gender(): Optional = Optional.ofNullable(gender.getNullable("gender")) - fun emails(): Optional = Optional.ofNullable(emails.getNullable("emails")) + fun lastName(): Optional = + Optional.ofNullable(lastName.getNullable("last_name")) + + fun middleName(): Optional = + Optional.ofNullable(middleName.getNullable("middle_name")) fun phoneNumbers(): Optional = Optional.ofNullable(phoneNumbers.getNullable("phone_numbers")) + fun preferredName(): Optional = + Optional.ofNullable(preferredName.getNullable("preferred_name")) + fun residence(): Optional = Optional.ofNullable(residence.getNullable("residence")) + fun ssn(): Optional = Optional.ofNullable(ssn.getNullable("ssn")) + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName + @JsonProperty("emails") @ExcludeMissing fun _emails() = emails - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn - @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName + @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity - @JsonProperty("dob") @ExcludeMissing fun _dob() = dob + @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @JsonProperty("gender") @ExcludeMissing fun _gender() = gender - @JsonProperty("ethnicity") @ExcludeMissing fun _ethnicity() = ethnicity - - @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn - - @JsonProperty("encrypted_ssn") @ExcludeMissing fun _encryptedSsn() = encryptedSsn + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - @JsonProperty("emails") @ExcludeMissing fun _emails() = emails + @JsonProperty("middle_name") @ExcludeMissing fun _middleName() = middleName @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers + @JsonProperty("preferred_name") @ExcludeMissing fun _preferredName() = preferredName + @JsonProperty("residence") @ExcludeMissing fun _residence() = residence + @JsonProperty("ssn") @ExcludeMissing fun _ssn() = ssn + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -3177,18 +3177,18 @@ private constructor( fun validate(): SupportedIndividualFields = apply { if (!validated) { id() - firstName() - middleName() - lastName() - preferredName() dob() - gender() - ethnicity() - ssn() - encryptedSsn() emails().map { it.validate() } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() phoneNumbers().map { it.validate() } + preferredName() residence().map { it.validate() } + ssn() validated = true } } @@ -3203,36 +3203,36 @@ private constructor( 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 preferredName: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() - private var gender: JsonField = JsonMissing.of() - private var ethnicity: JsonField = JsonMissing.of() - private var ssn: JsonField = JsonMissing.of() - private var encryptedSsn: JsonField = JsonMissing.of() private var emails: JsonField = JsonMissing.of() + private var encryptedSsn: JsonField = JsonMissing.of() + private var ethnicity: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() + private var gender: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() + private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField = JsonMissing.of() + private var preferredName: JsonField = JsonMissing.of() private var residence: JsonField = JsonMissing.of() + private var ssn: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedIndividualFields: SupportedIndividualFields) = apply { id = supportedIndividualFields.id - firstName = supportedIndividualFields.firstName - middleName = supportedIndividualFields.middleName - lastName = supportedIndividualFields.lastName - preferredName = supportedIndividualFields.preferredName dob = supportedIndividualFields.dob - gender = supportedIndividualFields.gender - ethnicity = supportedIndividualFields.ethnicity - ssn = supportedIndividualFields.ssn - encryptedSsn = supportedIndividualFields.encryptedSsn emails = supportedIndividualFields.emails + encryptedSsn = supportedIndividualFields.encryptedSsn + ethnicity = supportedIndividualFields.ethnicity + firstName = supportedIndividualFields.firstName + gender = supportedIndividualFields.gender + lastName = supportedIndividualFields.lastName + middleName = supportedIndividualFields.middleName phoneNumbers = supportedIndividualFields.phoneNumbers + preferredName = supportedIndividualFields.preferredName residence = supportedIndividualFields.residence + ssn = supportedIndividualFields.ssn additionalProperties = supportedIndividualFields.additionalProperties.toMutableMap() } @@ -3241,36 +3241,20 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - - fun firstName(firstName: JsonField) = apply { - this.firstName = firstName - } - - fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) - - fun middleName(middleName: JsonField) = apply { - this.middleName = middleName - } - - fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - - fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - - fun preferredName(preferredName: Boolean) = - preferredName(JsonField.of(preferredName)) - - fun preferredName(preferredName: JsonField) = apply { - this.preferredName = preferredName - } - fun dob(dob: Boolean) = dob(JsonField.of(dob)) fun dob(dob: JsonField) = apply { this.dob = dob } - fun gender(gender: Boolean) = gender(JsonField.of(gender)) + fun emails(emails: Emails) = emails(JsonField.of(emails)) + + fun emails(emails: JsonField) = apply { this.emails = emails } + + fun encryptedSsn(encryptedSsn: Boolean) = + encryptedSsn(JsonField.of(encryptedSsn)) - fun gender(gender: JsonField) = apply { this.gender = gender } + fun encryptedSsn(encryptedSsn: JsonField) = apply { + this.encryptedSsn = encryptedSsn + } fun ethnicity(ethnicity: Boolean) = ethnicity(JsonField.of(ethnicity)) @@ -3278,20 +3262,25 @@ private constructor( this.ethnicity = ethnicity } - fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) + fun firstName(firstName: Boolean) = firstName(JsonField.of(firstName)) - fun ssn(ssn: JsonField) = apply { this.ssn = ssn } + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName + } - fun encryptedSsn(encryptedSsn: Boolean) = - encryptedSsn(JsonField.of(encryptedSsn)) + fun gender(gender: Boolean) = gender(JsonField.of(gender)) - fun encryptedSsn(encryptedSsn: JsonField) = apply { - this.encryptedSsn = encryptedSsn - } + fun gender(gender: JsonField) = apply { this.gender = gender } - fun emails(emails: Emails) = emails(JsonField.of(emails)) + fun lastName(lastName: Boolean) = lastName(JsonField.of(lastName)) - fun emails(emails: JsonField) = apply { this.emails = emails } + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + + fun middleName(middleName: Boolean) = middleName(JsonField.of(middleName)) + + fun middleName(middleName: JsonField) = apply { + this.middleName = middleName + } fun phoneNumbers(phoneNumbers: PhoneNumbers) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -3300,12 +3289,23 @@ private constructor( this.phoneNumbers = phoneNumbers } + fun preferredName(preferredName: Boolean) = + preferredName(JsonField.of(preferredName)) + + fun preferredName(preferredName: JsonField) = apply { + this.preferredName = preferredName + } + fun residence(residence: Residence) = residence(JsonField.of(residence)) fun residence(residence: JsonField) = apply { this.residence = residence } + fun ssn(ssn: Boolean) = ssn(JsonField.of(ssn)) + + fun ssn(ssn: JsonField) = apply { this.ssn = ssn } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -3331,18 +3331,18 @@ private constructor( fun build(): SupportedIndividualFields = SupportedIndividualFields( id, - firstName, - middleName, - lastName, - preferredName, dob, - gender, - ethnicity, - ssn, - encryptedSsn, emails, + encryptedSsn, + ethnicity, + firstName, + gender, + lastName, + middleName, phoneNumbers, + preferredName, residence, + ssn, additionalProperties.toImmutable(), ) } @@ -3755,17 +3755,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedIndividualFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && dob == other.dob && gender == other.gender && ethnicity == other.ethnicity && ssn == other.ssn && encryptedSsn == other.encryptedSsn && emails == other.emails && phoneNumbers == other.phoneNumbers && residence == other.residence && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedIndividualFields && id == other.id && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, preferredName, dob, gender, ethnicity, ssn, encryptedSsn, emails, phoneNumbers, residence, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedIndividualFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, dob=$dob, gender=$gender, ethnicity=$ethnicity, ssn=$ssn, encryptedSsn=$encryptedSsn, emails=$emails, phoneNumbers=$phoneNumbers, residence=$residence, additionalProperties=$additionalProperties}" + "SupportedIndividualFields{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -3775,39 +3775,39 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("individual_ids") + @ExcludeMissing + private val individualIds: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("pay_frequencies") @ExcludeMissing private val payFrequencies: JsonField = JsonMissing.of(), - @JsonProperty("individual_ids") - @ExcludeMissing - private val individualIds: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) + fun individualIds(): Optional = + Optional.ofNullable(individualIds.getNullable("individual_ids")) + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) fun payFrequencies(): Optional = Optional.ofNullable(payFrequencies.getNullable("pay_frequencies")) - fun individualIds(): Optional = - Optional.ofNullable(individualIds.getNullable("individual_ids")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds + @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies - @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -3817,9 +3817,9 @@ private constructor( fun validate(): SupportedPayGroupFields = apply { if (!validated) { id() + individualIds() name() payFrequencies() - individualIds() validated = true } } @@ -3834,17 +3834,17 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() + private var individualIds: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var payFrequencies: JsonField = JsonMissing.of() - private var individualIds: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedPayGroupFields: SupportedPayGroupFields) = apply { id = supportedPayGroupFields.id + individualIds = supportedPayGroupFields.individualIds name = supportedPayGroupFields.name payFrequencies = supportedPayGroupFields.payFrequencies - individualIds = supportedPayGroupFields.individualIds additionalProperties = supportedPayGroupFields.additionalProperties.toMutableMap() } @@ -3853,6 +3853,13 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } + fun individualIds(individualIds: Boolean) = + individualIds(JsonField.of(individualIds)) + + fun individualIds(individualIds: JsonField) = apply { + this.individualIds = individualIds + } + fun name(name: Boolean) = name(JsonField.of(name)) fun name(name: JsonField) = apply { this.name = name } @@ -3864,13 +3871,6 @@ private constructor( this.payFrequencies = payFrequencies } - fun individualIds(individualIds: Boolean) = - individualIds(JsonField.of(individualIds)) - - fun individualIds(individualIds: JsonField) = apply { - this.individualIds = individualIds - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -3896,9 +3896,9 @@ private constructor( fun build(): SupportedPayGroupFields = SupportedPayGroupFields( id, + individualIds, name, payFrequencies, - individualIds, additionalProperties.toImmutable(), ) } @@ -3908,17 +3908,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPayGroupFields && id == other.id && name == other.name && payFrequencies == other.payFrequencies && individualIds == other.individualIds && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedPayGroupFields && id == other.id && individualIds == other.individualIds && name == other.name && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, payFrequencies, individualIds, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, individualIds, name, payFrequencies, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedPayGroupFields{id=$id, name=$name, payFrequencies=$payFrequencies, individualIds=$individualIds, additionalProperties=$additionalProperties}" + "SupportedPayGroupFields{id=$id, individualIds=$individualIds, name=$name, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -4138,24 +4138,6 @@ private constructor( class PayStatements @JsonCreator private constructor( - @JsonProperty("individual_id") - @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("payment_method") - @ExcludeMissing - private val paymentMethod: JsonField = JsonMissing.of(), - @JsonProperty("total_hours") - @ExcludeMissing - private val totalHours: JsonField = JsonMissing.of(), - @JsonProperty("gross_pay") - @ExcludeMissing - private val grossPay: JsonField = JsonMissing.of(), - @JsonProperty("net_pay") - @ExcludeMissing - private val netPay: JsonField = JsonMissing.of(), @JsonProperty("earnings") @ExcludeMissing private val earnings: JsonField = JsonMissing.of(), @@ -4167,30 +4149,31 @@ private constructor( @ExcludeMissing private val employerContributions: JsonField = JsonMissing.of(), + @JsonProperty("gross_pay") + @ExcludeMissing + private val grossPay: JsonField = JsonMissing.of(), + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonProperty("net_pay") + @ExcludeMissing + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("payment_method") + @ExcludeMissing + private val paymentMethod: JsonField = JsonMissing.of(), @JsonProperty("taxes") @ExcludeMissing private val taxes: JsonField = JsonMissing.of(), + @JsonProperty("total_hours") + @ExcludeMissing + private val totalHours: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) - - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - - fun paymentMethod(): Optional = - Optional.ofNullable(paymentMethod.getNullable("payment_method")) - - fun totalHours(): Optional = - Optional.ofNullable(totalHours.getNullable("total_hours")) - - fun grossPay(): Optional = - Optional.ofNullable(grossPay.getNullable("gross_pay")) - - fun netPay(): Optional = - Optional.ofNullable(netPay.getNullable("net_pay")) - fun earnings(): Optional = Optional.ofNullable(earnings.getNullable("earnings")) @@ -4202,23 +4185,24 @@ private constructor( employerContributions.getNullable("employer_contributions") ) - fun taxes(): Optional = Optional.ofNullable(taxes.getNullable("taxes")) + fun grossPay(): Optional = + Optional.ofNullable(grossPay.getNullable("gross_pay")) - @JsonProperty("individual_id") - @ExcludeMissing - fun _individualId() = individualId + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun netPay(): Optional = + Optional.ofNullable(netPay.getNullable("net_pay")) - @JsonProperty("payment_method") - @ExcludeMissing - fun _paymentMethod() = paymentMethod + fun paymentMethod(): Optional = + Optional.ofNullable(paymentMethod.getNullable("payment_method")) - @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + fun taxes(): Optional = Optional.ofNullable(taxes.getNullable("taxes")) - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + fun totalHours(): Optional = + Optional.ofNullable(totalHours.getNullable("total_hours")) - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) @JsonProperty("earnings") @ExcludeMissing fun _earnings() = earnings @@ -4230,8 +4214,24 @@ private constructor( @ExcludeMissing fun _employerContributions() = employerContributions + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + + @JsonProperty("individual_id") + @ExcludeMissing + fun _individualId() = individualId + + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + + @JsonProperty("payment_method") + @ExcludeMissing + fun _paymentMethod() = paymentMethod + @JsonProperty("taxes") @ExcludeMissing fun _taxes() = taxes + @JsonProperty("total_hours") @ExcludeMissing fun _totalHours() = totalHours + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4240,16 +4240,16 @@ private constructor( fun validate(): PayStatements = apply { if (!validated) { - individualId() - type() - paymentMethod() - totalHours() - grossPay() - netPay() earnings().map { it.validate() } employeeDeductions().map { it.validate() } employerContributions().map { it.validate() } + grossPay() + individualId() + netPay() + paymentMethod() taxes().map { it.validate() } + totalHours() + type() validated = true } } @@ -4263,59 +4263,56 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var paymentMethod: JsonField = JsonMissing.of() - private var totalHours: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() private var earnings: JsonField = JsonMissing.of() private var employeeDeductions: JsonField = JsonMissing.of() private var employerContributions: JsonField = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var paymentMethod: JsonField = JsonMissing.of() private var taxes: JsonField = JsonMissing.of() + private var totalHours: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatements: PayStatements) = apply { - individualId = payStatements.individualId - type = payStatements.type - paymentMethod = payStatements.paymentMethod - totalHours = payStatements.totalHours - grossPay = payStatements.grossPay - netPay = payStatements.netPay earnings = payStatements.earnings employeeDeductions = payStatements.employeeDeductions employerContributions = payStatements.employerContributions + grossPay = payStatements.grossPay + individualId = payStatements.individualId + netPay = payStatements.netPay + paymentMethod = payStatements.paymentMethod taxes = payStatements.taxes + totalHours = payStatements.totalHours + type = payStatements.type additionalProperties = payStatements.additionalProperties.toMutableMap() } - fun individualId(individualId: Boolean) = - individualId(JsonField.of(individualId)) + fun earnings(earnings: Earnings) = earnings(JsonField.of(earnings)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId + fun earnings(earnings: JsonField) = apply { + this.earnings = earnings } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - - fun paymentMethod(paymentMethod: Boolean) = - paymentMethod(JsonField.of(paymentMethod)) + fun employeeDeductions(employeeDeductions: EmployeeDeductions) = + employeeDeductions(JsonField.of(employeeDeductions)) - fun paymentMethod(paymentMethod: JsonField) = apply { - this.paymentMethod = paymentMethod - } + fun employeeDeductions(employeeDeductions: JsonField) = + apply { + this.employeeDeductions = employeeDeductions + } - fun totalHours(totalHours: Boolean) = totalHours(JsonField.of(totalHours)) + fun employerContributions(employerContributions: EmployerContributions) = + employerContributions(JsonField.of(employerContributions)) - fun totalHours(totalHours: JsonField) = apply { - this.totalHours = totalHours - } + fun employerContributions( + employerContributions: JsonField + ) = apply { this.employerContributions = employerContributions } fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) @@ -4323,34 +4320,37 @@ private constructor( this.grossPay = grossPay } + fun individualId(individualId: Boolean) = + individualId(JsonField.of(individualId)) + + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } + fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) fun netPay(netPay: JsonField) = apply { this.netPay = netPay } - fun earnings(earnings: Earnings) = earnings(JsonField.of(earnings)) + fun paymentMethod(paymentMethod: Boolean) = + paymentMethod(JsonField.of(paymentMethod)) - fun earnings(earnings: JsonField) = apply { - this.earnings = earnings + fun paymentMethod(paymentMethod: JsonField) = apply { + this.paymentMethod = paymentMethod } - fun employeeDeductions(employeeDeductions: EmployeeDeductions) = - employeeDeductions(JsonField.of(employeeDeductions)) + fun taxes(taxes: Taxes) = taxes(JsonField.of(taxes)) - fun employeeDeductions(employeeDeductions: JsonField) = - apply { - this.employeeDeductions = employeeDeductions - } + fun taxes(taxes: JsonField) = apply { this.taxes = taxes } - fun employerContributions(employerContributions: EmployerContributions) = - employerContributions(JsonField.of(employerContributions)) + fun totalHours(totalHours: Boolean) = totalHours(JsonField.of(totalHours)) - fun employerContributions( - employerContributions: JsonField - ) = apply { this.employerContributions = employerContributions } + fun totalHours(totalHours: JsonField) = apply { + this.totalHours = totalHours + } - fun taxes(taxes: Taxes) = taxes(JsonField.of(taxes)) + fun type(type: Boolean) = type(JsonField.of(type)) - fun taxes(taxes: JsonField) = apply { this.taxes = taxes } + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -4376,16 +4376,16 @@ private constructor( fun build(): PayStatements = PayStatements( - individualId, - type, - paymentMethod, - totalHours, - grossPay, - netPay, earnings, employeeDeductions, employerContributions, + grossPay, + individualId, + netPay, + paymentMethod, taxes, + totalHours, + type, additionalProperties.toImmutable(), ) } @@ -4394,43 +4394,43 @@ private constructor( class Earnings @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4439,10 +4439,10 @@ private constructor( fun validate(): Earnings = apply { if (!validated) { - type() - name() amount() currency() + name() + type() validated = true } } @@ -4456,30 +4456,22 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(earnings: Earnings) = apply { - type = earnings.type - name = earnings.name amount = earnings.amount currency = earnings.currency + name = earnings.name + type = earnings.type additionalProperties = earnings.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { this.amount = amount } @@ -4490,6 +4482,14 @@ private constructor( this.currency = currency } + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + + fun type(type: Boolean) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -4514,10 +4514,10 @@ private constructor( fun build(): Earnings = Earnings( - type, - name, amount, currency, + name, + type, additionalProperties.toImmutable(), ) } @@ -4527,67 +4527,67 @@ private constructor( return true } - return /* spotless:off */ other is Earnings && type == other.type && name == other.name && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earnings && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earnings{type=$type, name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Earnings{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployeeDeductions @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("currency") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonProperty("pre_tax") @ExcludeMissing private val preTax: JsonField = JsonMissing.of(), - @JsonProperty("currency") + @JsonProperty("type") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) + fun currency(): Optional = + Optional.ofNullable(currency.getNullable("currency")) + + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) fun preTax(): Optional = Optional.ofNullable(preTax.getNullable("pre_tax")) - fun currency(): Optional = - Optional.ofNullable(currency.getNullable("currency")) - - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonProperty("pre_tax") @ExcludeMissing fun _preTax() = preTax - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @ExcludeMissing @@ -4597,11 +4597,11 @@ private constructor( fun validate(): EmployeeDeductions = apply { if (!validated) { - name() amount() - type() - preTax() currency() + name() + preTax() + type() validated = true } } @@ -4615,46 +4615,46 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var preTax: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var preTax: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employeeDeductions: EmployeeDeductions) = apply { - name = employeeDeductions.name amount = employeeDeductions.amount - type = employeeDeductions.type - preTax = employeeDeductions.preTax currency = employeeDeductions.currency + name = employeeDeductions.name + preTax = employeeDeductions.preTax + type = employeeDeductions.type additionalProperties = employeeDeductions.additionalProperties.toMutableMap() } - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { this.amount = amount } - fun type(type: Boolean) = type(JsonField.of(type)) + fun currency(currency: Boolean) = currency(JsonField.of(currency)) - fun type(type: JsonField) = apply { this.type = type } + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } fun preTax(preTax: Boolean) = preTax(JsonField.of(preTax)) fun preTax(preTax: JsonField) = apply { this.preTax = preTax } - fun currency(currency: Boolean) = currency(JsonField.of(currency)) + fun type(type: Boolean) = type(JsonField.of(type)) - fun currency(currency: JsonField) = apply { - this.currency = currency - } + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -4680,11 +4680,11 @@ private constructor( fun build(): EmployeeDeductions = EmployeeDeductions( - name, amount, - type, - preTax, currency, + name, + preTax, + type, additionalProperties.toImmutable(), ) } @@ -4694,52 +4694,52 @@ private constructor( return true } - return /* spotless:off */ other is EmployeeDeductions && name == other.name && amount == other.amount && type == other.type && preTax == other.preTax && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeductions && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, type, preTax, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeductions{name=$name, amount=$amount, type=$type, preTax=$preTax, currency=$currency, additionalProperties=$additionalProperties}" + "EmployeeDeductions{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployerContributions @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("name") @ExcludeMissing fun _name() = name + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4748,9 +4748,9 @@ private constructor( fun validate(): EmployerContributions = apply { if (!validated) { - name() amount() currency() + name() validated = true } } @@ -4764,26 +4764,22 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employerContributions: EmployerContributions) = apply { - name = employerContributions.name amount = employerContributions.amount currency = employerContributions.currency + name = employerContributions.name additionalProperties = employerContributions.additionalProperties.toMutableMap() } - fun name(name: Boolean) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) fun amount(amount: JsonField) = apply { this.amount = amount } @@ -4794,6 +4790,10 @@ private constructor( this.currency = currency } + fun name(name: Boolean) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -4818,9 +4818,9 @@ private constructor( fun build(): EmployerContributions = EmployerContributions( - name, amount, currency, + name, additionalProperties.toImmutable(), ) } @@ -4830,68 +4830,68 @@ private constructor( return true } - return /* spotless:off */ other is EmployerContributions && name == other.name && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContributions && amount == other.amount && currency == other.currency && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContributions{name=$name, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "EmployerContributions{amount=$amount, currency=$currency, name=$name, additionalProperties=$additionalProperties}" } @NoAutoDetect class Taxes @JsonCreator private constructor( - @JsonProperty("type") + @JsonProperty("amount") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("name") + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing - private val name: JsonField = JsonMissing.of(), + private val currency: JsonField = JsonMissing.of(), @JsonProperty("employer") @ExcludeMissing private val employer: JsonField = JsonMissing.of(), - @JsonProperty("amount") + @JsonProperty("name") @ExcludeMissing - private val amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val name: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Optional = - Optional.ofNullable(type.getNullable("type")) - - fun name(): Optional = - Optional.ofNullable(name.getNullable("name")) - - fun employer(): Optional = - Optional.ofNullable(employer.getNullable("employer")) - fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun employer(): Optional = + Optional.ofNullable(employer.getNullable("employer")) - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = + Optional.ofNullable(name.getNullable("name")) - @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + fun type(): Optional = + Optional.ofNullable(type.getNullable("type")) @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("employer") @ExcludeMissing fun _employer() = employer + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4900,11 +4900,11 @@ private constructor( fun validate(): Taxes = apply { if (!validated) { - type() - name() - employer() amount() currency() + employer() + name() + type() validated = true } } @@ -4918,31 +4918,33 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var employer: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var employer: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(taxes: Taxes) = apply { - type = taxes.type - name = taxes.name - employer = taxes.employer amount = taxes.amount currency = taxes.currency + employer = taxes.employer + name = taxes.name + type = taxes.type additionalProperties = taxes.additionalProperties.toMutableMap() } - fun type(type: Boolean) = type(JsonField.of(type)) + fun amount(amount: Boolean) = amount(JsonField.of(amount)) - fun type(type: JsonField) = apply { this.type = type } + fun amount(amount: JsonField) = apply { this.amount = amount } - fun name(name: Boolean) = name(JsonField.of(name)) + fun currency(currency: Boolean) = currency(JsonField.of(currency)) - fun name(name: JsonField) = apply { this.name = name } + fun currency(currency: JsonField) = apply { + this.currency = currency + } fun employer(employer: Boolean) = employer(JsonField.of(employer)) @@ -4950,15 +4952,13 @@ private constructor( this.employer = employer } - fun amount(amount: Boolean) = amount(JsonField.of(amount)) + fun name(name: Boolean) = name(JsonField.of(name)) - fun amount(amount: JsonField) = apply { this.amount = amount } + fun name(name: JsonField) = apply { this.name = name } - fun currency(currency: Boolean) = currency(JsonField.of(currency)) + fun type(type: Boolean) = type(JsonField.of(type)) - fun currency(currency: JsonField) = apply { - this.currency = currency - } + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -4984,11 +4984,11 @@ private constructor( fun build(): Taxes = Taxes( - type, - name, - employer, amount, currency, + employer, + name, + type, additionalProperties.toImmutable(), ) } @@ -4998,17 +4998,17 @@ private constructor( return true } - return /* spotless:off */ other is Taxes && type == other.type && name == other.name && employer == other.employer && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Taxes && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, employer, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Taxes{type=$type, name=$name, employer=$employer, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Taxes{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5016,17 +5016,17 @@ private constructor( return true } - return /* spotless:off */ other is PayStatements && individualId == other.individualId && type == other.type && paymentMethod == other.paymentMethod && totalHours == other.totalHours && grossPay == other.grossPay && netPay == other.netPay && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && taxes == other.taxes && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatements && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && grossPay == other.grossPay && individualId == other.individualId && netPay == other.netPay && paymentMethod == other.paymentMethod && taxes == other.taxes && totalHours == other.totalHours && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, type, paymentMethod, totalHours, grossPay, netPay, earnings, employeeDeductions, employerContributions, taxes, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(earnings, employeeDeductions, employerContributions, grossPay, individualId, netPay, paymentMethod, taxes, totalHours, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatements{individualId=$individualId, type=$type, paymentMethod=$paymentMethod, totalHours=$totalHours, grossPay=$grossPay, netPay=$netPay, earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, taxes=$taxes, additionalProperties=$additionalProperties}" + "PayStatements{earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, grossPay=$grossPay, individualId=$individualId, netPay=$netPay, paymentMethod=$paymentMethod, taxes=$taxes, totalHours=$totalHours, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5054,103 +5054,103 @@ private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), - @JsonProperty("pay_date") - @ExcludeMissing - private val payDate: JsonField = JsonMissing.of(), - @JsonProperty("debit_date") - @ExcludeMissing - private val debitDate: JsonField = JsonMissing.of(), @JsonProperty("company_debit") @ExcludeMissing private val companyDebit: JsonField = JsonMissing.of(), - @JsonProperty("gross_pay") + @JsonProperty("debit_date") @ExcludeMissing - private val grossPay: JsonField = JsonMissing.of(), - @JsonProperty("net_pay") + private val debitDate: JsonField = JsonMissing.of(), + @JsonProperty("employee_taxes") @ExcludeMissing - private val netPay: JsonField = JsonMissing.of(), + private val employeeTaxes: JsonField = JsonMissing.of(), @JsonProperty("employer_taxes") @ExcludeMissing private val employerTaxes: JsonField = JsonMissing.of(), - @JsonProperty("employee_taxes") + @JsonProperty("gross_pay") @ExcludeMissing - private val employeeTaxes: JsonField = JsonMissing.of(), + private val grossPay: JsonField = JsonMissing.of(), @JsonProperty("individual_ids") @ExcludeMissing private val individualIds: JsonField = JsonMissing.of(), - @JsonProperty("pay_period") + @JsonProperty("net_pay") @ExcludeMissing - private val payPeriod: JsonField = JsonMissing.of(), - @JsonProperty("pay_group_ids") + private val netPay: JsonField = JsonMissing.of(), + @JsonProperty("pay_date") @ExcludeMissing - private val payGroupIds: JsonField = JsonMissing.of(), + private val payDate: JsonField = JsonMissing.of(), @JsonProperty("pay_frequencies") @ExcludeMissing private val payFrequencies: JsonField = JsonMissing.of(), + @JsonProperty("pay_group_ids") + @ExcludeMissing + private val payGroupIds: JsonField = JsonMissing.of(), + @JsonProperty("pay_period") + @ExcludeMissing + private val payPeriod: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun id(): Optional = Optional.ofNullable(id.getNullable("id")) - fun payDate(): Optional = - Optional.ofNullable(payDate.getNullable("pay_date")) - - fun debitDate(): Optional = - Optional.ofNullable(debitDate.getNullable("debit_date")) - fun companyDebit(): Optional = Optional.ofNullable(companyDebit.getNullable("company_debit")) - fun grossPay(): Optional = - Optional.ofNullable(grossPay.getNullable("gross_pay")) + fun debitDate(): Optional = + Optional.ofNullable(debitDate.getNullable("debit_date")) - fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) + fun employeeTaxes(): Optional = + Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) fun employerTaxes(): Optional = Optional.ofNullable(employerTaxes.getNullable("employer_taxes")) - fun employeeTaxes(): Optional = - Optional.ofNullable(employeeTaxes.getNullable("employee_taxes")) + fun grossPay(): Optional = + Optional.ofNullable(grossPay.getNullable("gross_pay")) fun individualIds(): Optional = Optional.ofNullable(individualIds.getNullable("individual_ids")) - fun payPeriod(): Optional = - Optional.ofNullable(payPeriod.getNullable("pay_period")) + fun netPay(): Optional = Optional.ofNullable(netPay.getNullable("net_pay")) - fun payGroupIds(): Optional = - Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) + fun payDate(): Optional = + Optional.ofNullable(payDate.getNullable("pay_date")) fun payFrequencies(): Optional = Optional.ofNullable(payFrequencies.getNullable("pay_frequencies")) - @JsonProperty("id") @ExcludeMissing fun _id() = id + fun payGroupIds(): Optional = + Optional.ofNullable(payGroupIds.getNullable("pay_group_ids")) - @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate + fun payPeriod(): Optional = + Optional.ofNullable(payPeriod.getNullable("pay_period")) - @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate + @JsonProperty("id") @ExcludeMissing fun _id() = id @JsonProperty("company_debit") @ExcludeMissing fun _companyDebit() = companyDebit - @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay + @JsonProperty("debit_date") @ExcludeMissing fun _debitDate() = debitDate - @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay + @JsonProperty("employee_taxes") @ExcludeMissing fun _employeeTaxes() = employeeTaxes @JsonProperty("employer_taxes") @ExcludeMissing fun _employerTaxes() = employerTaxes - @JsonProperty("employee_taxes") @ExcludeMissing fun _employeeTaxes() = employeeTaxes + @JsonProperty("gross_pay") @ExcludeMissing fun _grossPay() = grossPay @JsonProperty("individual_ids") @ExcludeMissing fun _individualIds() = individualIds - @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod + @JsonProperty("net_pay") @ExcludeMissing fun _netPay() = netPay - @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + @JsonProperty("pay_date") @ExcludeMissing fun _payDate() = payDate @JsonProperty("pay_frequencies") @ExcludeMissing fun _payFrequencies() = payFrequencies + @JsonProperty("pay_group_ids") @ExcludeMissing fun _payGroupIds() = payGroupIds + + @JsonProperty("pay_period") @ExcludeMissing fun _payPeriod() = payPeriod + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -5160,17 +5160,17 @@ private constructor( fun validate(): SupportedPaymentFields = apply { if (!validated) { id() - payDate() - debitDate() companyDebit() - grossPay() - netPay() - employerTaxes() + debitDate() employeeTaxes() + employerTaxes() + grossPay() individualIds() - payPeriod().map { it.validate() } - payGroupIds() + netPay() + payDate() payFrequencies() + payGroupIds() + payPeriod().map { it.validate() } validated = true } } @@ -5185,33 +5185,33 @@ private constructor( class Builder { private var id: JsonField = JsonMissing.of() - private var payDate: JsonField = JsonMissing.of() - private var debitDate: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() - private var grossPay: JsonField = JsonMissing.of() - private var netPay: JsonField = JsonMissing.of() - private var employerTaxes: JsonField = JsonMissing.of() + private var debitDate: JsonField = JsonMissing.of() private var employeeTaxes: JsonField = JsonMissing.of() + private var employerTaxes: JsonField = JsonMissing.of() + private var grossPay: JsonField = JsonMissing.of() private var individualIds: JsonField = JsonMissing.of() - private var payPeriod: JsonField = JsonMissing.of() - private var payGroupIds: JsonField = JsonMissing.of() + private var netPay: JsonField = JsonMissing.of() + private var payDate: JsonField = JsonMissing.of() private var payFrequencies: JsonField = JsonMissing.of() + private var payGroupIds: JsonField = JsonMissing.of() + private var payPeriod: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedPaymentFields: SupportedPaymentFields) = apply { id = supportedPaymentFields.id - payDate = supportedPaymentFields.payDate - debitDate = supportedPaymentFields.debitDate companyDebit = supportedPaymentFields.companyDebit - grossPay = supportedPaymentFields.grossPay - netPay = supportedPaymentFields.netPay - employerTaxes = supportedPaymentFields.employerTaxes + debitDate = supportedPaymentFields.debitDate employeeTaxes = supportedPaymentFields.employeeTaxes + employerTaxes = supportedPaymentFields.employerTaxes + grossPay = supportedPaymentFields.grossPay individualIds = supportedPaymentFields.individualIds - payPeriod = supportedPaymentFields.payPeriod - payGroupIds = supportedPaymentFields.payGroupIds + netPay = supportedPaymentFields.netPay + payDate = supportedPaymentFields.payDate payFrequencies = supportedPaymentFields.payFrequencies + payGroupIds = supportedPaymentFields.payGroupIds + payPeriod = supportedPaymentFields.payPeriod additionalProperties = supportedPaymentFields.additionalProperties.toMutableMap() } @@ -5220,16 +5220,6 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } - fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) - - fun payDate(payDate: JsonField) = apply { this.payDate = payDate } - - fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - - fun debitDate(debitDate: JsonField) = apply { - this.debitDate = debitDate - } - fun companyDebit(companyDebit: Boolean) = companyDebit(JsonField.of(companyDebit)) @@ -5237,13 +5227,18 @@ private constructor( this.companyDebit = companyDebit } - fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) + fun debitDate(debitDate: Boolean) = debitDate(JsonField.of(debitDate)) - fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } + fun debitDate(debitDate: JsonField) = apply { + this.debitDate = debitDate + } - fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) + fun employeeTaxes(employeeTaxes: Boolean) = + employeeTaxes(JsonField.of(employeeTaxes)) - fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + fun employeeTaxes(employeeTaxes: JsonField) = apply { + this.employeeTaxes = employeeTaxes + } fun employerTaxes(employerTaxes: Boolean) = employerTaxes(JsonField.of(employerTaxes)) @@ -5252,12 +5247,9 @@ private constructor( this.employerTaxes = employerTaxes } - fun employeeTaxes(employeeTaxes: Boolean) = - employeeTaxes(JsonField.of(employeeTaxes)) + fun grossPay(grossPay: Boolean) = grossPay(JsonField.of(grossPay)) - fun employeeTaxes(employeeTaxes: JsonField) = apply { - this.employeeTaxes = employeeTaxes - } + fun grossPay(grossPay: JsonField) = apply { this.grossPay = grossPay } fun individualIds(individualIds: Boolean) = individualIds(JsonField.of(individualIds)) @@ -5266,10 +5258,19 @@ private constructor( this.individualIds = individualIds } - fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) + fun netPay(netPay: Boolean) = netPay(JsonField.of(netPay)) - fun payPeriod(payPeriod: JsonField) = apply { - this.payPeriod = payPeriod + fun netPay(netPay: JsonField) = apply { this.netPay = netPay } + + fun payDate(payDate: Boolean) = payDate(JsonField.of(payDate)) + + fun payDate(payDate: JsonField) = apply { this.payDate = payDate } + + fun payFrequencies(payFrequencies: Boolean) = + payFrequencies(JsonField.of(payFrequencies)) + + fun payFrequencies(payFrequencies: JsonField) = apply { + this.payFrequencies = payFrequencies } fun payGroupIds(payGroupIds: Boolean) = payGroupIds(JsonField.of(payGroupIds)) @@ -5278,11 +5279,10 @@ private constructor( this.payGroupIds = payGroupIds } - fun payFrequencies(payFrequencies: Boolean) = - payFrequencies(JsonField.of(payFrequencies)) + fun payPeriod(payPeriod: PayPeriod) = payPeriod(JsonField.of(payPeriod)) - fun payFrequencies(payFrequencies: JsonField) = apply { - this.payFrequencies = payFrequencies + fun payPeriod(payPeriod: JsonField) = apply { + this.payPeriod = payPeriod } fun additionalProperties(additionalProperties: Map) = apply { @@ -5310,17 +5310,17 @@ private constructor( fun build(): SupportedPaymentFields = SupportedPaymentFields( id, - payDate, - debitDate, companyDebit, - grossPay, - netPay, - employerTaxes, + debitDate, employeeTaxes, + employerTaxes, + grossPay, individualIds, - payPeriod, - payGroupIds, + netPay, + payDate, payFrequencies, + payGroupIds, + payPeriod, additionalProperties.toImmutable(), ) } @@ -5329,26 +5329,26 @@ private constructor( class PayPeriod @JsonCreator private constructor( - @JsonProperty("start_date") - @ExcludeMissing - private val startDate: JsonField = JsonMissing.of(), @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), + @JsonProperty("start_date") + @ExcludeMissing + private val startDate: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun startDate(): Optional = - Optional.ofNullable(startDate.getNullable("start_date")) - fun endDate(): Optional = Optional.ofNullable(endDate.getNullable("end_date")) - @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + fun startDate(): Optional = + Optional.ofNullable(startDate.getNullable("start_date")) @JsonProperty("end_date") @ExcludeMissing fun _endDate() = endDate + @JsonProperty("start_date") @ExcludeMissing fun _startDate() = startDate + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -5357,8 +5357,8 @@ private constructor( fun validate(): PayPeriod = apply { if (!validated) { - startDate() endDate() + startDate() validated = true } } @@ -5372,28 +5372,28 @@ private constructor( class Builder { - private var startDate: JsonField = JsonMissing.of() private var endDate: JsonField = JsonMissing.of() + private var startDate: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payPeriod: PayPeriod) = apply { - startDate = payPeriod.startDate endDate = payPeriod.endDate + startDate = payPeriod.startDate additionalProperties = payPeriod.additionalProperties.toMutableMap() } + fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) + + fun endDate(endDate: JsonField) = apply { this.endDate = endDate } + fun startDate(startDate: Boolean) = startDate(JsonField.of(startDate)) fun startDate(startDate: JsonField) = apply { this.startDate = startDate } - fun endDate(endDate: Boolean) = endDate(JsonField.of(endDate)) - - fun endDate(endDate: JsonField) = apply { this.endDate = endDate } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -5418,8 +5418,8 @@ private constructor( fun build(): PayPeriod = PayPeriod( - startDate, endDate, + startDate, additionalProperties.toImmutable(), ) } @@ -5429,17 +5429,17 @@ private constructor( return true } - return /* spotless:off */ other is PayPeriod && startDate == other.startDate && endDate == other.endDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayPeriod && endDate == other.endDate && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(startDate, endDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(endDate, startDate, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayPeriod{startDate=$startDate, endDate=$endDate, additionalProperties=$additionalProperties}" + "PayPeriod{endDate=$endDate, startDate=$startDate, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5447,17 +5447,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPaymentFields && id == other.id && payDate == other.payDate && debitDate == other.debitDate && companyDebit == other.companyDebit && grossPay == other.grossPay && netPay == other.netPay && employerTaxes == other.employerTaxes && employeeTaxes == other.employeeTaxes && individualIds == other.individualIds && payPeriod == other.payPeriod && payGroupIds == other.payGroupIds && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedPaymentFields && id == other.id && companyDebit == other.companyDebit && debitDate == other.debitDate && employeeTaxes == other.employeeTaxes && employerTaxes == other.employerTaxes && grossPay == other.grossPay && individualIds == other.individualIds && netPay == other.netPay && payDate == other.payDate && payFrequencies == other.payFrequencies && payGroupIds == other.payGroupIds && payPeriod == other.payPeriod && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, payDate, debitDate, companyDebit, grossPay, netPay, employerTaxes, employeeTaxes, individualIds, payPeriod, payGroupIds, payFrequencies, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, companyDebit, debitDate, employeeTaxes, employerTaxes, grossPay, individualIds, netPay, payDate, payFrequencies, payGroupIds, payPeriod, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedPaymentFields{id=$id, payDate=$payDate, debitDate=$debitDate, companyDebit=$companyDebit, grossPay=$grossPay, netPay=$netPay, employerTaxes=$employerTaxes, employeeTaxes=$employeeTaxes, individualIds=$individualIds, payPeriod=$payPeriod, payGroupIds=$payGroupIds, payFrequencies=$payFrequencies, additionalProperties=$additionalProperties}" + "SupportedPaymentFields{id=$id, companyDebit=$companyDebit, debitDate=$debitDate, employeeTaxes=$employeeTaxes, employerTaxes=$employerTaxes, grossPay=$grossPay, individualIds=$individualIds, netPay=$netPay, payDate=$payDate, payFrequencies=$payFrequencies, payGroupIds=$payGroupIds, payPeriod=$payPeriod, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5465,17 +5465,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedFields && company == other.company && directory == other.directory && individual == other.individual && employment == other.employment && payment == other.payment && payStatement == other.payStatement && payGroup == other.payGroup && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedFields && company == other.company && directory == other.directory && employment == other.employment && individual == other.individual && payGroup == other.payGroup && payStatement == other.payStatement && payment == other.payment && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(company, directory, individual, employment, payment, payStatement, payGroup, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(company, directory, employment, individual, payGroup, payStatement, payment, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedFields{company=$company, directory=$directory, individual=$individual, employment=$employment, payment=$payment, payStatement=$payStatement, payGroup=$payGroup, additionalProperties=$additionalProperties}" + "SupportedFields{company=$company, directory=$directory, employment=$employment, individual=$individual, payGroup=$payGroup, payStatement=$payStatement, payment=$payment, additionalProperties=$additionalProperties}" } class Type @@ -5558,17 +5558,17 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationMethod && type == other.type && benefitsSupport == other.benefitsSupport && supportedFields == other.supportedFields && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AuthenticationMethod && benefitsSupport == other.benefitsSupport && supportedFields == other.supportedFields && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, benefitsSupport, supportedFields, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(benefitsSupport, supportedFields, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AuthenticationMethod{type=$type, benefitsSupport=$benefitsSupport, supportedFields=$supportedFields, additionalProperties=$additionalProperties}" + "AuthenticationMethod{benefitsSupport=$benefitsSupport, supportedFields=$supportedFields, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -5576,15 +5576,15 @@ private constructor( return true } - return /* spotless:off */ other is Provider && id == other.id && displayName == other.displayName && products == other.products && icon == other.icon && logo == other.logo && mfaRequired == other.mfaRequired && primaryColor == other.primaryColor && manual == other.manual && beta == other.beta && authenticationMethods == other.authenticationMethods && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Provider && id == other.id && authenticationMethods == other.authenticationMethods && beta == other.beta && displayName == other.displayName && icon == other.icon && logo == other.logo && manual == other.manual && mfaRequired == other.mfaRequired && primaryColor == other.primaryColor && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, displayName, products, icon, logo, mfaRequired, primaryColor, manual, beta, authenticationMethods, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, authenticationMethods, beta, displayName, icon, logo, manual, mfaRequired, primaryColor, products, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Provider{id=$id, displayName=$displayName, products=$products, icon=$icon, logo=$logo, mfaRequired=$mfaRequired, primaryColor=$primaryColor, manual=$manual, beta=$beta, authenticationMethods=$authenticationMethods, additionalProperties=$additionalProperties}" + "Provider{id=$id, authenticationMethods=$authenticationMethods, beta=$beta, displayName=$displayName, icon=$icon, logo=$logo, manual=$manual, mfaRequired=$mfaRequired, primaryColor=$primaryColor, products=$products, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt index e09623c2..cc9cd11e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt @@ -20,23 +20,17 @@ import java.util.Optional class RequestForwardingForwardResponse @JsonCreator private constructor( - @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), - @JsonProperty("statusCode") - @ExcludeMissing - private val statusCode: JsonField = JsonMissing.of(), @JsonProperty("data") @ExcludeMissing private val data: JsonField = JsonMissing.of(), + @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), @JsonProperty("request") @ExcludeMissing private val request: JsonField = JsonMissing.of(), + @JsonProperty("statusCode") + @ExcludeMissing + private val statusCode: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * The HTTP status code of the forwarded request’s response, exactly received from the - * underlying integration’s API. This value will be returned as an integer. - */ - fun statusCode(): Long = statusCode.getRequired("statusCode") - /** * A string representation of the HTTP response body of the forwarded request’s response * received from the underlying integration’s API. This field may be null in the case where the @@ -49,17 +43,11 @@ private constructor( */ fun request(): Request = request.getRequired("request") - /** - * The HTTP headers of the forwarded request’s response, exactly as received from the underlying - * integration’s API. - */ - @JsonProperty("headers") @ExcludeMissing fun _headers() = headers - /** * The HTTP status code of the forwarded request’s response, exactly received from the * underlying integration’s API. This value will be returned as an integer. */ - @JsonProperty("statusCode") @ExcludeMissing fun _statusCode() = statusCode + fun statusCode(): Long = statusCode.getRequired("statusCode") /** * A string representation of the HTTP response body of the forwarded request’s response @@ -68,11 +56,23 @@ private constructor( */ @JsonProperty("data") @ExcludeMissing fun _data() = data + /** + * The HTTP headers of the forwarded request’s response, exactly as received from the underlying + * integration’s API. + */ + @JsonProperty("headers") @ExcludeMissing fun _headers() = headers + /** * An object containing details of your original forwarded request, for your ease of reference. */ @JsonProperty("request") @ExcludeMissing fun _request() = request + /** + * The HTTP status code of the forwarded request’s response, exactly received from the + * underlying integration’s API. This value will be returned as an integer. + */ + @JsonProperty("statusCode") @ExcludeMissing fun _statusCode() = statusCode + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -81,9 +81,9 @@ private constructor( fun validate(): RequestForwardingForwardResponse = apply { if (!validated) { - statusCode() data() request().validate() + statusCode() validated = true } } @@ -97,41 +97,23 @@ private constructor( class Builder { - private var headers: JsonValue = JsonMissing.of() - private var statusCode: JsonField = JsonMissing.of() private var data: JsonField = JsonMissing.of() + private var headers: JsonValue = JsonMissing.of() private var request: JsonField = JsonMissing.of() + private var statusCode: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(requestForwardingForwardResponse: RequestForwardingForwardResponse) = apply { - headers = requestForwardingForwardResponse.headers - statusCode = requestForwardingForwardResponse.statusCode data = requestForwardingForwardResponse.data + headers = requestForwardingForwardResponse.headers request = requestForwardingForwardResponse.request + statusCode = requestForwardingForwardResponse.statusCode additionalProperties = requestForwardingForwardResponse.additionalProperties.toMutableMap() } - /** - * The HTTP headers of the forwarded request’s response, exactly as received from the - * underlying integration’s API. - */ - fun headers(headers: JsonValue) = apply { this.headers = headers } - - /** - * The HTTP status code of the forwarded request’s response, exactly received from the - * underlying integration’s API. This value will be returned as an integer. - */ - fun statusCode(statusCode: Long) = statusCode(JsonField.of(statusCode)) - - /** - * The HTTP status code of the forwarded request’s response, exactly received from the - * underlying integration’s API. This value will be returned as an integer. - */ - fun statusCode(statusCode: JsonField) = apply { this.statusCode = statusCode } - /** * A string representation of the HTTP response body of the forwarded request’s response * received from the underlying integration’s API. This field may be null in the case where @@ -146,6 +128,12 @@ private constructor( */ fun data(data: JsonField) = apply { this.data = data } + /** + * The HTTP headers of the forwarded request’s response, exactly as received from the + * underlying integration’s API. + */ + fun headers(headers: JsonValue) = apply { this.headers = headers } + /** * An object containing details of your original forwarded request, for your ease of * reference. @@ -158,6 +146,18 @@ private constructor( */ fun request(request: JsonField) = apply { this.request = request } + /** + * The HTTP status code of the forwarded request’s response, exactly received from the + * underlying integration’s API. This value will be returned as an integer. + */ + fun statusCode(statusCode: Long) = statusCode(JsonField.of(statusCode)) + + /** + * The HTTP status code of the forwarded request’s response, exactly received from the + * underlying integration’s API. This value will be returned as an integer. + */ + fun statusCode(statusCode: JsonField) = apply { this.statusCode = statusCode } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -179,10 +179,10 @@ private constructor( fun build(): RequestForwardingForwardResponse = RequestForwardingForwardResponse( - headers, - statusCode, data, + headers, request, + statusCode, additionalProperties.toImmutable(), ) } @@ -194,21 +194,28 @@ private constructor( class Request @JsonCreator private constructor( + @JsonProperty("data") + @ExcludeMissing + private val data: JsonField = JsonMissing.of(), + @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), @JsonProperty("method") @ExcludeMissing private val method: JsonField = JsonMissing.of(), + @JsonProperty("params") @ExcludeMissing private val params: JsonValue = JsonMissing.of(), @JsonProperty("route") @ExcludeMissing private val route: JsonField = JsonMissing.of(), - @JsonProperty("headers") @ExcludeMissing private val headers: JsonValue = JsonMissing.of(), - @JsonProperty("params") @ExcludeMissing private val params: JsonValue = JsonMissing.of(), - @JsonProperty("data") - @ExcludeMissing - private val data: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** + * The body that was specified for the forwarded request. If a value was not specified in + * the original request, this value will be returned as null ; otherwise, this value will + * always be returned as a string. + */ + fun data(): Optional = Optional.ofNullable(data.getNullable("data")) + /** * The HTTP method that was specified for the forwarded request. Valid values include: `GET` * , `POST` , `PUT` , `DELETE` , and `PATCH`. @@ -223,16 +230,7 @@ private constructor( * the original request, this value will be returned as null ; otherwise, this value will * always be returned as a string. */ - fun data(): Optional = Optional.ofNullable(data.getNullable("data")) - - /** - * The HTTP method that was specified for the forwarded request. Valid values include: `GET` - * , `POST` , `PUT` , `DELETE` , and `PATCH`. - */ - @JsonProperty("method") @ExcludeMissing fun _method() = method - - /** The URL route path that was specified for the forwarded request. */ - @JsonProperty("route") @ExcludeMissing fun _route() = route + @JsonProperty("data") @ExcludeMissing fun _data() = data /** * The specified HTTP headers that were included in the forwarded request. If no headers @@ -240,18 +238,20 @@ private constructor( */ @JsonProperty("headers") @ExcludeMissing fun _headers() = headers + /** + * The HTTP method that was specified for the forwarded request. Valid values include: `GET` + * , `POST` , `PUT` , `DELETE` , and `PATCH`. + */ + @JsonProperty("method") @ExcludeMissing fun _method() = method + /** * The query parameters that were included in the forwarded request. If no query parameters * were specified, this will be returned as `null`. */ @JsonProperty("params") @ExcludeMissing fun _params() = params - /** - * The body that was specified for the forwarded request. If a value was not specified in - * the original request, this value will be returned as null ; otherwise, this value will - * always be returned as a string. - */ - @JsonProperty("data") @ExcludeMissing fun _data() = data + /** The URL route path that was specified for the forwarded request. */ + @JsonProperty("route") @ExcludeMissing fun _route() = route @JsonAnyGetter @ExcludeMissing @@ -261,9 +261,9 @@ private constructor( fun validate(): Request = apply { if (!validated) { + data() method() route() - data() validated = true } } @@ -277,40 +277,36 @@ private constructor( class Builder { - private var method: JsonField = JsonMissing.of() - private var route: JsonField = JsonMissing.of() + private var data: JsonField = JsonMissing.of() private var headers: JsonValue = JsonMissing.of() + private var method: JsonField = JsonMissing.of() private var params: JsonValue = JsonMissing.of() - private var data: JsonField = JsonMissing.of() + private var route: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(request: Request) = apply { - method = request.method - route = request.route + data = request.data headers = request.headers + method = request.method params = request.params - data = request.data + route = request.route additionalProperties = request.additionalProperties.toMutableMap() } /** - * The HTTP method that was specified for the forwarded request. Valid values include: - * `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. + * The body that was specified for the forwarded request. If a value was not specified + * in the original request, this value will be returned as null ; otherwise, this value + * will always be returned as a string. */ - fun method(method: String) = method(JsonField.of(method)) + fun data(data: String) = data(JsonField.of(data)) /** - * The HTTP method that was specified for the forwarded request. Valid values include: - * `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. + * The body that was specified for the forwarded request. If a value was not specified + * in the original request, this value will be returned as null ; otherwise, this value + * will always be returned as a string. */ - fun method(method: JsonField) = apply { this.method = method } - - /** The URL route path that was specified for the forwarded request. */ - fun route(route: String) = route(JsonField.of(route)) - - /** The URL route path that was specified for the forwarded request. */ - fun route(route: JsonField) = apply { this.route = route } + fun data(data: JsonField) = apply { this.data = data } /** * The specified HTTP headers that were included in the forwarded request. If no headers @@ -319,24 +315,28 @@ private constructor( fun headers(headers: JsonValue) = apply { this.headers = headers } /** - * The query parameters that were included in the forwarded request. If no query - * parameters were specified, this will be returned as `null`. + * The HTTP method that was specified for the forwarded request. Valid values include: + * `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. */ - fun params(params: JsonValue) = apply { this.params = params } + fun method(method: String) = method(JsonField.of(method)) /** - * The body that was specified for the forwarded request. If a value was not specified - * in the original request, this value will be returned as null ; otherwise, this value - * will always be returned as a string. + * The HTTP method that was specified for the forwarded request. Valid values include: + * `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. */ - fun data(data: String) = data(JsonField.of(data)) + fun method(method: JsonField) = apply { this.method = method } /** - * The body that was specified for the forwarded request. If a value was not specified - * in the original request, this value will be returned as null ; otherwise, this value - * will always be returned as a string. + * The query parameters that were included in the forwarded request. If no query + * parameters were specified, this will be returned as `null`. */ - fun data(data: JsonField) = apply { this.data = data } + fun params(params: JsonValue) = apply { this.params = params } + + /** The URL route path that was specified for the forwarded request. */ + fun route(route: String) = route(JsonField.of(route)) + + /** The URL route path that was specified for the forwarded request. */ + fun route(route: JsonField) = apply { this.route = route } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -359,11 +359,11 @@ private constructor( fun build(): Request = Request( - method, - route, + data, headers, + method, params, - data, + route, additionalProperties.toImmutable(), ) } @@ -373,17 +373,17 @@ private constructor( return true } - return /* spotless:off */ other is Request && method == other.method && route == other.route && headers == other.headers && params == other.params && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Request && data == other.data && headers == other.headers && method == other.method && params == other.params && route == other.route && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(method, route, headers, params, data, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(data, headers, method, params, route, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Request{method=$method, route=$route, headers=$headers, params=$params, data=$data, additionalProperties=$additionalProperties}" + "Request{data=$data, headers=$headers, method=$method, params=$params, route=$route, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -391,15 +391,15 @@ private constructor( return true } - return /* spotless:off */ other is RequestForwardingForwardResponse && headers == other.headers && statusCode == other.statusCode && data == other.data && request == other.request && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is RequestForwardingForwardResponse && data == other.data && headers == other.headers && request == other.request && statusCode == other.statusCode && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(headers, statusCode, data, request, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(data, headers, request, statusCode, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "RequestForwardingForwardResponse{headers=$headers, statusCode=$statusCode, data=$data, request=$request, additionalProperties=$additionalProperties}" + "RequestForwardingForwardResponse{data=$data, headers=$headers, request=$request, statusCode=$statusCode, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index acf8366a..3c63530f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt @@ -421,36 +421,36 @@ constructor( class Account @JsonCreator private constructor( - @JsonProperty("routing_number") private val routingNumber: String?, @JsonProperty("account_name") private val accountName: String?, - @JsonProperty("institution_name") private val institutionName: String?, - @JsonProperty("account_type") private val accountType: AccountType?, @JsonProperty("account_number") private val accountNumber: String?, + @JsonProperty("account_type") private val accountType: AccountType?, + @JsonProperty("institution_name") private val institutionName: String?, + @JsonProperty("routing_number") private val routingNumber: String?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * A nine-digit code that's based on the U.S. Bank location where your account was opened. - */ - @JsonProperty("routing_number") - fun routingNumber(): Optional = Optional.ofNullable(routingNumber) - /** The name of the bank associated in the payroll/HRIS system. */ @JsonProperty("account_name") fun accountName(): Optional = Optional.ofNullable(accountName) - /** Name of the banking institution. */ - @JsonProperty("institution_name") - fun institutionName(): Optional = Optional.ofNullable(institutionName) + /** 10-12 digit number to specify the bank account */ + @JsonProperty("account_number") + fun accountNumber(): Optional = Optional.ofNullable(accountNumber) /** The type of bank account. */ @JsonProperty("account_type") fun accountType(): Optional = Optional.ofNullable(accountType) - /** 10-12 digit number to specify the bank account */ - @JsonProperty("account_number") - fun accountNumber(): Optional = Optional.ofNullable(accountNumber) + /** Name of the banking institution. */ + @JsonProperty("institution_name") + fun institutionName(): Optional = Optional.ofNullable(institutionName) + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was opened. + */ + @JsonProperty("routing_number") + fun routingNumber(): Optional = Optional.ofNullable(routingNumber) @JsonAnyGetter @ExcludeMissing @@ -465,42 +465,42 @@ constructor( class Builder { - private var routingNumber: String? = null private var accountName: String? = null - private var institutionName: String? = null - private var accountType: AccountType? = null private var accountNumber: String? = null + private var accountType: AccountType? = null + private var institutionName: String? = null + private var routingNumber: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(account: Account) = apply { - routingNumber = account.routingNumber accountName = account.accountName - institutionName = account.institutionName - accountType = account.accountType accountNumber = account.accountNumber + accountType = account.accountType + institutionName = account.institutionName + routingNumber = account.routingNumber additionalProperties = account.additionalProperties.toMutableMap() } - /** - * A nine-digit code that's based on the U.S. Bank location where your account was - * opened. - */ - fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } - /** The name of the bank associated in the payroll/HRIS system. */ fun accountName(accountName: String) = apply { this.accountName = accountName } + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } + + /** The type of bank account. */ + fun accountType(accountType: AccountType) = apply { this.accountType = accountType } + /** Name of the banking institution. */ fun institutionName(institutionName: String) = apply { this.institutionName = institutionName } - /** The type of bank account. */ - fun accountType(accountType: AccountType) = apply { this.accountType = accountType } - - /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -523,11 +523,11 @@ constructor( fun build(): Account = Account( - routingNumber, accountName, - institutionName, - accountType, accountNumber, + accountType, + institutionName, + routingNumber, additionalProperties.toImmutable(), ) } @@ -594,17 +594,17 @@ constructor( return true } - return /* spotless:off */ other is Account && routingNumber == other.routingNumber && accountName == other.accountName && institutionName == other.institutionName && accountType == other.accountType && accountNumber == other.accountNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Account && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(routingNumber, accountName, institutionName, accountType, accountNumber, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}" + "Account{accountName=$accountName, accountNumber=$accountNumber, accountType=$accountType, institutionName=$institutionName, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -784,18 +784,18 @@ constructor( class Entity @JsonCreator private constructor( - @JsonProperty("type") private val type: Type?, @JsonProperty("subtype") private val subtype: Subtype?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The tax payer type of the company. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) - /** The tax payer subtype of the company. */ @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) + /** The tax payer type of the company. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -809,23 +809,23 @@ constructor( class Builder { - private var type: Type? = null private var subtype: Subtype? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(entity: Entity) = apply { - type = entity.type subtype = entity.subtype + type = entity.type additionalProperties = entity.additionalProperties.toMutableMap() } - /** The tax payer type of the company. */ - fun type(type: Type) = apply { this.type = type } - /** The tax payer subtype of the company. */ fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + /** The tax payer type of the company. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -847,8 +847,8 @@ constructor( fun build(): Entity = Entity( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -1008,17 +1008,17 @@ constructor( return true } - return /* spotless:off */ other is Entity && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Entity{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index a8b10d8b..781b17d0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -187,72 +187,63 @@ constructor( class IndividualOrEmployment @JsonCreator private constructor( - @JsonProperty("first_name") private val firstName: String?, - @JsonProperty("middle_name") private val middleName: String?, - @JsonProperty("last_name") private val lastName: String?, - @JsonProperty("preferred_name") private val preferredName: String?, - @JsonProperty("emails") private val emails: List?, - @JsonProperty("phone_numbers") private val phoneNumbers: List?, - @JsonProperty("gender") private val gender: Gender?, - @JsonProperty("ethnicity") private val ethnicity: Ethnicity?, - @JsonProperty("dob") private val dob: String?, - @JsonProperty("ssn") private val ssn: String?, - @JsonProperty("encrypted_ssn") private val encryptedSsn: String?, - @JsonProperty("residence") private val residence: Location?, - @JsonProperty("title") private val title: String?, - @JsonProperty("manager") private val manager: Manager?, + @JsonProperty("class_code") private val classCode: String?, + @JsonProperty("custom_fields") private val customFields: List?, @JsonProperty("department") private val department: Department?, + @JsonProperty("dob") private val dob: String?, + @JsonProperty("emails") private val emails: List?, @JsonProperty("employment") private val employment: Employment?, - @JsonProperty("start_date") private val startDate: String?, - @JsonProperty("end_date") private val endDate: String?, - @JsonProperty("latest_rehire_date") private val latestRehireDate: String?, - @JsonProperty("is_active") private val isActive: Boolean?, @JsonProperty("employment_status") private val employmentStatus: EmploymentStatus?, - @JsonProperty("class_code") private val classCode: String?, - @JsonProperty("location") private val location: Location?, + @JsonProperty("encrypted_ssn") private val encryptedSsn: String?, + @JsonProperty("end_date") private val endDate: String?, + @JsonProperty("ethnicity") private val ethnicity: Ethnicity?, + @JsonProperty("first_name") private val firstName: String?, + @JsonProperty("gender") private val gender: Gender?, @JsonProperty("income") private val income: Income?, @JsonProperty("income_history") private val incomeHistory: List?, - @JsonProperty("custom_fields") private val customFields: List?, + @JsonProperty("is_active") private val isActive: Boolean?, + @JsonProperty("last_name") private val lastName: String?, + @JsonProperty("latest_rehire_date") private val latestRehireDate: String?, + @JsonProperty("location") private val location: Location?, + @JsonProperty("manager") private val manager: Manager?, + @JsonProperty("middle_name") private val middleName: String?, + @JsonProperty("phone_numbers") private val phoneNumbers: List?, + @JsonProperty("preferred_name") private val preferredName: String?, + @JsonProperty("residence") private val residence: Location?, @JsonProperty("source_id") private val sourceId: String?, + @JsonProperty("ssn") private val ssn: String?, + @JsonProperty("start_date") private val startDate: String?, + @JsonProperty("title") private val title: String?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The legal first name of the individual. */ - @JsonProperty("first_name") - fun firstName(): Optional = Optional.ofNullable(firstName) + /** Worker's compensation classification code for this employee */ + @JsonProperty("class_code") + fun classCode(): Optional = Optional.ofNullable(classCode) - /** The legal middle name of the individual. */ - @JsonProperty("middle_name") - fun middleName(): Optional = Optional.ofNullable(middleName) + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. Custom fields are not currently supported for assisted connections. + */ + @JsonProperty("custom_fields") + fun customFields(): Optional> = Optional.ofNullable(customFields) - /** The legal last name of the individual. */ - @JsonProperty("last_name") fun lastName(): Optional = Optional.ofNullable(lastName) + /** The department object. */ + @JsonProperty("department") + fun department(): Optional = Optional.ofNullable(department) - /** The preferred name of the individual. */ - @JsonProperty("preferred_name") - fun preferredName(): Optional = Optional.ofNullable(preferredName) + @JsonProperty("dob") fun dob(): Optional = Optional.ofNullable(dob) @JsonProperty("emails") fun emails(): Optional> = Optional.ofNullable(emails) - @JsonProperty("phone_numbers") - fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers) - - /** The gender of the individual. */ - @JsonProperty("gender") fun gender(): Optional = Optional.ofNullable(gender) - - /** The EEOC-defined ethnicity of the individual. */ - @JsonProperty("ethnicity") - fun ethnicity(): Optional = Optional.ofNullable(ethnicity) - - @JsonProperty("dob") fun dob(): Optional = Optional.ofNullable(dob) + /** The employment object. */ + @JsonProperty("employment") + fun employment(): Optional = Optional.ofNullable(employment) - /** - * Social Security Number of the individual. This field is only available with the `ssn` - * scope enabled and the `options: { include: ['ssn'] }` param set in the body. - * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). - */ - @JsonProperty("ssn") fun ssn(): Optional = Optional.ofNullable(ssn) + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) /** * Social Security Number of the individual in **encrypted** format. This field is only @@ -262,43 +253,18 @@ constructor( @JsonProperty("encrypted_ssn") fun encryptedSsn(): Optional = Optional.ofNullable(encryptedSsn) - @JsonProperty("residence") - fun residence(): Optional = Optional.ofNullable(residence) - - /** The current title of the individual. */ - @JsonProperty("title") fun title(): Optional = Optional.ofNullable(title) - - /** The manager object representing the manager of the individual within the org. */ - @JsonProperty("manager") fun manager(): Optional = Optional.ofNullable(manager) - - /** The department object. */ - @JsonProperty("department") - fun department(): Optional = Optional.ofNullable(department) - - /** The employment object. */ - @JsonProperty("employment") - fun employment(): Optional = Optional.ofNullable(employment) - - @JsonProperty("start_date") - fun startDate(): Optional = Optional.ofNullable(startDate) - @JsonProperty("end_date") fun endDate(): Optional = Optional.ofNullable(endDate) - @JsonProperty("latest_rehire_date") - fun latestRehireDate(): Optional = Optional.ofNullable(latestRehireDate) - - /** `true` if the individual an an active employee or contractor at the company. */ - @JsonProperty("is_active") fun isActive(): Optional = Optional.ofNullable(isActive) - - /** The detailed employment status of the individual. */ - @JsonProperty("employment_status") - fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) + /** The EEOC-defined ethnicity of the individual. */ + @JsonProperty("ethnicity") + fun ethnicity(): Optional = Optional.ofNullable(ethnicity) - /** Worker's compensation classification code for this employee */ - @JsonProperty("class_code") - fun classCode(): Optional = Optional.ofNullable(classCode) + /** The legal first name of the individual. */ + @JsonProperty("first_name") + fun firstName(): Optional = Optional.ofNullable(firstName) - @JsonProperty("location") fun location(): Optional = Optional.ofNullable(location) + /** The gender of the individual. */ + @JsonProperty("gender") fun gender(): Optional = Optional.ofNullable(gender) /** * The employee's income as reported by the provider. This may not always be annualized @@ -311,16 +277,50 @@ constructor( @JsonProperty("income_history") fun incomeHistory(): Optional> = Optional.ofNullable(incomeHistory) - /** - * Custom fields for the individual. These are fields which are defined by the employer in - * the system. Custom fields are not currently supported for assisted connections. - */ - @JsonProperty("custom_fields") - fun customFields(): Optional> = Optional.ofNullable(customFields) + /** `true` if the individual an an active employee or contractor at the company. */ + @JsonProperty("is_active") fun isActive(): Optional = Optional.ofNullable(isActive) + + /** The legal last name of the individual. */ + @JsonProperty("last_name") fun lastName(): Optional = Optional.ofNullable(lastName) + + @JsonProperty("latest_rehire_date") + fun latestRehireDate(): Optional = Optional.ofNullable(latestRehireDate) + + @JsonProperty("location") fun location(): Optional = Optional.ofNullable(location) + + /** The manager object representing the manager of the individual within the org. */ + @JsonProperty("manager") fun manager(): Optional = Optional.ofNullable(manager) + + /** The legal middle name of the individual. */ + @JsonProperty("middle_name") + fun middleName(): Optional = Optional.ofNullable(middleName) + + @JsonProperty("phone_numbers") + fun phoneNumbers(): Optional> = Optional.ofNullable(phoneNumbers) + + /** The preferred name of the individual. */ + @JsonProperty("preferred_name") + fun preferredName(): Optional = Optional.ofNullable(preferredName) + + @JsonProperty("residence") + fun residence(): Optional = Optional.ofNullable(residence) /** The source system's unique employment identifier for this individual */ @JsonProperty("source_id") fun sourceId(): Optional = Optional.ofNullable(sourceId) + /** + * Social Security Number of the individual. This field is only available with the `ssn` + * scope enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + @JsonProperty("ssn") fun ssn(): Optional = Optional.ofNullable(ssn) + + @JsonProperty("start_date") + fun startDate(): Optional = Optional.ofNullable(startDate) + + /** The current title of the individual. */ + @JsonProperty("title") fun title(): Optional = Optional.ofNullable(title) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -334,78 +334,90 @@ constructor( class Builder { - private var firstName: String? = null - private var middleName: String? = null - private var lastName: String? = null - private var preferredName: String? = null - private var emails: MutableList? = null - private var phoneNumbers: MutableList? = null - private var gender: Gender? = null - private var ethnicity: Ethnicity? = null - private var dob: String? = null - private var ssn: String? = null - private var encryptedSsn: String? = null - private var residence: Location? = null - private var title: String? = null - private var manager: Manager? = null + private var classCode: String? = null + private var customFields: MutableList? = null private var department: Department? = null + private var dob: String? = null + private var emails: MutableList? = null private var employment: Employment? = null - private var startDate: String? = null - private var endDate: String? = null - private var latestRehireDate: String? = null - private var isActive: Boolean? = null private var employmentStatus: EmploymentStatus? = null - private var classCode: String? = null - private var location: Location? = null + private var encryptedSsn: String? = null + private var endDate: String? = null + private var ethnicity: Ethnicity? = null + private var firstName: String? = null + private var gender: Gender? = null private var income: Income? = null private var incomeHistory: MutableList? = null - private var customFields: MutableList? = null + private var isActive: Boolean? = null + private var lastName: String? = null + private var latestRehireDate: String? = null + private var location: Location? = null + private var manager: Manager? = null + private var middleName: String? = null + private var phoneNumbers: MutableList? = null + private var preferredName: String? = null + private var residence: Location? = null private var sourceId: String? = null + private var ssn: String? = null + private var startDate: String? = null + private var title: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualOrEmployment: IndividualOrEmployment) = apply { - firstName = individualOrEmployment.firstName - middleName = individualOrEmployment.middleName - lastName = individualOrEmployment.lastName - preferredName = individualOrEmployment.preferredName - emails = individualOrEmployment.emails?.toMutableList() - phoneNumbers = individualOrEmployment.phoneNumbers?.toMutableList() - gender = individualOrEmployment.gender - ethnicity = individualOrEmployment.ethnicity - dob = individualOrEmployment.dob - ssn = individualOrEmployment.ssn - encryptedSsn = individualOrEmployment.encryptedSsn - residence = individualOrEmployment.residence - title = individualOrEmployment.title - manager = individualOrEmployment.manager + classCode = individualOrEmployment.classCode + customFields = individualOrEmployment.customFields?.toMutableList() department = individualOrEmployment.department + dob = individualOrEmployment.dob + emails = individualOrEmployment.emails?.toMutableList() employment = individualOrEmployment.employment - startDate = individualOrEmployment.startDate - endDate = individualOrEmployment.endDate - latestRehireDate = individualOrEmployment.latestRehireDate - isActive = individualOrEmployment.isActive employmentStatus = individualOrEmployment.employmentStatus - classCode = individualOrEmployment.classCode - location = individualOrEmployment.location + encryptedSsn = individualOrEmployment.encryptedSsn + endDate = individualOrEmployment.endDate + ethnicity = individualOrEmployment.ethnicity + firstName = individualOrEmployment.firstName + gender = individualOrEmployment.gender income = individualOrEmployment.income incomeHistory = individualOrEmployment.incomeHistory?.toMutableList() - customFields = individualOrEmployment.customFields?.toMutableList() + isActive = individualOrEmployment.isActive + lastName = individualOrEmployment.lastName + latestRehireDate = individualOrEmployment.latestRehireDate + location = individualOrEmployment.location + manager = individualOrEmployment.manager + middleName = individualOrEmployment.middleName + phoneNumbers = individualOrEmployment.phoneNumbers?.toMutableList() + preferredName = individualOrEmployment.preferredName + residence = individualOrEmployment.residence sourceId = individualOrEmployment.sourceId + ssn = individualOrEmployment.ssn + startDate = individualOrEmployment.startDate + title = individualOrEmployment.title additionalProperties = individualOrEmployment.additionalProperties.toMutableMap() } - /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: String) = apply { this.classCode = classCode } - /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: List) = apply { + this.customFields = customFields.toMutableList() + } - /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun addCustomField(customField: CustomField) = apply { + customFields = (customFields ?: mutableListOf()).apply { add(customField) } + } - /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } + /** The department object. */ + fun department(department: Department) = apply { this.department = department } + + fun dob(dob: String) = apply { this.dob = dob } fun emails(emails: List) = apply { this.emails = emails.toMutableList() } @@ -413,29 +425,14 @@ constructor( emails = (emails ?: mutableListOf()).apply { add(email) } } - fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers = phoneNumbers.toMutableList() - } + /** The employment object. */ + fun employment(employment: Employment) = apply { this.employment = employment } - fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { - phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + this.employmentStatus = employmentStatus } - /** The gender of the individual. */ - fun gender(gender: Gender) = apply { this.gender = gender } - - /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } - - fun dob(dob: String) = apply { this.dob = dob } - - /** - * Social Security Number of the individual. This field is only available with the `ssn` - * scope enabled and the `options: { include: ['ssn'] }` param set in the body. - * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). - */ - fun ssn(ssn: String) = apply { this.ssn = ssn } - /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param @@ -443,40 +440,16 @@ constructor( */ fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } - fun residence(residence: Location) = apply { this.residence = residence } - - /** The current title of the individual. */ - fun title(title: String) = apply { this.title = title } - - /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = apply { this.manager = manager } - - /** The department object. */ - fun department(department: Department) = apply { this.department = department } - - /** The employment object. */ - fun employment(employment: Employment) = apply { this.employment = employment } - - fun startDate(startDate: String) = apply { this.startDate = startDate } - fun endDate(endDate: String) = apply { this.endDate = endDate } - fun latestRehireDate(latestRehireDate: String) = apply { - this.latestRehireDate = latestRehireDate - } - - /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = apply { this.isActive = isActive } - - /** The detailed employment status of the individual. */ - fun employmentStatus(employmentStatus: EmploymentStatus) = apply { - this.employmentStatus = employmentStatus - } + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } - /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = apply { this.classCode = classCode } + /** The legal first name of the individual. */ + fun firstName(firstName: String) = apply { this.firstName = firstName } - fun location(location: Location) = apply { this.location = location } + /** The gender of the individual. */ + fun gender(gender: Gender) = apply { this.gender = gender } /** * The employee's income as reported by the provider. This may not always be annualized @@ -496,25 +469,52 @@ constructor( (this.incomeHistory ?: mutableListOf()).apply { add(incomeHistory) } } - /** - * Custom fields for the individual. These are fields which are defined by the employer - * in the system. Custom fields are not currently supported for assisted connections. - */ - fun customFields(customFields: List) = apply { - this.customFields = customFields.toMutableList() + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = apply { this.isActive = isActive } + + /** The legal last name of the individual. */ + fun lastName(lastName: String) = apply { this.lastName = lastName } + + fun latestRehireDate(latestRehireDate: String) = apply { + this.latestRehireDate = latestRehireDate } - /** - * Custom fields for the individual. These are fields which are defined by the employer - * in the system. Custom fields are not currently supported for assisted connections. - */ - fun addCustomField(customField: CustomField) = apply { - customFields = (customFields ?: mutableListOf()).apply { add(customField) } + fun location(location: Location) = apply { this.location = location } + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager) = apply { this.manager = manager } + + /** The legal middle name of the individual. */ + fun middleName(middleName: String) = apply { this.middleName = middleName } + + fun phoneNumbers(phoneNumbers: List) = apply { + this.phoneNumbers = phoneNumbers.toMutableList() + } + + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { + phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } } + /** The preferred name of the individual. */ + fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } + + fun residence(residence: Location) = apply { this.residence = residence } + /** The source system's unique employment identifier for this individual */ fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } + /** + * Social Security Number of the individual. This field is only available with the `ssn` + * scope enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + fun ssn(ssn: String) = apply { this.ssn = ssn } + + fun startDate(startDate: String) = apply { this.startDate = startDate } + + /** The current title of the individual. */ + fun title(title: String) = apply { this.title = title } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -536,33 +536,33 @@ constructor( fun build(): IndividualOrEmployment = IndividualOrEmployment( - firstName, - middleName, - lastName, - preferredName, - emails?.toImmutable(), - phoneNumbers?.toImmutable(), - gender, - ethnicity, - dob, - ssn, - encryptedSsn, - residence, - title, - manager, + classCode, + customFields?.toImmutable(), department, + dob, + emails?.toImmutable(), employment, - startDate, - endDate, - latestRehireDate, - isActive, employmentStatus, - classCode, - location, + encryptedSsn, + endDate, + ethnicity, + firstName, + gender, income, incomeHistory?.toImmutable(), - customFields?.toImmutable(), + isActive, + lastName, + latestRehireDate, + location, + manager, + middleName, + phoneNumbers?.toImmutable(), + preferredName, + residence, sourceId, + ssn, + startDate, + title, additionalProperties.toImmutable(), ) } @@ -890,21 +890,21 @@ constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") private val type: Type?, @JsonProperty("subtype") private val subtype: Subtype?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The main employment type of the individual. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) + /** The main employment type of the individual. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -918,26 +918,26 @@ constructor( class Builder { - private var type: Type? = null private var subtype: Subtype? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - /** The main employment type of the individual. */ - fun type(type: Type) = apply { this.type = type } - /** * The secondary employment type of the individual. Options: `full_time`, * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. */ fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + /** The main employment type of the individual. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -962,8 +962,8 @@ constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -1111,17 +1111,17 @@ constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } class EmploymentStatus @@ -1607,17 +1607,17 @@ constructor( return true } - return /* spotless:off */ other is IndividualOrEmployment && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && emails == other.emails && phoneNumbers == other.phoneNumbers && gender == other.gender && ethnicity == other.ethnicity && dob == other.dob && ssn == other.ssn && encryptedSsn == other.encryptedSsn && residence == other.residence && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualOrEmployment && classCode == other.classCode && customFields == other.customFields && department == other.department && dob == other.dob && emails == other.emails && employment == other.employment && employmentStatus == other.employmentStatus && encryptedSsn == other.encryptedSsn && endDate == other.endDate && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && sourceId == other.sourceId && ssn == other.ssn && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, preferredName, emails, phoneNumbers, gender, ethnicity, dob, ssn, encryptedSsn, residence, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(classCode, customFields, department, dob, emails, employment, employmentStatus, encryptedSsn, endDate, ethnicity, firstName, gender, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, phoneNumbers, preferredName, residence, sourceId, ssn, startDate, title, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualOrEmployment{firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, emails=$emails, phoneNumbers=$phoneNumbers, gender=$gender, ethnicity=$ethnicity, dob=$dob, ssn=$ssn, encryptedSsn=$encryptedSsn, residence=$residence, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, additionalProperties=$additionalProperties}" + "IndividualOrEmployment{classCode=$classCode, customFields=$customFields, department=$department, dob=$dob, emails=$emails, employment=$employment, employmentStatus=$employmentStatus, encryptedSsn=$encryptedSsn, endDate=$endDate, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, sourceId=$sourceId, ssn=$ssn, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index dde7bd10..1f623676 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -791,21 +791,21 @@ constructor( class Employment @JsonCreator private constructor( - @JsonProperty("type") private val type: Type?, @JsonProperty("subtype") private val subtype: Subtype?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The main employment type of the individual. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ @JsonProperty("subtype") fun subtype(): Optional = Optional.ofNullable(subtype) + /** The main employment type of the individual. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -819,26 +819,26 @@ constructor( class Builder { - private var type: Type? = null private var subtype: Subtype? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employment: Employment) = apply { - type = employment.type subtype = employment.subtype + type = employment.type additionalProperties = employment.additionalProperties.toMutableMap() } - /** The main employment type of the individual. */ - fun type(type: Type) = apply { this.type = type } - /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + /** The main employment type of the individual. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -860,8 +860,8 @@ constructor( fun build(): Employment = Employment( - type, subtype, + type, additionalProperties.toImmutable(), ) } @@ -1009,17 +1009,17 @@ constructor( return true } - return /* spotless:off */ other is Employment && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, subtype, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" + "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } class EmploymentStatus diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt index c17023e5..395bd5c9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt @@ -21,21 +21,21 @@ import java.util.Objects class SandboxJobConfiguration @JsonCreator private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("completion_status") @ExcludeMissing private val completionStatus: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun type(): Type = type.getRequired("type") - fun completionStatus(): CompletionStatus = completionStatus.getRequired("completion_status") - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): Type = type.getRequired("type") @JsonProperty("completion_status") @ExcludeMissing fun _completionStatus() = completionStatus + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -44,8 +44,8 @@ private constructor( fun validate(): SandboxJobConfiguration = apply { if (!validated) { - type() completionStatus() + type() validated = true } } @@ -59,21 +59,17 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var completionStatus: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sandboxJobConfiguration: SandboxJobConfiguration) = apply { - type = sandboxJobConfiguration.type completionStatus = sandboxJobConfiguration.completionStatus + type = sandboxJobConfiguration.type additionalProperties = sandboxJobConfiguration.additionalProperties.toMutableMap() } - fun type(type: Type) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - fun completionStatus(completionStatus: CompletionStatus) = completionStatus(JsonField.of(completionStatus)) @@ -81,6 +77,10 @@ private constructor( this.completionStatus = completionStatus } + fun type(type: Type) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -102,8 +102,8 @@ private constructor( fun build(): SandboxJobConfiguration = SandboxJobConfiguration( - type, completionStatus, + type, additionalProperties.toImmutable(), ) } @@ -233,15 +233,15 @@ private constructor( return true } - return /* spotless:off */ other is SandboxJobConfiguration && type == other.type && completionStatus == other.completionStatus && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SandboxJobConfiguration && completionStatus == other.completionStatus && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, completionStatus, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(completionStatus, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SandboxJobConfiguration{type=$type, completionStatus=$completionStatus, additionalProperties=$additionalProperties}" + "SandboxJobConfiguration{completionStatus=$completionStatus, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index 52f30fdc..f16c37ad 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt @@ -313,56 +313,56 @@ constructor( class PayStatement @JsonCreator private constructor( - @JsonProperty("individual_id") private val individualId: String?, - @JsonProperty("type") private val type: Type?, - @JsonProperty("payment_method") private val paymentMethod: PaymentMethod?, - @JsonProperty("total_hours") private val totalHours: Double?, - @JsonProperty("gross_pay") private val grossPay: Money?, - @JsonProperty("net_pay") private val netPay: Money?, @JsonProperty("earnings") private val earnings: List?, - @JsonProperty("taxes") private val taxes: List?, @JsonProperty("employee_deductions") private val employeeDeductions: List?, @JsonProperty("employer_contributions") private val employerContributions: List?, + @JsonProperty("gross_pay") private val grossPay: Money?, + @JsonProperty("individual_id") private val individualId: String?, + @JsonProperty("net_pay") private val netPay: Money?, + @JsonProperty("payment_method") private val paymentMethod: PaymentMethod?, + @JsonProperty("taxes") private val taxes: List?, + @JsonProperty("total_hours") private val totalHours: Double?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** The array of earnings objects associated with this pay statement */ + @JsonProperty("earnings") + fun earnings(): Optional> = Optional.ofNullable(earnings) + + /** The array of deductions objects associated with this pay statement. */ + @JsonProperty("employee_deductions") + fun employeeDeductions(): Optional> = + Optional.ofNullable(employeeDeductions) + + @JsonProperty("employer_contributions") + fun employerContributions(): Optional> = + Optional.ofNullable(employerContributions) + + @JsonProperty("gross_pay") fun grossPay(): Optional = Optional.ofNullable(grossPay) + /** A stable Finch `id` (UUID v4) for an individual in the company */ @JsonProperty("individual_id") fun individualId(): Optional = Optional.ofNullable(individualId) - /** The type of the payment associated with the pay statement. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + @JsonProperty("net_pay") fun netPay(): Optional = Optional.ofNullable(netPay) /** The payment method. */ @JsonProperty("payment_method") fun paymentMethod(): Optional = Optional.ofNullable(paymentMethod) - /** The number of hours worked for this pay period */ - @JsonProperty("total_hours") - fun totalHours(): Optional = Optional.ofNullable(totalHours) - - @JsonProperty("gross_pay") fun grossPay(): Optional = Optional.ofNullable(grossPay) - - @JsonProperty("net_pay") fun netPay(): Optional = Optional.ofNullable(netPay) - - /** The array of earnings objects associated with this pay statement */ - @JsonProperty("earnings") - fun earnings(): Optional> = Optional.ofNullable(earnings) - /** The array of taxes objects associated with this pay statement. */ @JsonProperty("taxes") fun taxes(): Optional> = Optional.ofNullable(taxes) - /** The array of deductions objects associated with this pay statement. */ - @JsonProperty("employee_deductions") - fun employeeDeductions(): Optional> = - Optional.ofNullable(employeeDeductions) + /** The number of hours worked for this pay period */ + @JsonProperty("total_hours") + fun totalHours(): Optional = Optional.ofNullable(totalHours) - @JsonProperty("employer_contributions") - fun employerContributions(): Optional> = - Optional.ofNullable(employerContributions) + /** The type of the payment associated with the pay statement. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -377,51 +377,33 @@ constructor( class Builder { - private var individualId: String? = null - private var type: Type? = null - private var paymentMethod: PaymentMethod? = null - private var totalHours: Double? = null - private var grossPay: Money? = null - private var netPay: Money? = null private var earnings: MutableList? = null - private var taxes: MutableList? = null private var employeeDeductions: MutableList? = null private var employerContributions: MutableList? = null + private var grossPay: Money? = null + private var individualId: String? = null + private var netPay: Money? = null + private var paymentMethod: PaymentMethod? = null + private var taxes: MutableList? = null + private var totalHours: Double? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(payStatement: PayStatement) = apply { - individualId = payStatement.individualId - type = payStatement.type - paymentMethod = payStatement.paymentMethod - totalHours = payStatement.totalHours - grossPay = payStatement.grossPay - netPay = payStatement.netPay earnings = payStatement.earnings?.toMutableList() - taxes = payStatement.taxes?.toMutableList() employeeDeductions = payStatement.employeeDeductions?.toMutableList() employerContributions = payStatement.employerContributions?.toMutableList() + grossPay = payStatement.grossPay + individualId = payStatement.individualId + netPay = payStatement.netPay + paymentMethod = payStatement.paymentMethod + taxes = payStatement.taxes?.toMutableList() + totalHours = payStatement.totalHours + type = payStatement.type additionalProperties = payStatement.additionalProperties.toMutableMap() } - /** A stable Finch `id` (UUID v4) for an individual in the company */ - fun individualId(individualId: String) = apply { this.individualId = individualId } - - /** The type of the payment associated with the pay statement. */ - fun type(type: Type) = apply { this.type = type } - - /** The payment method. */ - fun paymentMethod(paymentMethod: PaymentMethod) = apply { - this.paymentMethod = paymentMethod - } - - /** The number of hours worked for this pay period */ - fun totalHours(totalHours: Double) = apply { this.totalHours = totalHours } - - fun grossPay(grossPay: Money) = apply { this.grossPay = grossPay } - - fun netPay(netPay: Money) = apply { this.netPay = netPay } - /** The array of earnings objects associated with this pay statement */ fun earnings(earnings: List) = apply { this.earnings = earnings.toMutableList() @@ -432,12 +414,6 @@ constructor( earnings = (earnings ?: mutableListOf()).apply { add(earning) } } - /** The array of taxes objects associated with this pay statement. */ - fun taxes(taxes: List) = apply { this.taxes = taxes.toMutableList() } - - /** The array of taxes objects associated with this pay statement. */ - fun addTax(tax: Tax) = apply { taxes = (taxes ?: mutableListOf()).apply { add(tax) } } - /** The array of deductions objects associated with this pay statement. */ fun employeeDeductions(employeeDeductions: List) = apply { this.employeeDeductions = employeeDeductions.toMutableList() @@ -458,6 +434,30 @@ constructor( (employerContributions ?: mutableListOf()).apply { add(employerContribution) } } + fun grossPay(grossPay: Money) = apply { this.grossPay = grossPay } + + /** A stable Finch `id` (UUID v4) for an individual in the company */ + fun individualId(individualId: String) = apply { this.individualId = individualId } + + fun netPay(netPay: Money) = apply { this.netPay = netPay } + + /** The payment method. */ + fun paymentMethod(paymentMethod: PaymentMethod) = apply { + this.paymentMethod = paymentMethod + } + + /** The array of taxes objects associated with this pay statement. */ + fun taxes(taxes: List) = apply { this.taxes = taxes.toMutableList() } + + /** The array of taxes objects associated with this pay statement. */ + fun addTax(tax: Tax) = apply { taxes = (taxes ?: mutableListOf()).apply { add(tax) } } + + /** The number of hours worked for this pay period */ + fun totalHours(totalHours: Double) = apply { this.totalHours = totalHours } + + /** The type of the payment associated with the pay statement. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -479,16 +479,16 @@ constructor( fun build(): PayStatement = PayStatement( - individualId, - type, - paymentMethod, - totalHours, - grossPay, - netPay, earnings?.toImmutable(), - taxes?.toImmutable(), employeeDeductions?.toImmutable(), employerContributions?.toImmutable(), + grossPay, + individualId, + netPay, + paymentMethod, + taxes?.toImmutable(), + totalHours, + type, additionalProperties.toImmutable(), ) } @@ -497,21 +497,15 @@ constructor( class Earning @JsonCreator private constructor( - @JsonProperty("type") private val type: Type?, - @JsonProperty("name") private val name: String?, @JsonProperty("amount") private val amount: Long?, @JsonProperty("currency") private val currency: String?, @JsonProperty("hours") private val hours: Double?, + @JsonProperty("name") private val name: String?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of earning. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) - - /** The exact name of the deduction from the pay statement. */ - @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - /** The earnings amount in cents. */ @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) @@ -525,6 +519,12 @@ constructor( */ @JsonProperty("hours") fun hours(): Optional = Optional.ofNullable(hours) + /** The exact name of the deduction from the pay statement. */ + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) + + /** The type of earning. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -538,29 +538,23 @@ constructor( class Builder { - private var type: Type? = null - private var name: String? = null private var amount: Long? = null private var currency: String? = null private var hours: Double? = null + private var name: String? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(earning: Earning) = apply { - type = earning.type - name = earning.name amount = earning.amount currency = earning.currency hours = earning.hours + name = earning.name + type = earning.type additionalProperties = earning.additionalProperties.toMutableMap() } - /** The type of earning. */ - fun type(type: Type) = apply { this.type = type } - - /** The exact name of the deduction from the pay statement. */ - fun name(name: String) = apply { this.name = name } - /** The earnings amount in cents. */ fun amount(amount: Long) = apply { this.amount = amount } @@ -573,6 +567,12 @@ constructor( */ fun hours(hours: Double) = apply { this.hours = hours } + /** The exact name of the deduction from the pay statement. */ + fun name(name: String) = apply { this.name = name } + + /** The type of earning. */ + fun type(type: Type) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -597,11 +597,11 @@ constructor( fun build(): Earning = Earning( - type, - name, amount, currency, hours, + name, + type, additionalProperties.toImmutable(), ) } @@ -734,35 +734,32 @@ constructor( return true } - return /* spotless:off */ other is Earning && type == other.type && name == other.name && amount == other.amount && currency == other.currency && hours == other.hours && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earning && amount == other.amount && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, amount, currency, hours, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, hours, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earning{type=$type, name=$name, amount=$amount, currency=$currency, hours=$hours, additionalProperties=$additionalProperties}" + "Earning{amount=$amount, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployeeDeduction @JsonCreator private constructor( - @JsonProperty("name") private val name: String?, @JsonProperty("amount") private val amount: Long?, @JsonProperty("currency") private val currency: String?, + @JsonProperty("name") private val name: String?, @JsonProperty("pre_tax") private val preTax: Boolean?, @JsonProperty("type") private val type: BenefitType?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The deduction name from the pay statement. */ - @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - /** The deduction amount in cents. */ @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) @@ -770,6 +767,9 @@ constructor( @JsonProperty("currency") fun currency(): Optional = Optional.ofNullable(currency) + /** The deduction name from the pay statement. */ + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) + /** Boolean indicating if the deduction is pre-tax. */ @JsonProperty("pre_tax") fun preTax(): Optional = Optional.ofNullable(preTax) @@ -789,32 +789,32 @@ constructor( class Builder { - private var name: String? = null private var amount: Long? = null private var currency: String? = null + private var name: String? = null private var preTax: Boolean? = null private var type: BenefitType? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { - name = employeeDeduction.name amount = employeeDeduction.amount currency = employeeDeduction.currency + name = employeeDeduction.name preTax = employeeDeduction.preTax type = employeeDeduction.type additionalProperties = employeeDeduction.additionalProperties.toMutableMap() } - /** The deduction name from the pay statement. */ - fun name(name: String) = apply { this.name = name } - /** The deduction amount in cents. */ fun amount(amount: Long) = apply { this.amount = amount } /** The deduction currency. */ fun currency(currency: String) = apply { this.currency = currency } + /** The deduction name from the pay statement. */ + fun name(name: String) = apply { this.name = name } + /** Boolean indicating if the deduction is pre-tax. */ fun preTax(preTax: Boolean) = apply { this.preTax = preTax } @@ -845,9 +845,9 @@ constructor( fun build(): EmployeeDeduction = EmployeeDeduction( - name, amount, currency, + name, preTax, type, additionalProperties.toImmutable(), @@ -859,34 +859,31 @@ constructor( return true } - return /* spotless:off */ other is EmployeeDeduction && name == other.name && amount == other.amount && currency == other.currency && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, preTax, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeduction{name=$name, amount=$amount, currency=$currency, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" + "EmployeeDeduction{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect class EmployerContribution @JsonCreator private constructor( - @JsonProperty("name") private val name: String?, @JsonProperty("amount") private val amount: Long?, @JsonProperty("currency") private val currency: String?, + @JsonProperty("name") private val name: String?, @JsonProperty("type") private val type: BenefitType?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The contribution name from the pay statement. */ - @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - /** The contribution amount in cents. */ @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) @@ -894,6 +891,9 @@ constructor( @JsonProperty("currency") fun currency(): Optional = Optional.ofNullable(currency) + /** The contribution name from the pay statement. */ + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) + /** Type of benefit. */ @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @@ -910,30 +910,30 @@ constructor( class Builder { - private var name: String? = null private var amount: Long? = null private var currency: String? = null + private var name: String? = null private var type: BenefitType? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { - name = employerContribution.name amount = employerContribution.amount currency = employerContribution.currency + name = employerContribution.name type = employerContribution.type additionalProperties = employerContribution.additionalProperties.toMutableMap() } - /** The contribution name from the pay statement. */ - fun name(name: String) = apply { this.name = name } - /** The contribution amount in cents. */ fun amount(amount: Long) = apply { this.amount = amount } /** The contribution currency. */ fun currency(currency: String) = apply { this.currency = currency } + /** The contribution name from the pay statement. */ + fun name(name: String) = apply { this.name = name } + /** Type of benefit. */ fun type(type: BenefitType) = apply { this.type = type } @@ -961,9 +961,9 @@ constructor( fun build(): EmployerContribution = EmployerContribution( - name, amount, currency, + name, type, additionalProperties.toImmutable(), ) @@ -974,17 +974,17 @@ constructor( return true } - return /* spotless:off */ other is EmployerContribution && name == other.name && amount == other.amount && currency == other.currency && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContribution && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, amount, currency, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContribution{name=$name, amount=$amount, currency=$currency, type=$type, additionalProperties=$additionalProperties}" + "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } class PaymentMethod @@ -1048,31 +1048,31 @@ constructor( class Tax @JsonCreator private constructor( - @JsonProperty("type") private val type: Type?, - @JsonProperty("name") private val name: String?, - @JsonProperty("employer") private val employer: Boolean?, @JsonProperty("amount") private val amount: Long?, @JsonProperty("currency") private val currency: String?, + @JsonProperty("employer") private val employer: Boolean?, + @JsonProperty("name") private val name: String?, + @JsonProperty("type") private val type: Type?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of taxes. */ - @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) + /** The tax amount in cents. */ + @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) - /** The exact name of tax from the pay statement. */ - @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) + /** The currency code. */ + @JsonProperty("currency") + fun currency(): Optional = Optional.ofNullable(currency) /** `true` if the amount is paid by the employers. */ @JsonProperty("employer") fun employer(): Optional = Optional.ofNullable(employer) - /** The tax amount in cents. */ - @JsonProperty("amount") fun amount(): Optional = Optional.ofNullable(amount) + /** The exact name of tax from the pay statement. */ + @JsonProperty("name") fun name(): Optional = Optional.ofNullable(name) - /** The currency code. */ - @JsonProperty("currency") - fun currency(): Optional = Optional.ofNullable(currency) + /** The type of taxes. */ + @JsonProperty("type") fun type(): Optional = Optional.ofNullable(type) @JsonAnyGetter @ExcludeMissing @@ -1087,37 +1087,37 @@ constructor( class Builder { - private var type: Type? = null - private var name: String? = null - private var employer: Boolean? = null private var amount: Long? = null private var currency: String? = null + private var employer: Boolean? = null + private var name: String? = null + private var type: Type? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(tax: Tax) = apply { - type = tax.type - name = tax.name - employer = tax.employer amount = tax.amount currency = tax.currency + employer = tax.employer + name = tax.name + type = tax.type additionalProperties = tax.additionalProperties.toMutableMap() } - /** The type of taxes. */ - fun type(type: Type) = apply { this.type = type } + /** The tax amount in cents. */ + fun amount(amount: Long) = apply { this.amount = amount } - /** The exact name of tax from the pay statement. */ - fun name(name: String) = apply { this.name = name } + /** The currency code. */ + fun currency(currency: String) = apply { this.currency = currency } /** `true` if the amount is paid by the employers. */ fun employer(employer: Boolean) = apply { this.employer = employer } - /** The tax amount in cents. */ - fun amount(amount: Long) = apply { this.amount = amount } + /** The exact name of tax from the pay statement. */ + fun name(name: String) = apply { this.name = name } - /** The currency code. */ - fun currency(currency: String) = apply { this.currency = currency } + /** The type of taxes. */ + fun type(type: Type) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1143,11 +1143,11 @@ constructor( fun build(): Tax = Tax( - type, - name, - employer, amount, currency, + employer, + name, + type, additionalProperties.toImmutable(), ) } @@ -1226,17 +1226,17 @@ constructor( return true } - return /* spotless:off */ other is Tax && type == other.type && name == other.name && employer == other.employer && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tax && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, name, employer, amount, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tax{type=$type, name=$name, employer=$employer, amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } class Type @@ -1307,17 +1307,17 @@ constructor( return true } - return /* spotless:off */ other is PayStatement && individualId == other.individualId && type == other.type && paymentMethod == other.paymentMethod && totalHours == other.totalHours && grossPay == other.grossPay && netPay == other.netPay && earnings == other.earnings && taxes == other.taxes && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PayStatement && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && grossPay == other.grossPay && individualId == other.individualId && netPay == other.netPay && paymentMethod == other.paymentMethod && taxes == other.taxes && totalHours == other.totalHours && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, type, paymentMethod, totalHours, grossPay, netPay, earnings, taxes, employeeDeductions, employerContributions, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(earnings, employeeDeductions, employerContributions, grossPay, individualId, netPay, paymentMethod, taxes, totalHours, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PayStatement{individualId=$individualId, type=$type, paymentMethod=$paymentMethod, totalHours=$totalHours, grossPay=$grossPay, netPay=$netPay, earnings=$earnings, taxes=$taxes, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, additionalProperties=$additionalProperties}" + "PayStatement{earnings=$earnings, employeeDeductions=$employeeDeductions, employerContributions=$employerContributions, grossPay=$grossPay, individualId=$individualId, netPay=$netPay, paymentMethod=$paymentMethod, taxes=$taxes, totalHours=$totalHours, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt index 8fa01679..d9f50133 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionNewResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class SessionNewResponse @JsonCreator private constructor( - @JsonProperty("session_id") - @ExcludeMissing - private val sessionId: JsonField = JsonMissing.of(), @JsonProperty("connect_url") @ExcludeMissing private val connectUrl: JsonField = JsonMissing.of(), + @JsonProperty("session_id") + @ExcludeMissing + private val sessionId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The unique identifier for the created connect session */ - fun sessionId(): String = sessionId.getRequired("session_id") - /** The Connect URL to redirect the user to for authentication */ fun connectUrl(): String = connectUrl.getRequired("connect_url") /** The unique identifier for the created connect session */ - @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId + fun sessionId(): String = sessionId.getRequired("session_id") /** The Connect URL to redirect the user to for authentication */ @JsonProperty("connect_url") @ExcludeMissing fun _connectUrl() = connectUrl + /** The unique identifier for the created connect session */ + @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): SessionNewResponse = apply { if (!validated) { - sessionId() connectUrl() + sessionId() validated = true } } @@ -63,29 +63,29 @@ private constructor( class Builder { - private var sessionId: JsonField = JsonMissing.of() private var connectUrl: JsonField = JsonMissing.of() + private var sessionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sessionNewResponse: SessionNewResponse) = apply { - sessionId = sessionNewResponse.sessionId connectUrl = sessionNewResponse.connectUrl + sessionId = sessionNewResponse.sessionId additionalProperties = sessionNewResponse.additionalProperties.toMutableMap() } - /** The unique identifier for the created connect session */ - fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) - - /** The unique identifier for the created connect session */ - fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } - /** The Connect URL to redirect the user to for authentication */ fun connectUrl(connectUrl: String) = connectUrl(JsonField.of(connectUrl)) /** The Connect URL to redirect the user to for authentication */ fun connectUrl(connectUrl: JsonField) = apply { this.connectUrl = connectUrl } + /** The unique identifier for the created connect session */ + fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) + + /** The unique identifier for the created connect session */ + fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -107,8 +107,8 @@ private constructor( fun build(): SessionNewResponse = SessionNewResponse( - sessionId, connectUrl, + sessionId, additionalProperties.toImmutable(), ) } @@ -118,15 +118,15 @@ private constructor( return true } - return /* spotless:off */ other is SessionNewResponse && sessionId == other.sessionId && connectUrl == other.connectUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SessionNewResponse && connectUrl == other.connectUrl && sessionId == other.sessionId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(sessionId, connectUrl, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(connectUrl, sessionId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SessionNewResponse{sessionId=$sessionId, connectUrl=$connectUrl, additionalProperties=$additionalProperties}" + "SessionNewResponse{connectUrl=$connectUrl, sessionId=$sessionId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt index 2c997ca8..5cbb526d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SessionReauthenticateResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class SessionReauthenticateResponse @JsonCreator private constructor( - @JsonProperty("session_id") - @ExcludeMissing - private val sessionId: JsonField = JsonMissing.of(), @JsonProperty("connect_url") @ExcludeMissing private val connectUrl: JsonField = JsonMissing.of(), + @JsonProperty("session_id") + @ExcludeMissing + private val sessionId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The unique identifier for the created connect session */ - fun sessionId(): String = sessionId.getRequired("session_id") - /** The Connect URL to redirect the user to for reauthentication */ fun connectUrl(): String = connectUrl.getRequired("connect_url") /** The unique identifier for the created connect session */ - @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId + fun sessionId(): String = sessionId.getRequired("session_id") /** The Connect URL to redirect the user to for reauthentication */ @JsonProperty("connect_url") @ExcludeMissing fun _connectUrl() = connectUrl + /** The unique identifier for the created connect session */ + @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): SessionReauthenticateResponse = apply { if (!validated) { - sessionId() connectUrl() + sessionId() validated = true } } @@ -63,29 +63,29 @@ private constructor( class Builder { - private var sessionId: JsonField = JsonMissing.of() private var connectUrl: JsonField = JsonMissing.of() + private var sessionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(sessionReauthenticateResponse: SessionReauthenticateResponse) = apply { - sessionId = sessionReauthenticateResponse.sessionId connectUrl = sessionReauthenticateResponse.connectUrl + sessionId = sessionReauthenticateResponse.sessionId additionalProperties = sessionReauthenticateResponse.additionalProperties.toMutableMap() } - /** The unique identifier for the created connect session */ - fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) - - /** The unique identifier for the created connect session */ - fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } - /** The Connect URL to redirect the user to for reauthentication */ fun connectUrl(connectUrl: String) = connectUrl(JsonField.of(connectUrl)) /** The Connect URL to redirect the user to for reauthentication */ fun connectUrl(connectUrl: JsonField) = apply { this.connectUrl = connectUrl } + /** The unique identifier for the created connect session */ + fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) + + /** The unique identifier for the created connect session */ + fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -107,8 +107,8 @@ private constructor( fun build(): SessionReauthenticateResponse = SessionReauthenticateResponse( - sessionId, connectUrl, + sessionId, additionalProperties.toImmutable(), ) } @@ -118,15 +118,15 @@ private constructor( return true } - return /* spotless:off */ other is SessionReauthenticateResponse && sessionId == other.sessionId && connectUrl == other.connectUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SessionReauthenticateResponse && connectUrl == other.connectUrl && sessionId == other.sessionId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(sessionId, connectUrl, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(connectUrl, sessionId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SessionReauthenticateResponse{sessionId=$sessionId, connectUrl=$connectUrl, additionalProperties=$additionalProperties}" + "SessionReauthenticateResponse{connectUrl=$connectUrl, sessionId=$sessionId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt index 1f6817c4..8fba0666 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt @@ -22,51 +22,33 @@ import java.util.Optional class SupportedBenefit @JsonCreator private constructor( - @JsonProperty("type") + @JsonProperty("annual_maximum") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val annualMaximum: JsonField = JsonMissing.of(), + @JsonProperty("catch_up") + @ExcludeMissing + private val catchUp: JsonField = JsonMissing.of(), + @JsonProperty("company_contribution") + @ExcludeMissing + private val companyContribution: JsonField> = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), - @JsonProperty("frequencies") - @ExcludeMissing - private val frequencies: JsonField> = JsonMissing.of(), @JsonProperty("employee_deduction") @ExcludeMissing private val employeeDeduction: JsonField> = JsonMissing.of(), - @JsonProperty("company_contribution") - @ExcludeMissing - private val companyContribution: JsonField> = JsonMissing.of(), - @JsonProperty("annual_maximum") - @ExcludeMissing - private val annualMaximum: JsonField = JsonMissing.of(), - @JsonProperty("catch_up") + @JsonProperty("frequencies") @ExcludeMissing - private val catchUp: JsonField = JsonMissing.of(), + private val frequencies: JsonField> = JsonMissing.of(), @JsonProperty("hsa_contribution_limit") @ExcludeMissing private val hsaContributionLimit: JsonField> = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Type of benefit. */ - fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - - fun description(): Optional = - Optional.ofNullable(description.getNullable("description")) - - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(): Optional> = - Optional.ofNullable(frequencies.getNullable("frequencies")) - - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(): Optional> = - Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) - - /** Supported contribution types. An empty array indicates contributions are not supported. */ - fun companyContribution(): Optional> = - Optional.ofNullable(companyContribution.getNullable("company_contribution")) - /** Whether the provider supports an annual maximum for this benefit. */ fun annualMaximum(): Optional = Optional.ofNullable(annualMaximum.getNullable("annual_maximum")) @@ -77,6 +59,21 @@ private constructor( */ fun catchUp(): Optional = Optional.ofNullable(catchUp.getNullable("catch_up")) + /** Supported contribution types. An empty array indicates contributions are not supported. */ + fun companyContribution(): Optional> = + Optional.ofNullable(companyContribution.getNullable("company_contribution")) + + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** Supported deduction types. An empty array indicates deductions are not supported. */ + fun employeeDeduction(): Optional> = + Optional.ofNullable(employeeDeduction.getNullable("employee_deduction")) + + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(): Optional> = + Optional.ofNullable(frequencies.getNullable("frequencies")) + /** * Whether the provider supports HSA contribution limits. Empty if this feature is not supported * for the benefit. This array only has values for HSA benefits. @@ -85,20 +82,7 @@ private constructor( Optional.ofNullable(hsaContributionLimit.getNullable("hsa_contribution_limit")) /** Type of benefit. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - @JsonProperty("description") @ExcludeMissing fun _description() = description - - /** The list of frequencies supported by the provider for this benefit */ - @JsonProperty("frequencies") @ExcludeMissing fun _frequencies() = frequencies - - /** Supported deduction types. An empty array indicates deductions are not supported. */ - @JsonProperty("employee_deduction") @ExcludeMissing fun _employeeDeduction() = employeeDeduction - - /** Supported contribution types. An empty array indicates contributions are not supported. */ - @JsonProperty("company_contribution") - @ExcludeMissing - fun _companyContribution() = companyContribution + fun type(): Optional = Optional.ofNullable(type.getNullable("type")) /** Whether the provider supports an annual maximum for this benefit. */ @JsonProperty("annual_maximum") @ExcludeMissing fun _annualMaximum() = annualMaximum @@ -109,6 +93,19 @@ private constructor( */ @JsonProperty("catch_up") @ExcludeMissing fun _catchUp() = catchUp + /** Supported contribution types. An empty array indicates contributions are not supported. */ + @JsonProperty("company_contribution") + @ExcludeMissing + fun _companyContribution() = companyContribution + + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** Supported deduction types. An empty array indicates deductions are not supported. */ + @JsonProperty("employee_deduction") @ExcludeMissing fun _employeeDeduction() = employeeDeduction + + /** The list of frequencies supported by the provider for this benefit */ + @JsonProperty("frequencies") @ExcludeMissing fun _frequencies() = frequencies + /** * Whether the provider supports HSA contribution limits. Empty if this feature is not supported * for the benefit. This array only has values for HSA benefits. @@ -117,6 +114,9 @@ private constructor( @ExcludeMissing fun _hsaContributionLimit() = hsaContributionLimit + /** Type of benefit. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -125,14 +125,14 @@ private constructor( fun validate(): SupportedBenefit = apply { if (!validated) { - type() - description() - frequencies() - employeeDeduction() - companyContribution() annualMaximum() catchUp() + companyContribution() + description() + employeeDeduction() + frequencies() hsaContributionLimit() + type() validated = true } } @@ -146,56 +146,48 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() - private var description: JsonField = JsonMissing.of() - private var frequencies: JsonField> = JsonMissing.of() - private var employeeDeduction: JsonField> = JsonMissing.of() - private var companyContribution: JsonField> = JsonMissing.of() private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() + private var companyContribution: JsonField> = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var employeeDeduction: JsonField> = JsonMissing.of() + private var frequencies: JsonField> = JsonMissing.of() private var hsaContributionLimit: JsonField> = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(supportedBenefit: SupportedBenefit) = apply { - type = supportedBenefit.type - description = supportedBenefit.description - frequencies = supportedBenefit.frequencies - employeeDeduction = supportedBenefit.employeeDeduction - companyContribution = supportedBenefit.companyContribution annualMaximum = supportedBenefit.annualMaximum catchUp = supportedBenefit.catchUp + companyContribution = supportedBenefit.companyContribution + description = supportedBenefit.description + employeeDeduction = supportedBenefit.employeeDeduction + frequencies = supportedBenefit.frequencies hsaContributionLimit = supportedBenefit.hsaContributionLimit + type = supportedBenefit.type additionalProperties = supportedBenefit.additionalProperties.toMutableMap() } - /** Type of benefit. */ - fun type(type: BenefitType) = type(JsonField.of(type)) - - /** Type of benefit. */ - fun type(type: JsonField) = apply { this.type = type } - - fun description(description: String) = description(JsonField.of(description)) - - fun description(description: JsonField) = apply { this.description = description } - - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(frequencies: List) = - frequencies(JsonField.of(frequencies)) + /** Whether the provider supports an annual maximum for this benefit. */ + fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) - /** The list of frequencies supported by the provider for this benefit */ - fun frequencies(frequencies: JsonField>) = apply { - this.frequencies = frequencies + /** Whether the provider supports an annual maximum for this benefit. */ + fun annualMaximum(annualMaximum: JsonField) = apply { + this.annualMaximum = annualMaximum } - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(employeeDeduction: List) = - employeeDeduction(JsonField.of(employeeDeduction)) + /** + * Whether the provider supports catch up for this benefit. This field will only be true for + * retirement benefits. + */ + fun catchUp(catchUp: Boolean) = catchUp(JsonField.of(catchUp)) - /** Supported deduction types. An empty array indicates deductions are not supported. */ - fun employeeDeduction(employeeDeduction: JsonField>) = apply { - this.employeeDeduction = employeeDeduction - } + /** + * Whether the provider supports catch up for this benefit. This field will only be true for + * retirement benefits. + */ + fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } /** * Supported contribution types. An empty array indicates contributions are not supported. @@ -211,25 +203,27 @@ private constructor( this.companyContribution = companyContribution } - /** Whether the provider supports an annual maximum for this benefit. */ - fun annualMaximum(annualMaximum: Boolean) = annualMaximum(JsonField.of(annualMaximum)) + fun description(description: String) = description(JsonField.of(description)) - /** Whether the provider supports an annual maximum for this benefit. */ - fun annualMaximum(annualMaximum: JsonField) = apply { - this.annualMaximum = annualMaximum + fun description(description: JsonField) = apply { this.description = description } + + /** Supported deduction types. An empty array indicates deductions are not supported. */ + fun employeeDeduction(employeeDeduction: List) = + employeeDeduction(JsonField.of(employeeDeduction)) + + /** Supported deduction types. An empty array indicates deductions are not supported. */ + fun employeeDeduction(employeeDeduction: JsonField>) = apply { + this.employeeDeduction = employeeDeduction } - /** - * Whether the provider supports catch up for this benefit. This field will only be true for - * retirement benefits. - */ - fun catchUp(catchUp: Boolean) = catchUp(JsonField.of(catchUp)) + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(frequencies: List) = + frequencies(JsonField.of(frequencies)) - /** - * Whether the provider supports catch up for this benefit. This field will only be true for - * retirement benefits. - */ - fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp } + /** The list of frequencies supported by the provider for this benefit */ + fun frequencies(frequencies: JsonField>) = apply { + this.frequencies = frequencies + } /** * Whether the provider supports HSA contribution limits. Empty if this feature is not @@ -247,6 +241,12 @@ private constructor( this.hsaContributionLimit = hsaContributionLimit } + /** Type of benefit. */ + fun type(type: BenefitType) = type(JsonField.of(type)) + + /** Type of benefit. */ + fun type(type: JsonField) = apply { this.type = type } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -268,14 +268,14 @@ private constructor( fun build(): SupportedBenefit = SupportedBenefit( - type, - description, - frequencies.map { it.toImmutable() }, - employeeDeduction.map { it.toImmutable() }, - companyContribution.map { it.toImmutable() }, annualMaximum, catchUp, + companyContribution.map { it.toImmutable() }, + description, + employeeDeduction.map { it.toImmutable() }, + frequencies.map { it.toImmutable() }, hsaContributionLimit.map { it.toImmutable() }, + type, additionalProperties.toImmutable(), ) } @@ -456,15 +456,15 @@ private constructor( return true } - return /* spotless:off */ other is SupportedBenefit && type == other.type && description == other.description && frequencies == other.frequencies && employeeDeduction == other.employeeDeduction && companyContribution == other.companyContribution && annualMaximum == other.annualMaximum && catchUp == other.catchUp && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedBenefit && annualMaximum == other.annualMaximum && catchUp == other.catchUp && companyContribution == other.companyContribution && description == other.description && employeeDeduction == other.employeeDeduction && frequencies == other.frequencies && hsaContributionLimit == other.hsaContributionLimit && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, description, frequencies, employeeDeduction, companyContribution, annualMaximum, catchUp, hsaContributionLimit, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(annualMaximum, catchUp, companyContribution, description, employeeDeduction, frequencies, hsaContributionLimit, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedBenefit{type=$type, description=$description, frequencies=$frequencies, employeeDeduction=$employeeDeduction, companyContribution=$companyContribution, annualMaximum=$annualMaximum, catchUp=$catchUp, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}" + "SupportedBenefit{annualMaximum=$annualMaximum, catchUp=$catchUp, companyContribution=$companyContribution, description=$description, employeeDeduction=$employeeDeduction, frequencies=$frequencies, hsaContributionLimit=$hsaContributionLimit, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt index d28fc407..d381cf19 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt @@ -20,28 +20,28 @@ import java.util.Optional class UnenrolledIndividual @JsonCreator private constructor( + @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), + @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @JsonProperty("individual_id") @ExcludeMissing private val individualId: JsonField = JsonMissing.of(), - @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), - @JsonProperty("body") @ExcludeMissing private val body: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun individualId(): Optional = - Optional.ofNullable(individualId.getNullable("individual_id")) + fun body(): Optional = Optional.ofNullable(body.getNullable("body")) /** HTTP status code */ fun code(): Optional = Optional.ofNullable(code.getNullable("code")) - fun body(): Optional = Optional.ofNullable(body.getNullable("body")) + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) - @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId + @JsonProperty("body") @ExcludeMissing fun _body() = body /** HTTP status code */ @JsonProperty("code") @ExcludeMissing fun _code() = code - @JsonProperty("body") @ExcludeMissing fun _body() = body + @JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId @JsonAnyGetter @ExcludeMissing @@ -51,9 +51,9 @@ private constructor( fun validate(): UnenrolledIndividual = apply { if (!validated) { - individualId() - code() body().map { it.validate() } + code() + individualId() validated = true } } @@ -67,24 +67,22 @@ private constructor( class Builder { - private var individualId: JsonField = JsonMissing.of() - private var code: JsonField = JsonMissing.of() private var body: JsonField = JsonMissing.of() + private var code: JsonField = JsonMissing.of() + private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(unenrolledIndividual: UnenrolledIndividual) = apply { - individualId = unenrolledIndividual.individualId - code = unenrolledIndividual.code body = unenrolledIndividual.body + code = unenrolledIndividual.code + individualId = unenrolledIndividual.individualId additionalProperties = unenrolledIndividual.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun body(body: Body) = body(JsonField.of(body)) - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun body(body: JsonField) = apply { this.body = body } /** HTTP status code */ fun code(code: Long) = code(JsonField.of(code)) @@ -92,9 +90,11 @@ private constructor( /** HTTP status code */ fun code(code: JsonField) = apply { this.code = code } - fun body(body: Body) = body(JsonField.of(body)) + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) - fun body(body: JsonField) = apply { this.body = body } + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -117,9 +117,9 @@ private constructor( fun build(): UnenrolledIndividual = UnenrolledIndividual( - individualId, - code, body, + code, + individualId, additionalProperties.toImmutable(), ) } @@ -128,22 +128,19 @@ private constructor( class Body @JsonCreator private constructor( - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonProperty("finch_code") @ExcludeMissing private val finchCode: JsonField = JsonMissing.of(), @JsonProperty("message") @ExcludeMissing private val message: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) - /** A descriptive identifier for the response. */ fun finchCode(): Optional = Optional.ofNullable(finchCode.getNullable("finch_code")) @@ -151,7 +148,7 @@ private constructor( fun message(): Optional = Optional.ofNullable(message.getNullable("message")) /** Identifier indicating whether the benefit was newly enrolled or updated. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** A descriptive identifier for the response. */ @JsonProperty("finch_code") @ExcludeMissing fun _finchCode() = finchCode @@ -159,6 +156,9 @@ private constructor( /** Short description in English that provides more information about the response. */ @JsonProperty("message") @ExcludeMissing fun _message() = message + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -167,9 +167,9 @@ private constructor( fun validate(): Body = apply { if (!validated) { - name() finchCode() message() + name() validated = true } } @@ -183,25 +183,19 @@ private constructor( class Builder { - private var name: JsonField = JsonMissing.of() private var finchCode: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { - name = body.name finchCode = body.finchCode message = body.message + name = body.name additionalProperties = body.additionalProperties.toMutableMap() } - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(name: String) = name(JsonField.of(name)) - - /** Identifier indicating whether the benefit was newly enrolled or updated. */ - fun name(name: JsonField) = apply { this.name = name } - /** A descriptive identifier for the response. */ fun finchCode(finchCode: String) = finchCode(JsonField.of(finchCode)) @@ -214,6 +208,12 @@ private constructor( /** Short description in English that provides more information about the response. */ fun message(message: JsonField) = apply { this.message = message } + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + fun name(name: String) = name(JsonField.of(name)) + + /** Identifier indicating whether the benefit was newly enrolled or updated. */ + fun name(name: JsonField) = apply { this.name = name } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -235,9 +235,9 @@ private constructor( fun build(): Body = Body( - name, finchCode, message, + name, additionalProperties.toImmutable(), ) } @@ -247,17 +247,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && name == other.name && finchCode == other.finchCode && message == other.message && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && finchCode == other.finchCode && message == other.message && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, finchCode, message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(finchCode, message, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Body{name=$name, finchCode=$finchCode, message=$message, additionalProperties=$additionalProperties}" + "Body{finchCode=$finchCode, message=$message, name=$name, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -265,15 +265,15 @@ private constructor( return true } - return /* spotless:off */ other is UnenrolledIndividual && individualId == other.individualId && code == other.code && body == other.body && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnenrolledIndividual && body == other.body && code == other.code && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, code, body, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(body, code, individualId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnenrolledIndividual{individualId=$individualId, code=$code, body=$body, additionalProperties=$additionalProperties}" + "UnenrolledIndividual{body=$body, code=$code, individualId=$individualId, additionalProperties=$additionalProperties}" } From e4f8ca9dd0387833aa49d7a386bf806cf2af597b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 19:38:38 +0000 Subject: [PATCH 6/7] feat(client): allow passing null or optional for nullable fields (#379) --- .../api/client/okhttp/FinchOkHttpClient.kt | 18 +- .../client/okhttp/FinchOkHttpClientAsync.kt | 18 +- .../com/tryfinch/api/core/ClientOptions.kt | 18 +- .../api/models/AccessTokenCreateParams.kt | 25 +- .../api/models/ConnectSessionNewParams.kt | 88 +++++-- .../ConnectSessionReauthenticateParams.kt | 55 +++- .../api/models/HrisBenefitCreateParams.kt | 35 ++- ...fitIndividualRetrieveManyBenefitsParams.kt | 9 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 16 +- .../api/models/HrisBenefitUpdateParams.kt | 10 +- .../HrisDirectoryListIndividualsParams.kt | 18 +- .../api/models/HrisDirectoryListParams.kt | 18 +- .../HrisIndividualRetrieveManyParams.kt | 27 +- .../HrisPayStatementRetrieveManyParams.kt | 18 +- .../api/models/JobAutomatedListParams.kt | 18 +- .../api/models/PayrollPayGroupListParams.kt | 11 +- .../models/RequestForwardingForwardParams.kt | 50 +++- .../api/models/SandboxCompanyUpdateParams.kt | 146 ++++++++--- .../SandboxConnectionAccountCreateParams.kt | 28 ++- .../SandboxConnectionAccountUpdateParams.kt | 10 +- .../models/SandboxConnectionCreateParams.kt | 56 ++++- .../models/SandboxDirectoryCreateParams.kt | 206 ++++++++++++--- .../models/SandboxEmploymentUpdateParams.kt | 237 ++++++++++++++---- .../models/SandboxIndividualUpdateParams.kt | 151 ++++++++--- .../api/models/SandboxPaymentCreateParams.kt | 221 +++++++++++++--- 25 files changed, 1237 insertions(+), 270 deletions(-) diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt index 2aaeb055..786e65de 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.QueryParams import java.net.Proxy import java.time.Clock import java.time.Duration +import java.util.Optional class FinchOkHttpClient private constructor() { @@ -128,16 +129,25 @@ class FinchOkHttpClient private constructor() { clientOptions.responseValidation(responseValidation) } - fun accessToken(accessToken: String) = apply { clientOptions.accessToken(accessToken) } + fun accessToken(accessToken: String?) = apply { clientOptions.accessToken(accessToken) } - fun clientId(clientId: String) = apply { clientOptions.clientId(clientId) } + fun accessToken(accessToken: Optional) = accessToken(accessToken.orElse(null)) - fun clientSecret(clientSecret: String) = apply { clientOptions.clientSecret(clientSecret) } + fun clientId(clientId: String?) = apply { clientOptions.clientId(clientId) } - fun webhookSecret(webhookSecret: String) = apply { + fun clientId(clientId: Optional) = clientId(clientId.orElse(null)) + + fun clientSecret(clientSecret: String?) = apply { clientOptions.clientSecret(clientSecret) } + + fun clientSecret(clientSecret: Optional) = clientSecret(clientSecret.orElse(null)) + + fun webhookSecret(webhookSecret: String?) = apply { clientOptions.webhookSecret(webhookSecret) } + fun webhookSecret(webhookSecret: Optional) = + webhookSecret(webhookSecret.orElse(null)) + fun fromEnv() = apply { clientOptions.fromEnv() } fun build(): FinchClient = diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt index e5f243c8..9ce013bb 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.QueryParams import java.net.Proxy import java.time.Clock import java.time.Duration +import java.util.Optional class FinchOkHttpClientAsync private constructor() { @@ -128,16 +129,25 @@ class FinchOkHttpClientAsync private constructor() { clientOptions.responseValidation(responseValidation) } - fun accessToken(accessToken: String) = apply { clientOptions.accessToken(accessToken) } + fun accessToken(accessToken: String?) = apply { clientOptions.accessToken(accessToken) } - fun clientId(clientId: String) = apply { clientOptions.clientId(clientId) } + fun accessToken(accessToken: Optional) = accessToken(accessToken.orElse(null)) - fun clientSecret(clientSecret: String) = apply { clientOptions.clientSecret(clientSecret) } + fun clientId(clientId: String?) = apply { clientOptions.clientId(clientId) } - fun webhookSecret(webhookSecret: String) = apply { + fun clientId(clientId: Optional) = clientId(clientId.orElse(null)) + + fun clientSecret(clientSecret: String?) = apply { clientOptions.clientSecret(clientSecret) } + + fun clientSecret(clientSecret: Optional) = clientSecret(clientSecret.orElse(null)) + + fun webhookSecret(webhookSecret: String?) = apply { clientOptions.webhookSecret(webhookSecret) } + fun webhookSecret(webhookSecret: Optional) = + webhookSecret(webhookSecret.orElse(null)) + fun fromEnv() = apply { clientOptions.fromEnv() } fun build(): FinchClientAsync = diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt index 8b56f29f..743402d6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.http.RetryingHttpClient import java.time.Clock import java.util.Base64 +import java.util.Optional class ClientOptions private constructor( @@ -164,13 +165,22 @@ private constructor( fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } - fun accessToken(accessToken: String) = apply { this.accessToken = accessToken } + fun accessToken(accessToken: String?) = apply { this.accessToken = accessToken } - fun clientId(clientId: String) = apply { this.clientId = clientId } + fun accessToken(accessToken: Optional) = accessToken(accessToken.orElse(null)) - fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret } + fun clientId(clientId: String?) = apply { this.clientId = clientId } - fun webhookSecret(webhookSecret: String) = apply { this.webhookSecret = webhookSecret } + fun clientId(clientId: Optional) = clientId(clientId.orElse(null)) + + fun clientSecret(clientSecret: String?) = apply { this.clientSecret = clientSecret } + + fun clientSecret(clientSecret: Optional) = clientSecret(clientSecret.orElse(null)) + + fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret } + + fun webhookSecret(webhookSecret: Optional) = + webhookSecret(webhookSecret.orElse(null)) fun fromEnv() = apply { System.getenv("FINCH_CLIENT_ID")?.let { clientId(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt index 205a5396..52895682 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt @@ -95,11 +95,18 @@ constructor( fun code(code: String) = apply { this.code = code } - fun clientId(clientId: String) = apply { this.clientId = clientId } + fun clientId(clientId: String?) = apply { this.clientId = clientId } - fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret } + fun clientId(clientId: Optional) = clientId(clientId.orElse(null)) - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + fun clientSecret(clientSecret: String?) = apply { this.clientSecret = clientSecret } + + fun clientSecret(clientSecret: Optional) = + clientSecret(clientSecret.orElse(null)) + + fun redirectUri(redirectUri: String?) = apply { this.redirectUri = redirectUri } + + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -171,11 +178,17 @@ constructor( fun code(code: String) = apply { body.code(code) } - fun clientId(clientId: String) = apply { body.clientId(clientId) } + fun clientId(clientId: String?) = apply { body.clientId(clientId) } + + fun clientId(clientId: Optional) = clientId(clientId.orElse(null)) + + fun clientSecret(clientSecret: String?) = apply { body.clientSecret(clientSecret) } + + fun clientSecret(clientSecret: Optional) = clientSecret(clientSecret.orElse(null)) - fun clientSecret(clientSecret: String) = apply { body.clientSecret(clientSecret) } + fun redirectUri(redirectUri: String?) = apply { body.redirectUri(redirectUri) } - fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index 414ae9ed..687966ca 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt @@ -149,23 +149,53 @@ constructor( products = (products ?: mutableListOf()).apply { add(product) } } - fun customerEmail(customerEmail: String) = apply { this.customerEmail = customerEmail } + fun customerEmail(customerEmail: String?) = apply { this.customerEmail = customerEmail } - fun integration(integration: Integration) = apply { this.integration = integration } + fun customerEmail(customerEmail: Optional) = + customerEmail(customerEmail.orElse(null)) - fun manual(manual: Boolean) = apply { this.manual = manual } + fun integration(integration: Integration?) = apply { this.integration = integration } + + fun integration(integration: Optional) = + integration(integration.orElse(null)) + + fun manual(manual: Boolean?) = apply { this.manual = manual } + + fun manual(manual: Boolean) = manual(manual as Boolean?) + + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun manual(manual: Optional) = manual(manual.orElse(null) as Boolean?) /** * The number of minutes until the session expires (defaults to 20,160, which is 14 * days) */ - fun minutesToExpire(minutesToExpire: Double) = apply { + fun minutesToExpire(minutesToExpire: Double?) = apply { this.minutesToExpire = minutesToExpire } - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 + * days) + */ + fun minutesToExpire(minutesToExpire: Double) = + minutesToExpire(minutesToExpire as Double?) + + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 + * days) + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun minutesToExpire(minutesToExpire: Optional) = + minutesToExpire(minutesToExpire.orElse(null) as Double?) + + fun redirectUri(redirectUri: String?) = apply { this.redirectUri = redirectUri } + + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) + + fun sandbox(sandbox: Sandbox?) = apply { this.sandbox = sandbox } - fun sandbox(sandbox: Sandbox) = apply { this.sandbox = sandbox } + fun sandbox(sandbox: Optional) = sandbox(sandbox.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -249,22 +279,48 @@ constructor( fun addProduct(product: ConnectProducts) = apply { body.addProduct(product) } - fun customerEmail(customerEmail: String) = apply { body.customerEmail(customerEmail) } + fun customerEmail(customerEmail: String?) = apply { body.customerEmail(customerEmail) } - fun integration(integration: Integration) = apply { body.integration(integration) } + fun customerEmail(customerEmail: Optional) = + customerEmail(customerEmail.orElse(null)) - fun manual(manual: Boolean) = apply { body.manual(manual) } + fun integration(integration: Integration?) = apply { body.integration(integration) } + + fun integration(integration: Optional) = integration(integration.orElse(null)) + + fun manual(manual: Boolean?) = apply { body.manual(manual) } + + fun manual(manual: Boolean) = manual(manual as Boolean?) + + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun manual(manual: Optional) = manual(manual.orElse(null) as Boolean?) /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ - fun minutesToExpire(minutesToExpire: Double) = apply { + fun minutesToExpire(minutesToExpire: Double?) = apply { body.minutesToExpire(minutesToExpire) } - fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + */ + fun minutesToExpire(minutesToExpire: Double) = minutesToExpire(minutesToExpire as Double?) + + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun minutesToExpire(minutesToExpire: Optional) = + minutesToExpire(minutesToExpire.orElse(null) as Double?) + + fun redirectUri(redirectUri: String?) = apply { body.redirectUri(redirectUri) } - fun sandbox(sandbox: Sandbox) = apply { body.sandbox(sandbox) } + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) + + fun sandbox(sandbox: Sandbox?) = apply { body.sandbox(sandbox) } + + fun sandbox(sandbox: Optional) = sandbox(sandbox.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -523,9 +579,13 @@ constructor( additionalProperties = integration.additionalProperties.toMutableMap() } - fun authMethod(authMethod: AuthMethod) = apply { this.authMethod = authMethod } + fun authMethod(authMethod: AuthMethod?) = apply { this.authMethod = authMethod } + + fun authMethod(authMethod: Optional) = authMethod(authMethod.orElse(null)) + + fun provider(provider: String?) = apply { this.provider = provider } - fun provider(provider: String) = apply { this.provider = provider } + fun provider(provider: Optional) = provider(provider.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index 86b01e4e..6dd995e6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt @@ -116,22 +116,43 @@ constructor( * The number of minutes until the session expires (defaults to 20,160, which is 14 * days) */ - fun minutesToExpire(minutesToExpire: Long) = apply { + fun minutesToExpire(minutesToExpire: Long?) = apply { this.minutesToExpire = minutesToExpire } + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 + * days) + */ + fun minutesToExpire(minutesToExpire: Long) = minutesToExpire(minutesToExpire as Long?) + + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 + * days) + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun minutesToExpire(minutesToExpire: Optional) = + minutesToExpire(minutesToExpire.orElse(null) as Long?) + /** The products to request access to (optional for reauthentication) */ - fun products(products: List) = apply { - this.products = products.toMutableList() + fun products(products: List?) = apply { + this.products = products?.toMutableList() } + /** The products to request access to (optional for reauthentication) */ + fun products(products: Optional>) = + products(products.orElse(null)) + /** The products to request access to (optional for reauthentication) */ fun addProduct(product: ConnectProducts) = apply { products = (products ?: mutableListOf()).apply { add(product) } } /** The URI to redirect to after the Connect flow is completed */ - fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri } + fun redirectUri(redirectUri: String?) = apply { this.redirectUri = redirectUri } + + /** The URI to redirect to after the Connect flow is completed */ + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -210,16 +231,36 @@ constructor( /** * The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ - fun minutesToExpire(minutesToExpire: Long) = apply { body.minutesToExpire(minutesToExpire) } + fun minutesToExpire(minutesToExpire: Long?) = apply { + body.minutesToExpire(minutesToExpire) + } + + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + */ + fun minutesToExpire(minutesToExpire: Long) = minutesToExpire(minutesToExpire as Long?) + + /** + * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun minutesToExpire(minutesToExpire: Optional) = + minutesToExpire(minutesToExpire.orElse(null) as Long?) + + /** The products to request access to (optional for reauthentication) */ + fun products(products: List?) = apply { body.products(products) } /** The products to request access to (optional for reauthentication) */ - fun products(products: List) = apply { body.products(products) } + fun products(products: Optional>) = products(products.orElse(null)) /** The products to request access to (optional for reauthentication) */ fun addProduct(product: ConnectProducts) = apply { body.addProduct(product) } /** The URI to redirect to after the Connect flow is completed */ - fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) } + fun redirectUri(redirectUri: String?) = apply { body.redirectUri(redirectUri) } + + /** The URI to redirect to after the Connect flow is completed */ + fun redirectUri(redirectUri: Optional) = redirectUri(redirectUri.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt index 94778244..1ddf9377 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt @@ -101,12 +101,24 @@ constructor( * limiting this to <30 characters due to limitations in specific providers (e.g. * Justworks). */ - fun description(description: String) = apply { this.description = description } + fun description(description: String?) = apply { this.description = description } - fun frequency(frequency: BenefitFrequency) = apply { this.frequency = frequency } + /** + * Name of the benefit as it appears in the provider and pay statements. Recommend + * limiting this to <30 characters due to limitations in specific providers (e.g. + * Justworks). + */ + fun description(description: Optional) = description(description.orElse(null)) + + fun frequency(frequency: BenefitFrequency?) = apply { this.frequency = frequency } + + fun frequency(frequency: Optional) = frequency(frequency.orElse(null)) + + /** Type of benefit. */ + fun type(type: BenefitType?) = apply { this.type = type } /** Type of benefit. */ - fun type(type: BenefitType) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -179,12 +191,23 @@ constructor( * Name of the benefit as it appears in the provider and pay statements. Recommend limiting * this to <30 characters due to limitations in specific providers (e.g. Justworks). */ - fun description(description: String) = apply { body.description(description) } + fun description(description: String?) = apply { body.description(description) } - fun frequency(frequency: BenefitFrequency) = apply { body.frequency(frequency) } + /** + * Name of the benefit as it appears in the provider and pay statements. Recommend limiting + * this to <30 characters due to limitations in specific providers (e.g. Justworks). + */ + fun description(description: Optional) = description(description.orElse(null)) + + fun frequency(frequency: BenefitFrequency?) = apply { body.frequency(frequency) } + + fun frequency(frequency: Optional) = frequency(frequency.orElse(null)) + + /** Type of benefit. */ + fun type(type: BenefitType?) = apply { body.type(type) } /** Type of benefit. */ - fun type(type: BenefitType) = apply { body.type(type) } + fun type(type: Optional) = type(type.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt index 0f6dca6d..0b271e6c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt @@ -79,7 +79,14 @@ constructor( * comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all * individuals */ - fun individualIds(individualIds: String) = apply { this.individualIds = individualIds } + fun individualIds(individualIds: String?) = apply { this.individualIds = individualIds } + + /** + * comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all + * individuals + */ + fun individualIds(individualIds: Optional) = + individualIds(individualIds.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt index 0d55e642..5952a750 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt @@ -87,10 +87,14 @@ constructor( } /** Array of individual_ids to unenroll. */ - fun individualIds(individualIds: List) = apply { - this.individualIds = individualIds.toMutableList() + fun individualIds(individualIds: List?) = apply { + this.individualIds = individualIds?.toMutableList() } + /** Array of individual_ids to unenroll. */ + fun individualIds(individualIds: Optional>) = + individualIds(individualIds.orElse(null)) + /** Array of individual_ids to unenroll. */ fun addIndividualId(individualId: String) = apply { individualIds = (individualIds ?: mutableListOf()).apply { add(individualId) } @@ -171,7 +175,13 @@ constructor( fun benefitId(benefitId: String) = apply { this.benefitId = benefitId } /** Array of individual_ids to unenroll. */ - fun individualIds(individualIds: List) = apply { body.individualIds(individualIds) } + fun individualIds(individualIds: List?) = apply { + body.individualIds(individualIds) + } + + /** Array of individual_ids to unenroll. */ + fun individualIds(individualIds: Optional>) = + individualIds(individualIds.orElse(null)) /** Array of individual_ids to unenroll. */ fun addIndividualId(individualId: String) = apply { body.addIndividualId(individualId) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt index 7d539159..5c741e26 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt @@ -84,7 +84,10 @@ constructor( } /** Updated name or description. */ - fun description(description: String) = apply { this.description = description } + fun description(description: String?) = apply { this.description = description } + + /** Updated name or description. */ + fun description(description: Optional) = description(description.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -153,7 +156,10 @@ constructor( fun benefitId(benefitId: String) = apply { this.benefitId = benefitId } /** Updated name or description. */ - fun description(description: String) = apply { body.description(description) } + fun description(description: String?) = apply { body.description(description) } + + /** Updated name or description. */ + fun description(description: Optional) = description(description.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt index 28c88877..205c4872 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt @@ -63,10 +63,24 @@ constructor( } /** Number of employees to return (defaults to all) */ - fun limit(limit: Long) = apply { this.limit = limit } + fun limit(limit: Long?) = apply { this.limit = limit } + + /** Number of employees to return (defaults to all) */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Number of employees to return (defaults to all) */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long?) = apply { this.offset = offset } + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long) = offset(offset as Long?) /** Index to start from (defaults to 0) */ - fun offset(offset: Long) = apply { this.offset = offset } + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun offset(offset: Optional) = offset(offset.orElse(null) as Long?) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt index a6534671..f54344d2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt @@ -61,10 +61,24 @@ constructor( } /** Number of employees to return (defaults to all) */ - fun limit(limit: Long) = apply { this.limit = limit } + fun limit(limit: Long?) = apply { this.limit = limit } + + /** Number of employees to return (defaults to all) */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Number of employees to return (defaults to all) */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long?) = apply { this.offset = offset } + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long) = offset(offset as Long?) /** Index to start from (defaults to 0) */ - fun offset(offset: Long) = apply { this.offset = offset } + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun offset(offset: Optional) = offset(offset.orElse(null) as Long?) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt index b03acaa9..79acf859 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt @@ -80,12 +80,16 @@ constructor( hrisIndividualRetrieveManyBody.additionalProperties.toMutableMap() } - fun options(options: Options) = apply { this.options = options } + fun options(options: Options?) = apply { this.options = options } - fun requests(requests: List) = apply { - this.requests = requests.toMutableList() + fun options(options: Optional) = options(options.orElse(null)) + + fun requests(requests: List?) = apply { + this.requests = requests?.toMutableList() } + fun requests(requests: Optional>) = requests(requests.orElse(null)) + fun addRequest(request: Request) = apply { requests = (requests ?: mutableListOf()).apply { add(request) } } @@ -159,9 +163,13 @@ constructor( hrisIndividualRetrieveManyParams.additionalQueryParams.toBuilder() } - fun options(options: Options) = apply { body.options(options) } + fun options(options: Options?) = apply { body.options(options) } + + fun options(options: Optional) = options(options.orElse(null)) - fun requests(requests: List) = apply { body.requests(requests) } + fun requests(requests: List?) = apply { body.requests(requests) } + + fun requests(requests: Optional>) = requests(requests.orElse(null)) fun addRequest(request: Request) = apply { body.addRequest(request) } @@ -324,7 +332,9 @@ constructor( additionalProperties = options.additionalProperties.toMutableMap() } - fun include(include: List) = apply { this.include = include.toMutableList() } + fun include(include: List?) = apply { this.include = include?.toMutableList() } + + fun include(include: Optional>) = include(include.orElse(null)) fun addInclude(include: String) = apply { this.include = (this.include ?: mutableListOf()).apply { add(include) } @@ -405,7 +415,10 @@ constructor( additionalProperties = request.additionalProperties.toMutableMap() } - fun individualId(individualId: String) = apply { this.individualId = individualId } + fun individualId(individualId: String?) = apply { this.individualId = individualId } + + fun individualId(individualId: Optional) = + individualId(individualId.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt index 19df8ec7..a1446c29 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt @@ -334,10 +334,24 @@ constructor( fun paymentId(paymentId: String) = apply { this.paymentId = paymentId } /** Number of pay statements to return (defaults to all). */ - fun limit(limit: Long) = apply { this.limit = limit } + fun limit(limit: Long?) = apply { this.limit = limit } + + /** Number of pay statements to return (defaults to all). */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Number of pay statements to return (defaults to all). */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + + /** Index to start from. */ + fun offset(offset: Long?) = apply { this.offset = offset } + + /** Index to start from. */ + fun offset(offset: Long) = offset(offset as Long?) /** Index to start from. */ - fun offset(offset: Long) = apply { this.offset = offset } + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun offset(offset: Optional) = offset(offset.orElse(null) as Long?) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt index 16c7ca9c..a86984ab 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt @@ -61,10 +61,24 @@ constructor( } /** Number of items to return */ - fun limit(limit: Long) = apply { this.limit = limit } + fun limit(limit: Long?) = apply { this.limit = limit } + + /** Number of items to return */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Number of items to return */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long?) = apply { this.offset = offset } + + /** Index to start from (defaults to 0) */ + fun offset(offset: Long) = offset(offset as Long?) /** Index to start from (defaults to 0) */ - fun offset(offset: Long) = apply { this.offset = offset } + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun offset(offset: Optional) = offset(offset.orElse(null) as Long?) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt index 6dc5bab6..023edbab 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt @@ -59,12 +59,17 @@ constructor( additionalQueryParams = payrollPayGroupListParams.additionalQueryParams.toBuilder() } - fun individualId(individualId: String) = apply { this.individualId = individualId } + fun individualId(individualId: String?) = apply { this.individualId = individualId } - fun payFrequencies(payFrequencies: List) = apply { - this.payFrequencies = payFrequencies.toMutableList() + fun individualId(individualId: Optional) = individualId(individualId.orElse(null)) + + fun payFrequencies(payFrequencies: List?) = apply { + this.payFrequencies = payFrequencies?.toMutableList() } + fun payFrequencies(payFrequencies: Optional>) = + payFrequencies(payFrequencies.orElse(null)) + fun addPayFrequency(payFrequency: String) = apply { payFrequencies = (payFrequencies ?: mutableListOf()).apply { add(payFrequency) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt index 4b68239d..66c45651 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardParams.kt @@ -159,20 +159,39 @@ constructor( * The body for the forwarded request. This value must be specified as either a string * or a valid JSON object. */ - fun data(data: String) = apply { this.data = data } + fun data(data: String?) = apply { this.data = data } + + /** + * The body for the forwarded request. This value must be specified as either a string + * or a valid JSON object. + */ + fun data(data: Optional) = data(data.orElse(null)) + + /** + * The HTTP headers to include on the forwarded request. This value must be specified as + * an object of key-value pairs. Example: `{"Content-Type": "application/xml", + * "X-API-Version": "v1" }` + */ + fun headers(headers: JsonValue?) = apply { this.headers = headers } /** * The HTTP headers to include on the forwarded request. This value must be specified as * an object of key-value pairs. Example: `{"Content-Type": "application/xml", * "X-API-Version": "v1" }` */ - fun headers(headers: JsonValue) = apply { this.headers = headers } + fun headers(headers: Optional) = headers(headers.orElse(null)) + + /** + * The query parameters for the forwarded request. This value must be specified as a + * valid JSON object rather than a query string. + */ + fun params(params: JsonValue?) = apply { this.params = params } /** * The query parameters for the forwarded request. This value must be specified as a * valid JSON object rather than a query string. */ - fun params(params: JsonValue) = apply { this.params = params } + fun params(params: Optional) = params(params.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -260,20 +279,39 @@ constructor( * The body for the forwarded request. This value must be specified as either a string or a * valid JSON object. */ - fun data(data: String) = apply { body.data(data) } + fun data(data: String?) = apply { body.data(data) } + + /** + * The body for the forwarded request. This value must be specified as either a string or a + * valid JSON object. + */ + fun data(data: Optional) = data(data.orElse(null)) + + /** + * The HTTP headers to include on the forwarded request. This value must be specified as an + * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": + * "v1" }` + */ + fun headers(headers: JsonValue?) = apply { body.headers(headers) } /** * The HTTP headers to include on the forwarded request. This value must be specified as an * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": * "v1" }` */ - fun headers(headers: JsonValue) = apply { body.headers(headers) } + fun headers(headers: Optional) = headers(headers.orElse(null)) + + /** + * The query parameters for the forwarded request. This value must be specified as a valid + * JSON object rather than a query string. + */ + fun params(params: JsonValue?) = apply { body.params(params) } /** * The query parameters for the forwarded request. This value must be specified as a valid * JSON object rather than a query string. */ - fun params(params: JsonValue) = apply { body.params(params) } + fun params(params: Optional) = params(params.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index 3c63530f..ffdb478e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt @@ -143,50 +143,76 @@ constructor( } /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = apply { - this.accounts = accounts.toMutableList() + fun accounts(accounts: List?) = apply { + this.accounts = accounts?.toMutableList() } + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: Optional>) = accounts(accounts.orElse(null)) + /** An array of bank account objects associated with the payroll/HRIS system. */ fun addAccount(account: Account) = apply { accounts = (accounts ?: mutableListOf()).apply { add(account) } } /** The array of company departments. */ - fun departments(departments: List) = apply { - this.departments = departments.toMutableList() + fun departments(departments: List?) = apply { + this.departments = departments?.toMutableList() } + /** The array of company departments. */ + fun departments(departments: Optional>) = + departments(departments.orElse(null)) + /** The array of company departments. */ fun addDepartment(department: Department) = apply { departments = (departments ?: mutableListOf()).apply { add(department) } } /** The employer identification number. */ - fun ein(ein: String) = apply { this.ein = ein } + fun ein(ein: String?) = apply { this.ein = ein } + + /** The employer identification number. */ + fun ein(ein: Optional) = ein(ein.orElse(null)) + + /** The entity type object. */ + fun entity(entity: Entity?) = apply { this.entity = entity } /** The entity type object. */ - fun entity(entity: Entity) = apply { this.entity = entity } + fun entity(entity: Optional) = entity(entity.orElse(null)) + + /** The legal name of the company. */ + fun legalName(legalName: String?) = apply { this.legalName = legalName } /** The legal name of the company. */ - fun legalName(legalName: String) = apply { this.legalName = legalName } + fun legalName(legalName: Optional) = legalName(legalName.orElse(null)) - fun locations(locations: List) = apply { - this.locations = locations.toMutableList() + fun locations(locations: List?) = apply { + this.locations = locations?.toMutableList() } + fun locations(locations: Optional>) = locations(locations.orElse(null)) + fun addLocation(location: Location) = apply { locations = (locations ?: mutableListOf()).apply { add(location) } } /** The email of the main administrator on the account. */ - fun primaryEmail(primaryEmail: String) = apply { this.primaryEmail = primaryEmail } + fun primaryEmail(primaryEmail: String?) = apply { this.primaryEmail = primaryEmail } + + /** The email of the main administrator on the account. */ + fun primaryEmail(primaryEmail: Optional) = + primaryEmail(primaryEmail.orElse(null)) /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - fun primaryPhoneNumber(primaryPhoneNumber: String) = apply { + fun primaryPhoneNumber(primaryPhoneNumber: String?) = apply { this.primaryPhoneNumber = primaryPhoneNumber } + /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ + fun primaryPhoneNumber(primaryPhoneNumber: Optional) = + primaryPhoneNumber(primaryPhoneNumber.orElse(null)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -260,38 +286,63 @@ constructor( } /** An array of bank account objects associated with the payroll/HRIS system. */ - fun accounts(accounts: List) = apply { body.accounts(accounts) } + fun accounts(accounts: List?) = apply { body.accounts(accounts) } + + /** An array of bank account objects associated with the payroll/HRIS system. */ + fun accounts(accounts: Optional>) = accounts(accounts.orElse(null)) /** An array of bank account objects associated with the payroll/HRIS system. */ fun addAccount(account: Account) = apply { body.addAccount(account) } /** The array of company departments. */ - fun departments(departments: List) = apply { body.departments(departments) } + fun departments(departments: List?) = apply { body.departments(departments) } + + /** The array of company departments. */ + fun departments(departments: Optional>) = + departments(departments.orElse(null)) /** The array of company departments. */ fun addDepartment(department: Department) = apply { body.addDepartment(department) } /** The employer identification number. */ - fun ein(ein: String) = apply { body.ein(ein) } + fun ein(ein: String?) = apply { body.ein(ein) } + + /** The employer identification number. */ + fun ein(ein: Optional) = ein(ein.orElse(null)) /** The entity type object. */ - fun entity(entity: Entity) = apply { body.entity(entity) } + fun entity(entity: Entity?) = apply { body.entity(entity) } + + /** The entity type object. */ + fun entity(entity: Optional) = entity(entity.orElse(null)) + + /** The legal name of the company. */ + fun legalName(legalName: String?) = apply { body.legalName(legalName) } /** The legal name of the company. */ - fun legalName(legalName: String) = apply { body.legalName(legalName) } + fun legalName(legalName: Optional) = legalName(legalName.orElse(null)) + + fun locations(locations: List?) = apply { body.locations(locations) } - fun locations(locations: List) = apply { body.locations(locations) } + fun locations(locations: Optional>) = locations(locations.orElse(null)) fun addLocation(location: Location) = apply { body.addLocation(location) } /** The email of the main administrator on the account. */ - fun primaryEmail(primaryEmail: String) = apply { body.primaryEmail(primaryEmail) } + fun primaryEmail(primaryEmail: String?) = apply { body.primaryEmail(primaryEmail) } + + /** The email of the main administrator on the account. */ + fun primaryEmail(primaryEmail: Optional) = primaryEmail(primaryEmail.orElse(null)) /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ - fun primaryPhoneNumber(primaryPhoneNumber: String) = apply { + fun primaryPhoneNumber(primaryPhoneNumber: String?) = apply { body.primaryPhoneNumber(primaryPhoneNumber) } + /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */ + fun primaryPhoneNumber(primaryPhoneNumber: Optional) = + primaryPhoneNumber(primaryPhoneNumber.orElse(null)) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -483,24 +534,46 @@ constructor( } /** The name of the bank associated in the payroll/HRIS system. */ - fun accountName(accountName: String) = apply { this.accountName = accountName } + fun accountName(accountName: String?) = apply { this.accountName = accountName } + + /** The name of the bank associated in the payroll/HRIS system. */ + fun accountName(accountName: Optional) = accountName(accountName.orElse(null)) + + /** 10-12 digit number to specify the bank account */ + fun accountNumber(accountNumber: String?) = apply { this.accountNumber = accountNumber } /** 10-12 digit number to specify the bank account */ - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } + fun accountNumber(accountNumber: Optional) = + accountNumber(accountNumber.orElse(null)) /** The type of bank account. */ - fun accountType(accountType: AccountType) = apply { this.accountType = accountType } + fun accountType(accountType: AccountType?) = apply { this.accountType = accountType } + + /** The type of bank account. */ + fun accountType(accountType: Optional) = + accountType(accountType.orElse(null)) /** Name of the banking institution. */ - fun institutionName(institutionName: String) = apply { + fun institutionName(institutionName: String?) = apply { this.institutionName = institutionName } + /** Name of the banking institution. */ + fun institutionName(institutionName: Optional) = + institutionName(institutionName.orElse(null)) + + /** + * A nine-digit code that's based on the U.S. Bank location where your account was + * opened. + */ + fun routingNumber(routingNumber: String?) = apply { this.routingNumber = routingNumber } + /** * A nine-digit code that's based on the U.S. Bank location where your account was * opened. */ - fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } + fun routingNumber(routingNumber: Optional) = + routingNumber(routingNumber.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -648,10 +721,16 @@ constructor( } /** The department name. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The department name. */ + fun name(name: Optional) = name(name.orElse(null)) + + /** The parent department, if present. */ + fun parent(parent: Parent?) = apply { this.parent = parent } /** The parent department, if present. */ - fun parent(parent: Parent) = apply { this.parent = parent } + fun parent(parent: Optional) = parent(parent.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -716,7 +795,10 @@ constructor( } /** The parent department's name. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The parent department's name. */ + fun name(name: Optional) = name(name.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -821,10 +903,16 @@ constructor( } /** The tax payer subtype of the company. */ - fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + fun subtype(subtype: Subtype?) = apply { this.subtype = subtype } + + /** The tax payer subtype of the company. */ + fun subtype(subtype: Optional) = subtype(subtype.orElse(null)) + + /** The tax payer type of the company. */ + fun type(type: Type?) = apply { this.type = type } /** The tax payer type of the company. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index 986e641c..e4c8a567 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt @@ -115,18 +115,27 @@ constructor( /** The provider associated with the `access_token` */ fun providerId(providerId: String) = apply { this.providerId = providerId } - fun authenticationType(authenticationType: AuthenticationType) = apply { + fun authenticationType(authenticationType: AuthenticationType?) = apply { this.authenticationType = authenticationType } + fun authenticationType(authenticationType: Optional) = + authenticationType(authenticationType.orElse(null)) + /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - fun products(products: List) = apply { - this.products = products.toMutableList() + fun products(products: List?) = apply { + this.products = products?.toMutableList() } + /** + * Optional, defaults to Organization products (`company`, `directory`, `employment`, + * `individual`) + */ + fun products(products: Optional>) = products(products.orElse(null)) + /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) @@ -212,15 +221,24 @@ constructor( /** The provider associated with the `access_token` */ fun providerId(providerId: String) = apply { body.providerId(providerId) } - fun authenticationType(authenticationType: AuthenticationType) = apply { + fun authenticationType(authenticationType: AuthenticationType?) = apply { body.authenticationType(authenticationType) } + fun authenticationType(authenticationType: Optional) = + authenticationType(authenticationType.orElse(null)) + + /** + * Optional, defaults to Organization products (`company`, `directory`, `employment`, + * `individual`) + */ + fun products(products: List?) = apply { body.products(products) } + /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, * `individual`) */ - fun products(products: List) = apply { body.products(products) } + fun products(products: Optional>) = products(products.orElse(null)) /** * Optional, defaults to Organization products (`company`, `directory`, `employment`, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index 1ef07df8..bc570952 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt @@ -75,10 +75,13 @@ constructor( sandboxConnectionAccountUpdateBody.additionalProperties.toMutableMap() } - fun connectionStatus(connectionStatus: ConnectionStatusType) = apply { + fun connectionStatus(connectionStatus: ConnectionStatusType?) = apply { this.connectionStatus = connectionStatus } + fun connectionStatus(connectionStatus: Optional) = + connectionStatus(connectionStatus.orElse(null)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -148,10 +151,13 @@ constructor( sandboxConnectionAccountUpdateParams.additionalQueryParams.toBuilder() } - fun connectionStatus(connectionStatus: ConnectionStatusType) = apply { + fun connectionStatus(connectionStatus: ConnectionStatusType?) = apply { body.connectionStatus(connectionStatus) } + fun connectionStatus(connectionStatus: Optional) = + connectionStatus(connectionStatus.orElse(null)) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt index 02e95de9..62fe40d1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt @@ -114,21 +114,42 @@ constructor( /** The provider associated with the connection */ fun providerId(providerId: String) = apply { this.providerId = providerId } - fun authenticationType(authenticationType: AuthenticationType) = apply { + fun authenticationType(authenticationType: AuthenticationType?) = apply { this.authenticationType = authenticationType } + fun authenticationType(authenticationType: Optional) = + authenticationType(authenticationType.orElse(null)) + + /** + * Optional: the size of the employer to be created with this connection. Defaults + * to 20. Note that if this is higher than 100, historical payroll data will not be + * generated, and instead only one pay period will be created. + */ + fun employeeSize(employeeSize: Long?) = apply { this.employeeSize = employeeSize } + /** * Optional: the size of the employer to be created with this connection. Defaults * to 20. Note that if this is higher than 100, historical payroll data will not be * generated, and instead only one pay period will be created. */ - fun employeeSize(employeeSize: Long) = apply { this.employeeSize = employeeSize } + fun employeeSize(employeeSize: Long) = employeeSize(employeeSize as Long?) - fun products(products: List) = apply { - this.products = products.toMutableList() + /** + * Optional: the size of the employer to be created with this connection. Defaults + * to 20. Note that if this is higher than 100, historical payroll data will not be + * generated, and instead only one pay period will be created. + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun employeeSize(employeeSize: Optional) = + employeeSize(employeeSize.orElse(null) as Long?) + + fun products(products: List?) = apply { + this.products = products?.toMutableList() } + fun products(products: Optional>) = products(products.orElse(null)) + fun addProduct(product: String) = apply { products = (products ?: mutableListOf()).apply { add(product) } } @@ -205,18 +226,39 @@ constructor( /** The provider associated with the connection */ fun providerId(providerId: String) = apply { body.providerId(providerId) } - fun authenticationType(authenticationType: AuthenticationType) = apply { + fun authenticationType(authenticationType: AuthenticationType?) = apply { body.authenticationType(authenticationType) } + fun authenticationType(authenticationType: Optional) = + authenticationType(authenticationType.orElse(null)) + + /** + * Optional: the size of the employer to be created with this connection. Defaults to 20. + * Note that if this is higher than 100, historical payroll data will not be generated, and + * instead only one pay period will be created. + */ + fun employeeSize(employeeSize: Long?) = apply { body.employeeSize(employeeSize) } + /** * Optional: the size of the employer to be created with this connection. Defaults to 20. * Note that if this is higher than 100, historical payroll data will not be generated, and * instead only one pay period will be created. */ - fun employeeSize(employeeSize: Long) = apply { body.employeeSize(employeeSize) } + fun employeeSize(employeeSize: Long) = employeeSize(employeeSize as Long?) + + /** + * Optional: the size of the employer to be created with this connection. Defaults to 20. + * Note that if this is higher than 100, historical payroll data will not be generated, and + * instead only one pay period will be created. + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun employeeSize(employeeSize: Optional) = + employeeSize(employeeSize.orElse(null) as Long?) + + fun products(products: List?) = apply { body.products(products) } - fun products(products: List) = apply { body.products(products) } + fun products(products: Optional>) = products(products.orElse(null)) fun addProduct(product: String) = apply { body.addProduct(product) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index 781b17d0..92349133 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -396,16 +396,26 @@ constructor( } /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = apply { this.classCode = classCode } + fun classCode(classCode: String?) = apply { this.classCode = classCode } + + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: Optional) = classCode(classCode.orElse(null)) /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. */ - fun customFields(customFields: List) = apply { - this.customFields = customFields.toMutableList() + fun customFields(customFields: List?) = apply { + this.customFields = customFields?.toMutableList() } + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: Optional>) = + customFields(customFields.orElse(null)) + /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. @@ -415,54 +425,98 @@ constructor( } /** The department object. */ - fun department(department: Department) = apply { this.department = department } + fun department(department: Department?) = apply { this.department = department } + + /** The department object. */ + fun department(department: Optional) = department(department.orElse(null)) + + fun dob(dob: String?) = apply { this.dob = dob } - fun dob(dob: String) = apply { this.dob = dob } + fun dob(dob: Optional) = dob(dob.orElse(null)) - fun emails(emails: List) = apply { this.emails = emails.toMutableList() } + fun emails(emails: List?) = apply { this.emails = emails?.toMutableList() } + + fun emails(emails: Optional>) = emails(emails.orElse(null)) fun addEmail(email: Email) = apply { emails = (emails ?: mutableListOf()).apply { add(email) } } /** The employment object. */ - fun employment(employment: Employment) = apply { this.employment = employment } + fun employment(employment: Employment?) = apply { this.employment = employment } + + /** The employment object. */ + fun employment(employment: Optional) = employment(employment.orElse(null)) /** The detailed employment status of the individual. */ - fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + fun employmentStatus(employmentStatus: EmploymentStatus?) = apply { this.employmentStatus = employmentStatus } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: Optional) = + employmentStatus(employmentStatus.orElse(null)) + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param + * set in the body. + */ + fun encryptedSsn(encryptedSsn: String?) = apply { this.encryptedSsn = encryptedSsn } + /** * Social Security Number of the individual in **encrypted** format. This field is only * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param * set in the body. */ - fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } + fun encryptedSsn(encryptedSsn: Optional) = + encryptedSsn(encryptedSsn.orElse(null)) + + fun endDate(endDate: String?) = apply { this.endDate = endDate } - fun endDate(endDate: String) = apply { this.endDate = endDate } + fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } + fun ethnicity(ethnicity: Ethnicity?) = apply { this.ethnicity = ethnicity } + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Optional) = ethnicity(ethnicity.orElse(null)) + + /** The legal first name of the individual. */ + fun firstName(firstName: String?) = apply { this.firstName = firstName } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + fun firstName(firstName: Optional) = firstName(firstName.orElse(null)) + + /** The gender of the individual. */ + fun gender(gender: Gender?) = apply { this.gender = gender } /** The gender of the individual. */ - fun gender(gender: Gender) = apply { this.gender = gender } + fun gender(gender: Optional) = gender(gender.orElse(null)) + + /** + * The employee's income as reported by the provider. This may not always be annualized + * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what + * information the provider returns. + */ + fun income(income: Income?) = apply { this.income = income } /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - fun income(income: Income) = apply { this.income = income } + fun income(income: Optional) = income(income.orElse(null)) /** The array of income history. */ - fun incomeHistory(incomeHistory: List) = apply { - this.incomeHistory = incomeHistory.toMutableList() + fun incomeHistory(incomeHistory: List?) = apply { + this.incomeHistory = incomeHistory?.toMutableList() } + /** The array of income history. */ + fun incomeHistory(incomeHistory: Optional>) = + incomeHistory(incomeHistory.orElse(null)) + /** The array of income history. */ fun addIncomeHistory(incomeHistory: Income) = apply { this.incomeHistory = @@ -470,50 +524,95 @@ constructor( } /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = apply { this.isActive = isActive } + fun isActive(isActive: Boolean?) = apply { this.isActive = isActive } + + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(isActive as Boolean?) + + /** `true` if the individual an an active employee or contractor at the company. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun isActive(isActive: Optional) = isActive(isActive.orElse(null) as Boolean?) /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + fun lastName(lastName: String?) = apply { this.lastName = lastName } - fun latestRehireDate(latestRehireDate: String) = apply { + /** The legal last name of the individual. */ + fun lastName(lastName: Optional) = lastName(lastName.orElse(null)) + + fun latestRehireDate(latestRehireDate: String?) = apply { this.latestRehireDate = latestRehireDate } - fun location(location: Location) = apply { this.location = location } + fun latestRehireDate(latestRehireDate: Optional) = + latestRehireDate(latestRehireDate.orElse(null)) + + fun location(location: Location?) = apply { this.location = location } + + fun location(location: Optional) = location(location.orElse(null)) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager?) = apply { this.manager = manager } /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = apply { this.manager = manager } + fun manager(manager: Optional) = manager(manager.orElse(null)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: String?) = apply { this.middleName = middleName } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + fun middleName(middleName: Optional) = middleName(middleName.orElse(null)) - fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers = phoneNumbers.toMutableList() + fun phoneNumbers(phoneNumbers: List?) = apply { + this.phoneNumbers = phoneNumbers?.toMutableList() } + fun phoneNumbers(phoneNumbers: Optional>) = + phoneNumbers(phoneNumbers.orElse(null)) + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } } /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } + fun preferredName(preferredName: String?) = apply { this.preferredName = preferredName } + + /** The preferred name of the individual. */ + fun preferredName(preferredName: Optional) = + preferredName(preferredName.orElse(null)) + + fun residence(residence: Location?) = apply { this.residence = residence } - fun residence(residence: Location) = apply { this.residence = residence } + fun residence(residence: Optional) = residence(residence.orElse(null)) /** The source system's unique employment identifier for this individual */ - fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } + fun sourceId(sourceId: String?) = apply { this.sourceId = sourceId } + + /** The source system's unique employment identifier for this individual */ + fun sourceId(sourceId: Optional) = sourceId(sourceId.orElse(null)) + + /** + * Social Security Number of the individual. This field is only available with the `ssn` + * scope enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + fun ssn(ssn: String?) = apply { this.ssn = ssn } /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - fun ssn(ssn: String) = apply { this.ssn = ssn } + fun ssn(ssn: Optional) = ssn(ssn.orElse(null)) - fun startDate(startDate: String) = apply { this.startDate = startDate } + fun startDate(startDate: String?) = apply { this.startDate = startDate } + + fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + + /** The current title of the individual. */ + fun title(title: String?) = apply { this.title = title } /** The current title of the individual. */ - fun title(title: String) = apply { this.title = title } + fun title(title: Optional) = title(title.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -605,9 +704,13 @@ constructor( additionalProperties = customField.additionalProperties.toMutableMap() } - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + fun name(name: Optional) = name(name.orElse(null)) + + fun value(value: JsonValue?) = apply { this.value = value } - fun value(value: JsonValue) = apply { this.value = value } + fun value(value: Optional) = value(value.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -693,7 +796,10 @@ constructor( } /** The name of the department associated with the individual. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The name of the department associated with the individual. */ + fun name(name: Optional) = name(name.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -776,9 +882,13 @@ constructor( additionalProperties = email.additionalProperties.toMutableMap() } - fun data(data: String) = apply { this.data = data } + fun data(data: String?) = apply { this.data = data } + + fun data(data: Optional) = data(data.orElse(null)) - fun type(type: Type) = apply { this.type = type } + fun type(type: Type?) = apply { this.type = type } + + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -933,10 +1043,19 @@ constructor( * The secondary employment type of the individual. Options: `full_time`, * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. */ - fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + fun subtype(subtype: Subtype?) = apply { this.subtype = subtype } + + /** + * The secondary employment type of the individual. Options: `full_time`, + * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + */ + fun subtype(subtype: Optional) = subtype(subtype.orElse(null)) + + /** The main employment type of the individual. */ + fun type(type: Type?) = apply { this.type = type } /** The main employment type of the individual. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1411,7 +1530,10 @@ constructor( } /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: String) = apply { this.id = id } + fun id(id: String?) = apply { this.id = id } + + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: Optional) = id(id.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1493,9 +1615,13 @@ constructor( additionalProperties = phoneNumber.additionalProperties.toMutableMap() } - fun data(data: String) = apply { this.data = data } + fun data(data: String?) = apply { this.data = data } + + fun data(data: Optional) = data(data.orElse(null)) + + fun type(type: Type?) = apply { this.type = type } - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 1f623676..9a2fe56a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -256,16 +256,26 @@ constructor( } /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = apply { this.classCode = classCode } + fun classCode(classCode: String?) = apply { this.classCode = classCode } + + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: Optional) = classCode(classCode.orElse(null)) /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. */ - fun customFields(customFields: List) = apply { - this.customFields = customFields.toMutableList() + fun customFields(customFields: List?) = apply { + this.customFields = customFields?.toMutableList() } + /** + * Custom fields for the individual. These are fields which are defined by the employer + * in the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: Optional>) = + customFields(customFields.orElse(null)) + /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. @@ -275,33 +285,59 @@ constructor( } /** The department object. */ - fun department(department: Department) = apply { this.department = department } + fun department(department: Department?) = apply { this.department = department } + + /** The department object. */ + fun department(department: Optional) = department(department.orElse(null)) /** The employment object. */ - fun employment(employment: Employment) = apply { this.employment = employment } + fun employment(employment: Employment?) = apply { this.employment = employment } + + /** The employment object. */ + fun employment(employment: Optional) = employment(employment.orElse(null)) /** The detailed employment status of the individual. */ - fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + fun employmentStatus(employmentStatus: EmploymentStatus?) = apply { this.employmentStatus = employmentStatus } - fun endDate(endDate: String) = apply { this.endDate = endDate } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: Optional) = + employmentStatus(employmentStatus.orElse(null)) + + fun endDate(endDate: String?) = apply { this.endDate = endDate } + + fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + + /** The legal first name of the individual. */ + fun firstName(firstName: String?) = apply { this.firstName = firstName } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + fun firstName(firstName: Optional) = firstName(firstName.orElse(null)) + + /** + * The employee's income as reported by the provider. This may not always be annualized + * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what + * information the provider returns. + */ + fun income(income: Income?) = apply { this.income = income } /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - fun income(income: Income) = apply { this.income = income } + fun income(income: Optional) = income(income.orElse(null)) /** The array of income history. */ - fun incomeHistory(incomeHistory: List) = apply { - this.incomeHistory = incomeHistory.toMutableList() + fun incomeHistory(incomeHistory: List?) = apply { + this.incomeHistory = incomeHistory?.toMutableList() } + /** The array of income history. */ + fun incomeHistory(incomeHistory: Optional>) = + incomeHistory(incomeHistory.orElse(null)) + /** The array of income history. */ fun addIncomeHistory(incomeHistory: Income) = apply { this.incomeHistory = @@ -309,30 +345,59 @@ constructor( } /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = apply { this.isActive = isActive } + fun isActive(isActive: Boolean?) = apply { this.isActive = isActive } + + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(isActive as Boolean?) + + /** `true` if the individual an an active employee or contractor at the company. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun isActive(isActive: Optional) = isActive(isActive.orElse(null) as Boolean?) + + /** The legal last name of the individual. */ + fun lastName(lastName: String?) = apply { this.lastName = lastName } /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + fun lastName(lastName: Optional) = lastName(lastName.orElse(null)) - fun latestRehireDate(latestRehireDate: String) = apply { + fun latestRehireDate(latestRehireDate: String?) = apply { this.latestRehireDate = latestRehireDate } - fun location(location: Location) = apply { this.location = location } + fun latestRehireDate(latestRehireDate: Optional) = + latestRehireDate(latestRehireDate.orElse(null)) + + fun location(location: Location?) = apply { this.location = location } + + fun location(location: Optional) = location(location.orElse(null)) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager?) = apply { this.manager = manager } /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = apply { this.manager = manager } + fun manager(manager: Optional) = manager(manager.orElse(null)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: String?) = apply { this.middleName = middleName } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + fun middleName(middleName: Optional) = middleName(middleName.orElse(null)) /** The source system's unique employment identifier for this individual */ - fun sourceId(sourceId: String) = apply { this.sourceId = sourceId } + fun sourceId(sourceId: String?) = apply { this.sourceId = sourceId } - fun startDate(startDate: String) = apply { this.startDate = startDate } + /** The source system's unique employment identifier for this individual */ + fun sourceId(sourceId: Optional) = sourceId(sourceId.orElse(null)) + + fun startDate(startDate: String?) = apply { this.startDate = startDate } + + fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) /** The current title of the individual. */ - fun title(title: String) = apply { this.title = title } + fun title(title: String?) = apply { this.title = title } + + /** The current title of the individual. */ + fun title(title: Optional) = title(title.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -422,16 +487,26 @@ constructor( fun individualId(individualId: String) = apply { this.individualId = individualId } /** Worker's compensation classification code for this employee */ - fun classCode(classCode: String) = apply { body.classCode(classCode) } + fun classCode(classCode: String?) = apply { body.classCode(classCode) } + + /** Worker's compensation classification code for this employee */ + fun classCode(classCode: Optional) = classCode(classCode.orElse(null)) /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. */ - fun customFields(customFields: List) = apply { + fun customFields(customFields: List?) = apply { body.customFields(customFields) } + /** + * Custom fields for the individual. These are fields which are defined by the employer in + * the system. Custom fields are not currently supported for assisted connections. + */ + fun customFields(customFields: Optional>) = + customFields(customFields.orElse(null)) + /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. @@ -439,61 +514,116 @@ constructor( fun addCustomField(customField: CustomField) = apply { body.addCustomField(customField) } /** The department object. */ - fun department(department: Department) = apply { body.department(department) } + fun department(department: Department?) = apply { body.department(department) } + + /** The department object. */ + fun department(department: Optional) = department(department.orElse(null)) + + /** The employment object. */ + fun employment(employment: Employment?) = apply { body.employment(employment) } /** The employment object. */ - fun employment(employment: Employment) = apply { body.employment(employment) } + fun employment(employment: Optional) = employment(employment.orElse(null)) /** The detailed employment status of the individual. */ - fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + fun employmentStatus(employmentStatus: EmploymentStatus?) = apply { body.employmentStatus(employmentStatus) } - fun endDate(endDate: String) = apply { body.endDate(endDate) } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: Optional) = + employmentStatus(employmentStatus.orElse(null)) + + fun endDate(endDate: String?) = apply { body.endDate(endDate) } + + fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + + /** The legal first name of the individual. */ + fun firstName(firstName: String?) = apply { body.firstName(firstName) } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { body.firstName(firstName) } + fun firstName(firstName: Optional) = firstName(firstName.orElse(null)) + + /** + * The employee's income as reported by the provider. This may not always be annualized + * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what + * information the provider returns. + */ + fun income(income: Income?) = apply { body.income(income) } /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what * information the provider returns. */ - fun income(income: Income) = apply { body.income(income) } + fun income(income: Optional) = income(income.orElse(null)) /** The array of income history. */ - fun incomeHistory(incomeHistory: List) = apply { + fun incomeHistory(incomeHistory: List?) = apply { body.incomeHistory(incomeHistory) } + /** The array of income history. */ + fun incomeHistory(incomeHistory: Optional>) = + incomeHistory(incomeHistory.orElse(null)) + /** The array of income history. */ fun addIncomeHistory(incomeHistory: Income) = apply { body.addIncomeHistory(incomeHistory) } /** `true` if the individual an an active employee or contractor at the company. */ - fun isActive(isActive: Boolean) = apply { body.isActive(isActive) } + fun isActive(isActive: Boolean?) = apply { body.isActive(isActive) } + + /** `true` if the individual an an active employee or contractor at the company. */ + fun isActive(isActive: Boolean) = isActive(isActive as Boolean?) + + /** `true` if the individual an an active employee or contractor at the company. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun isActive(isActive: Optional) = isActive(isActive.orElse(null) as Boolean?) /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { body.lastName(lastName) } + fun lastName(lastName: String?) = apply { body.lastName(lastName) } - fun latestRehireDate(latestRehireDate: String) = apply { + /** The legal last name of the individual. */ + fun lastName(lastName: Optional) = lastName(lastName.orElse(null)) + + fun latestRehireDate(latestRehireDate: String?) = apply { body.latestRehireDate(latestRehireDate) } - fun location(location: Location) = apply { body.location(location) } + fun latestRehireDate(latestRehireDate: Optional) = + latestRehireDate(latestRehireDate.orElse(null)) + + fun location(location: Location?) = apply { body.location(location) } + + fun location(location: Optional) = location(location.orElse(null)) + + /** The manager object representing the manager of the individual within the org. */ + fun manager(manager: Manager?) = apply { body.manager(manager) } /** The manager object representing the manager of the individual within the org. */ - fun manager(manager: Manager) = apply { body.manager(manager) } + fun manager(manager: Optional) = manager(manager.orElse(null)) /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { body.middleName(middleName) } + fun middleName(middleName: String?) = apply { body.middleName(middleName) } + + /** The legal middle name of the individual. */ + fun middleName(middleName: Optional) = middleName(middleName.orElse(null)) + + /** The source system's unique employment identifier for this individual */ + fun sourceId(sourceId: String?) = apply { body.sourceId(sourceId) } /** The source system's unique employment identifier for this individual */ - fun sourceId(sourceId: String) = apply { body.sourceId(sourceId) } + fun sourceId(sourceId: Optional) = sourceId(sourceId.orElse(null)) + + fun startDate(startDate: String?) = apply { body.startDate(startDate) } + + fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) - fun startDate(startDate: String) = apply { body.startDate(startDate) } + /** The current title of the individual. */ + fun title(title: String?) = apply { body.title(title) } /** The current title of the individual. */ - fun title(title: String) = apply { body.title(title) } + fun title(title: Optional) = title(title.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -659,9 +789,13 @@ constructor( additionalProperties = customField.additionalProperties.toMutableMap() } - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + fun name(name: Optional) = name(name.orElse(null)) + + fun value(value: JsonValue?) = apply { this.value = value } - fun value(value: JsonValue) = apply { this.value = value } + fun value(value: Optional) = value(value.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -744,7 +878,10 @@ constructor( } /** The name of the department associated with the individual. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The name of the department associated with the individual. */ + fun name(name: Optional) = name(name.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -834,10 +971,19 @@ constructor( * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - fun subtype(subtype: Subtype) = apply { this.subtype = subtype } + fun subtype(subtype: Subtype?) = apply { this.subtype = subtype } + + /** + * The secondary employment type of the individual. Options: `full_time`, `part_time`, + * `intern`, `temp`, `seasonal` and `individual_contractor`. + */ + fun subtype(subtype: Optional) = subtype(subtype.orElse(null)) + + /** The main employment type of the individual. */ + fun type(type: Type?) = apply { this.type = type } /** The main employment type of the individual. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1145,7 +1291,10 @@ constructor( } /** A stable Finch `id` (UUID v4) for an individual in the company. */ - fun id(id: String) = apply { this.id = id } + fun id(id: String?) = apply { this.id = id } + + /** A stable Finch `id` (UUID v4) for an individual in the company. */ + fun id(id: Optional) = id(id.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 091dac04..df20ea2a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -200,9 +200,13 @@ constructor( sandboxIndividualUpdateBody.additionalProperties.toMutableMap() } - fun dob(dob: String) = apply { this.dob = dob } + fun dob(dob: String?) = apply { this.dob = dob } - fun emails(emails: List) = apply { this.emails = emails.toMutableList() } + fun dob(dob: Optional) = dob(dob.orElse(null)) + + fun emails(emails: List?) = apply { this.emails = emails?.toMutableList() } + + fun emails(emails: Optional>) = emails(emails.orElse(null)) fun addEmail(email: Email) = apply { emails = (emails ?: mutableListOf()).apply { add(email) } @@ -213,42 +217,81 @@ constructor( * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param * set in the body. */ - fun encryptedSsn(encryptedSsn: String) = apply { this.encryptedSsn = encryptedSsn } + fun encryptedSsn(encryptedSsn: String?) = apply { this.encryptedSsn = encryptedSsn } + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param + * set in the body. + */ + fun encryptedSsn(encryptedSsn: Optional) = + encryptedSsn(encryptedSsn.orElse(null)) /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = apply { this.ethnicity = ethnicity } + fun ethnicity(ethnicity: Ethnicity?) = apply { this.ethnicity = ethnicity } + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Optional) = ethnicity(ethnicity.orElse(null)) + + /** The legal first name of the individual. */ + fun firstName(firstName: String?) = apply { this.firstName = firstName } /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { this.firstName = firstName } + fun firstName(firstName: Optional) = firstName(firstName.orElse(null)) /** The gender of the individual. */ - fun gender(gender: Gender) = apply { this.gender = gender } + fun gender(gender: Gender?) = apply { this.gender = gender } + + /** The gender of the individual. */ + fun gender(gender: Optional) = gender(gender.orElse(null)) + + /** The legal last name of the individual. */ + fun lastName(lastName: String?) = apply { this.lastName = lastName } /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { this.lastName = lastName } + fun lastName(lastName: Optional) = lastName(lastName.orElse(null)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: String?) = apply { this.middleName = middleName } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { this.middleName = middleName } + fun middleName(middleName: Optional) = middleName(middleName.orElse(null)) - fun phoneNumbers(phoneNumbers: List) = apply { - this.phoneNumbers = phoneNumbers.toMutableList() + fun phoneNumbers(phoneNumbers: List?) = apply { + this.phoneNumbers = phoneNumbers?.toMutableList() } + fun phoneNumbers(phoneNumbers: Optional>) = + phoneNumbers(phoneNumbers.orElse(null)) + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { phoneNumbers = (phoneNumbers ?: mutableListOf()).apply { add(phoneNumber) } } /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = apply { this.preferredName = preferredName } + fun preferredName(preferredName: String?) = apply { this.preferredName = preferredName } - fun residence(residence: Location) = apply { this.residence = residence } + /** The preferred name of the individual. */ + fun preferredName(preferredName: Optional) = + preferredName(preferredName.orElse(null)) + + fun residence(residence: Location?) = apply { this.residence = residence } + + fun residence(residence: Optional) = residence(residence.orElse(null)) /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - fun ssn(ssn: String) = apply { this.ssn = ssn } + fun ssn(ssn: String?) = apply { this.ssn = ssn } + + /** + * Social Security Number of the individual. This field is only available with the `ssn` + * scope enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + fun ssn(ssn: Optional) = ssn(ssn.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -331,9 +374,13 @@ constructor( fun individualId(individualId: String) = apply { this.individualId = individualId } - fun dob(dob: String) = apply { body.dob(dob) } + fun dob(dob: String?) = apply { body.dob(dob) } + + fun dob(dob: Optional) = dob(dob.orElse(null)) + + fun emails(emails: List?) = apply { body.emails(emails) } - fun emails(emails: List) = apply { body.emails(emails) } + fun emails(emails: Optional>) = emails(emails.orElse(null)) fun addEmail(email: Email) = apply { body.addEmail(email) } @@ -342,40 +389,78 @@ constructor( * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set * in the body. */ - fun encryptedSsn(encryptedSsn: String) = apply { body.encryptedSsn(encryptedSsn) } + fun encryptedSsn(encryptedSsn: String?) = apply { body.encryptedSsn(encryptedSsn) } + + /** + * Social Security Number of the individual in **encrypted** format. This field is only + * available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set + * in the body. + */ + fun encryptedSsn(encryptedSsn: Optional) = encryptedSsn(encryptedSsn.orElse(null)) + + /** The EEOC-defined ethnicity of the individual. */ + fun ethnicity(ethnicity: Ethnicity?) = apply { body.ethnicity(ethnicity) } /** The EEOC-defined ethnicity of the individual. */ - fun ethnicity(ethnicity: Ethnicity) = apply { body.ethnicity(ethnicity) } + fun ethnicity(ethnicity: Optional) = ethnicity(ethnicity.orElse(null)) /** The legal first name of the individual. */ - fun firstName(firstName: String) = apply { body.firstName(firstName) } + fun firstName(firstName: String?) = apply { body.firstName(firstName) } + + /** The legal first name of the individual. */ + fun firstName(firstName: Optional) = firstName(firstName.orElse(null)) + + /** The gender of the individual. */ + fun gender(gender: Gender?) = apply { body.gender(gender) } /** The gender of the individual. */ - fun gender(gender: Gender) = apply { body.gender(gender) } + fun gender(gender: Optional) = gender(gender.orElse(null)) /** The legal last name of the individual. */ - fun lastName(lastName: String) = apply { body.lastName(lastName) } + fun lastName(lastName: String?) = apply { body.lastName(lastName) } + + /** The legal last name of the individual. */ + fun lastName(lastName: Optional) = lastName(lastName.orElse(null)) + + /** The legal middle name of the individual. */ + fun middleName(middleName: String?) = apply { body.middleName(middleName) } /** The legal middle name of the individual. */ - fun middleName(middleName: String) = apply { body.middleName(middleName) } + fun middleName(middleName: Optional) = middleName(middleName.orElse(null)) - fun phoneNumbers(phoneNumbers: List) = apply { + fun phoneNumbers(phoneNumbers: List?) = apply { body.phoneNumbers(phoneNumbers) } + fun phoneNumbers(phoneNumbers: Optional>) = + phoneNumbers(phoneNumbers.orElse(null)) + fun addPhoneNumber(phoneNumber: PhoneNumber) = apply { body.addPhoneNumber(phoneNumber) } /** The preferred name of the individual. */ - fun preferredName(preferredName: String) = apply { body.preferredName(preferredName) } + fun preferredName(preferredName: String?) = apply { body.preferredName(preferredName) } + + /** The preferred name of the individual. */ + fun preferredName(preferredName: Optional) = + preferredName(preferredName.orElse(null)) - fun residence(residence: Location) = apply { body.residence(residence) } + fun residence(residence: Location?) = apply { body.residence(residence) } + + fun residence(residence: Optional) = residence(residence.orElse(null)) /** * Social Security Number of the individual. This field is only available with the `ssn` * scope enabled and the `options: { include: ['ssn'] }` param set in the body. * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). */ - fun ssn(ssn: String) = apply { body.ssn(ssn) } + fun ssn(ssn: String?) = apply { body.ssn(ssn) } + + /** + * Social Security Number of the individual. This field is only available with the `ssn` + * scope enabled and the `options: { include: ['ssn'] }` param set in the body. + * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + */ + fun ssn(ssn: Optional) = ssn(ssn.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -541,9 +626,13 @@ constructor( additionalProperties = email.additionalProperties.toMutableMap() } - fun data(data: String) = apply { this.data = data } + fun data(data: String?) = apply { this.data = data } + + fun data(data: Optional) = data(data.orElse(null)) - fun type(type: Type) = apply { this.type = type } + fun type(type: Type?) = apply { this.type = type } + + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -848,9 +937,13 @@ constructor( additionalProperties = phoneNumber.additionalProperties.toMutableMap() } - fun data(data: String) = apply { this.data = data } + fun data(data: String?) = apply { this.data = data } + + fun data(data: Optional) = data(data.orElse(null)) + + fun type(type: Type?) = apply { this.type = type } - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index f16c37ad..11ef1439 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt @@ -93,17 +93,24 @@ constructor( additionalProperties = sandboxPaymentCreateBody.additionalProperties.toMutableMap() } - fun endDate(endDate: String) = apply { this.endDate = endDate } + fun endDate(endDate: String?) = apply { this.endDate = endDate } - fun payStatements(payStatements: List) = apply { - this.payStatements = payStatements.toMutableList() + fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + + fun payStatements(payStatements: List?) = apply { + this.payStatements = payStatements?.toMutableList() } + fun payStatements(payStatements: Optional>) = + payStatements(payStatements.orElse(null)) + fun addPayStatement(payStatement: PayStatement) = apply { payStatements = (payStatements ?: mutableListOf()).apply { add(payStatement) } } - fun startDate(startDate: String) = apply { this.startDate = startDate } + fun startDate(startDate: String?) = apply { this.startDate = startDate } + + fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -172,17 +179,24 @@ constructor( additionalQueryParams = sandboxPaymentCreateParams.additionalQueryParams.toBuilder() } - fun endDate(endDate: String) = apply { body.endDate(endDate) } + fun endDate(endDate: String?) = apply { body.endDate(endDate) } - fun payStatements(payStatements: List) = apply { + fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + + fun payStatements(payStatements: List?) = apply { body.payStatements(payStatements) } + fun payStatements(payStatements: Optional>) = + payStatements(payStatements.orElse(null)) + fun addPayStatement(payStatement: PayStatement) = apply { body.addPayStatement(payStatement) } - fun startDate(startDate: String) = apply { body.startDate(startDate) } + fun startDate(startDate: String?) = apply { body.startDate(startDate) } + + fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() @@ -405,58 +419,95 @@ constructor( } /** The array of earnings objects associated with this pay statement */ - fun earnings(earnings: List) = apply { - this.earnings = earnings.toMutableList() + fun earnings(earnings: List?) = apply { + this.earnings = earnings?.toMutableList() } + /** The array of earnings objects associated with this pay statement */ + fun earnings(earnings: Optional>) = earnings(earnings.orElse(null)) + /** The array of earnings objects associated with this pay statement */ fun addEarning(earning: Earning) = apply { earnings = (earnings ?: mutableListOf()).apply { add(earning) } } /** The array of deductions objects associated with this pay statement. */ - fun employeeDeductions(employeeDeductions: List) = apply { - this.employeeDeductions = employeeDeductions.toMutableList() + fun employeeDeductions(employeeDeductions: List?) = apply { + this.employeeDeductions = employeeDeductions?.toMutableList() } + /** The array of deductions objects associated with this pay statement. */ + fun employeeDeductions(employeeDeductions: Optional>) = + employeeDeductions(employeeDeductions.orElse(null)) + /** The array of deductions objects associated with this pay statement. */ fun addEmployeeDeduction(employeeDeduction: EmployeeDeduction) = apply { employeeDeductions = (employeeDeductions ?: mutableListOf()).apply { add(employeeDeduction) } } - fun employerContributions(employerContributions: List) = apply { - this.employerContributions = employerContributions.toMutableList() + fun employerContributions(employerContributions: List?) = apply { + this.employerContributions = employerContributions?.toMutableList() } + fun employerContributions( + employerContributions: Optional> + ) = employerContributions(employerContributions.orElse(null)) + fun addEmployerContribution(employerContribution: EmployerContribution) = apply { employerContributions = (employerContributions ?: mutableListOf()).apply { add(employerContribution) } } - fun grossPay(grossPay: Money) = apply { this.grossPay = grossPay } + fun grossPay(grossPay: Money?) = apply { this.grossPay = grossPay } + + fun grossPay(grossPay: Optional) = grossPay(grossPay.orElse(null)) + + /** A stable Finch `id` (UUID v4) for an individual in the company */ + fun individualId(individualId: String?) = apply { this.individualId = individualId } /** A stable Finch `id` (UUID v4) for an individual in the company */ - fun individualId(individualId: String) = apply { this.individualId = individualId } + fun individualId(individualId: Optional) = + individualId(individualId.orElse(null)) - fun netPay(netPay: Money) = apply { this.netPay = netPay } + fun netPay(netPay: Money?) = apply { this.netPay = netPay } + + fun netPay(netPay: Optional) = netPay(netPay.orElse(null)) /** The payment method. */ - fun paymentMethod(paymentMethod: PaymentMethod) = apply { + fun paymentMethod(paymentMethod: PaymentMethod?) = apply { this.paymentMethod = paymentMethod } + /** The payment method. */ + fun paymentMethod(paymentMethod: Optional) = + paymentMethod(paymentMethod.orElse(null)) + + /** The array of taxes objects associated with this pay statement. */ + fun taxes(taxes: List?) = apply { this.taxes = taxes?.toMutableList() } + /** The array of taxes objects associated with this pay statement. */ - fun taxes(taxes: List) = apply { this.taxes = taxes.toMutableList() } + fun taxes(taxes: Optional>) = taxes(taxes.orElse(null)) /** The array of taxes objects associated with this pay statement. */ fun addTax(tax: Tax) = apply { taxes = (taxes ?: mutableListOf()).apply { add(tax) } } /** The number of hours worked for this pay period */ - fun totalHours(totalHours: Double) = apply { this.totalHours = totalHours } + fun totalHours(totalHours: Double?) = apply { this.totalHours = totalHours } + + /** The number of hours worked for this pay period */ + fun totalHours(totalHours: Double) = totalHours(totalHours as Double?) + + /** The number of hours worked for this pay period */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun totalHours(totalHours: Optional) = + totalHours(totalHours.orElse(null) as Double?) + + /** The type of the payment associated with the pay statement. */ + fun type(type: Type?) = apply { this.type = type } /** The type of the payment associated with the pay statement. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -556,22 +607,51 @@ constructor( } /** The earnings amount in cents. */ - fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long?) = apply { this.amount = amount } + + /** The earnings amount in cents. */ + fun amount(amount: Long) = amount(amount as Long?) + + /** The earnings amount in cents. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun amount(amount: Optional) = amount(amount.orElse(null) as Long?) /** The earnings currency code. */ - fun currency(currency: String) = apply { this.currency = currency } + fun currency(currency: String?) = apply { this.currency = currency } + + /** The earnings currency code. */ + fun currency(currency: Optional) = currency(currency.orElse(null)) /** * The number of hours associated with this earning. (For salaried employees, this * could be hours per pay period, `0` or `null`, depending on the provider). */ - fun hours(hours: Double) = apply { this.hours = hours } + fun hours(hours: Double?) = apply { this.hours = hours } + + /** + * The number of hours associated with this earning. (For salaried employees, this + * could be hours per pay period, `0` or `null`, depending on the provider). + */ + fun hours(hours: Double) = hours(hours as Double?) + + /** + * The number of hours associated with this earning. (For salaried employees, this + * could be hours per pay period, `0` or `null`, depending on the provider). + */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun hours(hours: Optional) = hours(hours.orElse(null) as Double?) /** The exact name of the deduction from the pay statement. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The exact name of the deduction from the pay statement. */ + fun name(name: Optional) = name(name.orElse(null)) + + /** The type of earning. */ + fun type(type: Type?) = apply { this.type = type } /** The type of earning. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -807,19 +887,42 @@ constructor( } /** The deduction amount in cents. */ - fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long?) = apply { this.amount = amount } + + /** The deduction amount in cents. */ + fun amount(amount: Long) = amount(amount as Long?) + + /** The deduction amount in cents. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun amount(amount: Optional) = amount(amount.orElse(null) as Long?) + + /** The deduction currency. */ + fun currency(currency: String?) = apply { this.currency = currency } /** The deduction currency. */ - fun currency(currency: String) = apply { this.currency = currency } + fun currency(currency: Optional) = currency(currency.orElse(null)) + + /** The deduction name from the pay statement. */ + fun name(name: String?) = apply { this.name = name } /** The deduction name from the pay statement. */ - fun name(name: String) = apply { this.name = name } + fun name(name: Optional) = name(name.orElse(null)) /** Boolean indicating if the deduction is pre-tax. */ - fun preTax(preTax: Boolean) = apply { this.preTax = preTax } + fun preTax(preTax: Boolean?) = apply { this.preTax = preTax } + + /** Boolean indicating if the deduction is pre-tax. */ + fun preTax(preTax: Boolean) = preTax(preTax as Boolean?) + + /** Boolean indicating if the deduction is pre-tax. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun preTax(preTax: Optional) = preTax(preTax.orElse(null) as Boolean?) + + /** Type of benefit. */ + fun type(type: BenefitType?) = apply { this.type = type } /** Type of benefit. */ - fun type(type: BenefitType) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -926,16 +1029,32 @@ constructor( } /** The contribution amount in cents. */ - fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long?) = apply { this.amount = amount } + + /** The contribution amount in cents. */ + fun amount(amount: Long) = amount(amount as Long?) + + /** The contribution amount in cents. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun amount(amount: Optional) = amount(amount.orElse(null) as Long?) /** The contribution currency. */ - fun currency(currency: String) = apply { this.currency = currency } + fun currency(currency: String?) = apply { this.currency = currency } + + /** The contribution currency. */ + fun currency(currency: Optional) = currency(currency.orElse(null)) /** The contribution name from the pay statement. */ - fun name(name: String) = apply { this.name = name } + fun name(name: String?) = apply { this.name = name } + + /** The contribution name from the pay statement. */ + fun name(name: Optional) = name(name.orElse(null)) + + /** Type of benefit. */ + fun type(type: BenefitType?) = apply { this.type = type } /** Type of benefit. */ - fun type(type: BenefitType) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1105,19 +1224,43 @@ constructor( } /** The tax amount in cents. */ - fun amount(amount: Long) = apply { this.amount = amount } + fun amount(amount: Long?) = apply { this.amount = amount } + + /** The tax amount in cents. */ + fun amount(amount: Long) = amount(amount as Long?) + + /** The tax amount in cents. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun amount(amount: Optional) = amount(amount.orElse(null) as Long?) /** The currency code. */ - fun currency(currency: String) = apply { this.currency = currency } + fun currency(currency: String?) = apply { this.currency = currency } + + /** The currency code. */ + fun currency(currency: Optional) = currency(currency.orElse(null)) + + /** `true` if the amount is paid by the employers. */ + fun employer(employer: Boolean?) = apply { this.employer = employer } + + /** `true` if the amount is paid by the employers. */ + fun employer(employer: Boolean) = employer(employer as Boolean?) /** `true` if the amount is paid by the employers. */ - fun employer(employer: Boolean) = apply { this.employer = employer } + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun employer(employer: Optional) = + employer(employer.orElse(null) as Boolean?) + + /** The exact name of tax from the pay statement. */ + fun name(name: String?) = apply { this.name = name } /** The exact name of tax from the pay statement. */ - fun name(name: String) = apply { this.name = name } + fun name(name: Optional) = name(name.orElse(null)) + + /** The type of taxes. */ + fun type(type: Type?) = apply { this.type = type } /** The type of taxes. */ - fun type(type: Type) = apply { this.type = type } + fun type(type: Optional) = type(type.orElse(null)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() From 4ea75c02359fa758c5ae2c98e7b09a9c89d5802a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 19:39:03 +0000 Subject: [PATCH 7/7] release: 3.0.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ README.md | 6 +++--- build.gradle.kts | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 65f558e7..4191c889 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0" + ".": "3.0.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ff9c78f6..efcf5ac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 3.0.0 (2025-01-06) + +Full Changelog: [v2.0.0...v3.0.0](https://github.com/Finch-API/finch-api-java/compare/v2.0.0...v3.0.0) + +### ⚠ BREAKING CHANGES + +* **client:** switch query params objects to use `QueryParams` ([#369](https://github.com/Finch-API/finch-api-java/issues/369)) + +### Features + +* **client:** allow passing null or optional for nullable fields ([#379](https://github.com/Finch-API/finch-api-java/issues/379)) ([e4f8ca9](https://github.com/Finch-API/finch-api-java/commit/e4f8ca9dd0387833aa49d7a386bf806cf2af597b)) + + +### Chores + +* **internal:** codegen related update ([#374](https://github.com/Finch-API/finch-api-java/issues/374)) ([720b466](https://github.com/Finch-API/finch-api-java/commit/720b4664e700de2ddc5438a6ef3b0b9a4e882b32)) +* **internal:** codegen related update ([#376](https://github.com/Finch-API/finch-api-java/issues/376)) ([e61b257](https://github.com/Finch-API/finch-api-java/commit/e61b257b31e6824ceabe52c3d01e97a76ea7d0b2)) + + +### Styles + +* **internal:** sort fields ([#377](https://github.com/Finch-API/finch-api-java/issues/377)) ([0d8e0c9](https://github.com/Finch-API/finch-api-java/commit/0d8e0c980e77ceb4870ae930a22bc893249596b2)) + + +### Refactors + +* **client:** switch query params objects to use `QueryParams` ([#369](https://github.com/Finch-API/finch-api-java/issues/369)) ([af3c693](https://github.com/Finch-API/finch-api-java/commit/af3c693140281966f4162675c137b93bdcbf0014)) +* **internal:** use constructor to deserialize json ([#371](https://github.com/Finch-API/finch-api-java/issues/371)) ([418c911](https://github.com/Finch-API/finch-api-java/commit/418c911946742d49875c927b53dd86ddd750d59a)) + ## 2.0.0 (2024-12-19) Full Changelog: [v1.12.0...v2.0.0](https://github.com/Finch-API/finch-api-java/compare/v1.12.0...v2.0.0) diff --git a/README.md b/README.md index cb2abde7..dcd740fe 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/2.0.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/3.0.0) @@ -27,7 +27,7 @@ The REST API documentation can be found [in the Finch Documentation Center](htt ```kotlin -implementation("com.tryfinch.api:finch-java:2.0.0") +implementation("com.tryfinch.api:finch-java:3.0.0") ``` #### Maven @@ -36,7 +36,7 @@ implementation("com.tryfinch.api:finch-java:2.0.0") com.tryfinch.api finch-java - 2.0.0 + 3.0.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index b4f521ea..29cf7048 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.tryfinch.api" - version = "2.0.0" // x-release-please-version + version = "3.0.0" // x-release-please-version }