From 94b45894c92283b2f24a8c0c9938dc456203e7e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 02:48:32 +0000 Subject: [PATCH 01/34] chore(internal): codegen related update (#394) --- .../api/models/AccessTokenCreateParams.kt | 14 +- .../api/models/AccountCreateResponse.kt | 20 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 524 ++++++++++-------- .../api/models/AccountUpdateResponse.kt | 18 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 22 +- .../api/models/AutomatedCreateResponse.kt | 14 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 12 +- .../api/models/BenefitContribution.kt | 10 +- .../models/BenefitFeaturesAndOperations.kt | 30 +- .../tryfinch/api/models/BenefitsSupport.kt | 30 +- .../kotlin/com/tryfinch/api/models/Company.kt | 68 ++- .../com/tryfinch/api/models/CompanyBenefit.kt | 14 +- .../com/tryfinch/api/models/CompanyEvent.kt | 22 +- .../api/models/CompanyUpdateResponse.kt | 66 ++- .../api/models/ConnectSessionNewParams.kt | 34 +- .../ConnectSessionReauthenticateParams.kt | 14 +- .../api/models/ConnectionCreateResponse.kt | 22 +- .../api/models/CreateAccessTokenResponse.kt | 26 +- .../models/CreateCompanyBenefitsResponse.kt | 8 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 24 +- .../tryfinch/api/models/DisconnectResponse.kt | 8 +- .../api/models/DocumentListResponse.kt | 10 +- .../tryfinch/api/models/DocumentResponse.kt | 16 +- .../api/models/DocumentRetreiveResponse.kt | 28 +- .../com/tryfinch/api/models/EmploymentData.kt | 80 +-- .../api/models/EmploymentDataResponse.kt | 12 +- .../tryfinch/api/models/EmploymentEvent.kt | 24 +- .../api/models/EmploymentUpdateResponse.kt | 78 +-- .../tryfinch/api/models/EnrolledIndividual.kt | 24 +- .../api/models/HrisBenefitCreateParams.kt | 12 +- ...nefitIndividualRetrieveManyBenefitsPage.kt | 12 +- ...IndividualRetrieveManyBenefitsPageAsync.kt | 12 +- .../HrisBenefitIndividualUnenrollManyPage.kt | 12 +- ...sBenefitIndividualUnenrollManyPageAsync.kt | 12 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 8 +- .../api/models/HrisBenefitListPage.kt | 12 +- .../api/models/HrisBenefitListPageAsync.kt | 12 +- .../HrisBenefitListSupportedBenefitsPage.kt | 12 +- ...isBenefitListSupportedBenefitsPageAsync.kt | 12 +- .../api/models/HrisBenefitUpdateParams.kt | 8 +- .../HrisDirectoryListIndividualsPage.kt | 14 +- .../HrisDirectoryListIndividualsPageAsync.kt | 14 +- .../api/models/HrisDirectoryListPage.kt | 14 +- .../api/models/HrisDirectoryListPageAsync.kt | 14 +- .../models/HrisEmploymentRetrieveManyPage.kt | 12 +- .../HrisEmploymentRetrieveManyPageAsync.kt | 12 +- .../HrisEmploymentRetrieveManyParams.kt | 16 +- .../models/HrisIndividualRetrieveManyPage.kt | 12 +- .../HrisIndividualRetrieveManyPageAsync.kt | 12 +- .../HrisIndividualRetrieveManyParams.kt | 26 +- .../HrisPayStatementRetrieveManyPage.kt | 12 +- .../HrisPayStatementRetrieveManyPageAsync.kt | 12 +- .../HrisPayStatementRetrieveManyParams.kt | 20 +- .../api/models/HrisPaymentListPage.kt | 12 +- .../api/models/HrisPaymentListPageAsync.kt | 12 +- .../kotlin/com/tryfinch/api/models/Income.kt | 14 +- .../com/tryfinch/api/models/Individual.kt | 52 +- .../tryfinch/api/models/IndividualBenefit.kt | 28 +- .../models/IndividualEnrolledIdsResponse.kt | 10 +- .../tryfinch/api/models/IndividualEvent.kt | 24 +- .../api/models/IndividualInDirectory.kt | 36 +- .../tryfinch/api/models/IndividualResponse.kt | 12 +- .../api/models/IndividualUpdateResponse.kt | 52 +- .../com/tryfinch/api/models/Introspection.kt | 70 +-- .../api/models/JobAutomatedCreateParams.kt | 18 +- .../api/models/JobAutomatedListPage.kt | 14 +- .../api/models/JobAutomatedListPageAsync.kt | 14 +- .../tryfinch/api/models/JobCompletionEvent.kt | 26 +- .../tryfinch/api/models/JobCreateResponse.kt | 14 +- .../com/tryfinch/api/models/Location.kt | 22 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 12 +- .../kotlin/com/tryfinch/api/models/Money.kt | 10 +- .../api/models/OperationSupportMatrix.kt | 14 +- .../kotlin/com/tryfinch/api/models/Paging.kt | 10 +- .../api/models/PayGroupListResponse.kt | 12 +- .../api/models/PayGroupRetrieveResponse.kt | 14 +- .../com/tryfinch/api/models/PayStatement.kt | 88 +-- .../tryfinch/api/models/PayStatementEvent.kt | 26 +- .../api/models/PayStatementResponse.kt | 12 +- .../api/models/PayStatementResponseBody.kt | 10 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 40 +- .../api/models/PaymentCreateResponse.kt | 10 +- .../com/tryfinch/api/models/PaymentEvent.kt | 26 +- .../api/models/PayrollPayGroupListPage.kt | 12 +- .../models/PayrollPayGroupListPageAsync.kt | 12 +- .../com/tryfinch/api/models/Provider.kt | 524 ++++++++++-------- .../tryfinch/api/models/ProviderListPage.kt | 12 +- .../api/models/ProviderListPageAsync.kt | 12 +- .../models/RequestForwardingForwardParams.kt | 12 +- .../RequestForwardingForwardResponse.kt | 24 +- .../api/models/SandboxCompanyUpdateParams.kt | 66 ++- .../SandboxConnectionAccountCreateParams.kt | 14 +- .../SandboxConnectionAccountUpdateParams.kt | 8 +- .../models/SandboxConnectionCreateParams.kt | 14 +- .../models/SandboxDirectoryCreateParams.kt | 114 ++-- .../models/SandboxEmploymentUpdateParams.kt | 76 +-- .../models/SandboxIndividualUpdateParams.kt | 50 +- .../api/models/SandboxJobConfiguration.kt | 10 +- .../SandboxJobConfigurationUpdateParams.kt | 10 +- .../api/models/SandboxJobCreateParams.kt | 8 +- .../api/models/SandboxPaymentCreateParams.kt | 100 ++-- .../tryfinch/api/models/SessionNewResponse.kt | 10 +- .../models/SessionReauthenticateResponse.kt | 10 +- .../api/models/SupportPerBenefitType.kt | 10 +- .../tryfinch/api/models/SupportedBenefit.kt | 22 +- .../api/models/UnenrolledIndividual.kt | 24 +- .../models/UpdateCompanyBenefitResponse.kt | 8 +- .../kotlin/com/tryfinch/api/models/W42005.kt | 28 +- .../kotlin/com/tryfinch/api/models/W42020.kt | 34 +- .../com/tryfinch/api/models/WebhookEvent.kt | 113 ++-- 110 files changed, 2084 insertions(+), 1553 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 726764c7..5abaf293 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 @@ -103,13 +103,15 @@ constructor( private var validated: Boolean = false fun validate(): AccessTokenCreateBody = apply { - if (!validated) { - code() - clientId() - clientSecret() - redirectUri() - validated = true + if (validated) { + return@apply } + + code() + clientId() + clientSecret() + redirectUri() + validated = true } fun toBuilder() = Builder().from(this) 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 253bb585..d64a3586 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 @@ -95,16 +95,18 @@ private constructor( private var validated: Boolean = false fun validate(): AccountCreateResponse = apply { - if (!validated) { - accessToken() - accountId() - authenticationType() - companyId() - connectionId() - products() - providerId() - validated = true + if (validated) { + return@apply } + + accessToken() + accountId() + authenticationType() + companyId() + connectionId() + products() + providerId() + validated = true } fun toBuilder() = Builder().from(this) 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 c01ee175..1ceaa994 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): AccountUpdateEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -233,11 +235,13 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - authenticationMethod().validate() - status() - validated = true + if (validated) { + return@apply } + + authenticationMethod().validate() + status() + validated = true } fun toBuilder() = Builder().from(this) @@ -355,12 +359,14 @@ private constructor( private var validated: Boolean = false fun validate(): AuthenticationMethod = apply { - if (!validated) { - benefitsSupport().map { it.validate() } - supportedFields().map { it.validate() } - type() - validated = true + if (validated) { + return@apply } + + benefitsSupport().ifPresent { it.validate() } + supportedFields().ifPresent { it.validate() } + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -543,16 +549,18 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedFields = apply { - if (!validated) { - company().map { it.validate() } - directory().map { it.validate() } - employment().map { it.validate() } - individual().map { it.validate() } - payGroup().map { it.validate() } - payStatement().map { it.validate() } - payment().map { it.validate() } - validated = true + if (validated) { + return@apply } + + company().ifPresent { it.validate() } + directory().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + individual().ifPresent { it.validate() } + payGroup().ifPresent { it.validate() } + payStatement().ifPresent { it.validate() } + payment().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -767,18 +775,20 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedCompanyFields = apply { - if (!validated) { - id() - accounts().map { it.validate() } - departments().map { it.validate() } - ein() - entity().map { it.validate() } - legalName() - locations().map { it.validate() } - primaryEmail() - primaryPhoneNumber() - validated = true - } + if (validated) { + return@apply + } + + id() + accounts().ifPresent { it.validate() } + departments().ifPresent { it.validate() } + ein() + entity().ifPresent { it.validate() } + legalName() + locations().ifPresent { it.validate() } + primaryEmail() + primaryPhoneNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -971,14 +981,16 @@ private constructor( private var validated: Boolean = false fun validate(): Accounts = apply { - if (!validated) { - accountName() - accountNumber() - accountType() - institutionName() - routingNumber() - validated = true + if (validated) { + return@apply } + + accountName() + accountNumber() + accountType() + institutionName() + routingNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -1128,11 +1140,13 @@ private constructor( private var validated: Boolean = false fun validate(): Departments = apply { - if (!validated) { - name() - parent().map { it.validate() } - validated = true + if (validated) { + return@apply } + + name() + parent().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -1222,10 +1236,12 @@ private constructor( private var validated: Boolean = false fun validate(): Parent = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1349,11 +1365,13 @@ private constructor( private var validated: Boolean = false fun validate(): Entity = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1509,15 +1527,17 @@ private constructor( private var validated: Boolean = false fun validate(): Locations = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -1683,11 +1703,13 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedDirectoryFields = apply { - if (!validated) { - individuals().map { it.validate() } - paging().map { it.validate() } - validated = true + if (validated) { + return@apply } + + individuals().ifPresent { it.validate() } + paging().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -1837,16 +1859,18 @@ private constructor( private var validated: Boolean = false fun validate(): Individuals = apply { - if (!validated) { - id() - department() - firstName() - isActive() - lastName() - manager().map { it.validate() } - middleName() - validated = true + if (validated) { + return@apply } + + id() + department() + firstName() + isActive() + lastName() + manager().ifPresent { it.validate() } + middleName() + validated = true } fun toBuilder() = Builder().from(this) @@ -1982,10 +2006,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) @@ -2111,11 +2137,13 @@ private constructor( private var validated: Boolean = false fun validate(): Paging = apply { - if (!validated) { - count() - offset() - validated = true + if (validated) { + return@apply } + + count() + offset() + validated = true } fun toBuilder() = Builder().from(this) @@ -2392,26 +2420,28 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedEmploymentFields = apply { - if (!validated) { - id() - 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 - } + if (validated) { + return@apply + } + + id() + classCode() + customFields() + department().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + employmentStatus() + endDate() + firstName() + income().ifPresent { it.validate() } + incomeHistory() + isActive() + lastName() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + startDate() + title() + validated = true } fun toBuilder() = Builder().from(this) @@ -2633,10 +2663,12 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -2741,11 +2773,13 @@ private constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -2872,12 +2906,14 @@ private constructor( private var validated: Boolean = false fun validate(): Income = apply { - if (!validated) { - amount() - currency() - unit() - validated = true + if (validated) { + return@apply } + + amount() + currency() + unit() + validated = true } fun toBuilder() = Builder().from(this) @@ -3040,15 +3076,17 @@ private constructor( private var validated: Boolean = false fun validate(): Location = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -3184,10 +3222,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) @@ -3410,22 +3450,24 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedIndividualFields = apply { - if (!validated) { - id() - dob() - emails().map { it.validate() } - encryptedSsn() - ethnicity() - firstName() - gender() - lastName() - middleName() - phoneNumbers().map { it.validate() } - preferredName() - residence().map { it.validate() } - ssn() - validated = true - } + if (validated) { + return@apply + } + + id() + dob() + emails().ifPresent { it.validate() } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() + phoneNumbers().ifPresent { it.validate() } + preferredName() + residence().ifPresent { it.validate() } + ssn() + validated = true } fun toBuilder() = Builder().from(this) @@ -3617,11 +3659,13 @@ private constructor( private var validated: Boolean = false fun validate(): Emails = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -3733,11 +3777,13 @@ private constructor( private var validated: Boolean = false fun validate(): PhoneNumbers = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -3892,15 +3938,17 @@ private constructor( private var validated: Boolean = false fun validate(): Residence = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -4080,13 +4128,15 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPayGroupFields = apply { - if (!validated) { - id() - individualIds() - name() - payFrequencies() - validated = true + if (validated) { + return@apply } + + id() + individualIds() + name() + payFrequencies() + validated = true } fun toBuilder() = Builder().from(this) @@ -4223,11 +4273,13 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPayStatementFields = apply { - if (!validated) { - paging().map { it.validate() } - payStatements().map { it.validate() } - validated = true + if (validated) { + return@apply } + + paging().ifPresent { it.validate() } + payStatements().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -4329,11 +4381,13 @@ private constructor( private var validated: Boolean = false fun validate(): Paging = apply { - if (!validated) { - count() - offset() - validated = true + if (validated) { + return@apply } + + count() + offset() + validated = true } fun toBuilder() = Builder().from(this) @@ -4535,19 +4589,21 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatements = apply { - if (!validated) { - earnings().map { it.validate() } - employeeDeductions().map { it.validate() } - employerContributions().map { it.validate() } - grossPay() - individualId() - netPay() - paymentMethod() - taxes().map { it.validate() } - totalHours() - type() - validated = true + if (validated) { + return@apply } + + earnings().ifPresent { it.validate() } + employeeDeductions().ifPresent { it.validate() } + employerContributions().ifPresent { it.validate() } + grossPay() + individualId() + netPay() + paymentMethod() + taxes().ifPresent { it.validate() } + totalHours() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -4745,13 +4801,15 @@ private constructor( private var validated: Boolean = false fun validate(): Earnings = apply { - if (!validated) { - amount() - currency() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -4918,14 +4976,16 @@ private constructor( private var validated: Boolean = false fun validate(): EmployeeDeductions = apply { - if (!validated) { - amount() - currency() - name() - preTax() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + preTax() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -5081,12 +5141,14 @@ private constructor( private var validated: Boolean = false fun validate(): EmployerContributions = apply { - if (!validated) { - amount() - currency() - name() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -5248,14 +5310,16 @@ private constructor( private var validated: Boolean = false fun validate(): Taxes = apply { - if (!validated) { - amount() - currency() - employer() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + employer() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -5531,21 +5595,23 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPaymentFields = apply { - if (!validated) { - id() - companyDebit() - debitDate() - employeeTaxes() - employerTaxes() - grossPay() - individualIds() - netPay() - payDate() - payFrequencies() - payGroupIds() - payPeriod().map { it.validate() } - validated = true - } + if (validated) { + return@apply + } + + id() + companyDebit() + debitDate() + employeeTaxes() + employerTaxes() + grossPay() + individualIds() + netPay() + payDate() + payFrequencies() + payGroupIds() + payPeriod().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -5738,11 +5804,13 @@ private constructor( private var validated: Boolean = false fun validate(): PayPeriod = apply { - if (!validated) { - endDate() - startDate() - validated = true + if (validated) { + return@apply } + + endDate() + startDate() + validated = true } fun toBuilder() = Builder().from(this) 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 1883927b..a1dbb439 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 @@ -88,15 +88,17 @@ private constructor( private var validated: Boolean = false fun validate(): AccountUpdateResponse = apply { - if (!validated) { - accountId() - authenticationType() - companyId() - products() - providerId() - connectionId() - validated = true + if (validated) { + return@apply } + + accountId() + authenticationType() + companyId() + products() + providerId() + connectionId() + validated = true } fun toBuilder() = Builder().from(this) 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 64fb9241..a59d00b6 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 @@ -122,17 +122,19 @@ private constructor( private var validated: Boolean = false fun validate(): AutomatedAsyncJob = apply { - if (!validated) { - completedAt() - createdAt() - jobId() - jobUrl() - scheduledAt() - startedAt() - status() - type() - validated = true + if (validated) { + return@apply } + + completedAt() + createdAt() + jobId() + jobUrl() + scheduledAt() + startedAt() + status() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 ed868f17..92229902 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 @@ -67,13 +67,15 @@ private constructor( private var validated: Boolean = false fun validate(): AutomatedCreateResponse = apply { - if (!validated) { - allowedRefreshes() - jobId() - jobUrl() - remainingRefreshes() - validated = true + if (validated) { + return@apply } + + allowedRefreshes() + jobId() + jobUrl() + remainingRefreshes() + validated = true } fun toBuilder() = Builder().from(this) 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 74d2e8aa..56f0ffa0 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 @@ -72,12 +72,14 @@ private constructor( private var validated: Boolean = false fun validate(): BaseWebhookEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + validated = true } fun toBuilder() = Builder().from(this) 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 60809abe..c150a0d7 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 @@ -46,11 +46,13 @@ private constructor( private var validated: Boolean = false fun validate(): BenefitContribution = apply { - if (!validated) { - amount() - type() - validated = true + if (validated) { + return@apply } + + amount() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 f09e3ce1..d872581a 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 @@ -52,11 +52,13 @@ private constructor( private var validated: Boolean = false fun validate(): BenefitFeaturesAndOperations = apply { - if (!validated) { - supportedFeatures().map { it.validate() } - supportedOperations().map { it.validate() } - validated = true + if (validated) { + return@apply } + + supportedFeatures().ifPresent { it.validate() } + supportedOperations().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -230,16 +232,18 @@ private constructor( private var validated: Boolean = false fun validate(): BenefitFeature = apply { - if (!validated) { - annualMaximum() - catchUp() - companyContribution() - description() - employeeDeduction() - frequencies() - hsaContributionLimit() - validated = true + if (validated) { + return@apply } + + annualMaximum() + catchUp() + companyContribution() + description() + employeeDeduction() + frequencies() + hsaContributionLimit() + validated = true } fun toBuilder() = Builder().from(this) 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 814f1c40..ccde9258 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 @@ -154,21 +154,23 @@ private constructor( private var validated: Boolean = false fun validate(): BenefitsSupport = apply { - if (!validated) { - 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 + if (validated) { + return@apply } + + commuter().ifPresent { it.validate() } + customPostTax().ifPresent { it.validate() } + customPreTax().ifPresent { it.validate() } + fsaDependentCare().ifPresent { it.validate() } + fsaMedical().ifPresent { it.validate() } + hsaPost().ifPresent { it.validate() } + hsaPre().ifPresent { it.validate() } + s125Dental().ifPresent { it.validate() } + s125Medical().ifPresent { it.validate() } + s125Vision().ifPresent { it.validate() } + simple().ifPresent { it.validate() } + simpleIra().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 a1cdba5f..f24527b1 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 @@ -119,18 +119,20 @@ private constructor( private var validated: Boolean = false fun validate(): Company = apply { - if (!validated) { - id() - accounts().map { it.forEach { it.validate() } } - departments().map { it.forEach { it?.validate() } } - ein() - entity().map { it.validate() } - legalName() - locations().map { it.forEach { it?.validate() } } - primaryEmail() - primaryPhoneNumber() - validated = true + if (validated) { + return@apply } + + id() + accounts().ifPresent { it.forEach { it.validate() } } + departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + ein() + entity().ifPresent { it.validate() } + legalName() + locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + primaryEmail() + primaryPhoneNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -415,14 +417,16 @@ private constructor( private var validated: Boolean = false fun validate(): Account = apply { - if (!validated) { - accountName() - accountNumber() - accountType() - institutionName() - routingNumber() - validated = true + if (validated) { + return@apply } + + accountName() + accountNumber() + accountType() + institutionName() + routingNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -661,11 +665,13 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - parent().map { it.validate() } - validated = true + if (validated) { + return@apply } + + name() + parent().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -758,10 +764,12 @@ private constructor( private var validated: Boolean = false fun validate(): Parent = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -884,11 +892,13 @@ private constructor( private var validated: Boolean = false fun validate(): Entity = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 b7d1a27e..a24c26fa 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 @@ -64,13 +64,15 @@ private constructor( private var validated: Boolean = false fun validate(): CompanyBenefit = apply { - if (!validated) { - benefitId() - description() - frequency() - type() - validated = true + if (validated) { + return@apply } + + benefitId() + description() + frequency() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 e411a503..23900709 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): CompanyEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -216,9 +218,11 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - validated = true + if (validated) { + return@apply } + + validated = true } fun toBuilder() = Builder().from(this) 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 50137d22..d2996de6 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 @@ -112,17 +112,19 @@ private constructor( private var validated: Boolean = false fun validate(): CompanyUpdateResponse = apply { - if (!validated) { - accounts().map { it.forEach { it.validate() } } - departments().map { it.forEach { it?.validate() } } - ein() - entity().map { it.validate() } - legalName() - locations().map { it.forEach { it?.validate() } } - primaryEmail() - primaryPhoneNumber() - validated = true + if (validated) { + return@apply } + + accounts().ifPresent { it.forEach { it.validate() } } + departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + ein() + entity().ifPresent { it.validate() } + legalName() + locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + primaryEmail() + primaryPhoneNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -398,14 +400,16 @@ private constructor( private var validated: Boolean = false fun validate(): Account = apply { - if (!validated) { - accountName() - accountNumber() - accountType() - institutionName() - routingNumber() - validated = true + if (validated) { + return@apply } + + accountName() + accountNumber() + accountType() + institutionName() + routingNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -644,11 +648,13 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - parent().map { it.validate() } - validated = true + if (validated) { + return@apply } + + name() + parent().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -741,10 +747,12 @@ private constructor( private var validated: Boolean = false fun validate(): Parent = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -867,11 +875,13 @@ private constructor( private var validated: Boolean = false fun validate(): Entity = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 98dd4ae6..4c08293a 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 @@ -180,18 +180,20 @@ constructor( private var validated: Boolean = false fun validate(): ConnectSessionNewBody = apply { - if (!validated) { - customerId() - customerName() - products() - customerEmail() - integration().map { it.validate() } - manual() - minutesToExpire() - redirectUri() - sandbox() - validated = true + if (validated) { + return@apply } + + customerId() + customerName() + products() + customerEmail() + integration().ifPresent { it.validate() } + manual() + minutesToExpire() + redirectUri() + sandbox() + validated = true } fun toBuilder() = Builder().from(this) @@ -734,11 +736,13 @@ constructor( private var validated: Boolean = false fun validate(): Integration = apply { - if (!validated) { - authMethod() - provider() - validated = true + if (validated) { + return@apply } + + authMethod() + provider() + validated = true } fun toBuilder() = Builder().from(this) 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 6698afa5..d711a92f 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 @@ -130,13 +130,15 @@ constructor( private var validated: Boolean = false fun validate(): ConnectSessionReauthenticateBody = apply { - if (!validated) { - connectionId() - minutesToExpire() - products() - redirectUri() - validated = true + if (validated) { + return@apply } + + connectionId() + minutesToExpire() + products() + redirectUri() + validated = true } fun toBuilder() = Builder().from(this) 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 3917b3e3..24db38fe 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 @@ -103,17 +103,19 @@ private constructor( private var validated: Boolean = false fun validate(): ConnectionCreateResponse = apply { - if (!validated) { - accessToken() - accountId() - authenticationType() - companyId() - connectionId() - products() - providerId() - tokenType() - validated = true + if (validated) { + return@apply } + + accessToken() + accountId() + authenticationType() + companyId() + connectionId() + products() + providerId() + tokenType() + validated = true } fun toBuilder() = Builder().from(this) 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 35b8d58a..52cd5ae2 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 @@ -144,19 +144,21 @@ private constructor( private var validated: Boolean = false fun validate(): CreateAccessTokenResponse = apply { - if (!validated) { - accessToken() - accountId() - clientType() - companyId() - connectionId() - connectionType() - products() - providerId() - customerId() - tokenType() - validated = true + if (validated) { + return@apply } + + accessToken() + accountId() + clientType() + companyId() + connectionId() + connectionType() + products() + providerId() + customerId() + tokenType() + validated = true } fun toBuilder() = Builder().from(this) 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 afd35fe1..898117a4 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 @@ -36,10 +36,12 @@ private constructor( private var validated: Boolean = false fun validate(): CreateCompanyBenefitsResponse = apply { - if (!validated) { - benefitId() - validated = true + if (validated) { + return@apply } + + benefitId() + validated = true } fun toBuilder() = Builder().from(this) 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 32f700e5..e7f3f0d7 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): DirectoryEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -226,10 +228,12 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - individualId() - validated = true + if (validated) { + return@apply } + + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 4759deb3..5fc23c15 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 @@ -38,10 +38,12 @@ private constructor( private var validated: Boolean = false fun validate(): DisconnectResponse = apply { - if (!validated) { - status() - validated = true + if (validated) { + return@apply } + + status() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt index 3e21e436..62291a63 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt @@ -45,11 +45,13 @@ private constructor( private var validated: Boolean = false fun validate(): DocumentListResponse = apply { - if (!validated) { - documents().forEach { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + documents().forEach { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt index 005d03a8..b68a126d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt @@ -84,14 +84,16 @@ private constructor( private var validated: Boolean = false fun validate(): DocumentResponse = apply { - if (!validated) { - id() - individualId() - type() - url() - year() - validated = true + if (validated) { + return@apply } + + id() + individualId() + type() + url() + year() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt index f4a7cd62..cc3a9c67 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt @@ -31,13 +31,12 @@ private constructor( private val _json: JsonValue? = null, ) { - private var validated: Boolean = false - /** * A 2020 version of the W-4 tax form containing information on an individual's filing status, * dependents, and withholding details. */ fun w42020(): Optional = Optional.ofNullable(w42020) + /** * A 2005 version of the W-4 tax form containing information on an individual's filing status, * dependents, and withholding details. @@ -53,6 +52,7 @@ private constructor( * dependents, and withholding details. */ fun asW42020(): W42020 = w42020.getOrThrow("w42020") + /** * A 2005 version of the W-4 tax form containing information on an individual's filing status, * dependents, and withholding details. @@ -69,15 +69,25 @@ private constructor( } } + private var validated: Boolean = false + fun validate(): DocumentRetreiveResponse = apply { - if (!validated) { - if (w42020 == null && w42005 == null) { - throw FinchInvalidDataException("Unknown DocumentRetreiveResponse: $_json") - } - w42020?.validate() - w42005?.validate() - validated = true + if (validated) { + return@apply } + + accept( + object : Visitor { + override fun visitW42020(w42020: W42020) { + w42020.validate() + } + + override fun visitW42005(w42005: W42005) { + w42005.validate() + } + } + ) + validated = true } override fun equals(other: Any?): Boolean { 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 108cf3c6..166edd14 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 @@ -238,29 +238,31 @@ private constructor( private var validated: Boolean = false fun validate(): EmploymentData = apply { - if (!validated) { - id() - classCode() - customFields().map { it.forEach { it.validate() } } - department().map { it.validate() } - employment().map { it.validate() } - employmentStatus() - endDate() - firstName() - income().map { it.validate() } - incomeHistory().map { it.forEach { it?.validate() } } - isActive() - lastName() - latestRehireDate() - location().map { it.validate() } - manager().map { it.validate() } - middleName() - sourceId() - startDate() - title() - workId() - validated = true + if (validated) { + return@apply } + + id() + classCode() + customFields().ifPresent { it.forEach { it.validate() } } + department().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + employmentStatus() + endDate() + firstName() + income().ifPresent { it.validate() } + incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + isActive() + lastName() + latestRehireDate() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + sourceId() + startDate() + title() + workId() + validated = true } fun toBuilder() = Builder().from(this) @@ -635,10 +637,12 @@ private constructor( private var validated: Boolean = false fun validate(): CustomField = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -737,10 +741,12 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -848,11 +854,13 @@ private constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1195,10 +1203,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) 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 6c9887d2..415130ba 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 @@ -52,12 +52,14 @@ private constructor( private var validated: Boolean = false fun validate(): EmploymentDataResponse = apply { - if (!validated) { - body().map { it.validate() } - code() - individualId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 9921898c..c6559f15 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): EmploymentEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -226,10 +228,12 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - individualId() - validated = true + if (validated) { + return@apply } + + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 e5f2aca3..c51f693e 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 @@ -223,28 +223,30 @@ private constructor( private var validated: Boolean = false fun validate(): EmploymentUpdateResponse = apply { - if (!validated) { - id() - classCode() - customFields().map { it.forEach { it.validate() } } - department().map { it.validate() } - employment().map { it.validate() } - employmentStatus() - endDate() - firstName() - income().map { it.validate() } - incomeHistory().map { it.forEach { it?.validate() } } - isActive() - lastName() - latestRehireDate() - location().map { it.validate() } - manager().map { it.validate() } - middleName() - sourceId() - startDate() - title() - validated = true + if (validated) { + return@apply } + + id() + classCode() + customFields().ifPresent { it.forEach { it.validate() } } + department().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + employmentStatus() + endDate() + firstName() + income().ifPresent { it.validate() } + incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + isActive() + lastName() + latestRehireDate() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + sourceId() + startDate() + title() + validated = true } fun toBuilder() = Builder().from(this) @@ -587,10 +589,12 @@ private constructor( private var validated: Boolean = false fun validate(): CustomField = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -691,10 +695,12 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -802,11 +808,13 @@ private constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1149,10 +1157,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) 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 6ee1fa49..0b555a0d 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 @@ -54,12 +54,14 @@ private constructor( private var validated: Boolean = false fun validate(): EnrolledIndividual = apply { - if (!validated) { - body().map { it.validate() } - code() - individualId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + individualId() + validated = true } fun toBuilder() = Builder().from(this) @@ -170,12 +172,14 @@ private constructor( private var validated: Boolean = false fun validate(): Body = apply { - if (!validated) { - finchCode() - message() - name() - validated = true + if (validated) { + return@apply } + + finchCode() + message() + name() + validated = true } fun toBuilder() = Builder().from(this) 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 9ff08b1c..77c89ba7 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 @@ -115,12 +115,14 @@ constructor( private var validated: Boolean = false fun validate(): HrisBenefitCreateBody = apply { - if (!validated) { - description() - frequency() - type() - validated = true + if (validated) { + return@apply } + + description() + frequency() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 f5f1d11d..1f0ed8ab 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -93,11 +91,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 b9f4793c..6623b355 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 @@ -86,8 +86,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -97,11 +95,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 6fe68d85..a8200935 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -93,11 +91,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 b4fdd6c4..415bb2db 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -96,11 +94,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 f1b1b5ac..07a84050 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 @@ -81,10 +81,12 @@ constructor( private var validated: Boolean = false fun validate(): HrisBenefitIndividualUnenrollManyBody = apply { - if (!validated) { - individualIds() - validated = true + if (validated) { + return@apply } + + individualIds() + validated = true } fun toBuilder() = Builder().from(this) 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 5c9d3159..b7d58f9a 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 @@ -78,8 +78,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -89,11 +87,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 ad78a2d4..4e2de629 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -96,11 +94,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 95cd2dbe..606114f5 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -93,11 +91,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 e00f8e52..ed182714 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -96,11 +94,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 e42c44da..d6faf2b7 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 @@ -81,10 +81,12 @@ constructor( private var validated: Boolean = false fun validate(): HrisBenefitUpdateBody = apply { - if (!validated) { - description() - validated = true + if (validated) { + return@apply } + + description() + validated = true } fun toBuilder() = Builder().from(this) 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 b24aa8e9..c20a77e4 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 @@ -95,8 +95,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun individuals(): List = individuals.getNullable("individuals") ?: listOf() @@ -113,12 +111,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - individuals().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + individuals().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 b0d74067..1811317f 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 @@ -98,8 +98,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun individuals(): List = individuals.getNullable("individuals") ?: listOf() @@ -116,12 +114,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - individuals().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + individuals().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 fc5cb237..9fce97f6 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 @@ -94,8 +94,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun individuals(): List = individuals.getNullable("individuals") ?: listOf() @@ -112,12 +110,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - individuals().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + individuals().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 75f3a775..128f5be8 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 @@ -97,8 +97,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun individuals(): List = individuals.getNullable("individuals") ?: listOf() @@ -115,12 +113,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - individuals().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + individuals().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 71ea48eb..63a720fd 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @@ -95,11 +93,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 9c7d988d..7eac76e0 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @@ -98,11 +96,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 2e9a4b87..b38f3a04 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 @@ -70,10 +70,12 @@ constructor( private var validated: Boolean = false fun validate(): HrisEmploymentRetrieveManyBody = apply { - if (!validated) { - requests().forEach { it.validate() } - validated = true + if (validated) { + return@apply } + + requests().forEach { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -355,10 +357,12 @@ constructor( private var validated: Boolean = false fun validate(): Request = apply { - if (!validated) { - individualId() - validated = true + if (validated) { + return@apply } + + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 72a1d20e..7e82f83c 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @JsonProperty("responses") @@ -94,11 +92,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 efdfe58a..bbed6de2 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @JsonProperty("responses") @@ -97,11 +95,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 2aca8f6e..7ed7c901 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 @@ -78,11 +78,13 @@ constructor( private var validated: Boolean = false fun validate(): HrisIndividualRetrieveManyBody = apply { - if (!validated) { - options().map { it.validate() } - requests().map { it.forEach { it.validate() } } - validated = true + if (validated) { + return@apply } + + options().ifPresent { it.validate() } + requests().ifPresent { it.forEach { it.validate() } } + validated = true } fun toBuilder() = Builder().from(this) @@ -360,10 +362,12 @@ constructor( private var validated: Boolean = false fun validate(): Options = apply { - if (!validated) { - include() - validated = true + if (validated) { + return@apply } + + include() + validated = true } fun toBuilder() = Builder().from(this) @@ -472,10 +476,12 @@ constructor( private var validated: Boolean = false fun validate(): Request = apply { - if (!validated) { - individualId() - validated = true + if (validated) { + return@apply } + + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 0c3034b0..3cb9aee4 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @JsonProperty("responses") @@ -94,11 +92,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 84291ccb..63c5da48 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun responses(): List = responses.getNullable("responses") ?: listOf() @JsonProperty("responses") @@ -97,11 +95,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - responses().map { it.validate() } - validated = true + if (validated) { + return@apply } + + responses().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 a3e8ac70..4a6cb4e4 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 @@ -74,10 +74,12 @@ constructor( private var validated: Boolean = false fun validate(): HrisPayStatementRetrieveManyBody = apply { - if (!validated) { - requests().forEach { it.validate() } - validated = true + if (validated) { + return@apply } + + requests().forEach { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -367,12 +369,14 @@ constructor( private var validated: Boolean = false fun validate(): Request = apply { - if (!validated) { - paymentId() - limit() - offset() - validated = true + if (validated) { + return@apply } + + paymentId() + limit() + offset() + validated = true } fun toBuilder() = Builder().from(this) 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 8b7c0854..182d9ed2 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 @@ -77,8 +77,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -88,11 +86,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 f84e657c..a8a10ab7 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 @@ -84,8 +84,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -95,11 +93,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 302b43e2..26f3d1df 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 @@ -78,13 +78,15 @@ private constructor( private var validated: Boolean = false fun validate(): Income = apply { - if (!validated) { - amount() - currency() - effectiveDate() - unit() - validated = true + if (validated) { + return@apply } + + amount() + currency() + effectiveDate() + unit() + validated = true } fun toBuilder() = Builder().from(this) 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 12cf5231..105aa8a5 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 @@ -160,22 +160,24 @@ private constructor( private var validated: Boolean = false fun validate(): Individual = apply { - if (!validated) { - id() - dob() - emails().map { it.forEach { it.validate() } } - encryptedSsn() - ethnicity() - firstName() - gender() - lastName() - middleName() - phoneNumbers().map { it.forEach { it?.validate() } } - preferredName() - residence().map { it.validate() } - ssn() - validated = true + if (validated) { + return@apply } + + id() + dob() + emails().ifPresent { it.forEach { it.validate() } } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() + phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + preferredName() + residence().ifPresent { it.validate() } + ssn() + validated = true } fun toBuilder() = Builder().from(this) @@ -449,11 +451,13 @@ private constructor( private var validated: Boolean = false fun validate(): Email = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -778,11 +782,13 @@ private constructor( private var validated: Boolean = false fun validate(): PhoneNumber = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 5d784e1a..0af61f0d 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 @@ -52,12 +52,14 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualBenefit = apply { - if (!validated) { - body().map { it.validate() } - code() - individualId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + individualId() + validated = true } fun toBuilder() = Builder().from(this) @@ -198,14 +200,16 @@ private constructor( private var validated: Boolean = false fun validate(): Body = apply { - if (!validated) { - annualMaximum() - catchUp() - companyContribution().map { it.validate() } - employeeDeduction().map { it.validate() } - hsaContributionLimit() - validated = true + if (validated) { + return@apply } + + annualMaximum() + catchUp() + companyContribution().ifPresent { it.validate() } + employeeDeduction().ifPresent { it.validate() } + hsaContributionLimit() + validated = true } fun toBuilder() = Builder().from(this) 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 f357d9ca..76b076bf 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 @@ -45,11 +45,13 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualEnrolledIdsResponse = apply { - if (!validated) { - benefitId() - individualIds() - validated = true + if (validated) { + return@apply } + + benefitId() + individualIds() + validated = true } fun toBuilder() = Builder().from(this) 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 2ddad75f..955fa1f4 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -226,10 +228,12 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - individualId() - validated = true + if (validated) { + return@apply } + + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 1bf98637..89791d8e 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 @@ -94,16 +94,18 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualInDirectory = apply { - if (!validated) { - id() - department().map { it.validate() } - firstName() - isActive() - lastName() - manager().map { it.validate() } - middleName() - validated = true + if (validated) { + return@apply } + + id() + department().ifPresent { it.validate() } + firstName() + isActive() + lastName() + manager().ifPresent { it.validate() } + middleName() + validated = true } fun toBuilder() = Builder().from(this) @@ -257,10 +259,12 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -353,10 +357,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) 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 7bf461f2..7c13b2f9 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 @@ -52,12 +52,14 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualResponse = apply { - if (!validated) { - body().map { it.validate() } - code() - individualId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + individualId() + validated = true } fun toBuilder() = Builder().from(this) 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 b70a9897..b408d809 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 @@ -160,22 +160,24 @@ private constructor( private var validated: Boolean = false fun validate(): IndividualUpdateResponse = apply { - if (!validated) { - id() - dob() - emails().map { it.forEach { it.validate() } } - encryptedSsn() - ethnicity() - firstName() - gender() - lastName() - middleName() - phoneNumbers().map { it.forEach { it?.validate() } } - preferredName() - residence().map { it.validate() } - ssn() - validated = true + if (validated) { + return@apply } + + id() + dob() + emails().ifPresent { it.forEach { it.validate() } } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() + phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + preferredName() + residence().ifPresent { it.validate() } + ssn() + validated = true } fun toBuilder() = Builder().from(this) @@ -449,11 +451,13 @@ private constructor( private var validated: Boolean = false fun validate(): Email = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -778,11 +782,13 @@ private constructor( private var validated: Boolean = false fun validate(): PhoneNumber = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 2bc6b92f..6c7fb3d0 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 @@ -239,25 +239,27 @@ private constructor( private var validated: Boolean = false fun validate(): Introspection = apply { - if (!validated) { - accountId() - authenticationMethods().forEach { it.validate() } - clientId() - clientType() - companyId() - connectionId() - connectionStatus().validate() - connectionType() - customerEmail() - customerId() - customerName() - manual() - payrollProviderId() - products() - providerId() - username() - validated = true + if (validated) { + return@apply } + + accountId() + authenticationMethods().forEach { it.validate() } + clientId() + clientType() + companyId() + connectionId() + connectionStatus().validate() + connectionType() + customerEmail() + customerId() + customerName() + manual() + payrollProviderId() + products() + providerId() + username() + validated = true } fun toBuilder() = Builder().from(this) @@ -609,12 +611,14 @@ private constructor( private var validated: Boolean = false fun validate(): AuthenticationMethod = apply { - if (!validated) { - connectionStatus().map { it.validate() } - products() - type() - validated = true + if (validated) { + return@apply } + + connectionStatus().ifPresent { it.validate() } + products() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -734,11 +738,13 @@ private constructor( private var validated: Boolean = false fun validate(): ConnectionStatus = apply { - if (!validated) { - message() - status() - validated = true + if (validated) { + return@apply } + + message() + status() + validated = true } fun toBuilder() = Builder().from(this) @@ -1005,11 +1011,13 @@ private constructor( private var validated: Boolean = false fun validate(): ConnectionStatus = apply { - if (!validated) { - message() - status() - validated = true + if (validated) { + return@apply } + + message() + status() + validated = true } fun toBuilder() = Builder().from(this) 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 b977af66..0f378e5c 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 @@ -340,10 +340,12 @@ constructor( private var validated: Boolean = false fun validate(): DataSyncAll = apply { - if (!validated) { - type() - validated = true + if (validated) { + return@apply } + + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -498,11 +500,13 @@ constructor( private var validated: Boolean = false fun validate(): W4FormEmployeeSync = apply { - if (!validated) { - individualId() - type() - validated = true + if (validated) { + return@apply } + + individualId() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 d6048527..c662caa5 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 @@ -94,8 +94,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun data(): List = data.getNullable("data") ?: listOf() fun paging(): Paging = paging.getRequired("paging") @@ -110,12 +108,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - data().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + data().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 a580d6b8..55f03c4e 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 @@ -97,8 +97,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun data(): List = data.getNullable("data") ?: listOf() fun paging(): Paging = paging.getRequired("paging") @@ -113,12 +111,16 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - data().map { it.validate() } - paging().validate() - validated = true + if (validated) { + return@apply } + + data().map { it.validate() } + paging().validate() + validated = true } fun toBuilder() = Builder().from(this) 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 5edc106c..72e8e56b 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): JobCompletionEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -232,11 +234,13 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - jobId() - jobUrl() - validated = true + if (validated) { + return@apply } + + jobId() + jobUrl() + validated = true } fun toBuilder() = Builder().from(this) 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 9efdd745..53762ca1 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 @@ -67,13 +67,15 @@ private constructor( private var validated: Boolean = false fun validate(): JobCreateResponse = apply { - if (!validated) { - allowedRefreshes() - jobId() - jobUrl() - remainingRefreshes() - validated = true + if (validated) { + return@apply } + + allowedRefreshes() + jobId() + jobUrl() + remainingRefreshes() + validated = true } fun toBuilder() = Builder().from(this) 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 74b7ece0..5fec9b2c 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 @@ -88,17 +88,19 @@ private constructor( private var validated: Boolean = false fun validate(): Location = apply { - if (!validated) { - city() - country() - line1() - line2() - name() - postalCode() - sourceId() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + name() + postalCode() + sourceId() + state() + validated = true } fun toBuilder() = Builder().from(this) 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 0d24f99c..aacdf0d4 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 @@ -53,12 +53,14 @@ private constructor( private var validated: Boolean = false fun validate(): ManualAsyncJob = apply { - if (!validated) { - body() - jobId() - status() - validated = true + if (validated) { + return@apply } + + body() + jobId() + status() + validated = true } fun toBuilder() = Builder().from(this) 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 59202734..a0c09af1 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 @@ -44,11 +44,13 @@ private constructor( private var validated: Boolean = false fun validate(): Money = apply { - if (!validated) { - amount() - currency() - validated = true + if (validated) { + return@apply } + + amount() + currency() + validated = true } fun toBuilder() = Builder().from(this) 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 42e31488..a62484f9 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 @@ -130,13 +130,15 @@ private constructor( private var validated: Boolean = false fun validate(): OperationSupportMatrix = apply { - if (!validated) { - create() - delete() - read() - update() - validated = true + if (validated) { + return@apply } + + create() + delete() + read() + update() + validated = true } fun toBuilder() = Builder().from(this) 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 4ce7f300..eec53ca6 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 @@ -44,11 +44,13 @@ private constructor( private var validated: Boolean = false fun validate(): Paging = apply { - if (!validated) { - count() - offset() - validated = true + if (validated) { + return@apply } + + count() + offset() + validated = true } fun toBuilder() = Builder().from(this) 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 e83fa445..de991a2b 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 @@ -58,12 +58,14 @@ private constructor( private var validated: Boolean = false fun validate(): PayGroupListResponse = apply { - if (!validated) { - id() - name() - payFrequencies() - validated = true + if (validated) { + return@apply } + + id() + name() + payFrequencies() + validated = true } fun toBuilder() = Builder().from(this) 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 830b64c5..84610199 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 @@ -65,13 +65,15 @@ private constructor( private var validated: Boolean = false fun validate(): PayGroupRetrieveResponse = apply { - if (!validated) { - id() - individualIds() - name() - payFrequencies() - validated = true + if (validated) { + return@apply } + + id() + individualIds() + name() + payFrequencies() + validated = true } fun toBuilder() = Builder().from(this) 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 8edc003b..3b6b78df 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 @@ -126,19 +126,21 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatement = apply { - if (!validated) { - earnings().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 + if (validated) { + return@apply } + + earnings().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + employeeDeductions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + employerContributions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + grossPay().ifPresent { it.validate() } + individualId() + netPay().ifPresent { it.validate() } + paymentMethod() + taxes().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + totalHours() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -433,14 +435,16 @@ private constructor( private var validated: Boolean = false fun validate(): Earning = apply { - if (!validated) { - amount() - currency() - hours() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + hours() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -765,14 +769,16 @@ private constructor( private var validated: Boolean = false fun validate(): EmployeeDeduction = apply { - if (!validated) { - amount() - currency() - name() - preTax() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + preTax() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -953,13 +959,15 @@ private constructor( private var validated: Boolean = false fun validate(): EmployerContribution = apply { - if (!validated) { - amount() - currency() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1188,14 +1196,16 @@ private constructor( private var validated: Boolean = false fun validate(): Tax = apply { - if (!validated) { - amount() - currency() - employer() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + employer() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 50bae7d3..4bd724fc 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 @@ -93,14 +93,16 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatementEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -235,11 +237,13 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - individualId() - paymentId() - validated = true + if (validated) { + return@apply } + + individualId() + paymentId() + validated = true } fun toBuilder() = Builder().from(this) 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 6924dc30..a01f729b 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 @@ -49,12 +49,14 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatementResponse = apply { - if (!validated) { - body().map { it.validate() } - code() - paymentId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + paymentId() + validated = true } fun toBuilder() = Builder().from(this) 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 a14b8564..d28332cd 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 @@ -49,11 +49,13 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatementResponseBody = apply { - if (!validated) { - paging().map { it.validate() } - payStatements().map { it.forEach { it.validate() } } - validated = true + if (validated) { + return@apply } + + paging().ifPresent { it.validate() } + payStatements().ifPresent { it.forEach { it.validate() } } + validated = true } fun toBuilder() = Builder().from(this) 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 6a0c1ffb..81013c08 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 @@ -142,21 +142,23 @@ private constructor( private var validated: Boolean = false fun validate(): Payment = apply { - if (!validated) { - id() - companyDebit().map { it.validate() } - debitDate() - employeeTaxes().map { it.validate() } - employerTaxes().map { it.validate() } - grossPay().map { it.validate() } - individualIds() - netPay().map { it.validate() } - payDate() - payFrequencies() - payGroupIds() - payPeriod().map { it.validate() } - validated = true + if (validated) { + return@apply } + + id() + companyDebit().ifPresent { it.validate() } + debitDate() + employeeTaxes().ifPresent { it.validate() } + employerTaxes().ifPresent { it.validate() } + grossPay().ifPresent { it.validate() } + individualIds() + netPay().ifPresent { it.validate() } + payDate() + payFrequencies() + payGroupIds() + payPeriod().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -511,11 +513,13 @@ private constructor( private var validated: Boolean = false fun validate(): PayPeriod = apply { - if (!validated) { - endDate() - startDate() - validated = true + if (validated) { + return@apply } + + endDate() + startDate() + validated = true } fun toBuilder() = Builder().from(this) 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 169ccfe8..ab46011a 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 @@ -47,11 +47,13 @@ private constructor( private var validated: Boolean = false fun validate(): PaymentCreateResponse = apply { - if (!validated) { - payDate() - paymentId() - validated = true + if (validated) { + return@apply } + + payDate() + paymentId() + validated = true } fun toBuilder() = Builder().from(this) 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 6a340eb7..2724e13c 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 @@ -95,14 +95,16 @@ private constructor( private var validated: Boolean = false fun validate(): PaymentEvent = apply { - if (!validated) { - accountId() - companyId() - connectionId() - data().map { it.validate() } - eventType() - validated = true + if (validated) { + return@apply } + + accountId() + companyId() + connectionId() + data().ifPresent { it.validate() } + eventType() + validated = true } fun toBuilder() = Builder().from(this) @@ -234,11 +236,13 @@ private constructor( private var validated: Boolean = false fun validate(): PaymentIdentifiers = apply { - if (!validated) { - payDate() - paymentId() - validated = true + if (validated) { + return@apply } + + payDate() + paymentId() + validated = true } fun toBuilder() = Builder().from(this) 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 5d6d47b4..180eb6a1 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 @@ -82,8 +82,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -93,11 +91,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 a59f56bf..b0def484 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 @@ -85,8 +85,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -96,11 +94,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 3092504d..baf139c6 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 @@ -134,19 +134,21 @@ private constructor( private var validated: Boolean = false fun validate(): Provider = apply { - if (!validated) { - id() - authenticationMethods().map { it.forEach { it.validate() } } - beta() - displayName() - icon() - logo() - manual() - mfaRequired() - primaryColor() - products() - validated = true + if (validated) { + return@apply } + + id() + authenticationMethods().ifPresent { it.forEach { it.validate() } } + beta() + displayName() + icon() + logo() + manual() + mfaRequired() + primaryColor() + products() + validated = true } fun toBuilder() = Builder().from(this) @@ -376,12 +378,14 @@ private constructor( private var validated: Boolean = false fun validate(): AuthenticationMethod = apply { - if (!validated) { - benefitsSupport().map { it.validate() } - supportedFields().map { it.validate() } - type() - validated = true + if (validated) { + return@apply } + + benefitsSupport().ifPresent { it.validate() } + supportedFields().ifPresent { it.validate() } + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -561,16 +565,18 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedFields = apply { - if (!validated) { - company().map { it.validate() } - directory().map { it.validate() } - employment().map { it.validate() } - individual().map { it.validate() } - payGroup().map { it.validate() } - payStatement().map { it.validate() } - payment().map { it.validate() } - validated = true + if (validated) { + return@apply } + + company().ifPresent { it.validate() } + directory().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + individual().ifPresent { it.validate() } + payGroup().ifPresent { it.validate() } + payStatement().ifPresent { it.validate() } + payment().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -780,18 +786,20 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedCompanyFields = apply { - if (!validated) { - id() - accounts().map { it.validate() } - departments().map { it.validate() } - ein() - entity().map { it.validate() } - legalName() - locations().map { it.validate() } - primaryEmail() - primaryPhoneNumber() - validated = true - } + if (validated) { + return@apply + } + + id() + accounts().ifPresent { it.validate() } + departments().ifPresent { it.validate() } + ein() + entity().ifPresent { it.validate() } + legalName() + locations().ifPresent { it.validate() } + primaryEmail() + primaryPhoneNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -980,14 +988,16 @@ private constructor( private var validated: Boolean = false fun validate(): Accounts = apply { - if (!validated) { - accountName() - accountNumber() - accountType() - institutionName() - routingNumber() - validated = true + if (validated) { + return@apply } + + accountName() + accountNumber() + accountType() + institutionName() + routingNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -1135,11 +1145,13 @@ private constructor( private var validated: Boolean = false fun validate(): Departments = apply { - if (!validated) { - name() - parent().map { it.validate() } - validated = true + if (validated) { + return@apply } + + name() + parent().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -1225,10 +1237,12 @@ private constructor( private var validated: Boolean = false fun validate(): Parent = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1347,11 +1361,13 @@ private constructor( private var validated: Boolean = false fun validate(): Entity = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1494,15 +1510,17 @@ private constructor( private var validated: Boolean = false fun validate(): Locations = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -1662,11 +1680,13 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedDirectoryFields = apply { - if (!validated) { - individuals().map { it.validate() } - paging().map { it.validate() } - validated = true + if (validated) { + return@apply } + + individuals().ifPresent { it.validate() } + paging().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -1813,16 +1833,18 @@ private constructor( private var validated: Boolean = false fun validate(): Individuals = apply { - if (!validated) { - id() - department() - firstName() - isActive() - lastName() - manager().map { it.validate() } - middleName() - validated = true + if (validated) { + return@apply } + + id() + department() + firstName() + isActive() + lastName() + manager().ifPresent { it.validate() } + middleName() + validated = true } fun toBuilder() = Builder().from(this) @@ -1952,10 +1974,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) @@ -2074,11 +2098,13 @@ private constructor( private var validated: Boolean = false fun validate(): Paging = apply { - if (!validated) { - count() - offset() - validated = true + if (validated) { + return@apply } + + count() + offset() + validated = true } fun toBuilder() = Builder().from(this) @@ -2352,26 +2378,28 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedEmploymentFields = apply { - if (!validated) { - id() - 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 - } + if (validated) { + return@apply + } + + id() + classCode() + customFields() + department().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + employmentStatus() + endDate() + firstName() + income().ifPresent { it.validate() } + incomeHistory() + isActive() + lastName() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + startDate() + title() + validated = true } fun toBuilder() = Builder().from(this) @@ -2582,10 +2610,12 @@ private constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -2687,11 +2717,13 @@ private constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -2813,12 +2845,14 @@ private constructor( private var validated: Boolean = false fun validate(): Income = apply { - if (!validated) { - amount() - currency() - unit() - validated = true + if (validated) { + return@apply } + + amount() + currency() + unit() + validated = true } fun toBuilder() = Builder().from(this) @@ -2970,15 +3004,17 @@ private constructor( private var validated: Boolean = false fun validate(): Location = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -3110,10 +3146,12 @@ private constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) @@ -3330,22 +3368,24 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedIndividualFields = apply { - if (!validated) { - id() - dob() - emails().map { it.validate() } - encryptedSsn() - ethnicity() - firstName() - gender() - lastName() - middleName() - phoneNumbers().map { it.validate() } - preferredName() - residence().map { it.validate() } - ssn() - validated = true - } + if (validated) { + return@apply + } + + id() + dob() + emails().ifPresent { it.validate() } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() + phoneNumbers().ifPresent { it.validate() } + preferredName() + residence().ifPresent { it.validate() } + ssn() + validated = true } fun toBuilder() = Builder().from(this) @@ -3531,11 +3571,13 @@ private constructor( private var validated: Boolean = false fun validate(): Emails = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -3644,11 +3686,13 @@ private constructor( private var validated: Boolean = false fun validate(): PhoneNumbers = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -3791,15 +3835,17 @@ private constructor( private var validated: Boolean = false fun validate(): Residence = apply { - if (!validated) { - city() - country() - line1() - line2() - postalCode() - state() - validated = true + if (validated) { + return@apply } + + city() + country() + line1() + line2() + postalCode() + state() + validated = true } fun toBuilder() = Builder().from(this) @@ -3976,13 +4022,15 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPayGroupFields = apply { - if (!validated) { - id() - individualIds() - name() - payFrequencies() - validated = true + if (validated) { + return@apply } + + id() + individualIds() + name() + payFrequencies() + validated = true } fun toBuilder() = Builder().from(this) @@ -4114,11 +4162,13 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPayStatementFields = apply { - if (!validated) { - paging().map { it.validate() } - payStatements().map { it.validate() } - validated = true + if (validated) { + return@apply } + + paging().ifPresent { it.validate() } + payStatements().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -4215,11 +4265,13 @@ private constructor( private var validated: Boolean = false fun validate(): Paging = apply { - if (!validated) { - count() - offset() - validated = true + if (validated) { + return@apply } + + count() + offset() + validated = true } fun toBuilder() = Builder().from(this) @@ -4413,19 +4465,21 @@ private constructor( private var validated: Boolean = false fun validate(): PayStatements = apply { - if (!validated) { - earnings().map { it.validate() } - employeeDeductions().map { it.validate() } - employerContributions().map { it.validate() } - grossPay() - individualId() - netPay() - paymentMethod() - taxes().map { it.validate() } - totalHours() - type() - validated = true + if (validated) { + return@apply } + + earnings().ifPresent { it.validate() } + employeeDeductions().ifPresent { it.validate() } + employerContributions().ifPresent { it.validate() } + grossPay() + individualId() + netPay() + paymentMethod() + taxes().ifPresent { it.validate() } + totalHours() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -4616,13 +4670,15 @@ private constructor( private var validated: Boolean = false fun validate(): Earnings = apply { - if (!validated) { - amount() - currency() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -4780,14 +4836,16 @@ private constructor( private var validated: Boolean = false fun validate(): EmployeeDeductions = apply { - if (!validated) { - amount() - currency() - name() - preTax() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + preTax() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -4935,12 +4993,14 @@ private constructor( private var validated: Boolean = false fun validate(): EmployerContributions = apply { - if (!validated) { - amount() - currency() - name() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -5093,14 +5153,16 @@ private constructor( private var validated: Boolean = false fun validate(): Taxes = apply { - if (!validated) { - amount() - currency() - employer() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + employer() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -5370,21 +5432,23 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedPaymentFields = apply { - if (!validated) { - id() - companyDebit() - debitDate() - employeeTaxes() - employerTaxes() - grossPay() - individualIds() - netPay() - payDate() - payFrequencies() - payGroupIds() - payPeriod().map { it.validate() } - validated = true - } + if (validated) { + return@apply + } + + id() + companyDebit() + debitDate() + employeeTaxes() + employerTaxes() + grossPay() + individualIds() + netPay() + payDate() + payFrequencies() + payGroupIds() + payPeriod().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -5572,11 +5636,13 @@ private constructor( private var validated: Boolean = false fun validate(): PayPeriod = apply { - if (!validated) { - endDate() - startDate() - validated = true + if (validated) { + return@apply } + + endDate() + startDate() + validated = true } fun toBuilder() = Builder().from(this) 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 9f4ad152..840d5d6d 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 @@ -77,8 +77,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -88,11 +86,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 607497d1..ec9bcbc6 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 @@ -84,8 +84,6 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - private var validated: Boolean = false - fun items(): List = items.getNullable("items") ?: listOf() @JsonProperty("items") @@ -95,11 +93,15 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties + private var validated: Boolean = false + fun validate(): Response = apply { - if (!validated) { - items().map { it.validate() } - validated = true + if (validated) { + return@apply } + + items().map { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 4e0fb356..ad5e0e4b 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 @@ -167,12 +167,14 @@ constructor( private var validated: Boolean = false fun validate(): RequestForwardingForwardBody = apply { - if (!validated) { - method() - route() - data() - validated = true + if (validated) { + return@apply } + + method() + route() + data() + validated = true } fun toBuilder() = Builder().from(this) 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 8fdf3c20..c61c487b 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 @@ -80,12 +80,14 @@ private constructor( private var validated: Boolean = false fun validate(): RequestForwardingForwardResponse = apply { - if (!validated) { - data() - request().validate() - statusCode() - validated = true + if (validated) { + return@apply } + + data() + request().validate() + statusCode() + validated = true } fun toBuilder() = Builder().from(this) @@ -267,12 +269,14 @@ private constructor( private var validated: Boolean = false fun validate(): Request = apply { - if (!validated) { - data() - method() - route() - validated = true + if (validated) { + return@apply } + + data() + method() + route() + validated = true } fun toBuilder() = Builder().from(this) 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 e1fa5d5c..07f3c130 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 @@ -184,17 +184,19 @@ constructor( private var validated: Boolean = false fun validate(): SandboxCompanyUpdateBody = apply { - if (!validated) { - accounts().map { it.forEach { it.validate() } } - departments().map { it.forEach { it?.validate() } } - ein() - entity().map { it.validate() } - legalName() - locations().map { it.forEach { it?.validate() } } - primaryEmail() - primaryPhoneNumber() - validated = true + if (validated) { + return@apply } + + accounts().ifPresent { it.forEach { it.validate() } } + departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + ein() + entity().ifPresent { it.validate() } + legalName() + locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + primaryEmail() + primaryPhoneNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -723,14 +725,16 @@ constructor( private var validated: Boolean = false fun validate(): Account = apply { - if (!validated) { - accountName() - accountNumber() - accountType() - institutionName() - routingNumber() - validated = true + if (validated) { + return@apply } + + accountName() + accountNumber() + accountType() + institutionName() + routingNumber() + validated = true } fun toBuilder() = Builder().from(this) @@ -969,11 +973,13 @@ constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - parent().map { it.validate() } - validated = true + if (validated) { + return@apply } + + name() + parent().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) @@ -1066,10 +1072,12 @@ constructor( private var validated: Boolean = false fun validate(): Parent = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1192,11 +1200,13 @@ constructor( private var validated: Boolean = false fun validate(): Entity = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 62b1169c..173b9615 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 @@ -127,13 +127,15 @@ constructor( private var validated: Boolean = false fun validate(): SandboxConnectionAccountCreateBody = apply { - if (!validated) { - companyId() - providerId() - authenticationType() - products() - validated = true + if (validated) { + return@apply } + + companyId() + providerId() + authenticationType() + products() + validated = true } fun toBuilder() = Builder().from(this) 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 1e675c2b..e7dc0fc1 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 @@ -70,10 +70,12 @@ constructor( private var validated: Boolean = false fun validate(): SandboxConnectionAccountUpdateBody = apply { - if (!validated) { - connectionStatus() - validated = true + if (validated) { + return@apply } + + connectionStatus() + validated = true } fun toBuilder() = Builder().from(this) 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 0530185d..bf15bea7 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 @@ -134,13 +134,15 @@ constructor( private var validated: Boolean = false fun validate(): SandboxConnectionCreateBody = apply { - if (!validated) { - providerId() - authenticationType() - employeeSize() - products() - validated = true + if (validated) { + return@apply } + + providerId() + authenticationType() + employeeSize() + products() + validated = true } fun toBuilder() = Builder().from(this) 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 c8633465..72e5a6f3 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 @@ -487,36 +487,38 @@ constructor( private var validated: Boolean = false fun validate(): IndividualOrEmployment = apply { - if (!validated) { - classCode() - customFields().map { it.forEach { it.validate() } } - department().map { it.validate() } - dob() - emails().map { it.forEach { it.validate() } } - employment().map { it.validate() } - employmentStatus() - encryptedSsn() - endDate() - ethnicity() - firstName() - gender() - income().map { it.validate() } - incomeHistory().map { it.forEach { it?.validate() } } - isActive() - lastName() - latestRehireDate() - location().map { it.validate() } - manager().map { it.validate() } - middleName() - phoneNumbers().map { it.forEach { it?.validate() } } - preferredName() - residence().map { it.validate() } - sourceId() - ssn() - startDate() - title() - validated = true + if (validated) { + return@apply } + + classCode() + customFields().ifPresent { it.forEach { it.validate() } } + department().ifPresent { it.validate() } + dob() + emails().ifPresent { it.forEach { it.validate() } } + employment().ifPresent { it.validate() } + employmentStatus() + encryptedSsn() + endDate() + ethnicity() + firstName() + gender() + income().ifPresent { it.validate() } + incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + isActive() + lastName() + latestRehireDate() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + preferredName() + residence().ifPresent { it.validate() } + sourceId() + ssn() + startDate() + title() + validated = true } fun toBuilder() = Builder().from(this) @@ -1015,10 +1017,12 @@ constructor( private var validated: Boolean = false fun validate(): CustomField = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1122,10 +1126,12 @@ constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1227,11 +1233,13 @@ constructor( private var validated: Boolean = false fun validate(): Email = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1409,11 +1417,13 @@ constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1925,10 +1935,12 @@ constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) @@ -2026,11 +2038,13 @@ constructor( private var validated: Boolean = false fun validate(): PhoneNumber = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 1b4eda05..2b12efbd 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 @@ -368,27 +368,29 @@ constructor( private var validated: Boolean = false fun validate(): SandboxEmploymentUpdateBody = apply { - if (!validated) { - classCode() - customFields().map { it.forEach { it.validate() } } - department().map { it.validate() } - employment().map { it.validate() } - employmentStatus() - endDate() - firstName() - income().map { it.validate() } - incomeHistory().map { it.forEach { it?.validate() } } - isActive() - lastName() - latestRehireDate() - location().map { it.validate() } - manager().map { it.validate() } - middleName() - sourceId() - startDate() - title() - validated = true + if (validated) { + return@apply } + + classCode() + customFields().ifPresent { it.forEach { it.validate() } } + department().ifPresent { it.validate() } + employment().ifPresent { it.validate() } + employmentStatus() + endDate() + firstName() + income().ifPresent { it.validate() } + incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + isActive() + lastName() + latestRehireDate() + location().ifPresent { it.validate() } + manager().ifPresent { it.validate() } + middleName() + sourceId() + startDate() + title() + validated = true } fun toBuilder() = Builder().from(this) @@ -1092,10 +1094,12 @@ constructor( private var validated: Boolean = false fun validate(): CustomField = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1196,10 +1200,12 @@ constructor( private var validated: Boolean = false fun validate(): Department = apply { - if (!validated) { - name() - validated = true + if (validated) { + return@apply } + + name() + validated = true } fun toBuilder() = Builder().from(this) @@ -1307,11 +1313,13 @@ constructor( private var validated: Boolean = false fun validate(): Employment = apply { - if (!validated) { - subtype() - type() - validated = true + if (validated) { + return@apply } + + subtype() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1654,10 +1662,12 @@ constructor( private var validated: Boolean = false fun validate(): Manager = apply { - if (!validated) { - id() - validated = true + if (validated) { + return@apply } + + id() + validated = true } fun toBuilder() = Builder().from(this) 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 536b4c89..dba02e18 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 @@ -273,21 +273,23 @@ constructor( private var validated: Boolean = false fun validate(): SandboxIndividualUpdateBody = apply { - if (!validated) { - dob() - emails().map { it.forEach { it.validate() } } - encryptedSsn() - ethnicity() - firstName() - gender() - lastName() - middleName() - phoneNumbers().map { it.forEach { it?.validate() } } - preferredName() - residence().map { it.validate() } - ssn() - validated = true + if (validated) { + return@apply } + + dob() + emails().ifPresent { it.forEach { it.validate() } } + encryptedSsn() + ethnicity() + firstName() + gender() + lastName() + middleName() + phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + preferredName() + residence().ifPresent { it.validate() } + ssn() + validated = true } fun toBuilder() = Builder().from(this) @@ -859,11 +861,13 @@ constructor( private var validated: Boolean = false fun validate(): Email = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1188,11 +1192,13 @@ constructor( private var validated: Boolean = false fun validate(): PhoneNumber = apply { - if (!validated) { - data() - type() - validated = true + if (validated) { + return@apply } + + data() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 3a260bdd..ddfed32d 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 @@ -45,11 +45,13 @@ private constructor( private var validated: Boolean = false fun validate(): SandboxJobConfiguration = apply { - if (!validated) { - completionStatus() - type() - validated = true + if (validated) { + return@apply } + + completionStatus() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 0ccd3dcf..26edbfbe 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 @@ -76,11 +76,13 @@ constructor( private var validated: Boolean = false fun validate(): SandboxJobConfigurationUpdateBody = apply { - if (!validated) { - completionStatus() - type() - validated = true + if (validated) { + return@apply } + + completionStatus() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 23c24cf8..619e4bf1 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 @@ -67,10 +67,12 @@ constructor( private var validated: Boolean = false fun validate(): SandboxJobCreateBody = apply { - if (!validated) { - type() - validated = true + if (validated) { + return@apply } + + type() + validated = true } fun toBuilder() = Builder().from(this) 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 3aefbc7b..d77587b6 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 @@ -95,12 +95,14 @@ constructor( private var validated: Boolean = false fun validate(): SandboxPaymentCreateBody = apply { - if (!validated) { - endDate() - payStatements().map { it.forEach { it.validate() } } - startDate() - validated = true + if (validated) { + return@apply } + + endDate() + payStatements().ifPresent { it.forEach { it.validate() } } + startDate() + validated = true } fun toBuilder() = Builder().from(this) @@ -481,19 +483,21 @@ constructor( private var validated: Boolean = false fun validate(): PayStatement = apply { - if (!validated) { - earnings().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 + if (validated) { + return@apply } + + earnings().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + employeeDeductions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + employerContributions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + grossPay().ifPresent { it.validate() } + individualId() + netPay().ifPresent { it.validate() } + paymentMethod() + taxes().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + totalHours() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -794,14 +798,16 @@ constructor( private var validated: Boolean = false fun validate(): Earning = apply { - if (!validated) { - amount() - currency() - hours() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + hours() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1129,14 +1135,16 @@ constructor( private var validated: Boolean = false fun validate(): EmployeeDeduction = apply { - if (!validated) { - amount() - currency() - name() - preTax() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + preTax() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1320,13 +1328,15 @@ constructor( private var validated: Boolean = false fun validate(): EmployerContribution = apply { - if (!validated) { - amount() - currency() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) @@ -1561,14 +1571,16 @@ constructor( private var validated: Boolean = false fun validate(): Tax = apply { - if (!validated) { - amount() - currency() - employer() - name() - type() - validated = true + if (validated) { + return@apply } + + amount() + currency() + employer() + name() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 9a9624c4..95fa86b7 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 @@ -47,11 +47,13 @@ private constructor( private var validated: Boolean = false fun validate(): SessionNewResponse = apply { - if (!validated) { - connectUrl() - sessionId() - validated = true + if (validated) { + return@apply } + + connectUrl() + sessionId() + validated = true } fun toBuilder() = Builder().from(this) 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 0de2251e..9bca88da 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 @@ -47,11 +47,13 @@ private constructor( private var validated: Boolean = false fun validate(): SessionReauthenticateResponse = apply { - if (!validated) { - connectUrl() - sessionId() - validated = true + if (validated) { + return@apply } + + connectUrl() + sessionId() + validated = true } fun toBuilder() = Builder().from(this) 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 48530069..d5fc0289 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 @@ -50,11 +50,13 @@ private constructor( private var validated: Boolean = false fun validate(): SupportPerBenefitType = apply { - if (!validated) { - companyBenefits().map { it.validate() } - individualBenefits().map { it.validate() } - validated = true + if (validated) { + return@apply } + + companyBenefits().ifPresent { it.validate() } + individualBenefits().ifPresent { it.validate() } + validated = true } fun toBuilder() = Builder().from(this) 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 34cf0cd6..693aa6f4 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 @@ -130,17 +130,19 @@ private constructor( private var validated: Boolean = false fun validate(): SupportedBenefit = apply { - if (!validated) { - annualMaximum() - catchUp() - companyContribution() - description() - employeeDeduction() - frequencies() - hsaContributionLimit() - type() - validated = true + if (validated) { + return@apply } + + annualMaximum() + catchUp() + companyContribution() + description() + employeeDeduction() + frequencies() + hsaContributionLimit() + type() + validated = true } fun toBuilder() = Builder().from(this) 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 4902ebb5..da74b292 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 @@ -52,12 +52,14 @@ private constructor( private var validated: Boolean = false fun validate(): UnenrolledIndividual = apply { - if (!validated) { - body().map { it.validate() } - code() - individualId() - validated = true + if (validated) { + return@apply } + + body().ifPresent { it.validate() } + code() + individualId() + validated = true } fun toBuilder() = Builder().from(this) @@ -168,12 +170,14 @@ private constructor( private var validated: Boolean = false fun validate(): Body = apply { - if (!validated) { - finchCode() - message() - name() - validated = true + if (validated) { + return@apply } + + finchCode() + message() + name() + validated = true } fun toBuilder() = Builder().from(this) 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 e6f3e0ad..e27b92d8 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 @@ -36,10 +36,12 @@ private constructor( private var validated: Boolean = false fun validate(): UpdateCompanyBenefitResponse = apply { - if (!validated) { - benefitId() - validated = true + if (validated) { + return@apply } + + benefitId() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt index 6cdb84bf..c824ade0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt @@ -57,12 +57,14 @@ private constructor( private var validated: Boolean = false fun validate(): W42005 = apply { - if (!validated) { - data().map { it.validate() } - type() - year() - validated = true + if (validated) { + return@apply } + + data().ifPresent { it.validate() } + type() + year() + validated = true } fun toBuilder() = Builder().from(this) @@ -216,14 +218,16 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - additionalWithholding() - exemption() - filingStatus() - individualId() - totalNumberOfAllowances() - validated = true + if (validated) { + return@apply } + + additionalWithholding() + exemption() + filingStatus() + individualId() + totalNumberOfAllowances() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt index 7314afca..fc0b0cb4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt @@ -57,12 +57,14 @@ private constructor( private var validated: Boolean = false fun validate(): W42020 = apply { - if (!validated) { - data().map { it.validate() } - type() - year() - validated = true + if (validated) { + return@apply } + + data().ifPresent { it.validate() } + type() + year() + validated = true } fun toBuilder() = Builder().from(this) @@ -259,17 +261,19 @@ private constructor( private var validated: Boolean = false fun validate(): Data = apply { - if (!validated) { - amountForOtherDependents() - amountForQualifyingChildrenUnder17() - deductions() - extraWithholding() - filingStatus() - individualId() - otherIncome() - totalClaimDependentAndOtherCredits() - validated = true + if (validated) { + return@apply } + + amountForOtherDependents() + amountForQualifyingChildrenUnder17() + deductions() + extraWithholding() + filingStatus() + individualId() + otherIncome() + totalClaimDependentAndOtherCredits() + validated = true } fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt index 82ad6b1c..671513fa 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt @@ -32,8 +32,6 @@ private constructor( private val _json: JsonValue? = null, ) { - private var validated: Boolean = false - fun accountUpdateEvent(): Optional = Optional.ofNullable(accountUpdateEvent) fun jobCompletionEvent(): Optional = Optional.ofNullable(jobCompletionEvent) @@ -100,22 +98,49 @@ private constructor( } } + private var validated: Boolean = false + fun validate(): WebhookEvent = apply { - if (!validated) { - if ( - accountUpdateEvent == null && - jobCompletionEvent == null && - companyEvent == null && - directoryEvent == null && - employmentEvent == null && - individualEvent == null && - paymentEvent == null && - payStatementEvent == null - ) { - throw FinchInvalidDataException("Unknown WebhookEvent: $_json") - } - validated = true + if (validated) { + return@apply } + + accept( + object : Visitor { + override fun visitAccountUpdateEvent(accountUpdateEvent: AccountUpdateEvent) { + accountUpdateEvent.validate() + } + + override fun visitJobCompletionEvent(jobCompletionEvent: JobCompletionEvent) { + jobCompletionEvent.validate() + } + + override fun visitCompanyEvent(companyEvent: CompanyEvent) { + companyEvent.validate() + } + + override fun visitDirectoryEvent(directoryEvent: DirectoryEvent) { + directoryEvent.validate() + } + + override fun visitEmploymentEvent(employmentEvent: EmploymentEvent) { + employmentEvent.validate() + } + + override fun visitIndividualEvent(individualEvent: IndividualEvent) { + individualEvent.validate() + } + + override fun visitPaymentEvent(paymentEvent: PaymentEvent) { + paymentEvent.validate() + } + + override fun visitPayStatementEvent(payStatementEvent: PayStatementEvent) { + payStatementEvent.validate() + } + } + ) + validated = true } override fun equals(other: Any?): Boolean { @@ -203,30 +228,38 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): WebhookEvent { val json = JsonValue.fromJsonNode(node) - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(accountUpdateEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(jobCompletionEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(companyEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(directoryEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(employmentEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(individualEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(paymentEvent = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return WebhookEvent(payStatementEvent = it, _json = json) - } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(accountUpdateEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(jobCompletionEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(companyEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(directoryEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(employmentEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(individualEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(paymentEvent = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return WebhookEvent(payStatementEvent = it, _json = json) + } return WebhookEvent(_json = json) } From 595151c73573c47ce6d789431c35f3ad1665eac6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 03:52:12 +0000 Subject: [PATCH 02/34] chore(internal): fix up root `build.gradle.kts` formatting (#396) --- build.gradle.kts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8134b3c5..029c6ae4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,4 @@ -plugins { - -} - allprojects { group = "com.tryfinch.api" version = "3.3.0" // x-release-please-version } - - From c5f656d35f9642c946d18330bec0a453b522f234 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 03:57:23 +0000 Subject: [PATCH 03/34] chore(internal): remove unused Gradle imports (#397) --- buildSrc/src/main/kotlin/finch.java.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/finch.java.gradle.kts b/buildSrc/src/main/kotlin/finch.java.gradle.kts index 32a150ed..a2c35b93 100644 --- a/buildSrc/src/main/kotlin/finch.java.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.java.gradle.kts @@ -1,9 +1,5 @@ import com.diffplug.gradle.spotless.SpotlessExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import com.vanniktech.maven.publish.JavaLibrary -import com.vanniktech.maven.publish.JavadocJar -import com.vanniktech.maven.publish.MavenPublishBaseExtension -import com.vanniktech.maven.publish.SonatypeHost plugins { `java-library` From 5d706bc05046466b2b7a3ee43ec85c21943cb731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 04:05:16 +0000 Subject: [PATCH 04/34] chore(internal): remove unused or unnecessary Gradle imports (#398) --- buildSrc/src/main/kotlin/finch.kotlin.gradle.kts | 1 - buildSrc/src/main/kotlin/finch.publish.gradle.kts | 7 ------- 2 files changed, 8 deletions(-) diff --git a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts index 02304634..bad07eed 100644 --- a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts @@ -1,6 +1,5 @@ import com.diffplug.gradle.spotless.SpotlessExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import com.vanniktech.maven.publish.* plugins { id("finch.java") diff --git a/buildSrc/src/main/kotlin/finch.publish.gradle.kts b/buildSrc/src/main/kotlin/finch.publish.gradle.kts index dd28e5e0..e673bfed 100644 --- a/buildSrc/src/main/kotlin/finch.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.publish.gradle.kts @@ -1,10 +1,3 @@ -import org.gradle.api.publish.PublishingExtension -import org.gradle.api.publish.maven.MavenPublication -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.register -import org.gradle.kotlin.dsl.get -import com.vanniktech.maven.publish.JavaLibrary -import com.vanniktech.maven.publish.JavadocJar import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost From 623b1747a63e47b165e18cf5428faa9c9baa8d98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 04:08:39 +0000 Subject: [PATCH 05/34] chore(internal): update some gradle formatting (#399) --- buildSrc/src/main/kotlin/finch.publish.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/finch.publish.gradle.kts b/buildSrc/src/main/kotlin/finch.publish.gradle.kts index e673bfed..e193185b 100644 --- a/buildSrc/src/main/kotlin/finch.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.publish.gradle.kts @@ -18,7 +18,7 @@ configure { signAllPublications() publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - this.coordinates(project.group.toString(), project.name, project.version.toString()) + coordinates(project.group.toString(), project.name, project.version.toString()) pom { name.set("API Reference") From f0fec86853463134ddda5385e801c568de18487c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 04:19:58 +0000 Subject: [PATCH 06/34] chore(internal): extract a `checkRequired` function (#400) --- .../kotlin/com/tryfinch/api/core/Check.kt | 7 ++++ .../com/tryfinch/api/core/ClientOptions.kt | 2 +- .../api/models/AccessTokenCreateParams.kt | 3 +- .../api/models/AccountCreateResponse.kt | 18 ++++----- .../tryfinch/api/models/AccountUpdateEvent.kt | 15 ++++--- .../api/models/AccountUpdateResponse.kt | 14 +++---- .../tryfinch/api/models/AutomatedAsyncJob.kt | 17 ++++---- .../api/models/AutomatedCreateResponse.kt | 11 +++--- .../tryfinch/api/models/BaseWebhookEvent.kt | 5 ++- .../kotlin/com/tryfinch/api/models/Company.kt | 24 +++++------- .../com/tryfinch/api/models/CompanyBenefit.kt | 9 +++-- .../com/tryfinch/api/models/CompanyEvent.kt | 5 ++- .../api/models/CompanyUpdateResponse.kt | 22 +++++------ .../api/models/ConnectSessionNewParams.kt | 8 ++-- .../ConnectSessionReauthenticateParams.kt | 3 +- .../api/models/ConnectionCreateResponse.kt | 18 ++++----- .../api/models/CreateAccessTokenResponse.kt | 18 ++++----- .../models/CreateCompanyBenefitsResponse.kt | 3 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 5 ++- .../tryfinch/api/models/DisconnectResponse.kt | 6 +-- .../api/models/DocumentListResponse.kt | 6 +-- .../tryfinch/api/models/EmploymentEvent.kt | 5 ++- .../HrisBenefitIndividualEnrolledIdsParams.kt | 3 +- ...fitIndividualRetrieveManyBenefitsParams.kt | 3 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 3 +- .../api/models/HrisBenefitRetrieveParams.kt | 3 +- .../api/models/HrisBenefitUpdateParams.kt | 3 +- .../api/models/HrisDocumentRetreiveParams.kt | 3 +- .../HrisEmploymentRetrieveManyParams.kt | 6 +-- .../HrisPayStatementRetrieveManyParams.kt | 6 +-- .../api/models/HrisPaymentListParams.kt | 5 ++- .../models/IndividualEnrolledIdsResponse.kt | 6 +-- .../tryfinch/api/models/IndividualEvent.kt | 5 ++- .../com/tryfinch/api/models/Introspection.kt | 39 +++++++++---------- .../api/models/JobAutomatedCreateParams.kt | 10 ++--- .../api/models/JobAutomatedRetrieveParams.kt | 3 +- .../tryfinch/api/models/JobCompletionEvent.kt | 9 +++-- .../tryfinch/api/models/JobCreateResponse.kt | 11 +++--- .../api/models/JobManualRetrieveParams.kt | 3 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 8 ++-- .../api/models/PayGroupRetrieveResponse.kt | 11 +++--- .../tryfinch/api/models/PayStatementEvent.kt | 5 ++- .../api/models/PaymentCreateResponse.kt | 5 ++- .../com/tryfinch/api/models/PaymentEvent.kt | 9 +++-- .../models/PayrollPayGroupRetrieveParams.kt | 3 +- .../com/tryfinch/api/models/Provider.kt | 5 ++- .../models/RequestForwardingForwardParams.kt | 5 ++- .../RequestForwardingForwardResponse.kt | 19 ++++----- .../api/models/SandboxCompanyUpdateParams.kt | 22 +++++------ .../SandboxConnectionAccountCreateParams.kt | 5 ++- .../models/SandboxConnectionCreateParams.kt | 3 +- .../models/SandboxDirectoryCreateParams.kt | 3 +- .../models/SandboxEmploymentUpdateParams.kt | 3 +- .../models/SandboxIndividualUpdateParams.kt | 3 +- .../api/models/SandboxJobConfiguration.kt | 5 ++- .../SandboxJobConfigurationUpdateParams.kt | 7 ++-- .../api/models/SandboxJobCreateParams.kt | 3 +- .../tryfinch/api/models/SessionNewResponse.kt | 5 ++- .../models/SessionReauthenticateResponse.kt | 5 ++- .../models/UpdateCompanyBenefitResponse.kt | 3 +- 60 files changed, 248 insertions(+), 234 deletions(-) create mode 100644 finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt new file mode 100644 index 00000000..c9ed2c9e --- /dev/null +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt @@ -0,0 +1,7 @@ +@file:JvmName("Check") + +package com.tryfinch.api.core + +@JvmSynthetic +internal fun checkRequired(name: String, value: T?): T = + checkNotNull(value) { "`$name` is required but was not set" } 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 b397c26c..66c4adbf 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 @@ -189,7 +189,7 @@ private constructor( } fun build(): ClientOptions { - checkNotNull(httpClient) { "`httpClient` is required but was not set" } + checkRequired("httpClient", httpClient) val headers = Headers.builder() val queryParams = QueryParams.builder() 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 5abaf293..27c72ddf 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -179,7 +180,7 @@ constructor( fun build(): AccessTokenCreateBody = AccessTokenCreateBody( - checkNotNull(code) { "`code` is required but was not set" }, + checkRequired("code", code), clientId, clientSecret, redirectUri, 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 d64a3586..efce62dc 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -216,16 +217,13 @@ private constructor( fun build(): AccountCreateResponse = AccountCreateResponse( - checkNotNull(accessToken) { "`accessToken` is required but was not set" }, - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(authenticationType) { - "`authenticationType` is required but was not set" - }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("accessToken", accessToken), + checkRequired("accountId", accountId), + checkRequired("authenticationType", authenticationType), + checkRequired("companyId", companyId), + checkRequired("connectionId", connectionId), + checkRequired("products", products).map { it.toImmutable() }, + checkRequired("providerId", providerId), additionalProperties.toImmutable(), ) } 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 1ceaa994..ce76a63b 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): AccountUpdateEvent = AccountUpdateEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, @@ -297,10 +298,8 @@ private constructor( fun build(): Data = Data( - checkNotNull(authenticationMethod) { - "`authenticationMethod` is required but was not set" - }, - checkNotNull(status) { "`status` is required but was not set" }, + checkRequired("authenticationMethod", authenticationMethod), + checkRequired("status", status), additionalProperties.toImmutable(), ) } @@ -4443,8 +4442,8 @@ private constructor( fun build(): Paging = Paging( - checkNotNull(count) { "`count` is required but was not set" }, - checkNotNull(offset) { "`offset` is required but was not set" }, + checkRequired("count", count), + checkRequired("offset", offset), additionalProperties.toImmutable(), ) } 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 a1dbb439..be41f1f3 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -202,14 +203,11 @@ private constructor( fun build(): AccountUpdateResponse = AccountUpdateResponse( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(authenticationType) { - "`authenticationType` is required but was not set" - }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("authenticationType", authenticationType), + checkRequired("companyId", companyId), + checkRequired("products", products).map { it.toImmutable() }, + checkRequired("providerId", providerId), connectionId, additionalProperties.toImmutable(), ) 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 a59d00b6..cf1a2867 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -273,14 +274,14 @@ private constructor( fun build(): AutomatedAsyncJob = AutomatedAsyncJob( - checkNotNull(completedAt) { "`completedAt` is required but was not set" }, - checkNotNull(createdAt) { "`createdAt` is required but was not set" }, - checkNotNull(jobId) { "`jobId` is required but was not set" }, - checkNotNull(jobUrl) { "`jobUrl` is required but was not set" }, - checkNotNull(scheduledAt) { "`scheduledAt` is required but was not set" }, - checkNotNull(startedAt) { "`startedAt` is required but was not set" }, - checkNotNull(status) { "`status` is required but was not set" }, - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("completedAt", completedAt), + checkRequired("createdAt", createdAt), + checkRequired("jobId", jobId), + checkRequired("jobUrl", jobUrl), + checkRequired("scheduledAt", scheduledAt), + checkRequired("startedAt", startedAt), + checkRequired("status", status), + checkRequired("type", type), additionalProperties.toImmutable(), ) } 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 92229902..293e6c1a 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -153,12 +154,10 @@ private constructor( fun build(): AutomatedCreateResponse = AutomatedCreateResponse( - checkNotNull(allowedRefreshes) { "`allowedRefreshes` is required but was not set" }, - checkNotNull(jobId) { "`jobId` is required but was not set" }, - checkNotNull(jobUrl) { "`jobUrl` is required but was not set" }, - checkNotNull(remainingRefreshes) { - "`remainingRefreshes` is required but was not set" - }, + checkRequired("allowedRefreshes", allowedRefreshes), + checkRequired("jobId", jobId), + checkRequired("jobUrl", jobUrl), + checkRequired("remainingRefreshes", remainingRefreshes), additionalProperties.toImmutable(), ) } 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 56f0ffa0..82b53692 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -157,8 +158,8 @@ private constructor( fun build(): BaseWebhookEvent = BaseWebhookEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, additionalProperties.toImmutable(), ) 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 f24527b1..62c19e2a 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -320,20 +321,15 @@ private constructor( fun build(): Company = Company( - checkNotNull(id) { "`id` is required but was not set" }, - checkNotNull(accounts) { "`accounts` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(departments) { "`departments` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(ein) { "`ein` is required but was not set" }, - checkNotNull(entity) { "`entity` is required but was not set" }, - checkNotNull(legalName) { "`legalName` is required but was not set" }, - checkNotNull(locations) { "`locations` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(primaryEmail) { "`primaryEmail` is required but was not set" }, - checkNotNull(primaryPhoneNumber) { - "`primaryPhoneNumber` is required but was not set" - }, + checkRequired("id", id), + checkRequired("accounts", accounts).map { it.toImmutable() }, + checkRequired("departments", departments).map { it.toImmutable() }, + checkRequired("ein", ein), + checkRequired("entity", entity), + checkRequired("legalName", legalName), + checkRequired("locations", locations).map { it.toImmutable() }, + checkRequired("primaryEmail", primaryEmail), + checkRequired("primaryPhoneNumber", primaryPhoneNumber), additionalProperties.toImmutable(), ) } 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 a24c26fa..381aeb52 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -145,10 +146,10 @@ private constructor( fun build(): CompanyBenefit = CompanyBenefit( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, - checkNotNull(description) { "`description` is required but was not set" }, - checkNotNull(frequency) { "`frequency` is required but was not set" }, - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("benefitId", benefitId), + checkRequired("description", description), + checkRequired("frequency", frequency), + checkRequired("type", type), additionalProperties.toImmutable(), ) } 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 23900709..e2427d65 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -194,8 +195,8 @@ private constructor( fun build(): CompanyEvent = CompanyEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, 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 d2996de6..ad30f63e 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -304,19 +305,14 @@ private constructor( fun build(): CompanyUpdateResponse = CompanyUpdateResponse( - checkNotNull(accounts) { "`accounts` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(departments) { "`departments` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(ein) { "`ein` is required but was not set" }, - checkNotNull(entity) { "`entity` is required but was not set" }, - checkNotNull(legalName) { "`legalName` is required but was not set" }, - checkNotNull(locations) { "`locations` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(primaryEmail) { "`primaryEmail` is required but was not set" }, - checkNotNull(primaryPhoneNumber) { - "`primaryPhoneNumber` is required but was not set" - }, + checkRequired("accounts", accounts).map { it.toImmutable() }, + checkRequired("departments", departments).map { it.toImmutable() }, + checkRequired("ein", ein), + checkRequired("entity", entity), + checkRequired("legalName", legalName), + checkRequired("locations", locations).map { it.toImmutable() }, + checkRequired("primaryEmail", primaryEmail), + checkRequired("primaryPhoneNumber", primaryPhoneNumber), additionalProperties.toImmutable(), ) } 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 4c08293a..78694de4 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -353,10 +354,9 @@ constructor( fun build(): ConnectSessionNewBody = ConnectSessionNewBody( - checkNotNull(customerId) { "`customerId` is required but was not set" }, - checkNotNull(customerName) { "`customerName` is required but was not set" }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, + checkRequired("customerId", customerId), + checkRequired("customerName", customerName), + checkRequired("products", products).map { it.toImmutable() }, customerEmail, integration, manual, 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 d711a92f..0ca21168 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -263,7 +264,7 @@ constructor( fun build(): ConnectSessionReauthenticateBody = ConnectSessionReauthenticateBody( - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, + checkRequired("connectionId", connectionId), minutesToExpire, (products ?: JsonMissing.of()).map { it.toImmutable() }, redirectUri, 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 24db38fe..5388fa64 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -231,16 +232,13 @@ private constructor( fun build(): ConnectionCreateResponse = ConnectionCreateResponse( - checkNotNull(accessToken) { "`accessToken` is required but was not set" }, - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(authenticationType) { - "`authenticationType` is required but was not set" - }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("accessToken", accessToken), + checkRequired("accountId", accountId), + checkRequired("authenticationType", authenticationType), + checkRequired("companyId", companyId), + checkRequired("connectionId", connectionId), + checkRequired("products", products).map { it.toImmutable() }, + checkRequired("providerId", providerId), tokenType, additionalProperties.toImmutable(), ) 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 52cd5ae2..8c56f481 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -327,15 +328,14 @@ private constructor( fun build(): CreateAccessTokenResponse = CreateAccessTokenResponse( - checkNotNull(accessToken) { "`accessToken` is required but was not set" }, - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(clientType) { "`clientType` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, - checkNotNull(connectionType) { "`connectionType` is required but was not set" }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("accessToken", accessToken), + checkRequired("accountId", accountId), + checkRequired("clientType", clientType), + checkRequired("companyId", companyId), + checkRequired("connectionId", connectionId), + checkRequired("connectionType", connectionType), + checkRequired("products", products).map { it.toImmutable() }, + checkRequired("providerId", providerId), customerId, tokenType, additionalProperties.toImmutable(), 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 898117a4..da7490db 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -87,7 +88,7 @@ private constructor( fun build(): CreateCompanyBenefitsResponse = CreateCompanyBenefitsResponse( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", 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 e7f3f0d7..c693180a 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): DirectoryEvent = DirectoryEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, 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 5fc23c15..2ff9bfc4 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -90,10 +91,7 @@ private constructor( } fun build(): DisconnectResponse = - DisconnectResponse( - checkNotNull(status) { "`status` is required but was not set" }, - additionalProperties.toImmutable() - ) + DisconnectResponse(checkRequired("status", status), additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt index 62291a63..4ff140ee 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -118,9 +119,8 @@ private constructor( fun build(): DocumentListResponse = DocumentListResponse( - checkNotNull(documents) { "`documents` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(paging) { "`paging` is required but was not set" }, + checkRequired("documents", documents).map { it.toImmutable() }, + checkRequired("paging", paging), additionalProperties.toImmutable(), ) } 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 c6559f15..6ce4f494 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): EmploymentEvent = EmploymentEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt index 1b2fd5e8..7f09475f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -158,7 +159,7 @@ constructor( fun build(): HrisBenefitIndividualEnrolledIdsParams = HrisBenefitIndividualEnrolledIdsParams( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 c49601d4..75c438f9 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -189,7 +190,7 @@ constructor( fun build(): HrisBenefitIndividualRetrieveManyBenefitsParams = HrisBenefitIndividualRetrieveManyBenefitsParams( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), individualIds, additionalHeaders.build(), additionalQueryParams.build(), 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 07a84050..af928445 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -338,7 +339,7 @@ constructor( fun build(): HrisBenefitIndividualUnenrollManyParams = HrisBenefitIndividualUnenrollManyParams( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), body.build(), additionalHeaders.build(), additionalQueryParams.build(), diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt index d9f46dfa..04fbb7a0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -155,7 +156,7 @@ constructor( fun build(): HrisBenefitRetrieveParams = HrisBenefitRetrieveParams( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 d6faf2b7..6b4f3c67 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -306,7 +307,7 @@ constructor( fun build(): HrisBenefitUpdateParams = HrisBenefitUpdateParams( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), body.build(), additionalHeaders.build(), additionalQueryParams.build(), diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt index 8b4bdc2d..a49db4ef 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -158,7 +159,7 @@ constructor( fun build(): HrisDocumentRetreiveParams = HrisDocumentRetreiveParams( - checkNotNull(documentId) { "`documentId` is required but was not set" }, + checkRequired("documentId", documentId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 b38f3a04..4e03f950 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -141,8 +142,7 @@ constructor( fun build(): HrisEmploymentRetrieveManyBody = HrisEmploymentRetrieveManyBody( - checkNotNull(requests) { "`requests` is required but was not set" } - .map { it.toImmutable() }, + checkRequired("requests", requests).map { it.toImmutable() }, additionalProperties.toImmutable() ) } @@ -420,7 +420,7 @@ constructor( fun build(): Request = Request( - checkNotNull(individualId) { "`individualId` is required but was not set" }, + checkRequired("individualId", 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 4a6cb4e4..eccab1d2 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -145,8 +146,7 @@ constructor( fun build(): HrisPayStatementRetrieveManyBody = HrisPayStatementRetrieveManyBody( - checkNotNull(requests) { "`requests` is required but was not set" } - .map { it.toImmutable() }, + checkRequired("requests", requests).map { it.toImmutable() }, additionalProperties.toImmutable() ) } @@ -440,7 +440,7 @@ constructor( fun build(): Request = Request( - checkNotNull(paymentId) { "`paymentId` is required but was not set" }, + checkRequired("paymentId", paymentId), limit, offset, additionalProperties.toImmutable(), 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 2d372bb9..01635c0c 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.time.LocalDate @@ -167,8 +168,8 @@ constructor( fun build(): HrisPaymentListParams = HrisPaymentListParams( - checkNotNull(endDate) { "`endDate` is required but was not set" }, - checkNotNull(startDate) { "`startDate` is required but was not set" }, + checkRequired("endDate", endDate), + checkRequired("startDate", startDate), additionalHeaders.build(), additionalQueryParams.build(), ) 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 76b076bf..c3839a26 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -118,9 +119,8 @@ private constructor( fun build(): IndividualEnrolledIdsResponse = IndividualEnrolledIdsResponse( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, - checkNotNull(individualIds) { "`individualIds` is required but was not set" } - .map { it.toImmutable() }, + checkRequired("benefitId", benefitId), + checkRequired("individualIds", individualIds).map { it.toImmutable() }, additionalProperties.toImmutable(), ) } 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 955fa1f4..b5ed002c 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): IndividualEvent = IndividualEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, 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 6c7fb3d0..0d895fa3 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -541,28 +542,24 @@ private constructor( fun build(): Introspection = Introspection( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(authenticationMethods) { - "`authenticationMethods` is required but was not set" - } - .map { it.toImmutable() }, - checkNotNull(clientId) { "`clientId` is required but was not set" }, - checkNotNull(clientType) { "`clientType` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(connectionId) { "`connectionId` is required but was not set" }, - checkNotNull(connectionStatus) { "`connectionStatus` is required but was not set" }, - checkNotNull(connectionType) { "`connectionType` is required but was not set" }, - checkNotNull(customerEmail) { "`customerEmail` is required but was not set" }, - checkNotNull(customerId) { "`customerId` is required but was not set" }, - checkNotNull(customerName) { "`customerName` is required but was not set" }, - checkNotNull(manual) { "`manual` is required but was not set" }, - checkNotNull(payrollProviderId) { - "`payrollProviderId` is required but was not set" + checkRequired("accountId", accountId), + checkRequired("authenticationMethods", authenticationMethods).map { + it.toImmutable() }, - checkNotNull(products) { "`products` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, - checkNotNull(username) { "`username` is required but was not set" }, + checkRequired("clientId", clientId), + checkRequired("clientType", clientType), + checkRequired("companyId", companyId), + checkRequired("connectionId", connectionId), + checkRequired("connectionStatus", connectionStatus), + checkRequired("connectionType", connectionType), + checkRequired("customerEmail", customerEmail), + checkRequired("customerId", customerId), + checkRequired("customerName", customerName), + checkRequired("manual", manual), + checkRequired("payrollProviderId", payrollProviderId), + checkRequired("products", products).map { it.toImmutable() }, + checkRequired("providerId", providerId), + checkRequired("username", username), additionalProperties.toImmutable(), ) } 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 0f378e5c..40d37449 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 @@ -21,6 +21,7 @@ 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.checkRequired import com.tryfinch.api.core.getOrThrow import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -392,10 +393,7 @@ constructor( } fun build(): DataSyncAll = - DataSyncAll( - checkNotNull(type) { "`type` is required but was not set" }, - additionalProperties.toImmutable() - ) + DataSyncAll(checkRequired("type", type), additionalProperties.toImmutable()) } class Type @@ -564,8 +562,8 @@ constructor( fun build(): W4FormEmployeeSync = W4FormEmployeeSync( - checkNotNull(individualId) { "`individualId` is required but was not set" }, - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("individualId", individualId), + checkRequired("type", type), additionalProperties.toImmutable(), ) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt index 1291d0a0..f813df98 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -155,7 +156,7 @@ constructor( fun build(): JobAutomatedRetrieveParams = JobAutomatedRetrieveParams( - checkNotNull(jobId) { "`jobId` is required but was not set" }, + checkRequired("jobId", jobId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 72e8e56b..41c67607 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): JobCompletionEvent = JobCompletionEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, @@ -296,8 +297,8 @@ private constructor( fun build(): Data = Data( - checkNotNull(jobId) { "`jobId` is required but was not set" }, - checkNotNull(jobUrl) { "`jobUrl` is required but was not set" }, + checkRequired("jobId", jobId), + checkRequired("jobUrl", jobUrl), additionalProperties.toImmutable(), ) } 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 53762ca1..7504491e 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -153,12 +154,10 @@ private constructor( fun build(): JobCreateResponse = JobCreateResponse( - checkNotNull(allowedRefreshes) { "`allowedRefreshes` is required but was not set" }, - checkNotNull(jobId) { "`jobId` is required but was not set" }, - checkNotNull(jobUrl) { "`jobUrl` is required but was not set" }, - checkNotNull(remainingRefreshes) { - "`remainingRefreshes` is required but was not set" - }, + checkRequired("allowedRefreshes", allowedRefreshes), + checkRequired("jobId", jobId), + checkRequired("jobUrl", jobUrl), + checkRequired("remainingRefreshes", remainingRefreshes), additionalProperties.toImmutable(), ) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt index fdab14f7..55f75456 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -158,7 +159,7 @@ constructor( fun build(): JobManualRetrieveParams = JobManualRetrieveParams( - checkNotNull(jobId) { "`jobId` is required but was not set" }, + checkRequired("jobId", jobId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 aacdf0d4..09fb403b 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -139,10 +140,9 @@ private constructor( fun build(): ManualAsyncJob = ManualAsyncJob( - checkNotNull(body) { "`body` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(jobId) { "`jobId` is required but was not set" }, - checkNotNull(status) { "`status` is required but was not set" }, + checkRequired("body", body).map { it.toImmutable() }, + checkRequired("jobId", jobId), + checkRequired("status", status), additionalProperties.toImmutable(), ) } 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 84610199..b5b3dfeb 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -175,12 +176,10 @@ private constructor( fun build(): PayGroupRetrieveResponse = PayGroupRetrieveResponse( - checkNotNull(id) { "`id` is required but was not set" }, - checkNotNull(individualIds) { "`individualIds` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(name) { "`name` is required but was not set" }, - checkNotNull(payFrequencies) { "`payFrequencies` is required but was not set" } - .map { it.toImmutable() }, + checkRequired("id", id), + checkRequired("individualIds", individualIds).map { it.toImmutable() }, + checkRequired("name", name), + checkRequired("payFrequencies", payFrequencies).map { it.toImmutable() }, additionalProperties.toImmutable(), ) } 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 4bd724fc..c3f914ec 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -192,8 +193,8 @@ private constructor( fun build(): PayStatementEvent = PayStatementEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, 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 ab46011a..d3727c4e 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -109,8 +110,8 @@ private constructor( fun build(): PaymentCreateResponse = PaymentCreateResponse( - checkNotNull(payDate) { "`payDate` is required but was not set" }, - checkNotNull(paymentId) { "`paymentId` is required but was not set" }, + checkRequired("payDate", payDate), + checkRequired("paymentId", paymentId), additionalProperties.toImmutable(), ) } 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 2724e13c..9ad66bb5 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -194,8 +195,8 @@ private constructor( fun build(): PaymentEvent = PaymentEvent( - checkNotNull(accountId) { "`accountId` is required but was not set" }, - checkNotNull(companyId) { "`companyId` is required but was not set" }, + checkRequired("accountId", accountId), + checkRequired("companyId", companyId), connectionId, data, eventType, @@ -298,8 +299,8 @@ private constructor( fun build(): PaymentIdentifiers = PaymentIdentifiers( - checkNotNull(payDate) { "`payDate` is required but was not set" }, - checkNotNull(paymentId) { "`paymentId` is required but was not set" }, + checkRequired("payDate", payDate), + checkRequired("paymentId", paymentId), additionalProperties.toImmutable(), ) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt index b355cb27..4078307d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -155,7 +156,7 @@ constructor( fun build(): PayrollPayGroupRetrieveParams = PayrollPayGroupRetrieveParams( - checkNotNull(payGroupId) { "`payGroupId` is required but was not set" }, + checkRequired("payGroupId", payGroupId), additionalHeaders.build(), additionalQueryParams.build(), ) 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 baf139c6..19d9ece5 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -4327,8 +4328,8 @@ private constructor( fun build(): Paging = Paging( - checkNotNull(count) { "`count` is required but was not set" }, - checkNotNull(offset) { "`offset` is required but was not set" }, + checkRequired("count", count), + checkRequired("offset", offset), additionalProperties.toImmutable(), ) } 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 ad5e0e4b..f2061a30 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -282,8 +283,8 @@ constructor( fun build(): RequestForwardingForwardBody = RequestForwardingForwardBody( - checkNotNull(method) { "`method` is required but was not set" }, - checkNotNull(route) { "`route` is required but was not set" }, + checkRequired("method", method), + checkRequired("route", route), data, headers, params, 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 c61c487b..b3b783c3 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -188,10 +189,10 @@ private constructor( fun build(): RequestForwardingForwardResponse = RequestForwardingForwardResponse( - checkNotNull(data) { "`data` is required but was not set" }, - checkNotNull(headers) { "`headers` is required but was not set" }, - checkNotNull(request) { "`request` is required but was not set" }, - checkNotNull(statusCode) { "`statusCode` is required but was not set" }, + checkRequired("data", data), + checkRequired("headers", headers), + checkRequired("request", request), + checkRequired("statusCode", statusCode), additionalProperties.toImmutable(), ) } @@ -377,11 +378,11 @@ private constructor( fun build(): Request = Request( - checkNotNull(data) { "`data` is required but was not set" }, - checkNotNull(headers) { "`headers` is required but was not set" }, - checkNotNull(method) { "`method` is required but was not set" }, - checkNotNull(params) { "`params` is required but was not set" }, - checkNotNull(route) { "`route` is required but was not set" }, + checkRequired("data", data), + checkRequired("headers", headers), + checkRequired("method", method), + checkRequired("params", params), + checkRequired("route", route), additionalProperties.toImmutable(), ) } 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 07f3c130..2bcc7513 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -378,19 +379,14 @@ constructor( fun build(): SandboxCompanyUpdateBody = SandboxCompanyUpdateBody( - checkNotNull(accounts) { "`accounts` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(departments) { "`departments` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(ein) { "`ein` is required but was not set" }, - checkNotNull(entity) { "`entity` is required but was not set" }, - checkNotNull(legalName) { "`legalName` is required but was not set" }, - checkNotNull(locations) { "`locations` is required but was not set" } - .map { it.toImmutable() }, - checkNotNull(primaryEmail) { "`primaryEmail` is required but was not set" }, - checkNotNull(primaryPhoneNumber) { - "`primaryPhoneNumber` is required but was not set" - }, + checkRequired("accounts", accounts).map { it.toImmutable() }, + checkRequired("departments", departments).map { it.toImmutable() }, + checkRequired("ein", ein), + checkRequired("entity", entity), + checkRequired("legalName", legalName), + checkRequired("locations", locations).map { it.toImmutable() }, + checkRequired("primaryEmail", primaryEmail), + checkRequired("primaryPhoneNumber", primaryPhoneNumber), additionalProperties.toImmutable(), ) } 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 173b9615..72cf592b 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -234,8 +235,8 @@ constructor( fun build(): SandboxConnectionAccountCreateBody = SandboxConnectionAccountCreateBody( - checkNotNull(companyId) { "`companyId` is required but was not set" }, - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("companyId", companyId), + checkRequired("providerId", providerId), authenticationType, (products ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toImmutable(), 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 bf15bea7..65bbd888 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -239,7 +240,7 @@ constructor( fun build(): SandboxConnectionCreateBody = SandboxConnectionCreateBody( - checkNotNull(providerId) { "`providerId` is required but was not set" }, + checkRequired("providerId", providerId), authenticationType, employeeSize, (products ?: JsonMissing.of()).map { it.toImmutable() }, 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 72e5a6f3..7bec20b3 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -179,7 +180,7 @@ constructor( fun build(): SandboxDirectoryCreateParams = SandboxDirectoryCreateParams( - checkNotNull(body) { "`body` is required but was not set" }.toImmutable(), + checkRequired("body", body).toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), ) 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 2b12efbd..5129afb8 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -1062,7 +1063,7 @@ constructor( fun build(): SandboxEmploymentUpdateParams = SandboxEmploymentUpdateParams( - checkNotNull(individualId) { "`individualId` is required but was not set" }, + checkRequired("individualId", individualId), body.build(), additionalHeaders.build(), additionalQueryParams.build(), 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 dba02e18..41638d12 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -827,7 +828,7 @@ constructor( fun build(): SandboxIndividualUpdateParams = SandboxIndividualUpdateParams( - checkNotNull(individualId) { "`individualId` is required but was not set" }, + checkRequired("individualId", individualId), body.build(), additionalHeaders.build(), additionalQueryParams.build(), 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 ddfed32d..0cced1e8 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException @@ -106,8 +107,8 @@ private constructor( fun build(): SandboxJobConfiguration = SandboxJobConfiguration( - checkNotNull(completionStatus) { "`completionStatus` is required but was not set" }, - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("completionStatus", completionStatus), + checkRequired("type", type), additionalProperties.toImmutable(), ) } 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 26edbfbe..26ddf678 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -140,10 +141,8 @@ constructor( fun build(): SandboxJobConfigurationUpdateBody = SandboxJobConfigurationUpdateBody( - checkNotNull(completionStatus) { - "`completionStatus` is required but was not set" - }, - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("completionStatus", completionStatus), + checkRequired("type", type), additionalProperties.toImmutable(), ) } 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 619e4bf1..66371e56 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 @@ -12,6 +12,7 @@ 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.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -120,7 +121,7 @@ constructor( fun build(): SandboxJobCreateBody = SandboxJobCreateBody( - checkNotNull(type) { "`type` is required but was not set" }, + checkRequired("type", type), additionalProperties.toImmutable() ) } 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 95fa86b7..a7219aa5 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -109,8 +110,8 @@ private constructor( fun build(): SessionNewResponse = SessionNewResponse( - checkNotNull(connectUrl) { "`connectUrl` is required but was not set" }, - checkNotNull(sessionId) { "`sessionId` is required but was not set" }, + checkRequired("connectUrl", connectUrl), + checkRequired("sessionId", sessionId), additionalProperties.toImmutable(), ) } 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 9bca88da..6f7d216a 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -109,8 +110,8 @@ private constructor( fun build(): SessionReauthenticateResponse = SessionReauthenticateResponse( - checkNotNull(connectUrl) { "`connectUrl` is required but was not set" }, - checkNotNull(sessionId) { "`sessionId` is required but was not set" }, + checkRequired("connectUrl", connectUrl), + checkRequired("sessionId", sessionId), additionalProperties.toImmutable(), ) } 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 e27b92d8..ac680027 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 @@ -11,6 +11,7 @@ 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.checkRequired import com.tryfinch.api.core.immutableEmptyMap import com.tryfinch.api.core.toImmutable import java.util.Objects @@ -87,7 +88,7 @@ private constructor( fun build(): UpdateCompanyBenefitResponse = UpdateCompanyBenefitResponse( - checkNotNull(benefitId) { "`benefitId` is required but was not set" }, + checkRequired("benefitId", benefitId), additionalProperties.toImmutable() ) } From a08f4ba13b492b408550783c8306668039963250 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:38:47 +0000 Subject: [PATCH 07/34] chore(internal): add and tweak check functions (#401) chore(internal): tweak client options nullability handling --- .../kotlin/com/tryfinch/api/core/Check.kt | 25 ++++++++++++++++++- .../com/tryfinch/api/core/ClientOptions.kt | 6 ++--- .../kotlin/com/tryfinch/api/core/Values.kt | 2 ++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt index c9ed2c9e..3d4c2472 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt @@ -4,4 +4,27 @@ package com.tryfinch.api.core @JvmSynthetic internal fun checkRequired(name: String, value: T?): T = - checkNotNull(value) { "`$name` is required but was not set" } + checkNotNull(value) { "`$name` is required, but was not set" } + +@JvmSynthetic +internal fun checkLength(name: String, value: String, length: Int): String = + value.also { + check(it.length == length) { "`$name` must have length $length, but was ${it.length}" } + } + +@JvmSynthetic +internal fun checkMinLength(name: String, value: String, minLength: Int): String = + value.also { + check(it.length >= minLength) { + if (minLength == 1) "`$name` must be non-empty, but was empty" + else "`$name` must have at least length $minLength, but was ${it.length}" + } + } + +@JvmSynthetic +internal fun checkMaxLength(name: String, value: String, maxLength: Int): String = + value.also { + check(it.length <= maxLength) { + "`$name` must have at most length $maxLength, but was ${it.length}" + } + } 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 66c4adbf..de47ebd5 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 @@ -189,7 +189,7 @@ private constructor( } fun build(): ClientOptions { - checkRequired("httpClient", httpClient) + val httpClient = checkRequired("httpClient", httpClient) val headers = Headers.builder() val queryParams = QueryParams.builder() @@ -220,10 +220,10 @@ private constructor( queryParams.replaceAll(this.queryParams.build()) return ClientOptions( - httpClient!!, + httpClient, PhantomReachableClosingHttpClient( RetryingHttpClient.builder() - .httpClient(httpClient!!) + .httpClient(httpClient) .clock(clock) .maxRetries(maxRetries) .build() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt index d5b5fa8a..16ad91e7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt @@ -117,6 +117,8 @@ sealed class JsonField { is JsonValue -> this } + @JvmSynthetic fun accept(consume: (T) -> Unit) = asKnown().ifPresent(consume) + fun accept(visitor: Visitor): R = when (this) { is KnownValue -> visitor.visitKnown(value) From 4520086fb9d7c43ffec2386fa585e3a56107f7ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 04:55:29 +0000 Subject: [PATCH 08/34] chore: simplify examples involving lists (#402) --- .../api/models/AccountCreateResponseTest.kt | 2 +- .../api/models/AccountUpdateResponseTest.kt | 2 +- .../BenefitFeaturesAndOperationsTest.kt | 42 +- .../api/models/BenefitsSupportTest.kt | 648 ++--- .../com/tryfinch/api/models/CompanyTest.kt | 54 +- .../api/models/CompanyUpdateResponseTest.kt | 60 +- .../api/models/ConnectSessionNewParamsTest.kt | 6 +- .../ConnectSessionReauthenticateParamsTest.kt | 4 +- .../models/ConnectionCreateResponseTest.kt | 2 +- .../models/CreateAccessTokenResponseTest.kt | 2 +- .../api/models/DocumentListResponseTest.kt | 18 +- .../api/models/EmploymentDataResponseTest.kt | 56 +- .../tryfinch/api/models/EmploymentDataTest.kt | 28 +- .../models/EmploymentUpdateResponseTest.kt | 28 +- ...BenefitIndividualUnenrollManyParamsTest.kt | 4 +- .../api/models/HrisDocumentListParamsTest.kt | 8 +- .../HrisEmploymentRetrieveManyParamsTest.kt | 30 +- .../HrisIndividualRetrieveManyParamsTest.kt | 28 +- .../HrisPayStatementRetrieveManyParamsTest.kt | 36 +- .../IndividualEnrolledIdsResponseTest.kt | 2 +- .../api/models/IndividualResponseTest.kt | 48 +- .../com/tryfinch/api/models/IndividualTest.kt | 21 +- .../models/IndividualUpdateResponseTest.kt | 24 +- .../tryfinch/api/models/IntrospectionTest.kt | 28 +- .../tryfinch/api/models/ManualAsyncJobTest.kt | 2 +- .../api/models/PayGroupListResponseTest.kt | 2 +- .../models/PayGroupRetrieveResponseTest.kt | 4 +- .../models/PayStatementResponseBodyTest.kt | 136 +- .../api/models/PayStatementResponseTest.kt | 194 +- .../tryfinch/api/models/PayStatementTest.kt | 70 +- .../com/tryfinch/api/models/PaymentTest.kt | 6 +- .../models/PayrollPayGroupListParamsTest.kt | 4 +- .../com/tryfinch/api/models/ProviderTest.kt | 2316 ++++++++--------- .../models/SandboxCompanyUpdateParamsTest.kt | 128 +- ...andboxConnectionAccountCreateParamsTest.kt | 4 +- .../SandboxConnectionCreateParamsTest.kt | 4 +- .../SandboxDirectoryCreateParamsTest.kt | 411 ++- .../SandboxEmploymentUpdateParamsTest.kt | 56 +- .../SandboxIndividualUpdateParamsTest.kt | 48 +- .../models/SandboxPaymentCreateParamsTest.kt | 277 +- .../api/models/SupportedBenefitTest.kt | 8 +- .../api/services/ErrorHandlingTest.kt | 54 +- .../api/services/ServiceParamsTest.kt | 24 +- .../blocking/connect/SessionServiceTest.kt | 4 +- .../blocking/hris/DocumentServiceTest.kt | 4 +- .../blocking/hris/EmploymentServiceTest.kt | 10 +- .../blocking/hris/PayStatementServiceTest.kt | 10 +- .../blocking/sandbox/CompanyServiceTest.kt | 64 +- .../blocking/sandbox/ConnectionServiceTest.kt | 2 +- .../blocking/sandbox/DirectoryServiceTest.kt | 255 +- .../blocking/sandbox/EmploymentServiceTest.kt | 28 +- .../blocking/sandbox/IndividualServiceTest.kt | 24 +- .../blocking/sandbox/PaymentServiceTest.kt | 111 +- .../sandbox/connections/AccountServiceTest.kt | 2 +- 54 files changed, 2366 insertions(+), 3077 deletions(-) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountCreateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountCreateResponseTest.kt index e650a68d..77ad0cd6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountCreateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountCreateResponseTest.kt @@ -16,7 +16,7 @@ class AccountCreateResponseTest { .authenticationType(AccountCreateResponse.AuthenticationType.CREDENTIAL) .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .connectionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .products(listOf("string")) + .addProduct("string") .providerId("provider_id") .build() assertThat(accountCreateResponse).isNotNull diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountUpdateResponseTest.kt index 69375e43..822eb797 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountUpdateResponseTest.kt @@ -14,7 +14,7 @@ class AccountUpdateResponseTest { .accountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .authenticationType(AccountUpdateResponse.AuthenticationType.CREDENTIAL) .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .products(listOf("string")) + .addProduct("string") .providerId("provider_id") .connectionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperationsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperationsTest.kt index 5e6dbb7f..c9ceed88 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperationsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperationsTest.kt @@ -15,24 +15,17 @@ class BenefitFeaturesAndOperationsTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution.FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -63,21 +56,16 @@ class BenefitFeaturesAndOperationsTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution.FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution.FIXED ) .description("description") - .employeeDeduction( - listOf(BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit.INDIVIDUAL ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitsSupportTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitsSupportTest.kt index c9651d4f..1d3cc3cb 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitsSupportTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/BenefitsSupportTest.kt @@ -17,28 +17,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -70,28 +61,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -123,28 +105,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -176,28 +149,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -229,28 +193,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -282,28 +237,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -335,28 +281,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -388,28 +325,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -441,28 +369,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -494,28 +413,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -547,28 +457,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -600,28 +501,19 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -656,25 +548,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -707,25 +592,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -758,25 +636,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -809,25 +680,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -860,25 +724,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -911,25 +768,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -962,25 +812,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1013,25 +856,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1064,25 +900,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1115,25 +944,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1166,25 +988,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1217,25 +1032,18 @@ class BenefitsSupportTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature.CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature.EmployeeDeduction.FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature.HsaContributionLimit + .INDIVIDUAL ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyTest.kt index cde80a41..4ca6ddb3 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyTest.kt @@ -12,24 +12,20 @@ class CompanyTest { val company = Company.builder() .id("id") - .accounts( - listOf( - Company.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType(Company.Account.AccountType.CHECKING) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + Company.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(Company.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - Company.Department.builder() - .name("name") - .parent(Company.Department.Parent.builder().name("name").build()) - .build() - ) + .addDepartment( + Company.Department.builder() + .name("name") + .parent(Company.Department.Parent.builder().name("name").build()) + .build() ) .ein("ein") .entity( @@ -39,19 +35,17 @@ class CompanyTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyUpdateResponseTest.kt index 832816a2..c08e1171 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CompanyUpdateResponseTest.kt @@ -11,28 +11,22 @@ class CompanyUpdateResponseTest { fun createCompanyUpdateResponse() { val companyUpdateResponse = CompanyUpdateResponse.builder() - .accounts( - listOf( - CompanyUpdateResponse.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType(CompanyUpdateResponse.Account.AccountType.CHECKING) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + CompanyUpdateResponse.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(CompanyUpdateResponse.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - CompanyUpdateResponse.Department.builder() - .name("name") - .parent( - CompanyUpdateResponse.Department.Parent.builder() - .name("name") - .build() - ) - .build() - ) + .addDepartment( + CompanyUpdateResponse.Department.builder() + .name("name") + .parent( + CompanyUpdateResponse.Department.Parent.builder().name("name").build() + ) + .build() ) .ein("ein") .entity( @@ -42,19 +36,17 @@ class CompanyUpdateResponseTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") 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 0710ca50..f6ff3d0b 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 @@ -12,7 +12,7 @@ class ConnectSessionNewParamsTest { ConnectSessionNewParams.builder() .customerId("x") .customerName("x") - .products(listOf(ConnectSessionNewParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .customerEmail("dev@stainlessapi.com") .integration( ConnectSessionNewParams.Integration.builder() @@ -33,7 +33,7 @@ class ConnectSessionNewParamsTest { ConnectSessionNewParams.builder() .customerId("x") .customerName("x") - .products(listOf(ConnectSessionNewParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .customerEmail("dev@stainlessapi.com") .integration( ConnectSessionNewParams.Integration.builder() @@ -72,7 +72,7 @@ class ConnectSessionNewParamsTest { ConnectSessionNewParams.builder() .customerId("x") .customerName("x") - .products(listOf(ConnectSessionNewParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .build() val body = params.getBody() assertThat(body).isNotNull 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 8bcdce50..3bd60865 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 @@ -12,7 +12,7 @@ class ConnectSessionReauthenticateParamsTest { ConnectSessionReauthenticateParams.builder() .connectionId("connection_id") .minutesToExpire(0L) - .products(listOf(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY) .redirectUri("https://example.com") .build() } @@ -23,7 +23,7 @@ class ConnectSessionReauthenticateParamsTest { ConnectSessionReauthenticateParams.builder() .connectionId("connection_id") .minutesToExpire(0L) - .products(listOf(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY) .redirectUri("https://example.com") .build() val body = params.getBody() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt index 887d1fc3..742816d8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt @@ -16,7 +16,7 @@ class ConnectionCreateResponseTest { .authenticationType(ConnectionCreateResponse.AuthenticationType.CREDENTIAL) .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .connectionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .products(listOf("string")) + .addProduct("string") .providerId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .tokenType("token_type") .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt index 6ad1c497..86c7535f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt @@ -17,7 +17,7 @@ class CreateAccessTokenResponseTest { .companyId("company_id") .connectionId("connection_id") .connectionType(CreateAccessTokenResponse.ConnectionType.PROVIDER) - .products(listOf("string")) + .addProduct("string") .providerId("provider_id") .customerId("customer_id") .tokenType("token_type") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/DocumentListResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/DocumentListResponseTest.kt index 2804ce70..ace92517 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/DocumentListResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/DocumentListResponseTest.kt @@ -11,16 +11,14 @@ class DocumentListResponseTest { fun createDocumentListResponse() { val documentListResponse = DocumentListResponse.builder() - .documents( - listOf( - DocumentResponse.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .individualId("individual_id") - .type(DocumentResponse.Type.W4_2020) - .url("https://example.com") - .year(0.0) - .build() - ) + .addDocument( + DocumentResponse.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .individualId("individual_id") + .type(DocumentResponse.Type.W4_2020) + .url("https://example.com") + .year(0.0) + .build() ) .paging(Paging.builder().count(0L).offset(0L).build()) .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt index b09c2cae..e35bbacf 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt @@ -16,13 +16,11 @@ class EmploymentDataResponseTest { EmploymentData.builder() .id("id") .classCode("class_code") - .customFields( - listOf( - EmploymentData.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + EmploymentData.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(EmploymentData.Department.builder().name("name").build()) .employment( @@ -42,15 +40,13 @@ class EmploymentDataResponseTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") @@ -84,13 +80,11 @@ class EmploymentDataResponseTest { EmploymentData.builder() .id("id") .classCode("class_code") - .customFields( - listOf( - EmploymentData.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + EmploymentData.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(EmploymentData.Department.builder().name("name").build()) .employment( @@ -110,15 +104,13 @@ class EmploymentDataResponseTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt index e941eb13..2eea0b0b 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt @@ -14,13 +14,11 @@ class EmploymentDataTest { EmploymentData.builder() .id("id") .classCode("class_code") - .customFields( - listOf( - EmploymentData.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + EmploymentData.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(EmploymentData.Department.builder().name("name").build()) .employment( @@ -40,15 +38,13 @@ class EmploymentDataTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt index 0c0a48d3..282c47ae 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt @@ -14,13 +14,11 @@ class EmploymentUpdateResponseTest { EmploymentUpdateResponse.builder() .id("id") .classCode("class_code") - .customFields( - listOf( - EmploymentUpdateResponse.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + EmploymentUpdateResponse.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(EmploymentUpdateResponse.Department.builder().name("name").build()) .employment( @@ -40,15 +38,13 @@ class EmploymentUpdateResponseTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") 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 74ebc36e..855cb1af 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 @@ -11,7 +11,7 @@ class HrisBenefitIndividualUnenrollManyParamsTest { fun createHrisBenefitIndividualUnenrollManyParams() { HrisBenefitIndividualUnenrollManyParams.builder() .benefitId("benefit_id") - .individualIds(listOf("string")) + .addIndividualId("string") .build() } @@ -20,7 +20,7 @@ class HrisBenefitIndividualUnenrollManyParamsTest { val params = HrisBenefitIndividualUnenrollManyParams.builder() .benefitId("benefit_id") - .individualIds(listOf("string")) + .addIndividualId("string") .build() val body = params.getBody() assertThat(body).isNotNull diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt index 5c413161..c620c19c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt @@ -11,10 +11,10 @@ class HrisDocumentListParamsTest { @Test fun createHrisDocumentListParams() { HrisDocumentListParams.builder() - .individualIds(listOf("string")) + .addIndividualId("string") .limit(0L) .offset(0L) - .types(listOf(HrisDocumentListParams.Type.W4_2020)) + .addType(HrisDocumentListParams.Type.W4_2020) .build() } @@ -22,10 +22,10 @@ class HrisDocumentListParamsTest { fun getQueryParams() { val params = HrisDocumentListParams.builder() - .individualIds(listOf("string")) + .addIndividualId("string") .limit(0L) .offset(0L) - .types(listOf(HrisDocumentListParams.Type.W4_2020)) + .addType(HrisDocumentListParams.Type.W4_2020) .build() val expected = QueryParams.builder() expected.put("individual_ids[]", "string") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt index f601384d..51003d77 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt @@ -10,12 +10,10 @@ class HrisEmploymentRetrieveManyParamsTest { @Test fun createHrisEmploymentRetrieveManyParams() { HrisEmploymentRetrieveManyParams.builder() - .requests( - listOf( - HrisEmploymentRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisEmploymentRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() } @@ -24,12 +22,10 @@ class HrisEmploymentRetrieveManyParamsTest { fun getBody() { val params = HrisEmploymentRetrieveManyParams.builder() - .requests( - listOf( - HrisEmploymentRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisEmploymentRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() val body = params.getBody() @@ -48,12 +44,10 @@ class HrisEmploymentRetrieveManyParamsTest { fun getBodyWithoutOptionalFields() { val params = HrisEmploymentRetrieveManyParams.builder() - .requests( - listOf( - HrisEmploymentRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisEmploymentRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() val body = params.getBody() 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 6cb7fdac..03e798a0 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 @@ -11,14 +11,12 @@ class HrisIndividualRetrieveManyParamsTest { fun createHrisIndividualRetrieveManyParams() { HrisIndividualRetrieveManyParams.builder() .options( - HrisIndividualRetrieveManyParams.Options.builder().include(listOf("string")).build() + HrisIndividualRetrieveManyParams.Options.builder().addInclude("string").build() ) - .requests( - listOf( - HrisIndividualRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisIndividualRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() } @@ -28,23 +26,19 @@ class HrisIndividualRetrieveManyParamsTest { val params = HrisIndividualRetrieveManyParams.builder() .options( - HrisIndividualRetrieveManyParams.Options.builder() - .include(listOf("string")) - .build() + HrisIndividualRetrieveManyParams.Options.builder().addInclude("string").build() ) - .requests( - listOf( - HrisIndividualRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisIndividualRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.options()) .contains( - HrisIndividualRetrieveManyParams.Options.builder().include(listOf("string")).build() + HrisIndividualRetrieveManyParams.Options.builder().addInclude("string").build() ) assertThat(body.requests()) .contains( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt index af667e5b..2c9c7b1b 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt @@ -10,14 +10,12 @@ class HrisPayStatementRetrieveManyParamsTest { @Test fun createHrisPayStatementRetrieveManyParams() { HrisPayStatementRetrieveManyParams.builder() - .requests( - listOf( - HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("string") - .limit(50L) - .offset(0L) - .build() - ) + .addRequest( + HrisPayStatementRetrieveManyParams.Request.builder() + .paymentId("string") + .limit(50L) + .offset(0L) + .build() ) .build() } @@ -26,14 +24,12 @@ class HrisPayStatementRetrieveManyParamsTest { fun getBody() { val params = HrisPayStatementRetrieveManyParams.builder() - .requests( - listOf( - HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("string") - .limit(50L) - .offset(0L) - .build() - ) + .addRequest( + HrisPayStatementRetrieveManyParams.Request.builder() + .paymentId("string") + .limit(50L) + .offset(0L) + .build() ) .build() val body = params.getBody() @@ -54,12 +50,8 @@ class HrisPayStatementRetrieveManyParamsTest { fun getBodyWithoutOptionalFields() { val params = HrisPayStatementRetrieveManyParams.builder() - .requests( - listOf( - HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("string") - .build() - ) + .addRequest( + HrisPayStatementRetrieveManyParams.Request.builder().paymentId("string").build() ) .build() val body = params.getBody() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponseTest.kt index 0f9fd0d1..02aedfcf 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualEnrolledIdsResponseTest.kt @@ -12,7 +12,7 @@ class IndividualEnrolledIdsResponseTest { val individualEnrolledIdsResponse = IndividualEnrolledIdsResponse.builder() .benefitId("benefit_id") - .individualIds(listOf("string")) + .addIndividualId("string") .build() assertThat(individualEnrolledIdsResponse).isNotNull assertThat(individualEnrolledIdsResponse.benefitId()).isEqualTo("benefit_id") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt index e8514a24..a2663ff8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt @@ -15,13 +15,11 @@ class IndividualResponseTest { Individual.builder() .id("id") .dob("dob") - .emails( - listOf( - Individual.Email.builder() - .data("data") - .type(Individual.Email.Type.WORK) - .build() - ) + .addEmail( + Individual.Email.builder() + .data("data") + .type(Individual.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(Individual.Ethnicity.ASIAN) @@ -29,13 +27,11 @@ class IndividualResponseTest { .gender(Individual.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - Individual.PhoneNumber.builder() - .data("data") - .type(Individual.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + Individual.PhoneNumber.builder() + .data("data") + .type(Individual.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( @@ -62,13 +58,11 @@ class IndividualResponseTest { Individual.builder() .id("id") .dob("dob") - .emails( - listOf( - Individual.Email.builder() - .data("data") - .type(Individual.Email.Type.WORK) - .build() - ) + .addEmail( + Individual.Email.builder() + .data("data") + .type(Individual.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(Individual.Ethnicity.ASIAN) @@ -76,13 +70,11 @@ class IndividualResponseTest { .gender(Individual.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - Individual.PhoneNumber.builder() - .data("data") - .type(Individual.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + Individual.PhoneNumber.builder() + .data("data") + .type(Individual.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt index 0dae2405..80107aeb 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt @@ -13,13 +13,8 @@ class IndividualTest { Individual.builder() .id("id") .dob("dob") - .emails( - listOf( - Individual.Email.builder() - .data("data") - .type(Individual.Email.Type.WORK) - .build() - ) + .addEmail( + Individual.Email.builder().data("data").type(Individual.Email.Type.WORK).build() ) .encryptedSsn("encrypted_ssn") .ethnicity(Individual.Ethnicity.ASIAN) @@ -27,13 +22,11 @@ class IndividualTest { .gender(Individual.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - Individual.PhoneNumber.builder() - .data("data") - .type(Individual.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + Individual.PhoneNumber.builder() + .data("data") + .type(Individual.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt index 3527cf91..20525b44 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt @@ -13,13 +13,11 @@ class IndividualUpdateResponseTest { IndividualUpdateResponse.builder() .id("id") .dob("dob") - .emails( - listOf( - IndividualUpdateResponse.Email.builder() - .data("data") - .type(IndividualUpdateResponse.Email.Type.WORK) - .build() - ) + .addEmail( + IndividualUpdateResponse.Email.builder() + .data("data") + .type(IndividualUpdateResponse.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(IndividualUpdateResponse.Ethnicity.ASIAN) @@ -27,13 +25,11 @@ class IndividualUpdateResponseTest { .gender(IndividualUpdateResponse.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - IndividualUpdateResponse.PhoneNumber.builder() - .data("data") - .type(IndividualUpdateResponse.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + IndividualUpdateResponse.PhoneNumber.builder() + .data("data") + .type(IndividualUpdateResponse.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IntrospectionTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IntrospectionTest.kt index 94d1b0fd..573f19a4 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IntrospectionTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IntrospectionTest.kt @@ -12,19 +12,17 @@ class IntrospectionTest { val introspection = Introspection.builder() .accountId("account_id") - .authenticationMethods( - listOf( - Introspection.AuthenticationMethod.builder() - .connectionStatus( - Introspection.AuthenticationMethod.ConnectionStatus.builder() - .message("message") - .status(ConnectionStatusType.PENDING) - .build() - ) - .products(listOf("string")) - .type(Introspection.AuthenticationMethod.Type.ASSISTED) - .build() - ) + .addAuthenticationMethod( + Introspection.AuthenticationMethod.builder() + .connectionStatus( + Introspection.AuthenticationMethod.ConnectionStatus.builder() + .message("message") + .status(ConnectionStatusType.PENDING) + .build() + ) + .addProduct("string") + .type(Introspection.AuthenticationMethod.Type.ASSISTED) + .build() ) .clientId("client_id") .clientType(Introspection.ClientType.PRODUCTION) @@ -42,7 +40,7 @@ class IntrospectionTest { .customerName("customer_name") .manual(true) .payrollProviderId("payroll_provider_id") - .products(listOf("string")) + .addProduct("string") .providerId("provider_id") .username("username") .build() @@ -57,7 +55,7 @@ class IntrospectionTest { .status(ConnectionStatusType.PENDING) .build() ) - .products(listOf("string")) + .addProduct("string") .type(Introspection.AuthenticationMethod.Type.ASSISTED) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ManualAsyncJobTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ManualAsyncJobTest.kt index 65c05386..198d409a 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ManualAsyncJobTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ManualAsyncJobTest.kt @@ -12,7 +12,7 @@ class ManualAsyncJobTest { fun createManualAsyncJob() { val manualAsyncJob = ManualAsyncJob.builder() - .body(listOf(JsonValue.from(mapOf()))) + .addBody(JsonValue.from(mapOf())) .jobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ManualAsyncJob.Status.PENDING) .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupListResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupListResponseTest.kt index 3a826480..f3c2561b 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupListResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupListResponseTest.kt @@ -13,7 +13,7 @@ class PayGroupListResponseTest { PayGroupListResponse.builder() .id("id") .name("name") - .payFrequencies(listOf(PayGroupListResponse.PayFrequency.ANNUALLY)) + .addPayFrequency(PayGroupListResponse.PayFrequency.ANNUALLY) .build() assertThat(payGroupListResponse).isNotNull assertThat(payGroupListResponse.id()).contains("id") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponseTest.kt index 60e9aed7..21f2f7c9 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponseTest.kt @@ -12,9 +12,9 @@ class PayGroupRetrieveResponseTest { val payGroupRetrieveResponse = PayGroupRetrieveResponse.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .individualIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .addIndividualId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("name") - .payFrequencies(listOf(PayGroupRetrieveResponse.PayFrequency.ANNUALLY)) + .addPayFrequency(PayGroupRetrieveResponse.PayFrequency.ANNUALLY) .build() assertThat(payGroupRetrieveResponse).isNotNull assertThat(payGroupRetrieveResponse.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseBodyTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseBodyTest.kt index e4f2f3f5..f6bfeaa6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseBodyTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseBodyTest.kt @@ -12,70 +12,9 @@ class PayStatementResponseBodyTest { val payStatementResponseBody = PayStatementResponseBody.builder() .paging(Paging.builder().count(0L).offset(0L).build()) - .payStatements( - listOf( - PayStatement.builder() - .earnings( - listOf( - PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type(PayStatement.Earning.Type.SALARY) - .build() - ) - ) - .employeeDeductions( - listOf( - PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") - .preTax(true) - .type(BenefitType._401K) - .build() - ) - ) - .employerContributions( - listOf( - PayStatement.EmployerContribution.builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) - ) - .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") - .netPay(Money.builder().amount(0L).currency("currency").build()) - .paymentMethod(PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(PayStatement.Tax.Type.STATE) - .build() - ) - ) - .totalHours(0.0) - .type(PayStatement.Type.REGULAR_PAYROLL) - .build() - ) - ) - .build() - assertThat(payStatementResponseBody).isNotNull - assertThat(payStatementResponseBody.paging()) - .contains(Paging.builder().count(0L).offset(0L).build()) - assertThat(payStatementResponseBody.payStatements().get()) - .containsExactly( - PayStatement.builder() - .earnings( - listOf( + .addPayStatement( + PayStatement.builder() + .addEarning( PayStatement.Earning.builder() .amount(0L) .currency("currency") @@ -84,9 +23,7 @@ class PayStatementResponseBodyTest { .type(PayStatement.Earning.Type.SALARY) .build() ) - ) - .employeeDeductions( - listOf( + .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) .currency("currency") @@ -95,9 +32,7 @@ class PayStatementResponseBodyTest { .type(BenefitType._401K) .build() ) - ) - .employerContributions( - listOf( + .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) .currency("currency") @@ -105,13 +40,11 @@ class PayStatementResponseBodyTest { .type(BenefitType._401K) .build() ) - ) - .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") - .netPay(Money.builder().amount(0L).currency("currency").build()) - .paymentMethod(PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( + .grossPay(Money.builder().amount(0L).currency("currency").build()) + .individualId("individual_id") + .netPay(Money.builder().amount(0L).currency("currency").build()) + .paymentMethod(PayStatement.PaymentMethod.CHECK) + .addTax( PayStatement.Tax.builder() .amount(0L) .currency("currency") @@ -120,6 +53,55 @@ class PayStatementResponseBodyTest { .type(PayStatement.Tax.Type.STATE) .build() ) + .totalHours(0.0) + .type(PayStatement.Type.REGULAR_PAYROLL) + .build() + ) + .build() + assertThat(payStatementResponseBody).isNotNull + assertThat(payStatementResponseBody.paging()) + .contains(Paging.builder().count(0L).offset(0L).build()) + assertThat(payStatementResponseBody.payStatements().get()) + .containsExactly( + PayStatement.builder() + .addEarning( + PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(PayStatement.Earning.Type.SALARY) + .build() + ) + .addEmployeeDeduction( + PayStatement.EmployeeDeduction.builder() + .amount(0L) + .currency("currency") + .name("name") + .preTax(true) + .type(BenefitType._401K) + .build() + ) + .addEmployerContribution( + PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() + ) + .grossPay(Money.builder().amount(0L).currency("currency").build()) + .individualId("individual_id") + .netPay(Money.builder().amount(0L).currency("currency").build()) + .paymentMethod(PayStatement.PaymentMethod.CHECK) + .addTax( + PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(PayStatement.Tax.Type.STATE) + .build() ) .totalHours(0.0) .type(PayStatement.Type.REGULAR_PAYROLL) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseTest.kt index d86ad139..6b944e36 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementResponseTest.kt @@ -14,127 +14,105 @@ class PayStatementResponseTest { .body( PayStatementResponseBody.builder() .paging(Paging.builder().count(0L).offset(0L).build()) - .payStatements( - listOf( - PayStatement.builder() - .earnings( - listOf( - PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type(PayStatement.Earning.Type.SALARY) - .build() - ) - ) - .employeeDeductions( - listOf( - PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") - .preTax(true) - .type(BenefitType._401K) - .build() - ) - ) - .employerContributions( - listOf( - PayStatement.EmployerContribution.builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) - ) - .grossPay( - Money.builder().amount(0L).currency("currency").build() - ) - .individualId("individual_id") - .netPay(Money.builder().amount(0L).currency("currency").build()) - .paymentMethod(PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(PayStatement.Tax.Type.STATE) - .build() - ) - ) - .totalHours(0.0) - .type(PayStatement.Type.REGULAR_PAYROLL) - .build() - ) - ) - .build() - ) - .code(0L) - .paymentId("payment_id") - .build() - assertThat(payStatementResponse).isNotNull - assertThat(payStatementResponse.body()) - .contains( - PayStatementResponseBody.builder() - .paging(Paging.builder().count(0L).offset(0L).build()) - .payStatements( - listOf( + .addPayStatement( PayStatement.builder() - .earnings( - listOf( - PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type(PayStatement.Earning.Type.SALARY) - .build() - ) + .addEarning( + PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(PayStatement.Earning.Type.SALARY) + .build() ) - .employeeDeductions( - listOf( - PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") - .preTax(true) - .type(BenefitType._401K) - .build() - ) + .addEmployeeDeduction( + PayStatement.EmployeeDeduction.builder() + .amount(0L) + .currency("currency") + .name("name") + .preTax(true) + .type(BenefitType._401K) + .build() ) - .employerContributions( - listOf( - PayStatement.EmployerContribution.builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) + .addEmployerContribution( + PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(PayStatement.Tax.Type.STATE) - .build() - ) + .addTax( + PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(PayStatement.Tax.Type.STATE) + .build() ) .totalHours(0.0) .type(PayStatement.Type.REGULAR_PAYROLL) .build() ) + .build() + ) + .code(0L) + .paymentId("payment_id") + .build() + assertThat(payStatementResponse).isNotNull + assertThat(payStatementResponse.body()) + .contains( + PayStatementResponseBody.builder() + .paging(Paging.builder().count(0L).offset(0L).build()) + .addPayStatement( + PayStatement.builder() + .addEarning( + PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(PayStatement.Earning.Type.SALARY) + .build() + ) + .addEmployeeDeduction( + PayStatement.EmployeeDeduction.builder() + .amount(0L) + .currency("currency") + .name("name") + .preTax(true) + .type(BenefitType._401K) + .build() + ) + .addEmployerContribution( + PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() + ) + .grossPay(Money.builder().amount(0L).currency("currency").build()) + .individualId("individual_id") + .netPay(Money.builder().amount(0L).currency("currency").build()) + .paymentMethod(PayStatement.PaymentMethod.CHECK) + .addTax( + PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(PayStatement.Tax.Type.STATE) + .build() + ) + .totalHours(0.0) + .type(PayStatement.Type.REGULAR_PAYROLL) + .build() ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementTest.kt index 3432b7c7..f6a928ec 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayStatementTest.kt @@ -11,52 +11,44 @@ class PayStatementTest { fun createPayStatement() { val payStatement = PayStatement.builder() - .earnings( - listOf( - PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type(PayStatement.Earning.Type.SALARY) - .build() - ) + .addEarning( + PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(PayStatement.Earning.Type.SALARY) + .build() ) - .employeeDeductions( - listOf( - PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") - .preTax(true) - .type(BenefitType._401K) - .build() - ) + .addEmployeeDeduction( + PayStatement.EmployeeDeduction.builder() + .amount(0L) + .currency("currency") + .name("name") + .preTax(true) + .type(BenefitType._401K) + .build() ) - .employerContributions( - listOf( - PayStatement.EmployerContribution.builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) + .addEmployerContribution( + PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(PayStatement.Tax.Type.STATE) - .build() - ) + .addTax( + PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(PayStatement.Tax.Type.STATE) + .build() ) .totalHours(0.0) .type(PayStatement.Type.REGULAR_PAYROLL) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PaymentTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PaymentTest.kt index 8f12e7a9..42235e2a 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PaymentTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PaymentTest.kt @@ -17,11 +17,11 @@ class PaymentTest { .employeeTaxes(Money.builder().amount(0L).currency("currency").build()) .employerTaxes(Money.builder().amount(0L).currency("currency").build()) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualIds(listOf("string")) + .addIndividualId("string") .netPay(Money.builder().amount(0L).currency("currency").build()) .payDate("pay_date") - .payFrequencies(listOf(Payment.PayFrequency.ANNUALLY)) - .payGroupIds(listOf("string")) + .addPayFrequency(Payment.PayFrequency.ANNUALLY) + .addPayGroupId("string") .payPeriod( Payment.PayPeriod.builder().endDate("end_date").startDate("start_date").build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt index 041f8109..c018d32f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt @@ -12,7 +12,7 @@ class PayrollPayGroupListParamsTest { fun createPayrollPayGroupListParams() { PayrollPayGroupListParams.builder() .individualId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .payFrequencies(listOf("string")) + .addPayFrequency("string") .build() } @@ -21,7 +21,7 @@ class PayrollPayGroupListParamsTest { val params = PayrollPayGroupListParams.builder() .individualId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .payFrequencies(listOf("string")) + .addPayFrequency("string") .build() val expected = QueryParams.builder() expected.put("individual_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt index 56d8dcc5..e16e32ae 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt @@ -12,1035 +12,907 @@ class ProviderTest { val provider = Provider.builder() .id("id") - .authenticationMethods( - listOf( - Provider.AuthenticationMethod.builder() - .benefitsSupport( - BenefitsSupport.builder() - .commuter( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .customPostTax( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .customPreTax( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .fsaDependentCare( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .fsaMedical( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .hsaPost( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .hsaPre( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .s125Dental( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .s125Medical( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .s125Vision( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .simple( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .simpleIra( - BenefitFeaturesAndOperations.builder() - .supportedFeatures( - BenefitFeaturesAndOperations.BenefitFeature - .builder() - .annualMaximum(true) - .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .CompanyContribution - .FIXED - ) - ) - .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .EmployeeDeduction - .FIXED - ) - ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations - .BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) - ) - .build() - ) - .supportedOperations( - SupportPerBenefitType.builder() - .companyBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .individualBenefits( - OperationSupportMatrix.builder() - .create(OperationSupport.SUPPORTED) - .delete(OperationSupport.SUPPORTED) - .read(OperationSupport.SUPPORTED) - .update(OperationSupport.SUPPORTED) - .build() - ) - .build() - ) - .build() - ) - .build() - ) - .supportedFields( - Provider.AuthenticationMethod.SupportedFields.builder() - .company( - Provider.AuthenticationMethod.SupportedFields - .SupportedCompanyFields - .builder() - .id(true) - .accounts( - Provider.AuthenticationMethod.SupportedFields - .SupportedCompanyFields - .Accounts - .builder() - .accountName(true) - .accountNumber(true) - .accountType(true) - .institutionName(true) - .routingNumber(true) - .build() - ) - .departments( - Provider.AuthenticationMethod.SupportedFields - .SupportedCompanyFields - .Departments - .builder() - .name(true) - .parent( - Provider.AuthenticationMethod - .SupportedFields - .SupportedCompanyFields - .Departments - .Parent - .builder() - .name(true) - .build() - ) - .build() - ) - .ein(true) - .entity( - Provider.AuthenticationMethod.SupportedFields - .SupportedCompanyFields - .Entity - .builder() - .subtype(true) - .type(true) - .build() - ) - .legalName(true) - .locations( - Provider.AuthenticationMethod.SupportedFields - .SupportedCompanyFields - .Locations - .builder() - .city(true) - .country(true) - .line1(true) - .line2(true) - .postalCode(true) - .state(true) - .build() - ) - .primaryEmail(true) - .primaryPhoneNumber(true) - .build() - ) - .directory( - Provider.AuthenticationMethod.SupportedFields - .SupportedDirectoryFields - .builder() - .individuals( - Provider.AuthenticationMethod.SupportedFields - .SupportedDirectoryFields - .Individuals - .builder() - .id(true) - .department(true) - .firstName(true) - .isActive(true) - .lastName(true) - .manager( - Provider.AuthenticationMethod - .SupportedFields - .SupportedDirectoryFields - .Individuals - .Manager - .builder() - .id(true) - .build() - ) - .middleName(true) - .build() - ) - .paging( - Provider.AuthenticationMethod.SupportedFields - .SupportedDirectoryFields - .Paging - .builder() - .count(true) - .offset(true) - .build() - ) - .build() - ) - .employment( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .builder() - .id(true) - .classCode(true) - .customFields(true) - .department( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .Department - .builder() - .name(true) - .build() - ) - .employment( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .Employment - .builder() - .subtype(true) - .type(true) - .build() - ) - .employmentStatus(true) - .endDate(true) - .firstName(true) - .income( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .Income - .builder() - .amount(true) - .currency(true) - .unit(true) - .build() - ) - .incomeHistory(true) - .isActive(true) - .lastName(true) - .location( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .Location - .builder() - .city(true) - .country(true) - .line1(true) - .line2(true) - .postalCode(true) - .state(true) - .build() - ) - .manager( - Provider.AuthenticationMethod.SupportedFields - .SupportedEmploymentFields - .Manager - .builder() - .id(true) - .build() - ) - .middleName(true) - .startDate(true) - .title(true) - .build() - ) - .individual( - Provider.AuthenticationMethod.SupportedFields - .SupportedIndividualFields - .builder() - .id(true) - .dob(true) - .emails( - Provider.AuthenticationMethod.SupportedFields - .SupportedIndividualFields - .Emails - .builder() - .data(true) - .type(true) - .build() - ) - .encryptedSsn(true) - .ethnicity(true) - .firstName(true) - .gender(true) - .lastName(true) - .middleName(true) - .phoneNumbers( - Provider.AuthenticationMethod.SupportedFields - .SupportedIndividualFields - .PhoneNumbers - .builder() - .data(true) - .type(true) - .build() - ) - .preferredName(true) - .residence( - Provider.AuthenticationMethod.SupportedFields - .SupportedIndividualFields - .Residence - .builder() - .city(true) - .country(true) - .line1(true) - .line2(true) - .postalCode(true) - .state(true) - .build() - ) - .ssn(true) - .build() - ) - .payGroup( - Provider.AuthenticationMethod.SupportedFields - .SupportedPayGroupFields - .builder() - .id(true) - .individualIds(true) - .name(true) - .payFrequencies(true) - .build() - ) - .payStatement( - Provider.AuthenticationMethod.SupportedFields - .SupportedPayStatementFields - .builder() - .paging( - Provider.AuthenticationMethod.SupportedFields - .SupportedPayStatementFields - .Paging - .builder() - .count(true) - .offset(true) - .build() - ) - .payStatements( - Provider.AuthenticationMethod.SupportedFields - .SupportedPayStatementFields - .PayStatements - .builder() - .earnings( - Provider.AuthenticationMethod - .SupportedFields - .SupportedPayStatementFields - .PayStatements - .Earnings - .builder() - .amount(true) - .currency(true) - .name(true) - .type(true) - .build() - ) - .employeeDeductions( - Provider.AuthenticationMethod - .SupportedFields - .SupportedPayStatementFields - .PayStatements - .EmployeeDeductions - .builder() - .amount(true) - .currency(true) - .name(true) - .preTax(true) - .type(true) - .build() - ) - .employerContributions( - Provider.AuthenticationMethod - .SupportedFields - .SupportedPayStatementFields - .PayStatements - .EmployerContributions - .builder() - .amount(true) - .currency(true) - .name(true) - .build() - ) - .grossPay(true) - .individualId(true) - .netPay(true) - .paymentMethod(true) - .taxes( - Provider.AuthenticationMethod - .SupportedFields - .SupportedPayStatementFields - .PayStatements - .Taxes - .builder() - .amount(true) - .currency(true) - .employer(true) - .name(true) - .type(true) - .build() - ) - .totalHours(true) - .type(true) - .build() - ) - .build() - ) - .payment( - Provider.AuthenticationMethod.SupportedFields - .SupportedPaymentFields - .builder() - .id(true) - .companyDebit(true) - .debitDate(true) - .employeeTaxes(true) - .employerTaxes(true) - .grossPay(true) - .individualIds(true) - .netPay(true) - .payDate(true) - .payFrequencies(true) - .payGroupIds(true) - .payPeriod( - Provider.AuthenticationMethod.SupportedFields - .SupportedPaymentFields - .PayPeriod - .builder() - .endDate(true) - .startDate(true) - .build() - ) - .build() - ) - .build() - ) - .type(Provider.AuthenticationMethod.Type.ASSISTED) - .build() - ) + .addAuthenticationMethod( + Provider.AuthenticationMethod.builder() + .benefitsSupport( + BenefitsSupport.builder() + .commuter( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .customPostTax( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .customPreTax( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .fsaDependentCare( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .fsaMedical( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .hsaPost( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .hsaPre( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .s125Dental( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .s125Medical( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .s125Vision( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .simple( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .simpleIra( + BenefitFeaturesAndOperations.builder() + .supportedFeatures( + BenefitFeaturesAndOperations.BenefitFeature.builder() + .annualMaximum(true) + .catchUp(true) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED + ) + .description("description") + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED + ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL + ) + .build() + ) + .supportedOperations( + SupportPerBenefitType.builder() + .companyBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .individualBenefits( + OperationSupportMatrix.builder() + .create(OperationSupport.SUPPORTED) + .delete(OperationSupport.SUPPORTED) + .read(OperationSupport.SUPPORTED) + .update(OperationSupport.SUPPORTED) + .build() + ) + .build() + ) + .build() + ) + .build() + ) + .supportedFields( + Provider.AuthenticationMethod.SupportedFields.builder() + .company( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .builder() + .id(true) + .accounts( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .Accounts + .builder() + .accountName(true) + .accountNumber(true) + .accountType(true) + .institutionName(true) + .routingNumber(true) + .build() + ) + .departments( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .Departments + .builder() + .name(true) + .parent( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .Departments + .Parent + .builder() + .name(true) + .build() + ) + .build() + ) + .ein(true) + .entity( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .Entity + .builder() + .subtype(true) + .type(true) + .build() + ) + .legalName(true) + .locations( + Provider.AuthenticationMethod.SupportedFields + .SupportedCompanyFields + .Locations + .builder() + .city(true) + .country(true) + .line1(true) + .line2(true) + .postalCode(true) + .state(true) + .build() + ) + .primaryEmail(true) + .primaryPhoneNumber(true) + .build() + ) + .directory( + Provider.AuthenticationMethod.SupportedFields + .SupportedDirectoryFields + .builder() + .individuals( + Provider.AuthenticationMethod.SupportedFields + .SupportedDirectoryFields + .Individuals + .builder() + .id(true) + .department(true) + .firstName(true) + .isActive(true) + .lastName(true) + .manager( + Provider.AuthenticationMethod.SupportedFields + .SupportedDirectoryFields + .Individuals + .Manager + .builder() + .id(true) + .build() + ) + .middleName(true) + .build() + ) + .paging( + Provider.AuthenticationMethod.SupportedFields + .SupportedDirectoryFields + .Paging + .builder() + .count(true) + .offset(true) + .build() + ) + .build() + ) + .employment( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .builder() + .id(true) + .classCode(true) + .customFields(true) + .department( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .Department + .builder() + .name(true) + .build() + ) + .employment( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .Employment + .builder() + .subtype(true) + .type(true) + .build() + ) + .employmentStatus(true) + .endDate(true) + .firstName(true) + .income( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .Income + .builder() + .amount(true) + .currency(true) + .unit(true) + .build() + ) + .incomeHistory(true) + .isActive(true) + .lastName(true) + .location( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .Location + .builder() + .city(true) + .country(true) + .line1(true) + .line2(true) + .postalCode(true) + .state(true) + .build() + ) + .manager( + Provider.AuthenticationMethod.SupportedFields + .SupportedEmploymentFields + .Manager + .builder() + .id(true) + .build() + ) + .middleName(true) + .startDate(true) + .title(true) + .build() + ) + .individual( + Provider.AuthenticationMethod.SupportedFields + .SupportedIndividualFields + .builder() + .id(true) + .dob(true) + .emails( + Provider.AuthenticationMethod.SupportedFields + .SupportedIndividualFields + .Emails + .builder() + .data(true) + .type(true) + .build() + ) + .encryptedSsn(true) + .ethnicity(true) + .firstName(true) + .gender(true) + .lastName(true) + .middleName(true) + .phoneNumbers( + Provider.AuthenticationMethod.SupportedFields + .SupportedIndividualFields + .PhoneNumbers + .builder() + .data(true) + .type(true) + .build() + ) + .preferredName(true) + .residence( + Provider.AuthenticationMethod.SupportedFields + .SupportedIndividualFields + .Residence + .builder() + .city(true) + .country(true) + .line1(true) + .line2(true) + .postalCode(true) + .state(true) + .build() + ) + .ssn(true) + .build() + ) + .payGroup( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayGroupFields + .builder() + .id(true) + .individualIds(true) + .name(true) + .payFrequencies(true) + .build() + ) + .payStatement( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .builder() + .paging( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .Paging + .builder() + .count(true) + .offset(true) + .build() + ) + .payStatements( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .PayStatements + .builder() + .earnings( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .PayStatements + .Earnings + .builder() + .amount(true) + .currency(true) + .name(true) + .type(true) + .build() + ) + .employeeDeductions( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .PayStatements + .EmployeeDeductions + .builder() + .amount(true) + .currency(true) + .name(true) + .preTax(true) + .type(true) + .build() + ) + .employerContributions( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .PayStatements + .EmployerContributions + .builder() + .amount(true) + .currency(true) + .name(true) + .build() + ) + .grossPay(true) + .individualId(true) + .netPay(true) + .paymentMethod(true) + .taxes( + Provider.AuthenticationMethod.SupportedFields + .SupportedPayStatementFields + .PayStatements + .Taxes + .builder() + .amount(true) + .currency(true) + .employer(true) + .name(true) + .type(true) + .build() + ) + .totalHours(true) + .type(true) + .build() + ) + .build() + ) + .payment( + Provider.AuthenticationMethod.SupportedFields + .SupportedPaymentFields + .builder() + .id(true) + .companyDebit(true) + .debitDate(true) + .employeeTaxes(true) + .employerTaxes(true) + .grossPay(true) + .individualIds(true) + .netPay(true) + .payDate(true) + .payFrequencies(true) + .payGroupIds(true) + .payPeriod( + Provider.AuthenticationMethod.SupportedFields + .SupportedPaymentFields + .PayPeriod + .builder() + .endDate(true) + .startDate(true) + .build() + ) + .build() + ) + .build() + ) + .type(Provider.AuthenticationMethod.Type.ASSISTED) + .build() ) .beta(true) .displayName("display_name") @@ -1049,7 +921,7 @@ class ProviderTest { .manual(true) .mfaRequired(true) .primaryColor("primary_color") - .products(listOf("string")) + .addProduct("string") .build() assertThat(provider).isNotNull assertThat(provider.id()).contains("id") @@ -1064,28 +936,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1117,28 +983,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1170,28 +1030,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1223,28 +1077,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1276,28 +1124,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1329,28 +1171,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1382,28 +1218,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1435,28 +1265,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1488,28 +1312,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1541,28 +1359,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1594,28 +1406,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) @@ -1647,28 +1453,22 @@ class ProviderTest { BenefitFeaturesAndOperations.BenefitFeature.builder() .annualMaximum(true) .catchUp(true) - .companyContribution( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .CompanyContribution - .FIXED - ) + .addCompanyContribution( + BenefitFeaturesAndOperations.BenefitFeature + .CompanyContribution + .FIXED ) .description("description") - .employeeDeduction( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .EmployeeDeduction - .FIXED - ) + .addEmployeeDeduction( + BenefitFeaturesAndOperations.BenefitFeature + .EmployeeDeduction + .FIXED ) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit( - listOf( - BenefitFeaturesAndOperations.BenefitFeature - .HsaContributionLimit - .INDIVIDUAL - ) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit( + BenefitFeaturesAndOperations.BenefitFeature + .HsaContributionLimit + .INDIVIDUAL ) .build() ) 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 451fe763..6d1d63ec 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 @@ -10,28 +10,22 @@ class SandboxCompanyUpdateParamsTest { @Test fun createSandboxCompanyUpdateParams() { SandboxCompanyUpdateParams.builder() - .accounts( - listOf( - SandboxCompanyUpdateParams.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType(SandboxCompanyUpdateParams.Account.AccountType.CHECKING) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + SandboxCompanyUpdateParams.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(SandboxCompanyUpdateParams.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - SandboxCompanyUpdateParams.Department.builder() - .name("name") - .parent( - SandboxCompanyUpdateParams.Department.Parent.builder() - .name("name") - .build() - ) - .build() - ) + .addDepartment( + SandboxCompanyUpdateParams.Department.builder() + .name("name") + .parent( + SandboxCompanyUpdateParams.Department.Parent.builder().name("name").build() + ) + .build() ) .ein("ein") .entity( @@ -41,19 +35,17 @@ class SandboxCompanyUpdateParamsTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") @@ -64,28 +56,24 @@ class SandboxCompanyUpdateParamsTest { fun getBody() { val params = SandboxCompanyUpdateParams.builder() - .accounts( - listOf( - SandboxCompanyUpdateParams.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType(SandboxCompanyUpdateParams.Account.AccountType.CHECKING) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + SandboxCompanyUpdateParams.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(SandboxCompanyUpdateParams.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - SandboxCompanyUpdateParams.Department.builder() - .name("name") - .parent( - SandboxCompanyUpdateParams.Department.Parent.builder() - .name("name") - .build() - ) - .build() - ) + .addDepartment( + SandboxCompanyUpdateParams.Department.builder() + .name("name") + .parent( + SandboxCompanyUpdateParams.Department.Parent.builder() + .name("name") + .build() + ) + .build() ) .ein("ein") .entity( @@ -95,19 +83,17 @@ class SandboxCompanyUpdateParamsTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") @@ -171,12 +157,12 @@ class SandboxCompanyUpdateParamsTest { fun getBodyWithoutOptionalFields() { val params = SandboxCompanyUpdateParams.builder() - .accounts(listOf(SandboxCompanyUpdateParams.Account.builder().build())) - .departments(listOf(SandboxCompanyUpdateParams.Department.builder().build())) + .addAccount(SandboxCompanyUpdateParams.Account.builder().build()) + .addDepartment(SandboxCompanyUpdateParams.Department.builder().build()) .ein("ein") .entity(SandboxCompanyUpdateParams.Entity.builder().build()) .legalName("legal_name") - .locations(listOf(Location.builder().build())) + .addLocation(Location.builder().build()) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") .build() 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 e3edeb1f..97201e02 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 @@ -13,7 +13,7 @@ class SandboxConnectionAccountCreateParamsTest { .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .providerId("provider_id") .authenticationType(SandboxConnectionAccountCreateParams.AuthenticationType.CREDENTIAL) - .products(listOf("string")) + .addProduct("string") .build() } @@ -26,7 +26,7 @@ class SandboxConnectionAccountCreateParamsTest { .authenticationType( SandboxConnectionAccountCreateParams.AuthenticationType.CREDENTIAL ) - .products(listOf("string")) + .addProduct("string") .build() val body = params.getBody() assertThat(body).isNotNull 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 b1ab1137..3c0b37d6 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 @@ -13,7 +13,7 @@ class SandboxConnectionCreateParamsTest { .providerId("provider_id") .authenticationType(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) .employeeSize(0L) - .products(listOf("string")) + .addProduct("string") .build() } @@ -24,7 +24,7 @@ class SandboxConnectionCreateParamsTest { .providerId("provider_id") .authenticationType(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) .employeeSize(0L) - .products(listOf("string")) + .addProduct("string") .build() val body = params.getBody() assertThat(body).isNotNull diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt index 7097786b..fe44428f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt @@ -11,18 +11,131 @@ class SandboxDirectoryCreateParamsTest { @Test fun createSandboxDirectoryCreateParams() { SandboxDirectoryCreateParams.builder() - .body( - listOf( + .addBody( + SandboxDirectoryCreateParams.IndividualOrEmployment.builder() + .classCode("class_code") + .addCustomField( + SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() + ) + .department( + SandboxDirectoryCreateParams.IndividualOrEmployment.Department.builder() + .name("name") + .build() + ) + .dob("01/01/2000") + .addEmail( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.Type.WORK + ) + .build() + ) + .employment( + SandboxDirectoryCreateParams.IndividualOrEmployment.Employment.builder() + .subtype( + SandboxDirectoryCreateParams.IndividualOrEmployment.Employment + .Subtype + .FULL_TIME + ) + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.Employment.Type + .EMPLOYEE + ) + .build() + ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus.ACTIVE + ) + .encryptedSsn("encrypted_ssn") + .endDate("end_date") + .ethnicity(SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN) + .firstName("John") + .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .income( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() + ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() + ) + .isActive(true) + .lastName("Smith") + .latestRehireDate("latest_rehire_date") + .location( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() + ) + .manager( + SandboxDirectoryCreateParams.IndividualOrEmployment.Manager.builder() + .id("id") + .build() + ) + .middleName("middle_name") + .addPhoneNumber( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.Type + .WORK + ) + .build() + ) + .preferredName("preferred_name") + .residence( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() + ) + .sourceId("source_id") + .ssn("ssn") + .startDate("start_date") + .title("title") + .build() + ) + .build() + } + + @Test + fun getBody() { + val params = + SandboxDirectoryCreateParams.builder() + .addBody( SandboxDirectoryCreateParams.IndividualOrEmployment.builder() .classCode("class_code") - .customFields( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField - .builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField + .builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department( SandboxDirectoryCreateParams.IndividualOrEmployment.Department.builder() @@ -30,17 +143,14 @@ class SandboxDirectoryCreateParamsTest { .build() ) .dob("01/01/2000") - .emails( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment.Email - .Type - .WORK - ) - .build() - ) + .addEmail( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.Type + .WORK + ) + .build() ) .employment( SandboxDirectoryCreateParams.IndividualOrEmployment.Employment.builder() @@ -75,15 +185,13 @@ class SandboxDirectoryCreateParamsTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("Smith") @@ -106,19 +214,16 @@ class SandboxDirectoryCreateParamsTest { .build() ) .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .PhoneNumber - .Type - .WORK - ) - .build() - ) + .addPhoneNumber( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber + .builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber + .Type + .WORK + ) + .build() ) .preferredName("preferred_name") .residence( @@ -139,152 +244,6 @@ class SandboxDirectoryCreateParamsTest { .title("title") .build() ) - ) - .build() - } - - @Test - fun getBody() { - val params = - SandboxDirectoryCreateParams.builder() - .body( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.builder() - .classCode("class_code") - .customFields( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField - .builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) - ) - .department( - SandboxDirectoryCreateParams.IndividualOrEmployment.Department - .builder() - .name("name") - .build() - ) - .dob("01/01/2000") - .emails( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.Email - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Email - .Type - .WORK - ) - .build() - ) - ) - .employment( - SandboxDirectoryCreateParams.IndividualOrEmployment.Employment - .builder() - .subtype( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Employment - .Subtype - .FULL_TIME - ) - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Employment - .Type - .EMPLOYEE - ) - .build() - ) - .employmentStatus( - SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus - .ACTIVE - ) - .encryptedSsn("encrypted_ssn") - .endDate("end_date") - .ethnicity( - SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN - ) - .firstName("John") - .gender( - SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE - ) - .income( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) - ) - .isActive(true) - .lastName("Smith") - .latestRehireDate("latest_rehire_date") - .location( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) - .manager( - SandboxDirectoryCreateParams.IndividualOrEmployment.Manager - .builder() - .id("id") - .build() - ) - .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .PhoneNumber - .Type - .WORK - ) - .build() - ) - ) - .preferredName("preferred_name") - .residence( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) - .sourceId("source_id") - .ssn("ssn") - .startDate("start_date") - .title("title") - .build() - ) - ) .build() val body = params.getBody() assertThat(body).isNotNull @@ -293,14 +252,12 @@ class SandboxDirectoryCreateParamsTest { listOf( SandboxDirectoryCreateParams.IndividualOrEmployment.builder() .classCode("class_code") - .customFields( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField - .builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField + .builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department( SandboxDirectoryCreateParams.IndividualOrEmployment.Department.builder() @@ -308,17 +265,14 @@ class SandboxDirectoryCreateParamsTest { .build() ) .dob("01/01/2000") - .emails( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment.Email - .Type - .WORK - ) - .build() - ) + .addEmail( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.Type + .WORK + ) + .build() ) .employment( SandboxDirectoryCreateParams.IndividualOrEmployment.Employment.builder() @@ -353,15 +307,13 @@ class SandboxDirectoryCreateParamsTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("Smith") @@ -384,19 +336,16 @@ class SandboxDirectoryCreateParamsTest { .build() ) .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .PhoneNumber - .Type - .WORK - ) - .build() - ) + .addPhoneNumber( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber + .builder() + .data("data") + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber + .Type + .WORK + ) + .build() ) .preferredName("preferred_name") .residence( @@ -424,7 +373,7 @@ class SandboxDirectoryCreateParamsTest { fun getBodyWithoutOptionalFields() { val params = SandboxDirectoryCreateParams.builder() - .body(listOf(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build())) + .addBody(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build()) .build() val body = params.getBody() assertThat(body).isNotNull 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 92630138..0103cc1a 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 @@ -13,13 +13,11 @@ class SandboxEmploymentUpdateParamsTest { SandboxEmploymentUpdateParams.builder() .individualId("individual_id") .classCode("class_code") - .customFields( - listOf( - SandboxEmploymentUpdateParams.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + SandboxEmploymentUpdateParams.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(SandboxEmploymentUpdateParams.Department.builder().name("name").build()) .employment( @@ -39,15 +37,13 @@ class SandboxEmploymentUpdateParamsTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") @@ -78,13 +74,11 @@ class SandboxEmploymentUpdateParamsTest { SandboxEmploymentUpdateParams.builder() .individualId("individual_id") .classCode("class_code") - .customFields( - listOf( - SandboxEmploymentUpdateParams.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + SandboxEmploymentUpdateParams.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department(SandboxEmploymentUpdateParams.Department.builder().name("name").build()) .employment( @@ -104,15 +98,13 @@ class SandboxEmploymentUpdateParamsTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") 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 464cec4e..3bbeb44c 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 @@ -12,13 +12,11 @@ class SandboxIndividualUpdateParamsTest { SandboxIndividualUpdateParams.builder() .individualId("individual_id") .dob("12/20/1989") - .emails( - listOf( - SandboxIndividualUpdateParams.Email.builder() - .data("data") - .type(SandboxIndividualUpdateParams.Email.Type.WORK) - .build() - ) + .addEmail( + SandboxIndividualUpdateParams.Email.builder() + .data("data") + .type(SandboxIndividualUpdateParams.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(SandboxIndividualUpdateParams.Ethnicity.ASIAN) @@ -26,13 +24,11 @@ class SandboxIndividualUpdateParamsTest { .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxIndividualUpdateParams.PhoneNumber.builder() - .data("data") - .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + SandboxIndividualUpdateParams.PhoneNumber.builder() + .data("data") + .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( @@ -57,13 +53,11 @@ class SandboxIndividualUpdateParamsTest { SandboxIndividualUpdateParams.builder() .individualId("individual_id") .dob("12/20/1989") - .emails( - listOf( - SandboxIndividualUpdateParams.Email.builder() - .data("data") - .type(SandboxIndividualUpdateParams.Email.Type.WORK) - .build() - ) + .addEmail( + SandboxIndividualUpdateParams.Email.builder() + .data("data") + .type(SandboxIndividualUpdateParams.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(SandboxIndividualUpdateParams.Ethnicity.ASIAN) @@ -71,13 +65,11 @@ class SandboxIndividualUpdateParamsTest { .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxIndividualUpdateParams.PhoneNumber.builder() - .data("data") - .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + SandboxIndividualUpdateParams.PhoneNumber.builder() + .data("data") + .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( 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 85c3dc8c..939d5ebe 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 @@ -11,137 +11,105 @@ class SandboxPaymentCreateParamsTest { fun createSandboxPaymentCreateParams() { SandboxPaymentCreateParams.builder() .endDate("end_date") - .payStatements( - listOf( + .addPayStatement( + SandboxPaymentCreateParams.PayStatement.builder() + .addEarning( + SandboxPaymentCreateParams.PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY) + .build() + ) + .addEmployeeDeduction( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() + .amount(2000L) + .currency("usd") + .name("401k test") + .preTax(true) + .type(BenefitType._401K) + .build() + ) + .addEmployerContribution( + SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() + ) + .grossPay(Money.builder().amount(0L).currency("currency").build()) + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .netPay(Money.builder().amount(0L).currency("currency").build()) + .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) + .addTax( + SandboxPaymentCreateParams.PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) + .build() + ) + .totalHours(0.0) + .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) + .build() + ) + .startDate("start_date") + .build() + } + + @Test + fun getBody() { + val params = + SandboxPaymentCreateParams.builder() + .endDate("end_date") + .addPayStatement( SandboxPaymentCreateParams.PayStatement.builder() - .earnings( - listOf( - SandboxPaymentCreateParams.PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY - ) - .build() - ) + .addEarning( + SandboxPaymentCreateParams.PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY) + .build() ) - .employeeDeductions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") - .preTax(true) - .type(BenefitType._401K) - .build() - ) + .addEmployeeDeduction( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() + .amount(2000L) + .currency("usd") + .name("401k test") + .preTax(true) + .type(BenefitType._401K) + .build() ) - .employerContributions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployerContribution - .builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) + .addEmployerContribution( + SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - SandboxPaymentCreateParams.PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) - .build() - ) + .addTax( + SandboxPaymentCreateParams.PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) + .build() ) .totalHours(0.0) .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) .build() ) - ) - .startDate("start_date") - .build() - } - - @Test - fun getBody() { - val params = - SandboxPaymentCreateParams.builder() - .endDate("end_date") - .payStatements( - listOf( - SandboxPaymentCreateParams.PayStatement.builder() - .earnings( - listOf( - SandboxPaymentCreateParams.PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Earning.Type - .SALARY - ) - .build() - ) - ) - .employeeDeductions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployeeDeduction - .builder() - .amount(2000L) - .currency("usd") - .name("401k test") - .preTax(true) - .type(BenefitType._401K) - .build() - ) - ) - .employerContributions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployerContribution - .builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) - ) - .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") - .netPay(Money.builder().amount(0L).currency("currency").build()) - .paymentMethod( - SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK - ) - .taxes( - listOf( - SandboxPaymentCreateParams.PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE - ) - .build() - ) - ) - .totalHours(0.0) - .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) - .build() - ) - ) .startDate("start_date") .build() val body = params.getBody() @@ -151,55 +119,44 @@ class SandboxPaymentCreateParamsTest { .contains( listOf( SandboxPaymentCreateParams.PayStatement.builder() - .earnings( - listOf( - SandboxPaymentCreateParams.PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY - ) - .build() - ) + .addEarning( + SandboxPaymentCreateParams.PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY) + .build() ) - .employeeDeductions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") - .preTax(true) - .type(BenefitType._401K) - .build() - ) + .addEmployeeDeduction( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() + .amount(2000L) + .currency("usd") + .name("401k test") + .preTax(true) + .type(BenefitType._401K) + .build() ) - .employerContributions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployerContribution - .builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) + .addEmployerContribution( + SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) - .taxes( - listOf( - SandboxPaymentCreateParams.PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) - .build() - ) + .addTax( + SandboxPaymentCreateParams.PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) + .build() ) .totalHours(0.0) .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SupportedBenefitTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SupportedBenefitTest.kt index 02a58a61..56ad5909 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SupportedBenefitTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SupportedBenefitTest.kt @@ -13,11 +13,11 @@ class SupportedBenefitTest { SupportedBenefit.builder() .annualMaximum(true) .catchUp(true) - .companyContribution(listOf(SupportedBenefit.CompanyContribution.FIXED)) + .addCompanyContribution(SupportedBenefit.CompanyContribution.FIXED) .description("description") - .employeeDeduction(listOf(SupportedBenefit.EmployeeDeduction.FIXED)) - .frequencies(listOf(BenefitFrequency.ONE_TIME)) - .hsaContributionLimit(listOf(SupportedBenefit.HsaContributionLimit.INDIVIDUAL)) + .addEmployeeDeduction(SupportedBenefit.EmployeeDeduction.FIXED) + .addFrequency(BenefitFrequency.ONE_TIME) + .addHsaContributionLimit(SupportedBenefit.HsaContributionLimit.INDIVIDUAL) .type(BenefitType._401K) .build() assertThat(supportedBenefit).isNotNull diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ErrorHandlingTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ErrorHandlingTest.kt index 7e131b2d..c76df6e8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ErrorHandlingTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ErrorHandlingTest.kt @@ -63,24 +63,20 @@ class ErrorHandlingTest { val expected = Company.builder() .id("id") - .accounts( - listOf( - Company.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType(Company.Account.AccountType.CHECKING) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + Company.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(Company.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - Company.Department.builder() - .name("name") - .parent(Company.Department.Parent.builder().name("name").build()) - .build() - ) + .addDepartment( + Company.Department.builder() + .name("name") + .parent(Company.Department.Parent.builder().name("name").build()) + .build() ) .ein("ein") .entity( @@ -90,19 +86,17 @@ class ErrorHandlingTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt index 555e8b13..94149e82 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt @@ -61,20 +61,16 @@ class ServiceParamsTest { val apiResponse = HrisDirectoryListPage.Response.builder() - .individuals( - listOf( - IndividualInDirectory.builder() - .id("id") - .department( - IndividualInDirectory.Department.builder().name("name").build() - ) - .firstName("first_name") - .isActive(true) - .lastName("last_name") - .manager(IndividualInDirectory.Manager.builder().id("id").build()) - .middleName("middle_name") - .build() - ) + .addIndividual( + IndividualInDirectory.builder() + .id("id") + .department(IndividualInDirectory.Department.builder().name("name").build()) + .firstName("first_name") + .isActive(true) + .lastName("last_name") + .manager(IndividualInDirectory.Manager.builder().id("id").build()) + .middleName("middle_name") + .build() ) .paging(Paging.builder().count(0L).offset(0L).build()) .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt index 1e47f3b5..d6a8f6d5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt @@ -25,7 +25,7 @@ class SessionServiceTest { ConnectSessionNewParams.builder() .customerId("x") .customerName("x") - .products(listOf(ConnectSessionNewParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .customerEmail("dev@stainlessapi.com") .integration( ConnectSessionNewParams.Integration.builder() @@ -56,7 +56,7 @@ class SessionServiceTest { ConnectSessionReauthenticateParams.builder() .connectionId("connection_id") .minutesToExpire(0L) - .products(listOf(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY)) + .addProduct(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY) .redirectUri("https://example.com") .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceTest.kt index aa7fdf33..09f54c0e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceTest.kt @@ -23,10 +23,10 @@ class DocumentServiceTest { val documentListResponse = documentService.list( HrisDocumentListParams.builder() - .individualIds(listOf("string")) + .addIndividualId("string") .limit(0L) .offset(0L) - .types(listOf(HrisDocumentListParams.Type.W4_2020)) + .addType(HrisDocumentListParams.Type.W4_2020) .build() ) println(documentListResponse) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt index 72c101cf..9eba85be 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt @@ -22,12 +22,10 @@ class EmploymentServiceTest { val getEmploymentResponse = employmentService.retrieveMany( HrisEmploymentRetrieveManyParams.builder() - .requests( - listOf( - HrisEmploymentRetrieveManyParams.Request.builder() - .individualId("individual_id") - .build() - ) + .addRequest( + HrisEmploymentRetrieveManyParams.Request.builder() + .individualId("individual_id") + .build() ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt index b46fe04e..6d52ab44 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt @@ -22,12 +22,10 @@ class PayStatementServiceTest { val getPayStatementsResponse = payStatementService.retrieveMany( HrisPayStatementRetrieveManyParams.builder() - .requests( - listOf( - HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("string") - .build() - ) + .addRequest( + HrisPayStatementRetrieveManyParams.Request.builder() + .paymentId("string") + .build() ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt index 1ecbae71..e6a6da70 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt @@ -23,30 +23,24 @@ class CompanyServiceTest { val companyUpdateResponse = companyService.update( SandboxCompanyUpdateParams.builder() - .accounts( - listOf( - SandboxCompanyUpdateParams.Account.builder() - .accountName("account_name") - .accountNumber("account_number") - .accountType( - SandboxCompanyUpdateParams.Account.AccountType.CHECKING - ) - .institutionName("institution_name") - .routingNumber("routing_number") - .build() - ) + .addAccount( + SandboxCompanyUpdateParams.Account.builder() + .accountName("account_name") + .accountNumber("account_number") + .accountType(SandboxCompanyUpdateParams.Account.AccountType.CHECKING) + .institutionName("institution_name") + .routingNumber("routing_number") + .build() ) - .departments( - listOf( - SandboxCompanyUpdateParams.Department.builder() - .name("name") - .parent( - SandboxCompanyUpdateParams.Department.Parent.builder() - .name("name") - .build() - ) - .build() - ) + .addDepartment( + SandboxCompanyUpdateParams.Department.builder() + .name("name") + .parent( + SandboxCompanyUpdateParams.Department.Parent.builder() + .name("name") + .build() + ) + .build() ) .ein("ein") .entity( @@ -56,19 +50,17 @@ class CompanyServiceTest { .build() ) .legalName("legal_name") - .locations( - listOf( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) + .addLocation( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() ) .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt index b8834168..7c74ddb7 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt @@ -25,7 +25,7 @@ class ConnectionServiceTest { .providerId("provider_id") .authenticationType(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) .employeeSize(0L) - .products(listOf("string")) + .addProduct("string") .build() ) println(connectionCreateResponse) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt index dad8dab1..013e7140 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt @@ -25,148 +25,131 @@ class DirectoryServiceTest { val directoryCreateResponse = directoryService.create( SandboxDirectoryCreateParams.builder() - .body( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment.builder() - .classCode("class_code") - .customFields( - listOf( - SandboxDirectoryCreateParams.IndividualOrEmployment - .CustomField - .builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) - ) - .department( - SandboxDirectoryCreateParams.IndividualOrEmployment.Department - .builder() - .name("name") - .build() - ) - .dob("01/01/2000") - .emails( - listOf( + .addBody( + SandboxDirectoryCreateParams.IndividualOrEmployment.builder() + .classCode("class_code") + .addCustomField( + SandboxDirectoryCreateParams.IndividualOrEmployment.CustomField + .builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() + ) + .department( + SandboxDirectoryCreateParams.IndividualOrEmployment.Department + .builder() + .name("name") + .build() + ) + .dob("01/01/2000") + .addEmail( + SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() + .data("data") + .type( SandboxDirectoryCreateParams.IndividualOrEmployment.Email - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Email - .Type - .WORK - ) - .build() + .Type + .WORK ) - ) - .employment( - SandboxDirectoryCreateParams.IndividualOrEmployment.Employment - .builder() - .subtype( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Employment - .Subtype - .FULL_TIME - ) - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .Employment - .Type - .EMPLOYEE - ) - .build() - ) - .employmentStatus( - SandboxDirectoryCreateParams.IndividualOrEmployment - .EmploymentStatus - .ACTIVE - ) - .encryptedSsn("encrypted_ssn") - .endDate("end_date") - .ethnicity( - SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity - .ASIAN - ) - .firstName("John") - .gender( - SandboxDirectoryCreateParams.IndividualOrEmployment.Gender - .FEMALE - ) - .income( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() + .build() + ) + .employment( + SandboxDirectoryCreateParams.IndividualOrEmployment.Employment + .builder() + .subtype( + SandboxDirectoryCreateParams.IndividualOrEmployment + .Employment + .Subtype + .FULL_TIME + ) + .type( + SandboxDirectoryCreateParams.IndividualOrEmployment + .Employment + .Type + .EMPLOYEE ) - ) - .isActive(true) - .lastName("Smith") - .latestRehireDate("latest_rehire_date") - .location( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) - .manager( - SandboxDirectoryCreateParams.IndividualOrEmployment.Manager - .builder() - .id("id") - .build() - ) - .middleName("middle_name") - .phoneNumbers( - listOf( + .build() + ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus + .ACTIVE + ) + .encryptedSsn("encrypted_ssn") + .endDate("end_date") + .ethnicity( + SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN + ) + .firstName("John") + .gender( + SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE + ) + .income( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() + ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() + ) + .isActive(true) + .lastName("Smith") + .latestRehireDate("latest_rehire_date") + .location( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() + ) + .manager( + SandboxDirectoryCreateParams.IndividualOrEmployment.Manager + .builder() + .id("id") + .build() + ) + .middleName("middle_name") + .addPhoneNumber( + SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber + .builder() + .data("data") + .type( SandboxDirectoryCreateParams.IndividualOrEmployment .PhoneNumber - .builder() - .data("data") - .type( - SandboxDirectoryCreateParams.IndividualOrEmployment - .PhoneNumber - .Type - .WORK - ) - .build() + .Type + .WORK ) - ) - .preferredName("preferred_name") - .residence( - Location.builder() - .city("city") - .country("country") - .line1("line1") - .line2("line2") - .name("name") - .postalCode("postal_code") - .sourceId("source_id") - .state("state") - .build() - ) - .sourceId("source_id") - .ssn("ssn") - .startDate("start_date") - .title("title") - .build() - ) + .build() + ) + .preferredName("preferred_name") + .residence( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .name("name") + .postalCode("postal_code") + .sourceId("source_id") + .state("state") + .build() + ) + .sourceId("source_id") + .ssn("ssn") + .startDate("start_date") + .title("title") + .build() ) .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt index c6842b48..aaeef4d7 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt @@ -27,13 +27,11 @@ class EmploymentServiceTest { SandboxEmploymentUpdateParams.builder() .individualId("individual_id") .classCode("class_code") - .customFields( - listOf( - SandboxEmploymentUpdateParams.CustomField.builder() - .name("name") - .value(JsonValue.from(mapOf())) - .build() - ) + .addCustomField( + SandboxEmploymentUpdateParams.CustomField.builder() + .name("name") + .value(JsonValue.from(mapOf())) + .build() ) .department( SandboxEmploymentUpdateParams.Department.builder().name("name").build() @@ -55,15 +53,13 @@ class EmploymentServiceTest { .unit(Income.Unit.YEARLY) .build() ) - .incomeHistory( - listOf( - Income.builder() - .amount(0L) - .currency("currency") - .effectiveDate("effective_date") - .unit(Income.Unit.YEARLY) - .build() - ) + .addIncomeHistory( + Income.builder() + .amount(0L) + .currency("currency") + .effectiveDate("effective_date") + .unit(Income.Unit.YEARLY) + .build() ) .isActive(true) .lastName("last_name") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt index 46747df2..5e6c4be6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt @@ -25,13 +25,11 @@ class IndividualServiceTest { SandboxIndividualUpdateParams.builder() .individualId("individual_id") .dob("12/20/1989") - .emails( - listOf( - SandboxIndividualUpdateParams.Email.builder() - .data("data") - .type(SandboxIndividualUpdateParams.Email.Type.WORK) - .build() - ) + .addEmail( + SandboxIndividualUpdateParams.Email.builder() + .data("data") + .type(SandboxIndividualUpdateParams.Email.Type.WORK) + .build() ) .encryptedSsn("encrypted_ssn") .ethnicity(SandboxIndividualUpdateParams.Ethnicity.ASIAN) @@ -39,13 +37,11 @@ class IndividualServiceTest { .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") .middleName("middle_name") - .phoneNumbers( - listOf( - SandboxIndividualUpdateParams.PhoneNumber.builder() - .data("data") - .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) - .build() - ) + .addPhoneNumber( + SandboxIndividualUpdateParams.PhoneNumber.builder() + .data("data") + .type(SandboxIndividualUpdateParams.PhoneNumber.Type.WORK) + .build() ) .preferredName("preferred_name") .residence( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceTest.kt index 45615a60..bbdc3623 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceTest.kt @@ -25,70 +25,55 @@ class PaymentServiceTest { paymentService.create( SandboxPaymentCreateParams.builder() .endDate("end_date") - .payStatements( - listOf( - SandboxPaymentCreateParams.PayStatement.builder() - .earnings( - listOf( - SandboxPaymentCreateParams.PayStatement.Earning.builder() - .amount(0L) - .currency("currency") - .hours(0.0) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Earning.Type - .SALARY - ) - .build() + .addPayStatement( + SandboxPaymentCreateParams.PayStatement.builder() + .addEarning( + SandboxPaymentCreateParams.PayStatement.Earning.builder() + .amount(0L) + .currency("currency") + .hours(0.0) + .name("name") + .type( + SandboxPaymentCreateParams.PayStatement.Earning.Type.SALARY ) - ) - .employeeDeductions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployeeDeduction - .builder() - .amount(2000L) - .currency("usd") - .name("401k test") - .preTax(true) - .type(BenefitType._401K) - .build() - ) - ) - .employerContributions( - listOf( - SandboxPaymentCreateParams.PayStatement.EmployerContribution - .builder() - .amount(0L) - .currency("currency") - .name("name") - .type(BenefitType._401K) - .build() - ) - ) - .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") - .netPay(Money.builder().amount(0L).currency("currency").build()) - .paymentMethod( - SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK - ) - .taxes( - listOf( - SandboxPaymentCreateParams.PayStatement.Tax.builder() - .amount(0L) - .currency("currency") - .employer(true) - .name("name") - .type( - SandboxPaymentCreateParams.PayStatement.Tax.Type - .STATE - ) - .build() - ) - ) - .totalHours(0.0) - .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) - .build() - ) + .build() + ) + .addEmployeeDeduction( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() + .amount(2000L) + .currency("usd") + .name("401k test") + .preTax(true) + .type(BenefitType._401K) + .build() + ) + .addEmployerContribution( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .builder() + .amount(0L) + .currency("currency") + .name("name") + .type(BenefitType._401K) + .build() + ) + .grossPay(Money.builder().amount(0L).currency("currency").build()) + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .netPay(Money.builder().amount(0L).currency("currency").build()) + .paymentMethod( + SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK + ) + .addTax( + SandboxPaymentCreateParams.PayStatement.Tax.builder() + .amount(0L) + .currency("currency") + .employer(true) + .name("name") + .type(SandboxPaymentCreateParams.PayStatement.Tax.Type.STATE) + .build() + ) + .totalHours(0.0) + .type(SandboxPaymentCreateParams.PayStatement.Type.REGULAR_PAYROLL) + .build() ) .startDate("start_date") .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt index ba50d5ed..9b1b064d 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt @@ -29,7 +29,7 @@ class AccountServiceTest { .authenticationType( SandboxConnectionAccountCreateParams.AuthenticationType.CREDENTIAL ) - .products(listOf("string")) + .addProduct("string") .build() ) println(accountCreateResponse) From 0d0766b6c48e7efd60dbb7f3e2306771d307526c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:53:54 +0000 Subject: [PATCH 09/34] chore(internal): upgrade kotlin compiler and gradle (#403) --- buildSrc/build.gradle.kts | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 43583 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 6 ++++-- gradlew.bat | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 493cb327..8a1d7a10 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ plugins { `kotlin-dsl` - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "2.1.0" id("com.vanniktech.maven.publish") version "0.28.0" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d4ba8a0da8d277868979cfbc8ad796..a4b76b9530d66f5e68d973ea569d8e19de379189 100644 GIT binary patch delta 12612 zcmY+pRa6|n(lttO3GVLh?(Xh3xVuAe26uONcL=V5;I6?T_zdn2`Oi5I_gl9gx~lft zRjVKRp?B~8Wyrx5$mS3|py!Njy{0Wt4i%@s8v88pK z6fPNA45)|*9+*w5kcg$o)}2g}%JfXe6l9ig4T8ia3Hlw#3f^fAKW63%<~GZJd-0YA z9YjleCs~#Y?V+`#nr+49hhsr$K$k!lg}AZDw@>2j=f7t~5IW6#K|lAX7|^N}lJ)I!km`nrwx> z))1Es16__aXGVzQM0EC8xH+O!nqTFBg9Ci{NwRK*CP<6s`Gq(~#lqb(zOlh6ZDBK* zr$|NDj^s6VanrKa+QC;5>twePaexqRI%RO~OY075y?NN90I|f^(P# zF=b>fZ73b5JzD`#GC3lTQ_B3lMeBWgQUGYnFw*HQC}^z{$6G4j(n4y-pRxPT(d2Wgb%vCH(?+t&Pj z)QM`zc`U`+<~D+9E{4Uj2kc#*6eZMU$4Oj6QMfA^K!rbl`iBix=2sPrs7j@aqIrE zTaZJ2M09>rp$mgyUZ!r2$UK{+DGqgl`n;*qFF~M(r#eh`T{MO?2&j?xgr8FU$u3-` zhRDc_I23LL4)K&xg$^&l-W=!Jp-P(_Ie07q>Je;QLxi8LaEc%;WIacJD_T69egF?7 z;I_Sg_!+qrur8$Hq4grigaiVF>U7uWJ@Hkd&%kmFnQN-P^fq0gB1|uRt!U#X;DnlV zo?yHWTw7g5B;#xxY`adhi4yZn@f(7-Xa(J6S=#d@&rlFw!qfvholE>MEb|VWn^g}G zMSrK&zQ^vDId&ojL!{%{o7?s{7;{+u%L{|tar(gp?Uxq3p?xAysB>0E$eG#$tvkk9 z2Q2gEP17{U6@UD*v({5MP-CTZfvWMItVjb4c;i~WLq&{?Q1(koX&vt7+$z}10{^Id z{KDjGi0JpD7@;~odF__0m|p;5rIrHidOP9^mwKe#-&JX-X@acc)06G{LO1Wu)#gvZ za~y9(fhA%UwkDOVU1LBJ`0ROE z4&)dJKK%mG@+CIm?+wt9f~@xIMr8}UH*K1j| z0pppo{7gv3v{URwxVMeg>Ps!L5IKxm zjac2egjgb0vH5i75$s|sY_RYec#>faqJk|AGgV;v=^%BM(^p{p;(^SVt-88G9f!q; z>p}9E4^f0=01S2pQBE4}9YqE%TV)*hlU^8k9{&=K76+*Ax^r=AkBb%OCP^P2nm0Ri z;D-|Zk?gGeU<12ti2CnPVNA(Pb)02+r|&yTWW-OJO7 zNLb0pps6aN?A~NJp5kj{{IOlf!5KWMleV@-hYLift)D>-7K+tgs=7Ake}oBnIy-y1 z(Hn@Hjw=_(x>dO5ysQsrnE%A*bk0K<-j{1Yqz@#n#jOL^AzCr#wR|WYzqk6i7v)Lf zkXdKxzuu20aP{Tbg$(+9&oh7cd(Uoqqf<#ujb$q4sZ~gxFbQfS zS)kNklyL*{2AELgjZ(LBu*>S(oH5AaJ;YiB@;l@=O%F6B?oanzoYRM^fQ9-<~^=3$H0g^JPMLQo@SZ@QuNvy)tyJ)LSj`+()#fy?{aV4Yg^7dlQ7AQM^3GLCR2dAFR zJjtfKiVqF`l-H_fz0HD|9g>)pOxn}k!vdZ=DO!7Sikm{Z%P6BrRkBS6W?ZB5W&7rT z@uYpf@M@a!z7H&o@-yrcCL^Ff3e7p3T`R9p?@o-acXmbTSa0>ZANzCSgovsd%;i$| zVus`not!oL#(W`L-!9w0jdaECaG4hk{V7IOs676ZquZH~0TX5hDq|)x z6T497l|E?f4)LA>j=S8}b$0LS=I4h|hUFJYJODT8Li@#6kF$k0)@*l{RnM1HQ%?VT ze-Pqlc!~t(oumVC*?5fwR;P6u{tHaZ~*LlD;B)4f? z?lpWfa2P@)g57flVl83Ej%P`2)gGyaPjhvD(%i~{`2b>#3!+y&` z!2nuwHMFA-zUY}f1^0B8<`N)Gr=A4TS@b1qykmd0Pq{?r)+1^^+D(=xasb^Tf!oK9 zBLL+*p6M_#ufgLzgq1zcSwZsZnQWFLC3`Yxdg-2=*tT`J9nrfYt)RF)YryBf8_gW{ zvKbB+oZLehfT)S#<|y1)E0hW^?+AnqPXq9Hu;v3dsMGdr{SVyF63;K<8VcgI#~}1i zLYSBL0K;RTT(;>2x=*!1Di9w0mwr;`CN}kM65|Ay{~z}_^JKOsRaN<~#9O^iiW<5P zYN7r~HV!#Nz~IZU`P>1Xe%4f~K}KcF#X&5kO*G}-)74S*tQ8CietdPcA1Yl;S=Mr# z`#MYY!{s^uo=jn7;k6O%(}fN+*0cWMpt~#n9DR<3NyU?+3D^AgI}S)Cu-Tljg`VY} zX1=fq$?8$DtOeGxE6f8lbS_6Q3C4+LDTO$}_IpM$Xv<|QSC%+Oll^q$y`7o@jD{dp zNDl|&X)r7wETa-#h*d`KXntxI(Y{vLha{$0i7@G8xx^m=c<{lJ9?p-i!^W{%j7-oo z0W^SzZ^(Wkyz*We{lEn%Yhu-ycUOHtrRiVJL4~&S91*D0MrLu}Q>v-Mc?GcWfpyz% zX|UvcN@krFO#@v|CtYM}g|=L3%aMo$E5<@CM%c*;?u>LOTz00@+dt1{yg1y=$h+{|D17U}$*^fE^H&8b431EUE z<9tv0V_#%#&1N#j7AKCj!tTK@J%oFW*ESW<(#Gl#Xs%v<@AitI?s92nLzm<)w3Wkkom1f$gcdUi%g_*jofy&}N#luL<$GVIe{iQkQ)sIHVy zBgItnPBFamrv6Kb{eE($Q(f`ZPeW!Hm%Y@F*OF1sKB{Yy|C>WEv_mfvv-N-jh)B-5 z4a!1WcT@9a+hGaBrc~sz=>G?Q!*Zp^JFRUvBMyNR1;`)j$RhH$6gEyVKhd$&K-CFT zXaWC-Y=fyOnqT84iMn9o5oLEOI(_3fk!W^8-74|q1QhQ|CmT0i=b;6Z3u?E{p7V{? z;f#Q-33!L+4&QQcZ~GAqu$NS{M;u%`+#9=7^Oa5PKvCCCWNG_~l(CidS!+xr-*gg{ z$UQ`_1tLT_9jB=Hckkwu>G{s0b0F4bnR7GibmHo?>TR&<3?D;5Fb#gd8*wYa$$~ar z7epl1qM)L{kwiNjQk}?)CFpNTd?0wAOUZ|gC{Ub|c-7h~+Rm(JbdoRe!RNVBQi!M8 z+~U6E2X&KSA*T6KJvsqwqZl#1&==Dm(#b^&VAKQ>7ygv*Fyr;)q9*^F@dCTg2g!w~ z%hg)UXAUyIpIbLXJv1nZX+a_C)BOH2hUim|>=JHCRf(!dtTidb&*~I!JrfRe+PO>w z@ox$G2a3i9d_N9J=|2$y2m-P&#PTNwe!oLBZFs;z|F5kXvBDn<)WwE0E3$ow=zg3R zK(9;sf0t;VEV3@gAg7jRtnj%-6O@!Hvg*;XcUAw}!=2*aErvB(eQIm(-UGmq^J=XN zTqJo$Y|WKo^HlBF3BXJrA#}7ZLg=r*w`I*~Ix`o&2k8^(0mt8Rp=A>F`&gehhp@Jy z^e^#B2!~$LvNCKugg)8)-G%&THdk~kfextilegP9?#C#()F59U$&eo(h|5>ceo*Em z{PEE79T$YP|Kr7K`WBHbtQwyxFkCl6xX&+oUf90B5xoi3_5KHHCyEE*oPbOQkfMz& z6^hT8_NXd2iWk{q9IKae1{_7hMPH8I7_BMtVOM4 z6jm?E0QJOn$qrgsJ`9w##GB9?G})-GXSQo6(tYS(Q0-Ct$co?Zzl0?NHsDRron?;_ zZZgQg)%XW>P?8_&zoGuF(>Och2kEJXsu1_X&~w87x!b z>~h!a>e7{`p@+#hXF88wI*JeWRZ;J4ev4<}HWf|Z;(7$E!S5l9wzBHFe>^I{2`a;a)QnAwa2xv1e(bq$<}!8o^ofGvYpk7dBR+`*%iE;hUY5 zaHF}OjGO9r*{%lmcK^uFiTHgoUD`^9Nx@~;Bg!V* zuuJ&ti{DQiq7RyJAR94wem{}cPK1J(Yxnn_{=>?USqz-~&QXRStS^s-7TksZ$AEI! z#og36s3JGtGU{CnDHRFtipFqvrE*gw7_K@NN0h+ItTq@4fqN!HeQU1y7*X?9+IfZT4Vxebpt z%#VzgdDK~-&+=Z*#>=n#XUhNvBZp3=Cr41jMqwJkHLf3L7Vm~V#GgJ(Jpii~PmJ#s zA7Ft!{xD@z>9DUb4JbiUBdNEcU4BO$651iN*mp*f)HbRRM`Cx5cR?5IfEcU{IZWwf zz(M6CDv)>xa3x}K6%tP^i15P1&&DOLK=k~+jNR$UK3frSl+|PjSC-dBItvD~LL! z>_g(YYdO4k(5EbPOw+v+;G7~jYm>F@Ai|o`gs%F)F8tDz$dl7Q%aCe|v|$UkAul_R zNlA-beBX^IJU?kgS`E$it7nF4DaI!SJAGq)2P&Few(-|tp z?K+%D3e4{pfkayrcbm0ftu6Ol2ZzdKM+4i!hNP3NRL`EvvZJ3yvNr2MV%igZ4kj``Qrdb_OI$7jWP z;l0DYf&0(-*QcP5zrP`HVznW+SbH63Qx$7_9~NjRNg7eKqI!UJ=XH`g^=t8GiFTu( z?2L{JKEu%jJx&XjNzU(*!ZNmL1@RlJA0G$2_LrAb_7lmjil(GSlSM zwTes`m+3R;3#N~Xg#9owh3ycXV8@ZlaY_16kpPFA={721b~URO4HD3sp%fmkZM}k) zZB0#)kP=RkNB~R-MCk8aljG_bagt4vIb~8)BV%(b8_;)&Kf9GX+%O_cNG|(D$!3&D zL(I8}*LqN5NntipFlN13=`D>6!{D@CFMBH0kW3=HccJV+xW~|$qeFR5i-2{X+iWMu zI2$gepQ)H_B%ip_BlWOQ*|pErXs|4ir{IHccgaIJ84irE{?+$KDABXr&f`jB^V-c% z$$u`uU1YB^{<+UN2cNg#7&0bz@yF?5>j|;)5&IV3wIQp58X#OE-M^$HdyvL|Um5t? zhZlAG!Mz%XkUe3t471JM*Yur}o30vzu6RN7gJyNcf!IItsDO730mcJ*O!~V``y5=3 zNJGp34DZ}wd1H6V`Uuy%es>BiO_aE-S8jzir#$& zyk)@2a5tP$@g%jW^b^JGdo)X@Q%sE`^lDQmY9m%uDFpPX`w9%=yQ+nneMm#OaXcD` z9}{tn5A2b2z9783vL2_jSao?uxJhWJoq%47*RafM4o0@gY(p)F>qT4^XM5GLzV#6j zC+HoGhAne7o_w{WUo(B++z7lU3Y0k1rYv9|TSv0vR-Du(5=VakbbelgZTeDn+a_Wv zq_j-^+Qz1WAl;Zg>ahX|CERbX1V%B!hTKN?M}fGoA07M(WU&NfT&TmN`P@56U2 z^)vLDs|Ln~0iTtn-?KTeQl@T&bskJFuTUS!m+$CS9vnd}8(UMO|Kv6TCfGN9NUu&4 zL{)GTxPq>fwsJ~aU=4Qhuq8*RzDsP(LZh$BHezq&9gK$IS<|DYbm})$QTGCS6T;Dr zEkLct!b+#<1r9OKG@P!f1wm8>=Nz!7OzJm!g<+`?N3;YaA3(P@EL=(sTaRMDD!c8=-XN^4BXp(eVkj$NmEMYPP>YJ4bJ3yUud z<3BeJAJ$6z^TuywnfH5lv#$lgwraNw{IV=tIznPH1DT`v-5yS=!)J<}xxl}uZf9azA2A97Haf!;<3y01hlw?dWNEv@TLi1s-mO4vmIT%O_42nS z$VRWrs9NngqRRkWAnWkn%`Rw@?wH|)7XL`EL5EZu$qyJW31&CB^T_)qwIv!{;E_6 zo-9XAryQRlk-O0>o#-SZO>|6OYq;}<*>Wu1AsVRiXY4f8qb;+sItv3AyS!4Ry+q}) zA!pAB|BmC;=RIOk^^vlsEH(!Q!7_1FK~ZB2err*o!+b(r=m1b?$6d!%zmN+69LXnT z&gRmM+n_R-F@sT*IYv0_mGPvur!u`iWbQO7SqiGFLeY&yga zf`lM&B74FA2C?N@8_z652fjhBEoDUKbP8hL{0{HAF%qDo7)o3=3rg#6)T7%%5^wl% z9R0*S*<~>nzYOdQk2l`9h#t+gJy_xujw6xjV(8S<_DbVg61&pT%Hi42l%D73G?adn znB%UdNM0p}lEF-P2%TAMam2zpQev71e>a$$%i+r~b+D9G9pF|oY_*(-u*89oKsXLY+UIbqq)MQ%(GYS{(*n_S_*RN$*~`zUtab%0aKwhx znc)Yo?{xq1sJCgQD)TeTci1ucvbez9q=A72H(-SB18Kl&6^vHV8^i!p@>iF!DIw17 z+8Q)TNisB7>pwyww4y)yJx*wX6SJO78eLBC-ar1+k$Z9fy;wBD|3kzI{<+l*>PSY^ z_?nLOZaeWbU@C3hfK?X;Di*8CHCPkx2qco6(ZyJdqSzp^TJ_5Lpa0UP{Gy+!b0Lr% z@xYxSjUKoY6L#>$qx~KD$-0=|OF7zhVP~ntMgEALYPIfhj@+ z!;JJ7te>CcovruwHsJH6Lta$nm|%^C@=V-rmhU{+I~0(|XHQ9jt@L7pb{gx#{4r!) zg($FyFTslcgu(~6lYr$nW?)%*l#VJ=R-jxK(x=t1bWlu(nL66T#qj%3aZ@uVhy}Co zDU_q61DD5FqqJ*#c|(M5tV)XBN?Ac^12*q)VN4yKPJ|#==S_`_QD9|0ls!`2)SwuHDRA_OfXQDq3%qW&MZB}Z!=k-9xqev8jHz(H z{^D@cIB~QiK>~wa)A&^Ll^Wi6QgCzU;iv-BHsLBs zH7=jN%|>0S`SjP%M&AF1PNVDp_FZ?2Bm@7`DC&v(pYrw!!yD#4 z6+<=HS0Ln6MhoKxF<%~H`y20{vf#pxh=;j{zY381gvAFekgG|>G1zo8$&az{V=;JR zy_puF4$L$?EMhT?;TpQoR*j16ll`#AS4e96C}yp_aGKkBe?1H|k_;gG-~Xorc<;lI zkB}fB{$c-D2mGA&{rm<*@F5)c3X+6??g~XoEwuzSuch0D@W~P5(2I8v8F$c2$Vw51 zP#YLSBDqtWW^EYBl^QYHF+MA7am6f4DOhwnJM=W9$uvMOsZ%_~?)2C#wb?CkI$7{K zEi)=#|5pFvg^){zK5kpBLjB2kZ+$ZB|L=W|aNwyyb(gC2l7bcpx{E-H@)q6@D6N^xh`{1E%ItF2$eeB_SjI@b2WgTpS1thwg&n`jiIzw^TtXUyB{00($GIq>vbj|}bav}}Q_~wp3>k8!E@hVC;OMUTu|= zAy#vXH*GrUHu7^cNZWe1>y;2(51js9wbu+R3Aa*(wzH9+X0dIsf&gc_x|_LP z>~CF^?(~U}+l~ehe|i>?4eo!xkq&Lk+RR-1duNP#o~>@1x)s&i&u zRaYL@+D&_M|JLI6fHbEr_`U;HgPTh#E3?sB)A$*gqyBgg*ql|a-m*TX5rACbWKCE6 zdeQ`v8m6>g^ugv`p|HY^#1QZrGGUj0^HVDc@{?Q0yhalbBEV{+|HzC^-{&e{5K%z9 z6Bxtnfu1!@Mp+Q&*&~;FOg&*Vm<@4b;{FG0-!UUXX!|)1w}op!B_|7_s~d(+=9Gba zKp8`LaB4D(H=cGcspJ_TjYaOwMb=sGn^gtUVhK!UI~2KKYEE-NC}F>+BEY7IVvy%KRvm00tg!Q`y=er}wpEetX}K@;}(}{s9AzV#q2@ zBy7}->|N?13POrs`;U?(qAG(I$~Gt+Rgw%aNZ_0fs_utVvRJT-7z4!@x36v@=NBX=IqkK{#Kg0w48de@?#Yb4M(Svj5=T+<ONr8-oh7l?Cji@+erqur zFhZ=9|Lk=$`c}v4u`)-!!UI=!9Jo@h&7p4RlS#u! zZ7-prn75JkV?VjptX;@$#`U`{vB!=Z?V`T*FBF>J?vsML7e6@2GbUteMFfX-TUu{2 zLNIG*;dV)8GV8gAgEf#)X3A>p3^CRka1v?~8x^anBhQ=L=LsOl=&pcOYHo98m##ye z34MtGCDK!`ptl?taGMr5q{!zVc? zG00e){TV?`YA9eB;(lA3lXI?RrB4BYQGk?vOmTIUJED=(`_*gtn2DB-t4WW54as*W zb2kD-lWX>lb$+W!VFakki>B^Vc+u$?NLF>)!U%b@Y}gYJ>m2H=^x0=nsE0TF^Yu0h ztgH8-o1%+jCk(+&`|)tTfEVHq0cMeFa{Uz)X$;fCq%Y=SOWML6bYfeP8j5hktL`KK z(18`XrUn&WN9PtFxh&dX`y~YBsmdhi7Kw%tKzM%^VEhdD<_XkulW-x=JN6OPbFI4@ zzDDRN+f=@{0h*MswwOqG6gJ?{NuHx(y-|FUGsxyZ*x0~$MW(eY>vqq4Fh#t7uzw=- zKB?|!0N~!h^AMdLa)oR!Ca#HZ9&Zf)ghuO<^RN)4twRlygHnQG(BE{cDc5E}OF4;xss6gYyV~EcJvJkX)xNWb=@yw!uq0v-sf^rvkp-;?DPWK@*SEw|V;IH=7 zfQqEV_>DjOPT~8X*J|H8=&RnzK4~S7ML~nLX^%s-Vqc^aWy7N$y57qciZGcqy#=zU zs8hcHiI=D$+RB{|62{ohCTiaML6FI4Uhzo5D{Jik@poCs0w7F)*w}F4r0sJ~#u-72 z5bK=ANt=M$Dh5NKnxGsg9NRR?WD-x|FhTwBjd zD<-K>44DB~i%frJOfnzh1R>PRY34kw!6~p3M$JLaD1r@`=h)~Ngks-(gdXh^Q?BTP zZ^Zj5w1AwtuR2$~E7s9iZdF}z%pv1em^V2rM{1tLUY@-+Sc0(9jA|iZWml1;v13=U zHf?y@#mb--7z6$ue>`qjhE~brk$AY-RG90~5wcBbDReXR2)pKg{L>;H(DI`U!MLNQ zY9rFJP@ZQ}jlcMh%WSCo%vf+nd0Gmd*F%KMIe>slCUh)8Ma|;M_I+v#;|ueg9oLg; zq2HtZX%&#F7vdpNlkX?}(C7dGC^y#NB#m4%69RzTNrk%4ol~hSI%>2r6B|*ZkW(*P z;u#s;+faHo{tfy+1L^RzWDi*^JR0iY(zJDB36y_QJ+|E-2x+cY z!V8uLNktH~q>WQZuY!Ap66WP|E!0PA1jK~)^8oJVGbspJs6QL!!-5Qm7 zHYI|_`Actg?vDzdg5{86w@GS$G6ANzff7->6i5pB$T4O}`fZ_;{217Om0gN5zTr12 z5mW{hCzCE-QubjxN$TAE-XgI-8dTY@OZmq`y+y_>dk*(qXF0{nam|q@~i}Utp*k{yurq(DW54hkDT4bbg z=_etM?Nf5W^o-HEu9_?&xEqPg^P^mTxLH8n%u$!mWvFG|{&)jtnU&6|5-`~eaNz0%D1BDo`{ zS1N5(KW5v^2eLdd_%`uaRndF@h0Uo6=M|8?b~KbOLZk{HXEnGmtgZXf2inI*1r%n! zQ3&%RI4r{f&dwW~HwH0Ked9b!k6{>_19H z_Ai>5IChDMY(FfMyG%;30?SQ{iV9KyGru62+Y)~qSQ91}b~}w<&*}R&1c#$O`H@~c z5)2S_eXx}M#N{MuGeQS9@#UJB@;W_j50b}jIhxMPloEFQZdvwxiU^RYycTzgK)-vl3LT&$L8~@68$C8~5_U{cR$E#w*x65(qw&eoL@>%ZHvj zWnEMlSh*(o&oy|J7eJ5OD`ssy%F?*Vp?`Cq;FShyl{ZoKCG5g{y}>usznni#8ki(i zO{w@n{iAj1_ooX@+s*!uW60WcH~*bNOT6z%0jVML5};wVrQp~`Uss_{cO2oud_nNA8^B$?07fJ6?iI)Q zuo9G)O-z)DqstrBqf>B%S05hf-wep0@$BFHKSrkZ{za3D)yVzRz)2{wf8(Wp+xyAM z$rtyx$gi3A=V~V!`Q3;BM0$>*VVtxEM|xDL^gew7ydy3Q6YzD&THRz*q33Ms_D;M- zbCx1Ft#UNB)V3bf`~{ImI72OTp^|bF8?G8#FRj+Biy8ET5#rA3sd|0FR@U(LAJ%w8 zS1%n8Z=Amhw)92rIsof=YVWF4jw&F*j1LG@-`+cR0-~2LqXRH8(Ccne{y#MCPncF64U`0uO zWmi$dlii~1D0rLR{qc|_2M!C$t8^=G7xQY)9!#Y331A|>N)EhmyVdLWL9I3YLJ`7? zZmpqUJB>Ni9oiL)^1IK1UoMyhWE{$9M2M6Xi zPKk7GpMsA6vjZbU7~i+u|J6Nk|Ci!Y3UMUT2|`M;JsNQACdJ%ooo9Yt{?A+0hMpxi znEa~~sxC>rKrU6bd=WRb;%wsH>A#j4{({&1GYSNR57Gama(3)2A;SM>qop}l>Jk2* zn1+C$fIxuwzg3mCU#SOqb-wOCb6mBcYlA5+mt<&_J~sBxc(GQtBFINUO~Mr7<-uu($>P HJ4oML2Lo<@i8BwbL^1~GkG`E7C$SEa_ zF^}Ea+#Je`Xy6;#D0FPnSrR%Y!QGA~NA^{oWmW8C<3dr{x6wWQ{4+bzemqV5W$i5~ z=J0jXZ>uZb>DT@0Ks?4QJ{`z?8JWl3$y;2pj#$XP*pv$>$g(z43{YH9KmmR6<#sIn zA`#=0#sgycaBQ^&}Xba!|KaZ8~b30v~nLt z9%#gz_*=~KD{3t^X~l>480*}PhKN=??g`RV|4Ud{Gyyl187MJ}r(#e+H$GEdI+p1s zq_25h;fV)$EPK%Dw-(G=f`yHB-_tttsC!?k7*#!|4a>`Ahj8nm?&n>NRs%jkZW^3-0P_yMP5&*6a26{MRj1&TPF zyE#|c)5uUHzMWx=rMKpuPih*V=S;W3MzIZTw2uTbr}8`p2bm+Z6Sa%vvWAWSf4H)p(+ zSQ8;EvUa#wqWV+9vmIio(%7wukK2SwjUS8Yl%Rq%=~PU)2$Tvm6`1!r3H@U#_|bB0 zmlT1PS3wPB(b&^+@YY7Y$n4l3mV3-X0$>z|gZp6O*Lhzn&?Gad2ZCF;+#95-Y?#y+ z?*l@Yf=a4w{Px=o!N|3~_XKfk&G;fN>Ps&dp2FpA~qD=0~=!NOS@B#XAKKkND>Y{4>rqxrViKD7;?>j8`R` z&G)3FN|dfsxnaI^!d1G%=>AbTTxZWo;n-DLrQ!sj=f~VAOe5zhGS(dgx|!ls62fbX zV@<7Ck^!}R=`Swr?(7w1rY6Nmq~sfXJ?TiKJLn=&SQdEt9$@0 zA+h1Wbwbri0s-stc8yVq;mRa6@kEf8^KXUz&jcic!+avDvvJFa>k0ioWug=T3oPw; zyj4it&0@>_*uI@2=^+T7sL1_!^aJW@Xfo8aC#3^WtQC7fET8b9C} z*u^ue6Ojn z7@(eskJ2+cNnH9~VyfIh<-|7!je~vGy*odz(sk-u$~SrYF3glruZ*W`{sqnS+9=;Z zh{D@MSG91%lr&ua8%$sJF%y1I<|e;EdfJykY8#D$Hc_81n5`$7;1N|b0tvvPLzSg& zn7!5x?T*@rQUKcUhTIjV(rw*5oQYlm5DbEO?60#mohHfbR$3_x#+PZoYi@Vd4`#YgKyTd^!4n{fN~WZDY61sAOm6 zl!d^i*a01QxpWM9Pcl?&{RgO}uq%ErOk5WpECvnfEh!*YP&1Sl)uTN4hg??Vqs~i5 zYsfufz3?{TtwuBN=`0~Qg1PlWH#OGG$ zLLWU17$v``)CE1cds_7kj8mJ{-+l8{DS|zAQ&3|qpOY=!J|kXUhXue9|H>4gqk|n) z-i34GmxLFj8asb3D#D&=ya*a5`C<=o?G;Ev^LV%;l#nH#O=7Nh@z1Do>j6Q;I5S2P zhg|AZbC&|c7}uSJt57s2IK#rSWuararn-02dkptTjo*R{c5o(bWV}_k3BBnKcE|6l zrHl&ezUyw^DmaMdDFVn<8ZY=7_{u{uW&*F<7Al6};lD(u;SB=RpIwI)PTyL=e25h* zGi{lRT}snjbMK~IUx|EGonH+w;iC2Ws)x>=5_{5$m?K z5(*1jMn%u0V1Y%m@`YS3kskt~`1p(rA4uk;Cs!w^KL$w>MH)+cP6|XKr4FfHIATJH z!EGAK4N>1yFR`-zW|w%ByRe#=&kA&#WyUldDGpt!wf-8SFWiSi!5QZL+l7*CE?u!NW1T$<1rdLJ9y3u{_zvHaM?#Rm4 zFk}^1!ffcrB|XK3gsO-s=wr*sUe&^$yN|KxrA)uW00Gu60%pw_+DcUjW`oW<35OC8 zq2{j8SgC}W$?10pvFU83(SL$%C?Kctu3*cs0aa%q!fjn1%xD*Jrm!F3HGR9-C{b?- zHp(cL;ezXMpL@0-1v0DMWddSDNZ5h?q50cOZyVi#bU3&PWE=(hpVn|M4_KYG5h9LffKNRsfhr^=SYiKg?#r&HNMi2@cd4aYL9lw(5_IvQJ zcB*DD()hUSAD^PdA0y|QrVnqwgI@pUXZXjHq3lG2OU&7sPOxxU$Y3&ytj6Qb=2#cC z;{d-{k|xI*bu+Vy&N+}{i(+1me!M;nshY_*&ZQLTGG*xNw#{RpI`3^eGfHck+*38NRgiGahkFethtVY=czJs#)VVc{T65rhU#3Vf?X)8f0)X{w!J3J{z|Sq|%?)nA+zo?$>L9@o`Kc|*7sJo4UjIqu0Ir~S5k^vEH};6K?-dZ0h*m%-1L zf!VC%YbM1~sZOG5zu&Sh>R;(md*_)kGHP)<;OA44W?y53PI%{&@MEN}9TOiqu+1a3AGetBr$c)Ao3OX>iGxmA;^^_alwS818r4Pn&uYe^;z6dh z)68T|AN=hjNdGpF7n>y+RTAZc9&opTXf zqWfK_dUv=mW{p_vN>|(cIkd(+Jy}qnK{IW%X*3!l`^H~FbAHwof+vLZ0C2ZXN1$v7 zgN&R9c8IO`fkR{6U%ERq8FN<1DQYbAN0-pH7EfcA{A&nhT!Be>jj>J!bNRw4NF|}! z1c70_#fkk!VQ!q1h2ff@`yDyrI1`np>*e#D4-Z~*!T^8#o*$V~!8bWQaie?P@KGBb z8rXc!YDL!$3ZgZZ%;-%~0Kn<+d+{xJ$stQbtN8GWV?MCJvzPU|(E(1z;rFw{&6vy) z3*@y%7Tx8rH-p$boS>bLyod?OKRE8v`QSBvGfY6f}_{Zo1q85xoyOF16n~yHx2W ziydUoYLkJmzq|n&2S(O!ZmLdP1(o1Jsq88cX)x3V-BK5eF&0e_0G!5?U7&3KN0`mc zH&Lt)q8!d_VgzxyL^(@xrbp2y)Hmr^V48));RSfE=*Ly0uh9!$3dv-vMZr2URf@l5zdwLjGZB zugY>7_fd_vbV*Qv1?H~>Z%RD%nEeFSI$n$$Lrpc6g>i4+XdBB!%zM$Bhrz5Swzyg? z$~I~n@~-wTBY3-T&pr+|gC+OHDoR?I(eLWa{Z#Rsh>lc~%u0!&R|s0pA*w<7QZ}{i z*AFr~0F3y~f$MGh_HDL7J_1?SxKL}fWIk!$G}`^{)xh*dZ5kK>xGL9>V`WZZg_ z)^Vm)EQK`yfh5KiR(vb&aHvhich z_5o+{d~0+4BEBqYJXyXBIEb1UgVDs;a!N2$9WA>CbfrWryqT25)S4E4)QXBd*3jN} z?phkAt`1rKW?xoLzEm!*IfkH|P>BtECVr0l8-IGk_`UjE#IWkUGqvyS+dMrCnFl<7RCgSMX^qn|Ld_4iYRldO zY&cHhv)GDo8nKvKwAbfyLR%t?9gG?R7~PSD#4D-;?F&!kV59O}neYut5AGbKwy-(U zqyBi=&Mgj|VIo>$u!DHM`R7O?W8-idbePuxiJMH``6c_5L-chKd}=rGC5Gfrc{f!* zWFEBm?l@_b7kzY7%1RQQbG5V<4=ZlkZ%sF74Q|mKOc7Ak7dP2#quiGcZ0_J%7Q?j{ zv9{WFw;n5G-Mn%r#0R;{jLt{yy}9J6rQ(>X9pJ`7Xy?Zv z=lNit#qXaq?CnElK^zF~sG}U5oCpR0T>FH=ZX}Prju$);?;VOhFH8L3I><9P_A|C+ z{;>~dk%9rrq(snjsEm}oUz2FQ21MCG*e?g)?{!&|eg7PX@I+Q0!hL6C7ZVY|g2E>i zr!Ri2@OfEu$)d52+>+cpgh6Z;cLYCZ&EMR0i<^~4&wEu_bdo;y^6}+U2GIQgW$|Od z_jg{O=pU>0-H$P-EOlWyQy#W0r@@_uT}Lg+!d5NxMii7aT1=|qm6BRaWOf{Pws54v zTu=}LR!V(JzI07>QR;;px0+zq=(s+XH-0~rVbmGp8<)7G+Jf)UYs<$Dd>-K+4}CsD zS}KYLmkbRvjwBO3PB%2@j(vOpm)!JABH_E7X^f#V-bzifSaKtE)|QrczC1$sC<<*Y z$hY*3E10fYk`2W09gM_U<2>+r^+ro$Bqh-O7uSa)cfPE_<#^O) zF+5V;-8LaCLKdIh3UB@idQZL`0Vx8`OE#6*1<;8(zi&E7MWB1S%~HAm%axyIHN2vd zA(pJGm_PraB0Aat3~?obWBs?iSc*NhM!{-l_WNCx4@F7I?)5&oI|z{o@JKd1HZ}zf*#}JjK3$ z-;3V*WJZvUcKvSOBH4c7C{fl8oRw8-vfgKQjNiR|KhQ%k6hWNEke(k8w-Ro| z7Y3)FsY-?7%;VT64vRM)l0%&HI~BXkSAOV#F3Bf#|3QLZM%6C{paqLTb3MU-_)`{R zRdfVQ)uX90VCa3ja$8m;cdtxQ*(tNjIfVb%#TCJWeH?o4RY#LWpyZBJHR| z6G-!4W5O^Z8U}e5GfZ!_M{B``ve{r0Z#CXV0x@~X#Pc;}{{ClY_uw^=wWurj0RKnoFzeY` z;gS!PCLCo*c}-hLc?C&wv&>P1hH75=p#;D3{Q8UZ0ctX!b)_@Ur=WCMEuz>pTs$@s z#7bIutL9Pm2FDb~d+H}uBI#pu6R}T{nzpz9U0XLb9lu@=9bTY&PEyFwhHHtXFX~6C zrcg|qqTk(|MIM%KQ<@j=DOjt|V)+8K26wE_CBNnZTg+Z+s}AU|jp6CFoIptG1{J*# z7Ne~l;ba*=bSwAMQ|Vq#fW~+je4PXA91YFzBubNF?ovIOw-$C-8=Ehed{lGD0}(Id zRe4sh8L>&T%{>8o))he}eE;5_ zxoXk3wX?MyNl-xF!q1d$G?=wp^`@09(jU&X zOqZIBI#dN`2PJNdATR3ivtub|nO$dulSaP|e4)WXF1YAGN1pDQIbIjXFG!oC85Mt; zW$eteoL{y^5t4TMRwP$jNPjZFpGsWnGe=jMMqKtcZm9Y9PFZLi*1p@qoKKub^T@2+ zk$@*KYdQ?Z`}<%4ALwk*Yc{(WTf@#u;as(fvE^9{Gk)lWbJP*SjttWofV0s?AB({~l zZI1hZVWFT~W-T?nfMMcnCS4-#6H-MU7H$KxD;yaM46K4Kc@~Q>xzB+QnD_I`b_l3m zo9pRx46b!p?a^&zCDwygqqV3epjs(s0NQI6ARA1n!Yy-qduipxQ& zUAlqRpNjBS+y-ZheD(!R;F}&^V_}b_gqH%tVZ5%%ziO7k^w=es+wZtK^i*vmrWNLMs{oWu_CIov|s1raZiS)>38>pYu;i+-t zI_DiNe6aA4KTZ2P09qPj(0~K4nUq^0+f(2$g`229zkG4jLzRvJUWE0oF1XHL4t3UN zDH466G56sy9hTZoAJB!C3;@F;ONxEk5u6Mv%zdo}Rq`=* zw1n7MOhfNSV48TS989ArIcj`C%Gk8~93~u>)!Yt2b4ZriKj9x2d`H2HQNJ=I>hkDlcZn zqRj>!;oRMTIOu zx|Zfsu~v76T{z7AC(jxj^c@tnJHZtGPsq$DE!8kqvkDx5W?KUJPL+!Ffpwfa+|5z5 zKPCiOPqZZrAG;2%OH0T$W|`C@C*!Z`@Wkop{CTjB&Tk`+{XPnt`ND`Haz;xV`H^RS zyXYtw@WlqTvToi;=mq1<-|IQ(gcOpU%)b#_46|IuWL#4$oYLbqwuk6=Q@xZaJSKVF zZcHs~ZBl;&lF3=+nK; zF`4gSCeZXlwmC_t4I`#PUNQ*)Uv&oGxMALip|sxv^lyVV73tKI7)+QY5=tEMas{vTD-BaTJ^*Y6gq~PU;F5X!sxqiq$iFCo+Uv7m%1w((=e}Vf*=dtds|6 zbX}91!G?C*KG03eHoN}RZS9DJxa&8YwNCT8?JxMXyZqZr13NA|GB{+vG`08C{V(yy zf*Lw$+tYSU_+dI`3n{bMrPdDb`A=Mkg!O=k>1|*3MC8j~- zXL79J4E=U^H=iBLTeHE_OKzE&dws8RNynsSJ!d;`zK?P92U{f)xvD7VQVosrXZrL+ z6lMVdD1YgL;%(1cq{#bS6yXmp|DS@nax#AqqlZhtUQdh<^2vr5`EpAO

LGYq)sa(w9^3-f}NHy=GR4v%t2YZly3m1G@5y`xBh_HGrD%f z>;|Ty?9FiJAc&UVD(StT4I` zfVQwxhE9bXE6r2mKO8Ag7{L^jCyqQb0QqKDPE=RAgqn8q1O^>(z7h5kE(6va%QqRZ zkIOmp(})rLSS(2{=C12e&@!W2=Jel-^_R``0xHO^+t!(oXbcv5yhD4g*$t_F)_5Dl zSVCgesW%;DtYPCFs{G;GX_o?1J3;QQPPv)rWw;>} zJ&KwnUqwNXloNXlK_+pNDfI~hON#SokVJb&ilg8d7^NWo2ZQymCqQMnjfi>ePibjr z-Z@q!?RGN$Mj}Nk){X_vaj6?Mj$>ACR*z|6MsXy3VZ^PFn@yHkPo(>m(iWepn8SC@ z>D2;R4m+gDRZ=SIX!b+CP(qE=JDIUkn=D$aUu+Ihn9-+k1LS3PreQg0N5eWIG@x${nC3v^7caS>1!PKNAY9J z#}E}Q9w#SP>(GY7Hbj&z4$Li6o5taBO|4+F`yS9zq*LJ<38wy4I>HA9(&GYrk4dLajKGww))BWli6Ln1A^Lda@N~p+snkb9C z@OthI+<##vp8!HVQT4Wk(=@zQ{OvZ$EKWS73+JHb)eYLGD-cqi6^|vd$<+IHuc?Nq zW7JertT~3))4?J|28n$I@nAD0c1%9C&IVhEZX~mUsf{efyS(XNG%ch;!N~d7S(Ri7 zb&=BuON95aVA&kLn6&MVU|x}xPMp7xwWxNU1wS+F6#y}1@^wQZB*(&ecT?RnQcI}Y z2*z!^!D?gDUhc@;M^OpLs4mq>C&p{}OWVv<)S9KMars@0JQ{c_ScGsFo3BJ)Irg++ zAWwypJdTO-_{Uh8m(Z!3KL7K{ZZzKHj;{M8I$mV>k znTM?sa0);^=X^cglL`uC+^J)M7nEa$w=VwFULg~%DJllw+7dJAj3{qnP5i3@wr7%y zjXp?Wl2%Th=my&3u?Q$RV6N5tzKMSPTsc#J+-cDDp~qFB6bL2C8AS7Y3PKtVhdhl) zIaLqH5+OnWPWSt(lQCgkN8lczc-V%_iZ{>#1%Z$N*>lu#S;0MZ$T2Y8Kg!U;hAZj> z6S#%$DQ_`Ic%Zr@?}GgjRXg@qTj^17n`65oJ@Wj0u1X8&+UVd|Xs?J+i_^GZ94m6= zUc96~Q`OJvlKB_Lr15*Yw_PUPEr?f?H&00b^-W%26mD)(n(rGGNfK9~2h=C>p-7BZ zFd&*&Msdu{w~(eyFOglwCPH^Rb}O(N7LtS+nnEwDx*pGD?|&9Si~M43a+*L(b0$5A zv`T`(G3xO;I_sx;FwTP21ZlfDpz zOo?}Vlgf~fo{YWm@n_JyD*frOg{XsvBA~|Tn4V6hu>Gd>89-rblfVJUaGvj6X%NZ} z$tFF9sx=4_$*c~G`9iPLGh@=sV+O{D2-t*K@J7H=`V+oVt}8?04WwU3h1BgS!f%1P zFak-T#7`TtLcR=Yz>g0R!ZQrH!YiZOQN=_V-UyncN1Rc18?KY?#O`v#JK+pq0K$~H z3D@v9DZF42R)b9#BBX{^$DOMlJ!g)Gc za{o-1e%F6NvgKq9tC8pV+9S$;9*zNv{J*)n&dmf~anP1)4~N%~h#c(=B#3*KgzhCKhFdgDoWi2IDog{RVyzK|Y`rCUs3T~pJMmdZJy4?b z&s5G=zhf**(t7Y^oC_mcTsE-{^}wiaoUu&?kojLKs>SJPxjcP>{a5CbXCx92AcBE) zHtqP}LjZ{W>PH?Tu(E0X=%{PBMW@F_?#7b&#!^q`<-5$ur+-q6 z{dn=(^UZw6*3-XM_(=@<1_*i&XM4=0t5u!gm6 z{UlmNGPKgO_;e;q9|#esq~Sq`<}%d{+sRmhvsA{5i*91=tub>OZZ%)xUA#4q$dDyy z1`w4%?OPLg3JeZb#cqSMO?*Xn%|-FCcuH2i2fn_{IFusub6;NQdN|7TD1N?%E8*g? z$apAt@cEe!I%jB=*q$p_3=t_5R0ph%{qaq+QDg!c99Y!Xa!&oDZOeis_ot)gNXr{l zdY$|So2Qed2Y7KMNBrS^E169kG%h<+z{Z_p_;shB!uY)>yAVcK=&!bg`lVg)4T1|7 z0}7FpfydVH4F87K@c!nEG+WGKm{Ouo)Slpl;#qcEIQ0zdMfLA#;dBxYw;p;KoVv6| z3_D5&7rJdG12CnDSvZUW?$UC6^UVSW^|vw|o-_4bz)(w5(3AiVhpeT(|=f#x_}E?s#qHZF#xA6AF_ujl$G z-jHD%q(d2}v2PhXx&6YWps~m(^+RXl91Q#xRRJBhjKl$FG4bk);|ag;ieUZ&!Ii3$ z(iGz1+0m7#g5>ASldBbNZL=ZHh=tmmJt$!71; zIML2GhEz1pg@1rQN(M^_691wAGkJ@Pga_05WuQ6! zG5RkGY2^`@(H~pp7&Ga+Pwh3L!Njj!-rc;^bTIfo5hP@H##1X8xUZJckrx>id`bAd3QUx9GuomqBYZ!uN1-&o zvTxC?;p8vL67&fW8fw(YOqt>L@bdLrEF*3OgYe$4n4{ zEB40LiU#6-0@5jdN`0w}N0qi@c0~oT2FP z)LNk&a82my?jv(tQpiMi$TK_L@lub#lsM$R{Dk?Ya@%%%huZkct~tSWM714c!45k}-ZLVA-bVM`>|_ZBbW_m-7| z3U%xrAhi}n?T(2F{_n4EZ10inkIFl#y09?7$uwBoJgqY8vylwev)fDOn;>0R!aEnV zBz%j0Mqpx~EZU3q@%+oV7;}|vt7$~ou@faEIq{p?FY$XXg&6*K)b_LP=}gi9`Bij3 zN`zEo|B6*|-;>S`rNa^BKRDbDAk>X#MsR`EvL>6bqU@SaDDs z8>bu@3YdRaWs*Te@G-UHjU%F~kTHw5(0PVJ+pwh#ha2u;DB+UMo@A5UYIl#5rtBV- zGX_hIpw}3C@H*Us(Cc-d#-gNrG#w$(9+S=GxO>3SR`SE2fHZ2KrDc#_C^$jI>Y}#; zMwY=R6@+dWi~0RXw(c@3GZ&%~9K(q&ee0Zw;pwL`E_tZak-#8^_b)Dpyi73^he?xV zXJ08&wh5-M&}qy4f7!D&=E)puDD(Nmg1d_(j`4LvxM5x_huNg-pGG%9rYqO6mImyJ@}*3Y>^3OvcnTG%EV1) zq_Ap?Z!Iw__7#D=pOWnQN$gB!Mr0!9yx|g<4icJh{cFOu3B8}&RiYm+Mb;VEK``LK zL(NcpcTiGieOIssSjr?ob}^``nNf&UcJhXyncO9m{6gD$kqSD`S69(aF8dkWz5>!9 zBLe4Sib7Hs2x_L2Ls6Ish$MGVKrGt5+_2zCyP1byaCg3upo+-I}R4&$m)8 zQ7|jc1Z^VWggpuQj*cP;>Zo9LS!VSzrqmZczaf;u`d0J(f%Z9r%An@s!e>n9%y=n!IZ_tVGu{Jmsbp}Fk%HJIU?a+-~bjfLTuH|JExA8EROowzr zqW9{YyZhR0a4clRK>1I4Ncx&WER~{iE;F^$T7K%X@3PGOA%6#Z%p3TS^&M;Dnjw@i z^o!$9nhcsmcHcY4?4j9+ofL_CWsZ4Hcch(rjsGfGD(nsH>w}^ERqGnz%iGj0j{g}h z7wMkJ-2Z2~eS>2!i}0~B63i;>SyFJU2+>VCS^AxaDOx%g6-t0eM^P<3+*z`ztvOqrG3)&#$K?& z_Y0wbWID47@cU`E1A6A&!`aZk0ZE@z-h#l1NqX2#`$Uev2gepW`rf8*!=rD5&;Jb{ zl08rU>dPo=K%-1Ao1~G-@4ve~y5#9E8x;TE0k5d^TC(=Zc>mwjW^c=+U-<9}b0ku~}gj z3sbW>R2M6DR!g#NUP;nxo>)@7*=RP{U18SDop6b2&PHce^&h97@xx3t+VK+!keE#} z;(Uf&89as9k8{$nkLbuB!-d7TP`_VJpL^Xs8OKB~ri$YUbW8fch64}7|0EWoT(TRj{ z*GT<7Y<7DsrCi79ZsM)z#c(!nNOGySOCkY1fAuQOq12&iUVC!a`#O;dBLf=d?&4*B zI~LgAO7E0qxK(uRTM;IgJ}+z^gD+bi-6I!3x{r9`l~%8TRP%UE0V8E*Sz>Nl1NVG<<7(wDHZ+HcOkQm$O&k+vyx)y)x{Pz!U8hS$*m zByc0h6BUI*BOpuL==P+H|Hx%`>7!W+1H!l9vi&)`V zyn2o9{z=lc+VX*!Vh~SF=)L}Z40XeG>LF6cP^b+R$NxSeUqbK^Q*UTalKzP8X%{9@RSCXm_NhF>{=S2 zi}ezam_^P`S!!-cyEW9y7DBbK93roz@Raccy*v}?mKXScU9E_4g;hBU7}zSofAFda zKYEe?{{I54 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## From 1cef90d50b2920f67b9455c0b1a1cdad5d86a0d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:57:20 +0000 Subject: [PATCH 10/34] docs: add more documentation (#404) --- .../src/main/kotlin/finch.kotlin.gradle.kts | 8 +++-- .../api/models/AccountCreateResponse.kt | 18 +++++++++--- .../tryfinch/api/models/AccountUpdateEvent.kt | 19 +++++++++--- .../api/models/AccountUpdateResponse.kt | 18 +++++++++--- .../tryfinch/api/models/AutomatedAsyncJob.kt | 1 + .../tryfinch/api/models/BaseWebhookEvent.kt | 18 +++++++++--- .../api/models/BenefitContribution.kt | 1 + .../com/tryfinch/api/models/BenefitType.kt | 1 + .../kotlin/com/tryfinch/api/models/Company.kt | 3 ++ .../com/tryfinch/api/models/CompanyEvent.kt | 18 +++++++++--- .../api/models/CompanyUpdateResponse.kt | 3 ++ .../api/models/ConnectSessionNewParams.kt | 1 + .../ConnectSessionReauthenticateParams.kt | 1 + .../api/models/ConnectionCreateResponse.kt | 18 +++++++++--- .../api/models/CreateAccessTokenResponse.kt | 24 ++++++++++++--- .../com/tryfinch/api/models/DirectoryEvent.kt | 18 +++++++++--- .../tryfinch/api/models/DocumentResponse.kt | 1 + .../api/models/DocumentRetreiveResponse.kt | 8 +++++ .../com/tryfinch/api/models/EmploymentData.kt | 20 +++++++++++-- .../tryfinch/api/models/EmploymentEvent.kt | 18 +++++++++--- .../api/models/EmploymentUpdateResponse.kt | 6 ++++ .../tryfinch/api/models/EnrolledIndividual.kt | 1 + ...nefitIndividualRetrieveManyBenefitsPage.kt | 1 + ...IndividualRetrieveManyBenefitsPageAsync.kt | 1 + .../HrisBenefitIndividualUnenrollManyPage.kt | 1 + ...sBenefitIndividualUnenrollManyPageAsync.kt | 1 + .../api/models/HrisBenefitListPage.kt | 1 + .../api/models/HrisBenefitListPageAsync.kt | 1 + .../HrisBenefitListSupportedBenefitsPage.kt | 1 + ...isBenefitListSupportedBenefitsPageAsync.kt | 1 + .../HrisDirectoryListIndividualsPage.kt | 3 +- .../HrisDirectoryListIndividualsPageAsync.kt | 3 +- .../HrisDirectoryListIndividualsParams.kt | 1 + .../api/models/HrisDirectoryListPage.kt | 1 + .../api/models/HrisDirectoryListPageAsync.kt | 1 + .../models/HrisEmploymentRetrieveManyPage.kt | 1 + .../HrisEmploymentRetrieveManyPageAsync.kt | 1 + .../models/HrisIndividualRetrieveManyPage.kt | 1 + .../HrisIndividualRetrieveManyPageAsync.kt | 1 + .../HrisPayStatementRetrieveManyPage.kt | 5 ++++ .../HrisPayStatementRetrieveManyPageAsync.kt | 5 ++++ .../api/models/HrisPaymentListPage.kt | 1 + .../api/models/HrisPaymentListPageAsync.kt | 1 + .../kotlin/com/tryfinch/api/models/Income.kt | 4 +++ .../com/tryfinch/api/models/Individual.kt | 2 ++ .../tryfinch/api/models/IndividualBenefit.kt | 1 + .../tryfinch/api/models/IndividualEvent.kt | 18 +++++++++--- .../api/models/IndividualUpdateResponse.kt | 2 ++ .../com/tryfinch/api/models/Introspection.kt | 29 ++++++++++++++++--- .../api/models/JobAutomatedCreateParams.kt | 2 ++ .../api/models/JobAutomatedListPage.kt | 5 ++++ .../api/models/JobAutomatedListPageAsync.kt | 5 ++++ .../tryfinch/api/models/JobCompletionEvent.kt | 18 +++++++++--- .../tryfinch/api/models/OperationSupport.kt | 9 ++++++ .../com/tryfinch/api/models/PayStatement.kt | 4 +++ .../tryfinch/api/models/PayStatementEvent.kt | 18 +++++++++--- .../com/tryfinch/api/models/PaymentEvent.kt | 18 +++++++++--- .../api/models/PayrollPayGroupListPage.kt | 1 + .../models/PayrollPayGroupListPageAsync.kt | 1 + .../com/tryfinch/api/models/Provider.kt | 1 + .../tryfinch/api/models/ProviderListPage.kt | 1 + .../api/models/ProviderListPageAsync.kt | 1 + .../api/models/SandboxCompanyUpdateParams.kt | 3 ++ .../models/SandboxDirectoryCreateParams.kt | 8 +++++ .../models/SandboxEmploymentUpdateParams.kt | 6 ++++ .../models/SandboxIndividualUpdateParams.kt | 2 ++ .../api/models/SandboxJobCreateParams.kt | 1 + .../api/models/SandboxPaymentCreateParams.kt | 4 +++ .../kotlin/com/tryfinch/api/models/W42005.kt | 3 ++ .../kotlin/com/tryfinch/api/models/W42020.kt | 2 ++ .../async/hris/DirectoryServiceAsync.kt | 2 +- .../blocking/hris/DirectoryService.kt | 2 +- .../blocking/hris/DirectoryServiceTest.kt | 1 - 73 files changed, 365 insertions(+), 66 deletions(-) diff --git a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts index bad07eed..c431ae27 100644 --- a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts @@ -21,8 +21,12 @@ configure { tasks.withType().configureEach { kotlinOptions { - allWarningsAsErrors = true - freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=1.8") + freeCompilerArgs = listOf( + "-Xjvm-default=all", + "-Xjdk-release=1.8", + // Suppress deprecation warnings because we may still reference and test deprecated members. + "-Xsuppress-warning=DEPRECATION" + ) jvmTarget = "1.8" } } 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 efce62dc..3ac31755 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 @@ -49,13 +49,13 @@ private constructor( 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") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") fun authenticationType(): AuthenticationType = authenticationType.getRequired("authentication_type") /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** The ID of the new connection */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -70,14 +70,20 @@ private constructor( fun _accessToken(): JsonField = accessToken /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId @JsonProperty("authentication_type") @ExcludeMissing fun _authenticationType(): JsonField = authenticationType /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** The ID of the new connection */ @JsonProperty("connection_id") @@ -145,9 +151,11 @@ private constructor( fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = @@ -158,9 +166,11 @@ private constructor( } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The ID of the new connection */ 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 ce76a63b..3ee67246 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ @@ -5929,6 +5939,7 @@ private constructor( "SupportedFields{company=$company, directory=$directory, employment=$employment, individual=$individual, payGroup=$payGroup, payStatement=$payStatement, payment=$payment, additionalProperties=$additionalProperties}" } + /** The type of authentication method. */ class Type @JsonCreator private constructor( 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 be41f1f3..95947a9f 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 @@ -45,13 +45,13 @@ private constructor( ) { /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") fun authenticationType(): AuthenticationType = authenticationType.getRequired("authentication_type") /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") fun products(): List = products.getRequired("products") @@ -63,14 +63,20 @@ private constructor( Optional.ofNullable(connectionId.getNullable("connection_id")) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId @JsonProperty("authentication_type") @ExcludeMissing fun _authenticationType(): JsonField = authenticationType /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId @JsonProperty("products") @ExcludeMissing fun _products(): JsonField> = products @@ -131,9 +137,11 @@ private constructor( } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = @@ -144,9 +152,11 @@ private constructor( } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } fun products(products: List) = products(JsonField.of(products)) 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 cf1a2867..bf1f2284 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 @@ -367,6 +367,7 @@ private constructor( override fun toString() = value.toString() } + /** Only `data_sync_all` currently supported */ class Type @JsonCreator private constructor( 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 82b53692..da060165 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 @@ -37,13 +37,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -53,13 +53,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -109,24 +115,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 c150a0d7..a3b1dd47 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 @@ -124,6 +124,7 @@ private constructor( ) } + /** Contribution type. */ class Type @JsonCreator private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt index baaacc1b..e3c08d48 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt @@ -7,6 +7,7 @@ import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField import com.tryfinch.api.errors.FinchInvalidDataException +/** Type of benefit. */ class BenefitType @JsonCreator private constructor( 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 62c19e2a..05af16d0 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 @@ -553,6 +553,7 @@ private constructor( ) } + /** The type of bank account. */ class AccountType @JsonCreator private constructor( @@ -962,6 +963,7 @@ private constructor( ) } + /** The tax payer subtype of the company. */ class Subtype @JsonCreator private constructor( @@ -1025,6 +1027,7 @@ private constructor( override fun toString() = value.toString() } + /** The tax payer type of the company. */ class Type @JsonCreator private constructor( 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 e2427d65..8bf208ef 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 ad30f63e..37dc3bb1 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 @@ -536,6 +536,7 @@ private constructor( ) } + /** The type of bank account. */ class AccountType @JsonCreator private constructor( @@ -945,6 +946,7 @@ private constructor( ) } + /** The tax payer subtype of the company. */ class Subtype @JsonCreator private constructor( @@ -1008,6 +1010,7 @@ private constructor( override fun toString() = value.toString() } + /** The tax payer type of the company. */ class Type @JsonCreator private constructor( 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 78694de4..8134ac6c 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 @@ -611,6 +611,7 @@ constructor( ) } + /** The Finch products that can be requested during the Connect flow. */ class ConnectProducts @JsonCreator private constructor( 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 0ca21168..0446feaf 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 @@ -494,6 +494,7 @@ constructor( ) } + /** The Finch products that can be requested during the Connect flow. */ class ConnectProducts @JsonCreator private constructor( 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 5388fa64..fac7ac47 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 @@ -53,13 +53,13 @@ private constructor( 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") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") fun authenticationType(): AuthenticationType = authenticationType.getRequired("authentication_type") /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** The ID of the new connection */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -76,14 +76,20 @@ private constructor( fun _accessToken(): JsonField = accessToken /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId @JsonProperty("authentication_type") @ExcludeMissing fun _authenticationType(): JsonField = authenticationType /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** The ID of the new connection */ @JsonProperty("connection_id") @@ -156,9 +162,11 @@ private constructor( fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationType(authenticationType: AuthenticationType) = @@ -169,9 +177,11 @@ private constructor( } /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** [DEPRECATED] Use `connection_id` to associate a connection with an access token */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The ID of the new connection */ 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 8c56f481..09bf9aba 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 @@ -60,13 +60,13 @@ private constructor( fun accessToken(): String = accessToken.getRequired("access_token") /** [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** The type of application associated with a token. */ fun clientType(): ClientType = clientType.getRequired("client_type") /** [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") 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") @@ -99,7 +99,10 @@ private constructor( fun _accessToken(): JsonField = accessToken /** [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** The type of application associated with a token. */ @JsonProperty("client_type") @@ -107,7 +110,10 @@ private constructor( fun _clientType(): JsonField = clientType /** [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** The Finch UUID of the connection associated with the `access_token`. */ @JsonProperty("connection_id") @@ -207,11 +213,13 @@ private constructor( /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** The type of application associated with a token. */ @@ -223,11 +231,13 @@ private constructor( /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The Finch UUID of the connection associated with the `access_token`. */ @@ -342,6 +352,7 @@ private constructor( ) } + /** The type of application associated with a token. */ class ClientType @JsonCreator private constructor( @@ -405,6 +416,11 @@ private constructor( override fun toString() = value.toString() } + /** + * The type of the connection associated with the token. + * - `provider` - connection to an external provider + * - `finch` - finch-generated data. + */ class ConnectionType @JsonCreator private constructor( 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 c693180a..89d92833 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt index b68a126d..4d3bb4d0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt @@ -209,6 +209,7 @@ private constructor( ) } + /** The type of document. */ class Type @JsonCreator private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt index cc3a9c67..4ddf57aa 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt @@ -125,8 +125,16 @@ private constructor( interface Visitor { + /** + * A 2020 version of the W-4 tax form containing information on an individual's filing + * status, dependents, and withholding details. + */ fun visitW42020(w42020: W42020): T + /** + * A 2005 version of the W-4 tax form containing information on an individual's filing + * status, dependents, and withholding details. + */ fun visitW42005(w42005: W42005): T fun unknown(json: JsonValue?): T { 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 166edd14..67e18b11 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 @@ -151,6 +151,7 @@ private constructor( fun title(): Optional = Optional.ofNullable(title.getNullable("title")) /** This field is deprecated in favour of `source_id` */ + @Deprecated("deprecated") fun workId(): Optional = Optional.ofNullable(workId.getNullable("work_id")) /** string A stable Finch `id` (UUID v4) for an individual in the company. */ @@ -229,7 +230,10 @@ private constructor( @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title /** This field is deprecated in favour of `source_id` */ - @JsonProperty("work_id") @ExcludeMissing fun _workId(): JsonField = workId + @Deprecated("deprecated") + @JsonProperty("work_id") + @ExcludeMissing + fun _workId(): JsonField = workId @JsonAnyGetter @ExcludeMissing @@ -559,12 +563,13 @@ private constructor( fun title(title: JsonField) = apply { this.title = title } /** This field is deprecated in favour of `source_id` */ - fun workId(workId: String?) = workId(JsonField.ofNullable(workId)) + @Deprecated("deprecated") fun workId(workId: String?) = workId(JsonField.ofNullable(workId)) /** This field is deprecated in favour of `source_id` */ - fun workId(workId: Optional) = workId(workId.orElse(null)) + @Deprecated("deprecated") fun workId(workId: Optional) = workId(workId.orElse(null)) /** This field is deprecated in favour of `source_id` */ + @Deprecated("deprecated") fun workId(workId: JsonField) = apply { this.workId = workId } fun additionalProperties(additionalProperties: Map) = apply { @@ -937,6 +942,10 @@ private constructor( ) } + /** + * The secondary employment type of the individual. Options: `full_time`, `part_time`, + * `intern`, `temp`, `seasonal` and `individual_contractor`. + */ class Subtype @JsonCreator private constructor( @@ -1018,6 +1027,7 @@ private constructor( override fun toString() = value.toString() } + /** The main employment type of the individual. */ class Type @JsonCreator private constructor( @@ -1093,6 +1103,10 @@ private constructor( "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } + /** + * The detailed employment status of the individual. Available options: `active`, `deceased`, + * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + */ class EmploymentStatus @JsonCreator private constructor( 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 6ce4f494..be6eb2a5 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 c51f693e..82843753 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 @@ -891,6 +891,10 @@ private constructor( ) } + /** + * The secondary employment type of the individual. Options: `full_time`, `part_time`, + * `intern`, `temp`, `seasonal` and `individual_contractor`. + */ class Subtype @JsonCreator private constructor( @@ -972,6 +976,7 @@ private constructor( override fun toString() = value.toString() } + /** The main employment type of the individual. */ class Type @JsonCreator private constructor( @@ -1047,6 +1052,7 @@ private constructor( "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } + /** The detailed employment status of the individual. */ class EmploymentStatus @JsonCreator private constructor( 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 0b555a0d..6b0cb507 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 @@ -277,6 +277,7 @@ private constructor( "Body{finchCode=$finchCode, message=$message, name=$name, additionalProperties=$additionalProperties}" } + /** HTTP status code. Either 201 or 200 */ class Code @JsonCreator private constructor( 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 1f0ed8ab..98a43b39 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Get enrollment information for the given individuals. */ class HrisBenefitIndividualRetrieveManyBenefitsPage private constructor( private val individualsService: IndividualService, 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 6623b355..b3840a25 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Get enrollment information for the given individuals. */ class HrisBenefitIndividualRetrieveManyBenefitsPageAsync private constructor( private val individualsService: IndividualServiceAsync, 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 a8200935..fb50d2cb 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Unenroll individuals from a deduction or contribution */ class HrisBenefitIndividualUnenrollManyPage private constructor( private val individualsService: IndividualService, 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 415bb2db..b6b6a9b4 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Unenroll individuals from a deduction or contribution */ class HrisBenefitIndividualUnenrollManyPageAsync private constructor( private val individualsService: IndividualServiceAsync, 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 b7d58f9a..64de7bf5 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** List all company-wide deductions and contributions. */ class HrisBenefitListPage private constructor( private val benefitsService: BenefitService, 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 4e2de629..07843b2d 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** List all company-wide deductions and contributions. */ class HrisBenefitListPageAsync private constructor( private val benefitsService: BenefitServiceAsync, 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 606114f5..9827634f 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Get deductions metadata */ class HrisBenefitListSupportedBenefitsPage private constructor( private val benefitsService: BenefitService, 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 ed182714..28fd12a4 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Get deductions metadata */ class HrisBenefitListSupportedBenefitsPageAsync private constructor( private val benefitsService: BenefitServiceAsync, 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 c20a77e4..fd39606d 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 @@ -19,6 +19,8 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read company directory and organization structure */ +@Deprecated("use `list` instead") class HrisDirectoryListIndividualsPage private constructor( private val directoryService: DirectoryService, @@ -63,7 +65,6 @@ private constructor( } fun getNextPage(): Optional { - @Suppress("DEPRECATION") return getNextPageParams().map { directoryService.listIndividuals(it) } } 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 1811317f..370bb6e1 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 @@ -20,6 +20,8 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read company directory and organization structure */ +@Deprecated("use `list` instead") class HrisDirectoryListIndividualsPageAsync private constructor( private val directoryService: DirectoryServiceAsync, @@ -64,7 +66,6 @@ private constructor( } fun getNextPage(): CompletableFuture> { - @Suppress("DEPRECATION") return getNextPageParams() .map { directoryService.listIndividuals(it).thenApply { Optional.of(it) } } .orElseGet { CompletableFuture.completedFuture(Optional.empty()) } 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 25dd34df..4eee83a7 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 @@ -9,6 +9,7 @@ import java.util.Objects import java.util.Optional /** Read company directory and organization structure */ +@Deprecated("use `list` instead") class HrisDirectoryListIndividualsParams constructor( private val limit: Long?, 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 9fce97f6..3acf24e3 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read company directory and organization structure */ class HrisDirectoryListPage private constructor( private val directoryService: DirectoryService, 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 128f5be8..4ab968b9 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read company directory and organization structure */ class HrisDirectoryListPageAsync private constructor( private val directoryService: DirectoryServiceAsync, 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 63a720fd..964fa55f 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read individual employment and income data */ class HrisEmploymentRetrieveManyPage private constructor( private val employmentsService: EmploymentService, 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 7eac76e0..1bac4e35 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read individual employment and income data */ class HrisEmploymentRetrieveManyPageAsync private constructor( private val employmentsService: EmploymentServiceAsync, 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 7e82f83c..0d69fb11 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read individual data, excluding income and employment data */ class HrisIndividualRetrieveManyPage private constructor( private val individualsService: IndividualService, 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 bbed6de2..ec788a53 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read individual data, excluding income and employment data */ class HrisIndividualRetrieveManyPageAsync private constructor( private val individualsService: IndividualServiceAsync, 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 3cb9aee4..3adacf9d 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 @@ -19,6 +19,11 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * Read detailed pay statements for each individual. + * + * Deduction and contribution types are supported by the payroll systems that supports Benefits. + */ class HrisPayStatementRetrieveManyPage private constructor( private val payStatementsService: PayStatementService, 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 63c5da48..2d715071 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 @@ -20,6 +20,11 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** + * Read detailed pay statements for each individual. + * + * Deduction and contribution types are supported by the payroll systems that supports Benefits. + */ class HrisPayStatementRetrieveManyPageAsync private constructor( private val payStatementsService: PayStatementServiceAsync, 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 182d9ed2..b90914d2 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read payroll and contractor related payments by the company. */ class HrisPaymentListPage private constructor( private val paymentsService: PaymentService, 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 a8a10ab7..55700ad4 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read payroll and contractor related payments by the company. */ class HrisPaymentListPageAsync private constructor( private val paymentsService: PaymentServiceAsync, 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 26f3d1df..63f7dae3 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 @@ -195,6 +195,10 @@ private constructor( ) } + /** + * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, + * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + */ class Unit @JsonCreator private constructor( 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 105aa8a5..61f51f38 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 @@ -592,6 +592,7 @@ private constructor( "Email{data=$data, type=$type, additionalProperties=$additionalProperties}" } + /** The EEOC-defined ethnicity of the individual. */ class Ethnicity @JsonCreator private constructor( @@ -686,6 +687,7 @@ private constructor( override fun toString() = value.toString() } + /** The gender of the individual. */ class Gender @JsonCreator private constructor( 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 0af61f0d..23bf5389 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 @@ -344,6 +344,7 @@ private constructor( ) } + /** Type for HSA contribution limit if the benefit is a HSA. */ class HsaContributionLimit @JsonCreator private constructor( 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 b5ed002c..9c92226a 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 b408d809..42c47e62 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 @@ -592,6 +592,7 @@ private constructor( "Email{data=$data, type=$type, additionalProperties=$additionalProperties}" } + /** The EEOC-defined ethnicity of the individual. */ class Ethnicity @JsonCreator private constructor( @@ -686,6 +687,7 @@ private constructor( override fun toString() = value.toString() } + /** The gender of the individual. */ class Gender @JsonCreator private constructor( 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 0d895fa3..635c019f 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 @@ -78,7 +78,7 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this * account ID. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") fun authenticationMethods(): List = authenticationMethods.getRequired("authentication_methods") @@ -93,7 +93,7 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this * company ID. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") 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") @@ -136,6 +136,7 @@ private constructor( /** * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. */ + @Deprecated("deprecated") fun payrollProviderId(): String = payrollProviderId.getRequired("payroll_provider_id") /** An array of the authorized products associated with the `access_token`. */ @@ -151,7 +152,10 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this * account ID. */ - @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId @JsonProperty("authentication_methods") @ExcludeMissing @@ -169,7 +173,10 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of this * company ID. */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** The Finch UUID of the connection associated with the `access_token`. */ @JsonProperty("connection_id") @@ -220,6 +227,7 @@ private constructor( /** * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider ID. */ + @Deprecated("deprecated") @JsonProperty("payroll_provider_id") @ExcludeMissing fun _payrollProviderId(): JsonField = payrollProviderId @@ -315,12 +323,14 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this account ID. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this account ID. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } fun authenticationMethods(authenticationMethods: List) = @@ -360,12 +370,14 @@ private constructor( * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this company ID. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection instead of * this company ID. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** The Finch UUID of the connection associated with the `access_token`. */ @@ -476,6 +488,7 @@ private constructor( * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider * ID. */ + @Deprecated("deprecated") fun payrollProviderId(payrollProviderId: String) = payrollProviderId(JsonField.of(payrollProviderId)) @@ -483,6 +496,7 @@ private constructor( * [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll provider * ID. */ + @Deprecated("deprecated") fun payrollProviderId(payrollProviderId: JsonField) = apply { this.payrollProviderId = payrollProviderId } @@ -820,6 +834,7 @@ private constructor( "ConnectionStatus{message=$message, status=$status, additionalProperties=$additionalProperties}" } + /** The type of authentication method. */ class Type @JsonCreator private constructor( @@ -913,6 +928,7 @@ private constructor( "AuthenticationMethod{connectionStatus=$connectionStatus, products=$products, type=$type, additionalProperties=$additionalProperties}" } + /** The type of application associated with a token. */ class ClientType @JsonCreator private constructor( @@ -1090,6 +1106,11 @@ private constructor( "ConnectionStatus{message=$message, status=$status, additionalProperties=$additionalProperties}" } + /** + * The type of the connection associated with the token. + * - `provider` - connection to an external provider + * - `finch` - finch-generated data. + */ class ConnectionType @JsonCreator private constructor( 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 40d37449..7be55e6b 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 @@ -396,6 +396,7 @@ constructor( DataSyncAll(checkRequired("type", type), additionalProperties.toImmutable()) } + /** The type of job to start. */ class Type @JsonCreator private constructor( @@ -568,6 +569,7 @@ constructor( ) } + /** The type of job to start. */ class Type @JsonCreator private constructor( 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 c662caa5..e8419ae9 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 @@ -19,6 +19,11 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * Get all automated jobs. Automated jobs are completed by a machine. By default, jobs are sorted in + * descending order by submission time. For scheduled jobs such as data syncs, only the next + * scheduled job is shown. + */ class JobAutomatedListPage private constructor( private val automatedService: AutomatedService, 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 55f03c4e..beaea7fd 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 @@ -20,6 +20,11 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** + * Get all automated jobs. Automated jobs are completed by a machine. By default, jobs are sorted in + * descending order by submission time. For scheduled jobs such as data syncs, only the next + * scheduled job is shown. + */ class JobAutomatedListPageAsync private constructor( private val automatedService: AutomatedServiceAsync, 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 41c67607..29853568 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt index 784345dc..1d3cf4ab 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt @@ -7,6 +7,15 @@ import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField import com.tryfinch.api.errors.FinchInvalidDataException +/** + * - `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 + * provider + * - `not_supported_by_provider`: This operation is not supported by the provider, so Finch cannot + * support + * - `client_access_only`: This behavior is supported by the provider, but only available to the + * client and not to Finch + */ class OperationSupport @JsonCreator private constructor( 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 3b6b78df..00be9dc1 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 @@ -568,6 +568,7 @@ private constructor( ) } + /** The type of earning. */ class Type @JsonCreator private constructor( @@ -1081,6 +1082,7 @@ private constructor( "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } + /** The payment method. */ class PaymentMethod @JsonCreator private constructor( @@ -1317,6 +1319,7 @@ private constructor( ) } + /** The type of taxes. */ class Type @JsonCreator private constructor( @@ -1404,6 +1407,7 @@ private constructor( "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } + /** The type of the payment associated with the pay statement. */ class Type @JsonCreator private constructor( 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 c3f914ec..26492340 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 @@ -43,13 +43,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -63,13 +63,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -136,24 +142,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 9ad66bb5..c8025842 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 @@ -45,13 +45,13 @@ 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. */ - fun accountId(): String = accountId.getRequired("account_id") + @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id") /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ - fun companyId(): String = companyId.getRequired("company_id") + @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id") /** Unique Finch ID of the connection associated with the webhook event. */ fun connectionId(): Optional = @@ -65,13 +65,19 @@ 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(): JsonField = accountId + @Deprecated("deprecated") + @JsonProperty("account_id") + @ExcludeMissing + fun _accountId(): JsonField = accountId /** * [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(): JsonField = companyId + @Deprecated("deprecated") + @JsonProperty("company_id") + @ExcludeMissing + fun _companyId(): JsonField = companyId /** Unique Finch ID of the connection associated with the webhook event. */ @JsonProperty("connection_id") @@ -138,24 +144,28 @@ 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. */ + @Deprecated("deprecated") fun accountId(accountId: String) = accountId(JsonField.of(accountId)) /** * [DEPRECATED] Unique Finch ID of the employer account used to make this connection. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** * [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. */ + @Deprecated("deprecated") fun companyId(companyId: String) = companyId(JsonField.of(companyId)) /** * [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use * `connection_id` instead to identify the connection associated with this event. */ + @Deprecated("deprecated") fun companyId(companyId: JsonField) = apply { this.companyId = companyId } /** Unique Finch ID of the connection associated with the webhook event. */ 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 180eb6a1..8240938d 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Read company pay groups and frequencies */ class PayrollPayGroupListPage private constructor( private val payGroupsService: PayGroupService, 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 b0def484..8524c73c 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Read company pay groups and frequencies */ class PayrollPayGroupListPageAsync private constructor( private val payGroupsService: PayGroupServiceAsync, 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 19d9ece5..d6da09bd 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 @@ -5761,6 +5761,7 @@ private constructor( "SupportedFields{company=$company, directory=$directory, employment=$employment, individual=$individual, payGroup=$payGroup, payStatement=$payStatement, payment=$payment, additionalProperties=$additionalProperties}" } + /** The type of authentication method. */ class Type @JsonCreator private constructor( 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 840d5d6d..08f6522f 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 @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Return details on all available payroll and HR systems. */ class ProviderListPage private constructor( private val providersService: ProviderService, 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 ec9bcbc6..fae9fbba 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 @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Return details on all available payroll and HR systems. */ class ProviderListPageAsync private constructor( private val providersService: ProviderServiceAsync, 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 2bcc7513..35af1296 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 @@ -861,6 +861,7 @@ constructor( ) } + /** The type of bank account. */ class AccountType @JsonCreator private constructor( @@ -1270,6 +1271,7 @@ constructor( ) } + /** The tax payer subtype of the company. */ class Subtype @JsonCreator private constructor( @@ -1333,6 +1335,7 @@ constructor( override fun toString() = value.toString() } + /** The tax payer type of the company. */ class Type @JsonCreator private constructor( 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 7bec20b3..4db6b6ef 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 @@ -1504,6 +1504,10 @@ constructor( ) } + /** + * The secondary employment type of the individual. Options: `full_time`, `part_time`, + * `intern`, `temp`, `seasonal` and `individual_contractor`. + */ class Subtype @JsonCreator private constructor( @@ -1585,6 +1589,7 @@ constructor( override fun toString() = value.toString() } + /** The main employment type of the individual. */ class Type @JsonCreator private constructor( @@ -1660,6 +1665,7 @@ constructor( "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } + /** The detailed employment status of the individual. */ class EmploymentStatus @JsonCreator private constructor( @@ -1747,6 +1753,7 @@ constructor( override fun toString() = value.toString() } + /** The EEOC-defined ethnicity of the individual. */ class Ethnicity @JsonCreator private constructor( @@ -1842,6 +1849,7 @@ constructor( override fun toString() = value.toString() } + /** The gender of the individual. */ class Gender @JsonCreator private constructor( 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 5129afb8..3b9609c9 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 @@ -1397,6 +1397,10 @@ constructor( ) } + /** + * The secondary employment type of the individual. Options: `full_time`, `part_time`, + * `intern`, `temp`, `seasonal` and `individual_contractor`. + */ class Subtype @JsonCreator private constructor( @@ -1478,6 +1482,7 @@ constructor( override fun toString() = value.toString() } + /** The main employment type of the individual. */ class Type @JsonCreator private constructor( @@ -1553,6 +1558,7 @@ constructor( "Employment{subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } + /** The detailed employment status of the individual. */ class EmploymentStatus @JsonCreator private constructor( 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 41638d12..75e2a888 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 @@ -1003,6 +1003,7 @@ constructor( "Email{data=$data, type=$type, additionalProperties=$additionalProperties}" } + /** The EEOC-defined ethnicity of the individual. */ class Ethnicity @JsonCreator private constructor( @@ -1097,6 +1098,7 @@ constructor( override fun toString() = value.toString() } + /** The gender of the individual. */ class Gender @JsonCreator private constructor( 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 66371e56..a634de9b 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 @@ -296,6 +296,7 @@ constructor( ) } + /** The type of job to start. Currently the only supported type is `data_sync_all` */ class Type @JsonCreator private constructor( 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 d77587b6..018ce839 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 @@ -934,6 +934,7 @@ constructor( ) } + /** The type of earning. */ class Type @JsonCreator private constructor( @@ -1453,6 +1454,7 @@ constructor( "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } + /** The payment method. */ class PaymentMethod @JsonCreator private constructor( @@ -1696,6 +1698,7 @@ constructor( ) } + /** The type of taxes. */ class Type @JsonCreator private constructor( @@ -1783,6 +1786,7 @@ constructor( "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } + /** The type of the payment associated with the pay statement. */ class Type @JsonCreator private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt index c824ade0..059da5ba 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt @@ -344,6 +344,7 @@ private constructor( ) } + /** Indicates exemption status from federal tax withholding. */ class Exemption @JsonCreator private constructor( @@ -401,6 +402,7 @@ private constructor( override fun toString() = value.toString() } + /** The individual's filing status for tax purposes. */ class FilingStatus @JsonCreator private constructor( @@ -486,6 +488,7 @@ private constructor( "Data{additionalWithholding=$additionalWithholding, exemption=$exemption, filingStatus=$filingStatus, individualId=$individualId, totalNumberOfAllowances=$totalNumberOfAllowances, additionalProperties=$additionalProperties}" } + /** Specifies the form type, indicating that this document is a 2005 W4 form. */ class Type @JsonCreator private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt index fc0b0cb4..a97410dd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt @@ -478,6 +478,7 @@ private constructor( ) } + /** The individual's filing status for tax purposes. */ class FilingStatus @JsonCreator private constructor( @@ -564,6 +565,7 @@ private constructor( "Data{amountForOtherDependents=$amountForOtherDependents, amountForQualifyingChildrenUnder17=$amountForQualifyingChildrenUnder17, deductions=$deductions, extraWithholding=$extraWithholding, filingStatus=$filingStatus, individualId=$individualId, otherIncome=$otherIncome, totalClaimDependentAndOtherCredits=$totalClaimDependentAndOtherCredits, additionalProperties=$additionalProperties}" } + /** Specifies the form type, indicating that this document is a 2020 W4 form. */ class Type @JsonCreator private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsync.kt index a61173f8..6c42d153 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsync.kt @@ -21,8 +21,8 @@ interface DirectoryServiceAsync { ): CompletableFuture /** Read company directory and organization structure */ - @JvmOverloads @Deprecated("use `list` instead") + @JvmOverloads fun listIndividuals( params: HrisDirectoryListIndividualsParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryService.kt index 6add41c8..8c8e64c0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryService.kt @@ -20,8 +20,8 @@ interface DirectoryService { ): HrisDirectoryListPage /** Read company directory and organization structure */ - @JvmOverloads @Deprecated("use `list` instead") + @JvmOverloads fun listIndividuals( params: HrisDirectoryListIndividualsParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt index 8ab41102..0fb92f37 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt @@ -33,7 +33,6 @@ class DirectoryServiceTest { .accessToken("My Access Token") .build() val directoryService = client.hris().directory() - @Suppress("DEPRECATION") val getDirectoryResponse = directoryService.listIndividuals(HrisDirectoryListIndividualsParams.builder().build()) println(getDirectoryResponse) From 38d434d35ed917af6b4e699db6a7928e15f898a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:48:26 +0000 Subject: [PATCH 11/34] fix(client): make service impl constructors internal (#405) --- .../tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/ConnectServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/HrisServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/JobServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/PayrollServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt | 2 +- .../api/services/async/RequestForwardingServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/SandboxServiceAsyncImpl.kt | 2 +- .../com/tryfinch/api/services/async/WebhookServiceAsyncImpl.kt | 2 +- .../api/services/async/connect/SessionServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt | 2 +- .../api/services/async/hris/DirectoryServiceAsyncImpl.kt | 2 +- .../api/services/async/hris/DocumentServiceAsyncImpl.kt | 2 +- .../api/services/async/hris/EmploymentServiceAsyncImpl.kt | 2 +- .../api/services/async/hris/IndividualServiceAsyncImpl.kt | 2 +- .../api/services/async/hris/PayStatementServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt | 2 +- .../services/async/hris/benefits/IndividualServiceAsyncImpl.kt | 2 +- .../api/services/async/jobs/AutomatedServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt | 2 +- .../api/services/async/payroll/PayGroupServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/CompanyServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/ConnectionServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/DirectoryServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/EmploymentServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/IndividualServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt | 2 +- .../api/services/async/sandbox/PaymentServiceAsyncImpl.kt | 2 +- .../async/sandbox/connections/AccountServiceAsyncImpl.kt | 2 +- .../async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt | 2 +- .../tryfinch/api/services/blocking/AccessTokenServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/AccountServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/ConnectServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/HrisServiceImpl.kt | 2 +- .../kotlin/com/tryfinch/api/services/blocking/JobServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/PayrollServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/ProviderServiceImpl.kt | 2 +- .../api/services/blocking/RequestForwardingServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/SandboxServiceImpl.kt | 2 +- .../com/tryfinch/api/services/blocking/WebhookServiceImpl.kt | 2 +- .../api/services/blocking/connect/SessionServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt | 2 +- .../api/services/blocking/hris/EmploymentServiceImpl.kt | 2 +- .../api/services/blocking/hris/IndividualServiceImpl.kt | 2 +- .../api/services/blocking/hris/PayStatementServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt | 2 +- .../services/blocking/hris/benefits/IndividualServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt | 2 +- .../api/services/blocking/payroll/PayGroupServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/CompanyServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/ConnectionServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/DirectoryServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/EmploymentServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/IndividualServiceImpl.kt | 2 +- .../tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt | 2 +- .../api/services/blocking/sandbox/PaymentServiceImpl.kt | 2 +- .../services/blocking/sandbox/connections/AccountServiceImpl.kt | 2 +- .../services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt | 2 +- 64 files changed, 64 insertions(+), 64 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt index 40c87fc5..8b226628 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.CreateAccessTokenResponse import java.util.concurrent.CompletableFuture class AccessTokenServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccessTokenServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt index df3dbbd5..9f7e4323 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.models.Introspection import java.util.concurrent.CompletableFuture class AccountServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccountServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ConnectServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ConnectServiceAsyncImpl.kt index f4de95dd..f86fb285 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ConnectServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ConnectServiceAsyncImpl.kt @@ -7,7 +7,7 @@ import com.tryfinch.api.services.async.connect.SessionServiceAsync import com.tryfinch.api.services.async.connect.SessionServiceAsyncImpl class ConnectServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConnectServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/HrisServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/HrisServiceAsyncImpl.kt index ad82c240..d39d2925 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/HrisServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/HrisServiceAsyncImpl.kt @@ -21,7 +21,7 @@ import com.tryfinch.api.services.async.hris.PaymentServiceAsync import com.tryfinch.api.services.async.hris.PaymentServiceAsyncImpl class HrisServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : HrisServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/JobServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/JobServiceAsyncImpl.kt index ad50cc4a..a8a0006f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/JobServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/JobServiceAsyncImpl.kt @@ -9,7 +9,7 @@ import com.tryfinch.api.services.async.jobs.ManualServiceAsync import com.tryfinch.api.services.async.jobs.ManualServiceAsyncImpl class JobServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : JobServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/PayrollServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/PayrollServiceAsyncImpl.kt index 91b9aad5..6431023a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/PayrollServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/PayrollServiceAsyncImpl.kt @@ -7,7 +7,7 @@ import com.tryfinch.api.services.async.payroll.PayGroupServiceAsync import com.tryfinch.api.services.async.payroll.PayGroupServiceAsyncImpl class PayrollServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayrollServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt index feecd79d..bcf2cb52 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.ProviderListParams import java.util.concurrent.CompletableFuture class ProviderServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ProviderServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt index 70cf33df..bc6bdd87 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.RequestForwardingForwardResponse import java.util.concurrent.CompletableFuture class RequestForwardingServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : RequestForwardingServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/SandboxServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/SandboxServiceAsyncImpl.kt index 3054e2d0..1557fa1a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/SandboxServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/SandboxServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.services.async.sandbox.PaymentServiceAsync import com.tryfinch.api.services.async.sandbox.PaymentServiceAsyncImpl class SandboxServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : SandboxServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/WebhookServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/WebhookServiceAsyncImpl.kt index f47b6f97..d85619e0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/WebhookServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/WebhookServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec class WebhookServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : WebhookServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt index 641cc8a4..2ea88902 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.models.SessionReauthenticateResponse import java.util.concurrent.CompletableFuture class SessionServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : SessionServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt index 611853e5..83bce702 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt @@ -28,7 +28,7 @@ import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsyncImpl import java.util.concurrent.CompletableFuture class BenefitServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : BenefitServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt index de0deb6f..a28f986f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.HrisCompanyRetrieveParams import java.util.concurrent.CompletableFuture class CompanyServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : CompanyServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt index 34b21439..89aa9662 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.HrisDirectoryListParams import java.util.concurrent.CompletableFuture class DirectoryServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DirectoryServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt index 6220340d..69af7e8e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.HrisDocumentRetreiveParams import java.util.concurrent.CompletableFuture class DocumentServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DocumentServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt index ff2b0852..0efdb186 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams import java.util.concurrent.CompletableFuture class EmploymentServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : EmploymentServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt index 54028d1b..b934ad0f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.HrisIndividualRetrieveManyParams import java.util.concurrent.CompletableFuture class IndividualServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt index 9767c9c7..c62e0e7e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams import java.util.concurrent.CompletableFuture class PayStatementServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayStatementServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt index 8748962c..422af6c8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.Payment import java.util.concurrent.CompletableFuture class PaymentServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PaymentServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt index 1442cf1f..c001ffdd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt @@ -23,7 +23,7 @@ import com.tryfinch.api.models.UnenrolledIndividual import java.util.concurrent.CompletableFuture class IndividualServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt index c32fa74c..4f6b91f9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt @@ -21,7 +21,7 @@ import com.tryfinch.api.models.JobAutomatedRetrieveParams import java.util.concurrent.CompletableFuture class AutomatedServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AutomatedServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt index 381fa46a..fff12786 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.ManualAsyncJob import java.util.concurrent.CompletableFuture class ManualServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ManualServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt index 21d27e59..2a55ec43 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.models.PayrollPayGroupRetrieveParams import java.util.concurrent.CompletableFuture class PayGroupServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayGroupServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt index 628b691e..ada4bceb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxCompanyUpdateParams import java.util.concurrent.CompletableFuture class CompanyServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : CompanyServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt index df722b81..c8aca0b9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.services.async.sandbox.connections.AccountServiceAsyncIm import java.util.concurrent.CompletableFuture class ConnectionServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConnectionServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt index 488215cd..762b2ab2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxDirectoryCreateParams import java.util.concurrent.CompletableFuture class DirectoryServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DirectoryServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt index 1fd0be2e..78ef3329 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxEmploymentUpdateParams import java.util.concurrent.CompletableFuture class EmploymentServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : EmploymentServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt index c7381d5d..de91e53f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxIndividualUpdateParams import java.util.concurrent.CompletableFuture class IndividualServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt index de27a873..8dff1041 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.services.async.sandbox.jobs.ConfigurationServiceAsyncImp import java.util.concurrent.CompletableFuture class JobServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : JobServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt index 28499c98..a5727a6c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxPaymentCreateParams import java.util.concurrent.CompletableFuture class PaymentServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PaymentServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt index d392bb15..1abe036d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams import java.util.concurrent.CompletableFuture class AccountServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccountServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt index b7ea0c42..26649ef4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.SandboxJobConfigurationUpdateParams import java.util.concurrent.CompletableFuture class ConfigurationServiceAsyncImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConfigurationServiceAsync { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt index ffe8cd3b..ffa7f7b3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.AccessTokenCreateParams import com.tryfinch.api.models.CreateAccessTokenResponse class AccessTokenServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccessTokenService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt index 0229ef6f..bc7054c4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.DisconnectResponse import com.tryfinch.api.models.Introspection class AccountServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccountService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ConnectServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ConnectServiceImpl.kt index 6a051d58..33ad8280 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ConnectServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ConnectServiceImpl.kt @@ -7,7 +7,7 @@ import com.tryfinch.api.services.blocking.connect.SessionService import com.tryfinch.api.services.blocking.connect.SessionServiceImpl class ConnectServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConnectService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/HrisServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/HrisServiceImpl.kt index 16a39aa7..7815bd7c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/HrisServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/HrisServiceImpl.kt @@ -21,7 +21,7 @@ import com.tryfinch.api.services.blocking.hris.PaymentService import com.tryfinch.api.services.blocking.hris.PaymentServiceImpl class HrisServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : HrisService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/JobServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/JobServiceImpl.kt index 706b94d5..e66f9efc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/JobServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/JobServiceImpl.kt @@ -9,7 +9,7 @@ import com.tryfinch.api.services.blocking.jobs.ManualService import com.tryfinch.api.services.blocking.jobs.ManualServiceImpl class JobServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : JobService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/PayrollServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/PayrollServiceImpl.kt index 1d99c82a..574b007b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/PayrollServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/PayrollServiceImpl.kt @@ -7,7 +7,7 @@ import com.tryfinch.api.services.blocking.payroll.PayGroupService import com.tryfinch.api.services.blocking.payroll.PayGroupServiceImpl class PayrollServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayrollService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt index 9e98c4df..957fca06 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.ProviderListPage import com.tryfinch.api.models.ProviderListParams class ProviderServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ProviderService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt index 4bb0d8ee..607d49fe 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.RequestForwardingForwardParams import com.tryfinch.api.models.RequestForwardingForwardResponse class RequestForwardingServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : RequestForwardingService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/SandboxServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/SandboxServiceImpl.kt index 5a919bfb..e93cb9d6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/SandboxServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/SandboxServiceImpl.kt @@ -19,7 +19,7 @@ import com.tryfinch.api.services.blocking.sandbox.PaymentService import com.tryfinch.api.services.blocking.sandbox.PaymentServiceImpl class SandboxServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : SandboxService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/WebhookServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/WebhookServiceImpl.kt index 0f688adc..0330cb2e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/WebhookServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/WebhookServiceImpl.kt @@ -19,7 +19,7 @@ import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec class WebhookServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : WebhookService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt index 19f293c2..06288e2e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.SessionNewResponse import com.tryfinch.api.models.SessionReauthenticateResponse class SessionServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : SessionService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt index 41949c15..2413ca6c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt @@ -27,7 +27,7 @@ import com.tryfinch.api.services.blocking.hris.benefits.IndividualService import com.tryfinch.api.services.blocking.hris.benefits.IndividualServiceImpl class BenefitServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : BenefitService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt index ce9b30a3..64ca8718 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt @@ -15,7 +15,7 @@ import com.tryfinch.api.models.Company import com.tryfinch.api.models.HrisCompanyRetrieveParams class CompanyServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : CompanyService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt index e4a941b0..3aa8d3c1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.HrisDirectoryListPage import com.tryfinch.api.models.HrisDirectoryListParams class DirectoryServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DirectoryService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt index 6a3f4cad..02e8a2ea 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.HrisDocumentListParams import com.tryfinch.api.models.HrisDocumentRetreiveParams class DocumentServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DocumentService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt index 293e707d..6921d929 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.HrisEmploymentRetrieveManyPage import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams class EmploymentServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : EmploymentService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt index 9d97bf6b..1881d10a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.HrisIndividualRetrieveManyPage import com.tryfinch.api.models.HrisIndividualRetrieveManyParams class IndividualServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt index 7233afb4..90d9b664 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.HrisPayStatementRetrieveManyPage import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams class PayStatementServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayStatementService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt index c4899295..77895717 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.HrisPaymentListParams import com.tryfinch.api.models.Payment class PaymentServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PaymentService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt index 66665585..ced77c2b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt @@ -22,7 +22,7 @@ import com.tryfinch.api.models.IndividualEnrolledIdsResponse import com.tryfinch.api.models.UnenrolledIndividual class IndividualServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt index 0fd1aecc..16587ad7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt @@ -20,7 +20,7 @@ import com.tryfinch.api.models.JobAutomatedListParams import com.tryfinch.api.models.JobAutomatedRetrieveParams class AutomatedServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AutomatedService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt index 7c128717..d778e371 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt @@ -15,7 +15,7 @@ import com.tryfinch.api.models.JobManualRetrieveParams import com.tryfinch.api.models.ManualAsyncJob class ManualServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ManualService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt index 43fca99c..342ced76 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.PayrollPayGroupListParams import com.tryfinch.api.models.PayrollPayGroupRetrieveParams class PayGroupServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PayGroupService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt index a3e81c36..8d129e76 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.CompanyUpdateResponse import com.tryfinch.api.models.SandboxCompanyUpdateParams class CompanyServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : CompanyService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt index 88562d06..fdb3f00b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.services.blocking.sandbox.connections.AccountService import com.tryfinch.api.services.blocking.sandbox.connections.AccountServiceImpl class ConnectionServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConnectionService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt index 233f06c0..37888bfc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxDirectoryCreateParams class DirectoryServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : DirectoryService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt index fa46cd45..36c9e60b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.EmploymentUpdateResponse import com.tryfinch.api.models.SandboxEmploymentUpdateParams class EmploymentServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : EmploymentService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt index e6bab225..7724a499 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.IndividualUpdateResponse import com.tryfinch.api.models.SandboxIndividualUpdateParams class IndividualServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : IndividualService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt index 0c90c100..c3a2e1ab 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.services.blocking.sandbox.jobs.ConfigurationService import com.tryfinch.api.services.blocking.sandbox.jobs.ConfigurationServiceImpl class JobServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : JobService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt index 69ca921f..5b2b2cbc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt @@ -16,7 +16,7 @@ import com.tryfinch.api.models.PaymentCreateResponse import com.tryfinch.api.models.SandboxPaymentCreateParams class PaymentServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : PaymentService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt index ef43cc7c..0fa881ec 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt @@ -18,7 +18,7 @@ import com.tryfinch.api.models.SandboxConnectionAccountCreateParams import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams class AccountServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : AccountService { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt index 65c9d523..78d271a8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt @@ -17,7 +17,7 @@ import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams import com.tryfinch.api.models.SandboxJobConfigurationUpdateParams class ConfigurationServiceImpl -constructor( +internal constructor( private val clientOptions: ClientOptions, ) : ConfigurationService { From 31e854c04ea5f0e9271d40b96e3fb313155de390 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:03:48 +0000 Subject: [PATCH 12/34] docs: update readme (#406) --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bd7aed71..80c72fec 100644 --- a/README.md +++ b/README.md @@ -6,31 +6,27 @@ -The Finch Java SDK provides convenient access to the Finch REST API from applications written in Java. It includes helper classes with helpful types and documentation for every request and response property. +The Finch Java SDK provides convenient access to the Finch REST API from applications written in Java. The Finch Java SDK is similar to the Finch Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions. It is generated with [Stainless](https://www.stainlessapi.com/). -## Documentation - The REST API documentation can be found [in the Finch Documentation Center](https://developer.tryfinch.com/). --- -## Getting started - -### Install dependencies - -#### Gradle +## Installation +### Gradle + ```kotlin implementation("com.tryfinch.api:finch-java:3.3.0") ``` -#### Maven +### Maven ```xml @@ -42,6 +38,8 @@ implementation("com.tryfinch.api:finch-java:3.3.0") +## Usage + ### Configure the client Use `FinchOkHttpClient.builder()` to configure the client. From a595f323b1bc0d26ef4ffda2b16f747c7d062660 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 19:53:03 +0000 Subject: [PATCH 13/34] docs: move up requirements section (#408) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 80c72fec..f97de1cf 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ implementation("com.tryfinch.api:finch-java:3.3.0") +## Requirements + +This library requires Java 8 or later. + ## Usage ### Configure the client @@ -373,7 +377,3 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. We are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-java/issues) with questions, bugs, or suggestions. - -## Requirements - -This library requires Java 8 or later. From 2919f4c2719dea03a28df252a3a64d606c1db9f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:20:52 +0000 Subject: [PATCH 14/34] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3f80b45c..590e7226 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 40 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-77520f5037161db86208e3a9d3f36f39e971a8ee10b1d9972a22c084fcf21845.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0ff5b707b4e3afcf4020e2d4b71bb4d4cfb25eac2828d6de5bee8d4d5d81550d.yml From 4018e4c4154bba72bb09a8421c1c75128da64c9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 02:08:08 +0000 Subject: [PATCH 15/34] chore(internal): swap `checkNotNull` to `checkRequired` (#409) --- .../main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt | 3 ++- finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt | 3 +-- .../src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt | 3 ++- .../kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt index c34c5d11..ef6f0633 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt @@ -1,6 +1,7 @@ package com.tryfinch.api.client.okhttp import com.tryfinch.api.core.RequestOptions +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.HttpClient import com.tryfinch.api.core.http.HttpMethod @@ -192,7 +193,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30)) .proxy(proxy) .build(), - checkNotNull(baseUrl) { "`baseUrl` is required but was not set" }, + checkRequired("baseUrl", baseUrl), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt index 3d4c2472..38ad8b3e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Check.kt @@ -2,8 +2,7 @@ package com.tryfinch.api.core -@JvmSynthetic -internal fun checkRequired(name: String, value: T?): T = +fun checkRequired(name: String, value: T?): T = checkNotNull(value) { "`$name` is required, but was not set" } @JvmSynthetic diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt index 314b55ed..4477451c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt @@ -1,5 +1,6 @@ package com.tryfinch.api.core.http +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.toImmutable class HttpRequest @@ -134,7 +135,7 @@ private constructor( fun build(): HttpRequest = HttpRequest( - checkNotNull(method) { "`method` is required but was not set" }, + checkRequired("method", method), url, pathSegments.toImmutable(), headers.build(), diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt index d3c26021..7b7f3dea 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt @@ -1,6 +1,7 @@ package com.tryfinch.api.core.http import com.tryfinch.api.core.RequestOptions +import com.tryfinch.api.core.checkRequired import com.tryfinch.api.errors.FinchIoException import java.io.IOException import java.time.Clock @@ -259,7 +260,7 @@ private constructor( fun build(): HttpClient = RetryingHttpClient( - checkNotNull(httpClient) { "`httpClient` is required but was not set" }, + checkRequired("httpClient", httpClient), clock, maxRetries, idempotencyHeader, From d0db606cfd7914c13915861498bd32340ff9f9f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:27:47 +0000 Subject: [PATCH 16/34] feat(client)!: better union variant method and variable names (#410) # Migration Some of the `WebhookEvent` class's method names have been shortened. To migrate, replace usages of the long method names with the shorter ones. For example: - `WebhookEvent.ofCompanyEvent(...)` becomes `WebhookEvent.ofCompany(...)` - `webhookEvent.isCompanyEvent()` becomes `webhookEvent.isCompany()` - `webhookEvent.asCompanyEvent()` becomes `webhookEvent.asCompany()` - etc. --- .../com/tryfinch/api/models/WebhookEvent.kt | 210 +++++++++--------- 1 file changed, 101 insertions(+), 109 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt index 671513fa..133f8926 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt @@ -21,79 +21,77 @@ import java.util.Optional @JsonSerialize(using = WebhookEvent.Serializer::class) class WebhookEvent private constructor( - private val accountUpdateEvent: AccountUpdateEvent? = null, - private val jobCompletionEvent: JobCompletionEvent? = null, - private val companyEvent: CompanyEvent? = null, - private val directoryEvent: DirectoryEvent? = null, - private val employmentEvent: EmploymentEvent? = null, - private val individualEvent: IndividualEvent? = null, - private val paymentEvent: PaymentEvent? = null, - private val payStatementEvent: PayStatementEvent? = null, + private val accountUpdate: AccountUpdateEvent? = null, + private val jobCompletion: JobCompletionEvent? = null, + private val company: CompanyEvent? = null, + private val directory: DirectoryEvent? = null, + private val employment: EmploymentEvent? = null, + private val individual: IndividualEvent? = null, + private val payment: PaymentEvent? = null, + private val payStatement: PayStatementEvent? = null, private val _json: JsonValue? = null, ) { - fun accountUpdateEvent(): Optional = Optional.ofNullable(accountUpdateEvent) + fun accountUpdate(): Optional = Optional.ofNullable(accountUpdate) - fun jobCompletionEvent(): Optional = Optional.ofNullable(jobCompletionEvent) + fun jobCompletion(): Optional = Optional.ofNullable(jobCompletion) - fun companyEvent(): Optional = Optional.ofNullable(companyEvent) + fun company(): Optional = Optional.ofNullable(company) - fun directoryEvent(): Optional = Optional.ofNullable(directoryEvent) + fun directory(): Optional = Optional.ofNullable(directory) - fun employmentEvent(): Optional = Optional.ofNullable(employmentEvent) + fun employment(): Optional = Optional.ofNullable(employment) - fun individualEvent(): Optional = Optional.ofNullable(individualEvent) + fun individual(): Optional = Optional.ofNullable(individual) - fun paymentEvent(): Optional = Optional.ofNullable(paymentEvent) + fun payment(): Optional = Optional.ofNullable(payment) - fun payStatementEvent(): Optional = Optional.ofNullable(payStatementEvent) + fun payStatement(): Optional = Optional.ofNullable(payStatement) - fun isAccountUpdateEvent(): Boolean = accountUpdateEvent != null + fun isAccountUpdate(): Boolean = accountUpdate != null - fun isJobCompletionEvent(): Boolean = jobCompletionEvent != null + fun isJobCompletion(): Boolean = jobCompletion != null - fun isCompanyEvent(): Boolean = companyEvent != null + fun isCompany(): Boolean = company != null - fun isDirectoryEvent(): Boolean = directoryEvent != null + fun isDirectory(): Boolean = directory != null - fun isEmploymentEvent(): Boolean = employmentEvent != null + fun isEmployment(): Boolean = employment != null - fun isIndividualEvent(): Boolean = individualEvent != null + fun isIndividual(): Boolean = individual != null - fun isPaymentEvent(): Boolean = paymentEvent != null + fun isPayment(): Boolean = payment != null - fun isPayStatementEvent(): Boolean = payStatementEvent != null + fun isPayStatement(): Boolean = payStatement != null - fun asAccountUpdateEvent(): AccountUpdateEvent = - accountUpdateEvent.getOrThrow("accountUpdateEvent") + fun asAccountUpdate(): AccountUpdateEvent = accountUpdate.getOrThrow("accountUpdate") - fun asJobCompletionEvent(): JobCompletionEvent = - jobCompletionEvent.getOrThrow("jobCompletionEvent") + fun asJobCompletion(): JobCompletionEvent = jobCompletion.getOrThrow("jobCompletion") - fun asCompanyEvent(): CompanyEvent = companyEvent.getOrThrow("companyEvent") + fun asCompany(): CompanyEvent = company.getOrThrow("company") - fun asDirectoryEvent(): DirectoryEvent = directoryEvent.getOrThrow("directoryEvent") + fun asDirectory(): DirectoryEvent = directory.getOrThrow("directory") - fun asEmploymentEvent(): EmploymentEvent = employmentEvent.getOrThrow("employmentEvent") + fun asEmployment(): EmploymentEvent = employment.getOrThrow("employment") - fun asIndividualEvent(): IndividualEvent = individualEvent.getOrThrow("individualEvent") + fun asIndividual(): IndividualEvent = individual.getOrThrow("individual") - fun asPaymentEvent(): PaymentEvent = paymentEvent.getOrThrow("paymentEvent") + fun asPayment(): PaymentEvent = payment.getOrThrow("payment") - fun asPayStatementEvent(): PayStatementEvent = payStatementEvent.getOrThrow("payStatementEvent") + fun asPayStatement(): PayStatementEvent = payStatement.getOrThrow("payStatement") fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { return when { - accountUpdateEvent != null -> visitor.visitAccountUpdateEvent(accountUpdateEvent) - jobCompletionEvent != null -> visitor.visitJobCompletionEvent(jobCompletionEvent) - companyEvent != null -> visitor.visitCompanyEvent(companyEvent) - directoryEvent != null -> visitor.visitDirectoryEvent(directoryEvent) - employmentEvent != null -> visitor.visitEmploymentEvent(employmentEvent) - individualEvent != null -> visitor.visitIndividualEvent(individualEvent) - paymentEvent != null -> visitor.visitPaymentEvent(paymentEvent) - payStatementEvent != null -> visitor.visitPayStatementEvent(payStatementEvent) + accountUpdate != null -> visitor.visitAccountUpdate(accountUpdate) + jobCompletion != null -> visitor.visitJobCompletion(jobCompletion) + company != null -> visitor.visitCompany(company) + directory != null -> visitor.visitDirectory(directory) + employment != null -> visitor.visitEmployment(employment) + individual != null -> visitor.visitIndividual(individual) + payment != null -> visitor.visitPayment(payment) + payStatement != null -> visitor.visitPayStatement(payStatement) else -> visitor.unknown(_json) } } @@ -107,36 +105,36 @@ private constructor( accept( object : Visitor { - override fun visitAccountUpdateEvent(accountUpdateEvent: AccountUpdateEvent) { - accountUpdateEvent.validate() + override fun visitAccountUpdate(accountUpdate: AccountUpdateEvent) { + accountUpdate.validate() } - override fun visitJobCompletionEvent(jobCompletionEvent: JobCompletionEvent) { - jobCompletionEvent.validate() + override fun visitJobCompletion(jobCompletion: JobCompletionEvent) { + jobCompletion.validate() } - override fun visitCompanyEvent(companyEvent: CompanyEvent) { - companyEvent.validate() + override fun visitCompany(company: CompanyEvent) { + company.validate() } - override fun visitDirectoryEvent(directoryEvent: DirectoryEvent) { - directoryEvent.validate() + override fun visitDirectory(directory: DirectoryEvent) { + directory.validate() } - override fun visitEmploymentEvent(employmentEvent: EmploymentEvent) { - employmentEvent.validate() + override fun visitEmployment(employment: EmploymentEvent) { + employment.validate() } - override fun visitIndividualEvent(individualEvent: IndividualEvent) { - individualEvent.validate() + override fun visitIndividual(individual: IndividualEvent) { + individual.validate() } - override fun visitPaymentEvent(paymentEvent: PaymentEvent) { - paymentEvent.validate() + override fun visitPayment(payment: PaymentEvent) { + payment.validate() } - override fun visitPayStatementEvent(payStatementEvent: PayStatementEvent) { - payStatementEvent.validate() + override fun visitPayStatement(payStatement: PayStatementEvent) { + payStatement.validate() } } ) @@ -148,21 +146,21 @@ private constructor( return true } - return /* spotless:off */ other is WebhookEvent && accountUpdateEvent == other.accountUpdateEvent && jobCompletionEvent == other.jobCompletionEvent && companyEvent == other.companyEvent && directoryEvent == other.directoryEvent && employmentEvent == other.employmentEvent && individualEvent == other.individualEvent && paymentEvent == other.paymentEvent && payStatementEvent == other.payStatementEvent /* spotless:on */ + return /* spotless:off */ other is WebhookEvent && accountUpdate == other.accountUpdate && jobCompletion == other.jobCompletion && company == other.company && directory == other.directory && employment == other.employment && individual == other.individual && payment == other.payment && payStatement == other.payStatement /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountUpdateEvent, jobCompletionEvent, companyEvent, directoryEvent, employmentEvent, individualEvent, paymentEvent, payStatementEvent) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountUpdate, jobCompletion, company, directory, employment, individual, payment, payStatement) /* spotless:on */ override fun toString(): String = when { - accountUpdateEvent != null -> "WebhookEvent{accountUpdateEvent=$accountUpdateEvent}" - jobCompletionEvent != null -> "WebhookEvent{jobCompletionEvent=$jobCompletionEvent}" - companyEvent != null -> "WebhookEvent{companyEvent=$companyEvent}" - directoryEvent != null -> "WebhookEvent{directoryEvent=$directoryEvent}" - employmentEvent != null -> "WebhookEvent{employmentEvent=$employmentEvent}" - individualEvent != null -> "WebhookEvent{individualEvent=$individualEvent}" - paymentEvent != null -> "WebhookEvent{paymentEvent=$paymentEvent}" - payStatementEvent != null -> "WebhookEvent{payStatementEvent=$payStatementEvent}" + accountUpdate != null -> "WebhookEvent{accountUpdate=$accountUpdate}" + jobCompletion != null -> "WebhookEvent{jobCompletion=$jobCompletion}" + company != null -> "WebhookEvent{company=$company}" + directory != null -> "WebhookEvent{directory=$directory}" + employment != null -> "WebhookEvent{employment=$employment}" + individual != null -> "WebhookEvent{individual=$individual}" + payment != null -> "WebhookEvent{payment=$payment}" + payStatement != null -> "WebhookEvent{payStatement=$payStatement}" _json != null -> "WebhookEvent{_unknown=$_json}" else -> throw IllegalStateException("Invalid WebhookEvent") } @@ -170,53 +168,47 @@ private constructor( companion object { @JvmStatic - fun ofAccountUpdateEvent(accountUpdateEvent: AccountUpdateEvent) = - WebhookEvent(accountUpdateEvent = accountUpdateEvent) + fun ofAccountUpdate(accountUpdate: AccountUpdateEvent) = + WebhookEvent(accountUpdate = accountUpdate) @JvmStatic - fun ofJobCompletionEvent(jobCompletionEvent: JobCompletionEvent) = - WebhookEvent(jobCompletionEvent = jobCompletionEvent) + fun ofJobCompletion(jobCompletion: JobCompletionEvent) = + WebhookEvent(jobCompletion = jobCompletion) - @JvmStatic - fun ofCompanyEvent(companyEvent: CompanyEvent) = WebhookEvent(companyEvent = companyEvent) + @JvmStatic fun ofCompany(company: CompanyEvent) = WebhookEvent(company = company) - @JvmStatic - fun ofDirectoryEvent(directoryEvent: DirectoryEvent) = - WebhookEvent(directoryEvent = directoryEvent) + @JvmStatic fun ofDirectory(directory: DirectoryEvent) = WebhookEvent(directory = directory) @JvmStatic - fun ofEmploymentEvent(employmentEvent: EmploymentEvent) = - WebhookEvent(employmentEvent = employmentEvent) + fun ofEmployment(employment: EmploymentEvent) = WebhookEvent(employment = employment) @JvmStatic - fun ofIndividualEvent(individualEvent: IndividualEvent) = - WebhookEvent(individualEvent = individualEvent) + fun ofIndividual(individual: IndividualEvent) = WebhookEvent(individual = individual) - @JvmStatic - fun ofPaymentEvent(paymentEvent: PaymentEvent) = WebhookEvent(paymentEvent = paymentEvent) + @JvmStatic fun ofPayment(payment: PaymentEvent) = WebhookEvent(payment = payment) @JvmStatic - fun ofPayStatementEvent(payStatementEvent: PayStatementEvent) = - WebhookEvent(payStatementEvent = payStatementEvent) + fun ofPayStatement(payStatement: PayStatementEvent) = + WebhookEvent(payStatement = payStatement) } interface Visitor { - fun visitAccountUpdateEvent(accountUpdateEvent: AccountUpdateEvent): T + fun visitAccountUpdate(accountUpdate: AccountUpdateEvent): T - fun visitJobCompletionEvent(jobCompletionEvent: JobCompletionEvent): T + fun visitJobCompletion(jobCompletion: JobCompletionEvent): T - fun visitCompanyEvent(companyEvent: CompanyEvent): T + fun visitCompany(company: CompanyEvent): T - fun visitDirectoryEvent(directoryEvent: DirectoryEvent): T + fun visitDirectory(directory: DirectoryEvent): T - fun visitEmploymentEvent(employmentEvent: EmploymentEvent): T + fun visitEmployment(employment: EmploymentEvent): T - fun visitIndividualEvent(individualEvent: IndividualEvent): T + fun visitIndividual(individual: IndividualEvent): T - fun visitPaymentEvent(paymentEvent: PaymentEvent): T + fun visitPayment(payment: PaymentEvent): T - fun visitPayStatementEvent(payStatementEvent: PayStatementEvent): T + fun visitPayStatement(payStatement: PayStatementEvent): T fun unknown(json: JsonValue?): T { throw FinchInvalidDataException("Unknown WebhookEvent: $json") @@ -230,35 +222,35 @@ private constructor( tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(accountUpdateEvent = it, _json = json) + return WebhookEvent(accountUpdate = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(jobCompletionEvent = it, _json = json) + return WebhookEvent(jobCompletion = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(companyEvent = it, _json = json) + return WebhookEvent(company = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(directoryEvent = it, _json = json) + return WebhookEvent(directory = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(employmentEvent = it, _json = json) + return WebhookEvent(employment = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(individualEvent = it, _json = json) + return WebhookEvent(individual = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(paymentEvent = it, _json = json) + return WebhookEvent(payment = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { - return WebhookEvent(payStatementEvent = it, _json = json) + return WebhookEvent(payStatement = it, _json = json) } return WebhookEvent(_json = json) @@ -273,14 +265,14 @@ private constructor( provider: SerializerProvider ) { when { - value.accountUpdateEvent != null -> generator.writeObject(value.accountUpdateEvent) - value.jobCompletionEvent != null -> generator.writeObject(value.jobCompletionEvent) - value.companyEvent != null -> generator.writeObject(value.companyEvent) - value.directoryEvent != null -> generator.writeObject(value.directoryEvent) - value.employmentEvent != null -> generator.writeObject(value.employmentEvent) - value.individualEvent != null -> generator.writeObject(value.individualEvent) - value.paymentEvent != null -> generator.writeObject(value.paymentEvent) - value.payStatementEvent != null -> generator.writeObject(value.payStatementEvent) + value.accountUpdate != null -> generator.writeObject(value.accountUpdate) + value.jobCompletion != null -> generator.writeObject(value.jobCompletion) + value.company != null -> generator.writeObject(value.company) + value.directory != null -> generator.writeObject(value.directory) + value.employment != null -> generator.writeObject(value.employment) + value.individual != null -> generator.writeObject(value.individual) + value.payment != null -> generator.writeObject(value.payment) + value.payStatement != null -> generator.writeObject(value.payStatement) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid WebhookEvent") } From e3831a7eec0fda1e05cc29ce5fbd77a23b05f308 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 23:36:30 +0000 Subject: [PATCH 17/34] chore: add max retries to test (#411) --- .../kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt index 9b37a54f..9b0bf771 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt @@ -45,6 +45,7 @@ internal class RetryingHttpClientTest { val retryingClient = RetryingHttpClient.builder() .httpClient(httpClient) + .maxRetries(2) .idempotencyHeader("X-Some-Header") .build() val response = retryingClient.execute(request) From d9b722b1d27703dd7bb5a26b962ab7df102a030b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:07:04 +0000 Subject: [PATCH 18/34] feat(client): add `close` method (#412) --- .../kotlin/com/tryfinch/api/client/FinchClient.kt | 13 +++++++++++++ .../com/tryfinch/api/client/FinchClientAsync.kt | 13 +++++++++++++ .../com/tryfinch/api/client/FinchClientAsyncImpl.kt | 2 ++ .../com/tryfinch/api/client/FinchClientImpl.kt | 2 ++ 4 files changed, 30 insertions(+) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt index a1518f6a..a7735d08 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt @@ -67,4 +67,17 @@ interface FinchClient { @JsonProperty("products") val products: List, @JsonProperty("provider_id") val providerId: String, ) + + /** + * Closes this client, relinquishing any underlying resources. + * + * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and + * usually should not be synchronously closed via try-with-resources. + * + * It's also usually not necessary to call this method at all. the default HTTP client + * automatically releases threads and connections if they remain idle, but if you are writing an + * application that needs to aggressively release unused resources, then you may call this + * method. + */ + fun close() } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt index 6f57c432..275c4bae 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt @@ -68,4 +68,17 @@ interface FinchClientAsync { @JsonProperty("products") val products: List, @JsonProperty("provider_id") val providerId: String, ) + + /** + * Closes this client, relinquishing any underlying resources. + * + * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and + * usually should not be synchronously closed via try-with-resources. + * + * It's also usually not necessary to call this method at all. the default HTTP client + * automatically releases threads and connections if they remain idle, but if you are writing an + * application that needs to aggressively release unused resources, then you may call this + * method. + */ + fun close() } 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 0bfac953..26d0d72f 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 @@ -195,4 +195,6 @@ constructor( @JsonProperty("products") val products: List, @JsonProperty("provider_id") val providerId: String, ) + + override fun close() = clientOptions.httpClient.close() } 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 e8cbf482..226fddca 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 @@ -184,4 +184,6 @@ constructor( @JsonProperty("products") val products: List, @JsonProperty("provider_id") val providerId: String, ) + + override fun close() = clientOptions.httpClient.close() } From d4b805129069eaa3d584abc78274f8b017dce885 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 15:46:40 +0000 Subject: [PATCH 19/34] docs: add client documentation (#414) --- .../kotlin/com/tryfinch/api/client/FinchClient.kt | 14 ++++++++++++++ .../com/tryfinch/api/client/FinchClientAsync.kt | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt index a7735d08..ed6e67e8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt @@ -14,6 +14,20 @@ import com.tryfinch.api.services.blocking.RequestForwardingService import com.tryfinch.api.services.blocking.SandboxService import com.tryfinch.api.services.blocking.WebhookService +/** + * A client for interacting with the Finch REST API synchronously. You can also switch to + * asynchronous execution via the [async] method. + * + * This client performs best when you create a single instance and reuse it for all interactions + * with the REST API. This is because each client holds its own connection pool and thread pools. + * Reusing connections and threads reduces latency and saves memory. The client also handles rate + * limiting per client. This means that creating and using multiple instances at the same time will + * not respect rate limits. + * + * The threads and connections that are held will be released automatically if they remain idle. But + * if you are writing an application that needs to aggressively release unused resources, then you + * may call [close]. + */ interface FinchClient { fun async(): FinchClientAsync diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt index 275c4bae..9d24e782 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt @@ -15,6 +15,20 @@ import com.tryfinch.api.services.async.SandboxServiceAsync import com.tryfinch.api.services.async.WebhookServiceAsync import java.util.concurrent.CompletableFuture +/** + * A client for interacting with the Finch REST API asynchronously. You can also switch to + * synchronous execution via the [sync] method. + * + * This client performs best when you create a single instance and reuse it for all interactions + * with the REST API. This is because each client holds its own connection pool and thread pools. + * Reusing connections and threads reduces latency and saves memory. The client also handles rate + * limiting per client. This means that creating and using multiple instances at the same time will + * not respect rate limits. + * + * The threads and connections that are held will be released automatically if they remain idle. But + * if you are writing an application that needs to aggressively release unused resources, then you + * may call [close]. + */ interface FinchClientAsync { fun sync(): FinchClient From ab65f2fe56ddd3199441d48921ef60f94eda85bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 16:15:07 +0000 Subject: [PATCH 20/34] docs: `async` and `sync` method comments (#415) --- .../src/main/kotlin/com/tryfinch/api/client/FinchClient.kt | 6 ++++++ .../main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt index ed6e67e8..424046b4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt @@ -30,6 +30,12 @@ import com.tryfinch.api.services.blocking.WebhookService */ interface FinchClient { + /** + * Returns a version of this client that uses asynchronous execution. + * + * The returned client shares its resources, like its connection pool and thread pools, with + * this client. + */ fun async(): FinchClientAsync fun accessTokens(): AccessTokenService diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt index 9d24e782..fcba9566 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt @@ -31,6 +31,12 @@ import java.util.concurrent.CompletableFuture */ interface FinchClientAsync { + /** + * Returns a version of this client that uses synchronous execution. + * + * The returned client shares its resources, like its connection pool and thread pools, with + * this client. + */ fun sync(): FinchClient fun accessTokens(): AccessTokenServiceAsync From 0a1b627cb52cf11b76f497ad379e98e30e1a9559 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:20:19 +0000 Subject: [PATCH 21/34] fix(client): make some classes and constructors non-public (#416) chore(internal): remove some unnecessary `constructor` keywords --- .../api/client/okhttp/FinchOkHttpClient.kt | 2 +- .../client/okhttp/FinchOkHttpClientAsync.kt | 2 +- .../api/client/okhttp/OkHttpClient.kt | 2 +- .../api/client/FinchClientAsyncImpl.kt | 3 +- .../tryfinch/api/client/FinchClientImpl.kt | 3 +- .../com/tryfinch/api/core/ClientOptions.kt | 2 +- .../com/tryfinch/api/core/RequestOptions.kt | 3 +- .../com/tryfinch/api/core/http/Headers.kt | 2 +- .../com/tryfinch/api/core/http/HttpRequest.kt | 2 +- .../com/tryfinch/api/core/http/QueryParams.kt | 2 +- .../api/core/http/RetryingHttpClient.kt | 2 +- .../com/tryfinch/api/errors/FinchError.kt | 2 +- .../api/models/AccessTokenCreateParams.kt | 6 +- .../api/models/AccountCreateResponse.kt | 2 +- .../api/models/AccountDisconnectParams.kt | 4 +- .../api/models/AccountIntrospectParams.kt | 4 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 68 +++++++++---------- .../api/models/AccountUpdateResponse.kt | 2 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 2 +- .../api/models/AutomatedCreateResponse.kt | 2 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 2 +- .../api/models/BenefitContribution.kt | 2 +- .../models/BenefitFeaturesAndOperations.kt | 4 +- .../tryfinch/api/models/BenefitsSupport.kt | 2 +- .../kotlin/com/tryfinch/api/models/Company.kt | 10 +-- .../com/tryfinch/api/models/CompanyBenefit.kt | 2 +- .../com/tryfinch/api/models/CompanyEvent.kt | 4 +- .../api/models/CompanyUpdateResponse.kt | 10 +-- .../api/models/ConnectSessionNewParams.kt | 8 +-- .../ConnectSessionReauthenticateParams.kt | 6 +- .../api/models/ConnectionCreateResponse.kt | 2 +- .../api/models/CreateAccessTokenResponse.kt | 2 +- .../models/CreateCompanyBenefitsResponse.kt | 2 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 4 +- .../tryfinch/api/models/DisconnectResponse.kt | 2 +- .../api/models/DocumentListResponse.kt | 2 +- .../tryfinch/api/models/DocumentResponse.kt | 2 +- .../api/models/DocumentRetreiveResponse.kt | 5 +- .../com/tryfinch/api/models/EmploymentData.kt | 10 +-- .../api/models/EmploymentDataResponse.kt | 2 +- .../tryfinch/api/models/EmploymentEvent.kt | 4 +- .../api/models/EmploymentUpdateResponse.kt | 10 +-- .../tryfinch/api/models/EnrolledIndividual.kt | 4 +- .../api/models/HrisBenefitCreateParams.kt | 6 +- .../HrisBenefitIndividualEnrolledIdsParams.kt | 4 +- ...nefitIndividualRetrieveManyBenefitsPage.kt | 3 +- ...IndividualRetrieveManyBenefitsPageAsync.kt | 3 +- ...fitIndividualRetrieveManyBenefitsParams.kt | 4 +- .../HrisBenefitIndividualUnenrollManyPage.kt | 3 +- ...sBenefitIndividualUnenrollManyPageAsync.kt | 3 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 6 +- .../api/models/HrisBenefitListPage.kt | 3 +- .../api/models/HrisBenefitListPageAsync.kt | 3 +- .../api/models/HrisBenefitListParams.kt | 4 +- .../HrisBenefitListSupportedBenefitsPage.kt | 3 +- ...isBenefitListSupportedBenefitsPageAsync.kt | 3 +- .../HrisBenefitListSupportedBenefitsParams.kt | 4 +- .../api/models/HrisBenefitRetrieveParams.kt | 4 +- .../api/models/HrisBenefitUpdateParams.kt | 6 +- .../api/models/HrisCompanyRetrieveParams.kt | 4 +- .../HrisDirectoryListIndividualsPage.kt | 3 +- .../HrisDirectoryListIndividualsPageAsync.kt | 3 +- .../HrisDirectoryListIndividualsParams.kt | 4 +- .../api/models/HrisDirectoryListPage.kt | 3 +- .../api/models/HrisDirectoryListPageAsync.kt | 3 +- .../api/models/HrisDirectoryListParams.kt | 4 +- .../api/models/HrisDocumentListParams.kt | 4 +- .../api/models/HrisDocumentRetreiveParams.kt | 4 +- .../models/HrisEmploymentRetrieveManyPage.kt | 3 +- .../HrisEmploymentRetrieveManyPageAsync.kt | 3 +- .../HrisEmploymentRetrieveManyParams.kt | 8 +-- .../models/HrisIndividualRetrieveManyPage.kt | 3 +- .../HrisIndividualRetrieveManyPageAsync.kt | 3 +- .../HrisIndividualRetrieveManyParams.kt | 10 +-- .../HrisPayStatementRetrieveManyPage.kt | 3 +- .../HrisPayStatementRetrieveManyPageAsync.kt | 3 +- .../HrisPayStatementRetrieveManyParams.kt | 8 +-- .../api/models/HrisPaymentListPage.kt | 3 +- .../api/models/HrisPaymentListPageAsync.kt | 3 +- .../api/models/HrisPaymentListParams.kt | 4 +- .../kotlin/com/tryfinch/api/models/Income.kt | 2 +- .../com/tryfinch/api/models/Individual.kt | 6 +- .../tryfinch/api/models/IndividualBenefit.kt | 4 +- .../models/IndividualEnrolledIdsResponse.kt | 2 +- .../tryfinch/api/models/IndividualEvent.kt | 4 +- .../api/models/IndividualInDirectory.kt | 6 +- .../tryfinch/api/models/IndividualResponse.kt | 2 +- .../api/models/IndividualUpdateResponse.kt | 6 +- .../com/tryfinch/api/models/Introspection.kt | 8 +-- .../api/models/JobAutomatedCreateParams.kt | 13 ++-- .../api/models/JobAutomatedListPage.kt | 3 +- .../api/models/JobAutomatedListPageAsync.kt | 3 +- .../api/models/JobAutomatedListParams.kt | 4 +- .../api/models/JobAutomatedRetrieveParams.kt | 4 +- .../tryfinch/api/models/JobCompletionEvent.kt | 4 +- .../tryfinch/api/models/JobCreateResponse.kt | 2 +- .../api/models/JobManualRetrieveParams.kt | 4 +- .../com/tryfinch/api/models/Location.kt | 2 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 2 +- .../kotlin/com/tryfinch/api/models/Money.kt | 2 +- .../api/models/OperationSupportMatrix.kt | 2 +- .../kotlin/com/tryfinch/api/models/Paging.kt | 2 +- .../api/models/PayGroupListResponse.kt | 2 +- .../api/models/PayGroupRetrieveResponse.kt | 2 +- .../com/tryfinch/api/models/PayStatement.kt | 10 +-- .../tryfinch/api/models/PayStatementEvent.kt | 4 +- .../api/models/PayStatementResponse.kt | 2 +- .../api/models/PayStatementResponseBody.kt | 2 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 4 +- .../api/models/PaymentCreateResponse.kt | 2 +- .../com/tryfinch/api/models/PaymentEvent.kt | 4 +- .../api/models/PayrollPayGroupListPage.kt | 3 +- .../models/PayrollPayGroupListPageAsync.kt | 3 +- .../api/models/PayrollPayGroupListParams.kt | 4 +- .../models/PayrollPayGroupRetrieveParams.kt | 4 +- .../com/tryfinch/api/models/Provider.kt | 66 +++++++++--------- .../tryfinch/api/models/ProviderListPage.kt | 3 +- .../api/models/ProviderListPageAsync.kt | 3 +- .../tryfinch/api/models/ProviderListParams.kt | 4 +- .../models/RequestForwardingForwardParams.kt | 6 +- .../RequestForwardingForwardResponse.kt | 4 +- .../api/models/SandboxCompanyUpdateParams.kt | 14 ++-- .../SandboxConnectionAccountCreateParams.kt | 6 +- .../SandboxConnectionAccountUpdateParams.kt | 6 +- .../models/SandboxConnectionCreateParams.kt | 6 +- .../models/SandboxDirectoryCreateParams.kt | 18 ++--- .../models/SandboxEmploymentUpdateParams.kt | 14 ++-- .../models/SandboxIndividualUpdateParams.kt | 10 +-- .../api/models/SandboxJobConfiguration.kt | 2 +- .../SandboxJobConfigurationRetrieveParams.kt | 4 +- .../SandboxJobConfigurationUpdateParams.kt | 6 +- .../api/models/SandboxJobCreateParams.kt | 6 +- .../api/models/SandboxPaymentCreateParams.kt | 16 ++--- .../tryfinch/api/models/SessionNewResponse.kt | 2 +- .../models/SessionReauthenticateResponse.kt | 2 +- .../api/models/SupportPerBenefitType.kt | 2 +- .../tryfinch/api/models/SupportedBenefit.kt | 2 +- .../api/models/UnenrolledIndividual.kt | 4 +- .../models/UpdateCompanyBenefitResponse.kt | 2 +- .../kotlin/com/tryfinch/api/models/W42005.kt | 4 +- .../kotlin/com/tryfinch/api/models/W42020.kt | 4 +- .../com/tryfinch/api/models/WebhookEvent.kt | 4 +- .../tryfinch/api/core/http/SerializerTest.kt | 3 +- 143 files changed, 349 insertions(+), 373 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 786e65de..18fd0863 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 @@ -22,7 +22,7 @@ class FinchOkHttpClient private constructor() { @JvmStatic fun fromEnv(): FinchClient = builder().fromEnv().build() } - class Builder { + class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL 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 9ce013bb..3c012e97 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 @@ -22,7 +22,7 @@ class FinchOkHttpClientAsync private constructor() { @JvmStatic fun fromEnv(): FinchClientAsync = builder().fromEnv().build() } - class Builder { + class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt index ef6f0633..8ab9b87e 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt @@ -171,7 +171,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var baseUrl: HttpUrl? = null // The default timeout is 1 minute. 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 26d0d72f..2e0e7395 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 @@ -38,8 +38,7 @@ import com.tryfinch.api.services.async.WebhookServiceAsyncImpl import java.net.URLEncoder import java.util.concurrent.CompletableFuture -class FinchClientAsyncImpl -constructor( +class FinchClientAsyncImpl( private val clientOptions: ClientOptions, ) : FinchClientAsync { 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 226fddca..84439057 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 @@ -37,8 +37,7 @@ import com.tryfinch.api.services.blocking.WebhookService import com.tryfinch.api.services.blocking.WebhookServiceImpl import java.net.URLEncoder -class FinchClientImpl -constructor( +class FinchClientImpl( private val clientOptions: ClientOptions, ) : FinchClient { 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 de47ebd5..18701a96 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 @@ -40,7 +40,7 @@ private constructor( @JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build() } - class Builder { + class Builder internal constructor() { private var httpClient: HttpClient? = null private var jsonMapper: JsonMapper = jsonMapper() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/RequestOptions.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/RequestOptions.kt index b1706dda..b31943e2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/RequestOptions.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/RequestOptions.kt @@ -23,7 +23,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { + private var responseValidation: Boolean? = null private var timeout: Duration? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/Headers.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/Headers.kt index 267dac4e..1a95b473 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/Headers.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/Headers.kt @@ -22,7 +22,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private val map: MutableMap> = TreeMap(String.CASE_INSENSITIVE_ORDER) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt index 4477451c..c75e9fb9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt @@ -22,7 +22,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var method: HttpMethod? = null private var url: String? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/QueryParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/QueryParams.kt index 38a46c18..73766d6a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/QueryParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/QueryParams.kt @@ -21,7 +21,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private val map: MutableMap> = mutableMapOf() private var size: Int = 0 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt index 7b7f3dea..9ea4b500 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt @@ -243,7 +243,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var httpClient: HttpClient? = null private var clock: Clock = Clock.systemUTC() 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 da8d7b2e..434f9424 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 @@ -30,7 +30,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 27c72ddf..e3392483 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 @@ -21,7 +21,7 @@ import java.util.Optional /** Exchange the authorization code for an access token */ class AccessTokenCreateParams -constructor( +private constructor( private val body: AccessTokenCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -122,7 +122,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var code: JsonField? = null private var clientId: JsonField = JsonMissing.of() @@ -214,7 +214,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: AccessTokenCreateBody.Builder = AccessTokenCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() 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 3ac31755..bc3116bb 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 @@ -123,7 +123,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accessToken: JsonField? = null private var accountId: JsonField? = null 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 4fc38a12..07e32f2e 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 @@ -12,7 +12,7 @@ import java.util.Optional /** Disconnect one or more `access_token`s from your application. */ class AccountDisconnectParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -40,7 +40,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt index c2e0cc27..cd9ddf95 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** Read account information associated with an `access_token` */ class AccountIntrospectParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 3ee67246..68109a5d 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -262,7 +262,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var authenticationMethod: JsonField? = null private var status: JsonField? = null @@ -385,7 +385,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitsSupport: JsonField = JsonMissing.of() private var supportedFields: JsonField = JsonMissing.of() @@ -579,7 +579,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var company: JsonField = JsonMissing.of() private var directory: JsonField = JsonMissing.of() @@ -807,7 +807,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var accounts: JsonField = JsonMissing.of() @@ -1009,7 +1009,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() @@ -1165,7 +1165,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var parent: JsonField = JsonMissing.of() @@ -1260,7 +1260,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -1390,7 +1390,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1556,7 +1556,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -1728,7 +1728,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individuals: JsonField = JsonMissing.of() private var paging: JsonField = JsonMissing.of() @@ -1889,7 +1889,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var department: JsonField = JsonMissing.of() @@ -2030,7 +2030,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -2162,7 +2162,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var count: JsonField = JsonMissing.of() private var offset: JsonField = JsonMissing.of() @@ -2460,7 +2460,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() @@ -2687,7 +2687,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -2798,7 +2798,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -2932,7 +2932,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -3105,7 +3105,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -3246,7 +3246,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -3486,7 +3486,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() @@ -3684,7 +3684,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -3802,7 +3802,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -3967,7 +3967,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -4155,7 +4155,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var individualIds: JsonField = JsonMissing.of() @@ -4298,7 +4298,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() private var payStatements: JsonField = JsonMissing.of() @@ -4406,7 +4406,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var count: JsonField? = null private var offset: JsonField? = null @@ -4622,7 +4622,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var earnings: JsonField = JsonMissing.of() private var employeeDeductions: JsonField = @@ -4828,7 +4828,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5004,7 +5004,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5167,7 +5167,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5338,7 +5338,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5630,7 +5630,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() @@ -5829,7 +5829,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() 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 95947a9f..cf4f91f0 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 @@ -115,7 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var authenticationType: JsonField? = null 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 bf1f2284..ccc7cad8 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 @@ -145,7 +145,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var completedAt: JsonField? = null private var createdAt: JsonField? = null 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 293e6c1a..2a02d0f5 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 @@ -86,7 +86,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var allowedRefreshes: JsonField? = null private var jobId: JsonField? = null 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 da060165..9bd27cf5 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 @@ -96,7 +96,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null 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 a3b1dd47..6a7d91a1 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 @@ -62,7 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 d872581a..72984d49 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 @@ -68,7 +68,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var supportedFeatures: JsonField = JsonMissing.of() private var supportedOperations: JsonField = JsonMissing.of() @@ -253,7 +253,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() 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 ccde9258..aeb8f010 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 @@ -180,7 +180,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var commuter: JsonField = JsonMissing.of() private var customPostTax: JsonField = JsonMissing.of() 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 05af16d0..017dcdf6 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 @@ -143,7 +143,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField? = null private var accounts: JsonField>? = null @@ -432,7 +432,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() @@ -678,7 +678,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var parent: JsonField = JsonMissing.of() @@ -776,7 +776,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -905,7 +905,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 381aeb52..6a118842 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 @@ -83,7 +83,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitId: JsonField? = null private var description: JsonField? = null 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 8bf208ef..7a3a32c5 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -243,7 +243,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 37dc3bb1..5baa470b 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 @@ -135,7 +135,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accounts: JsonField>? = null private var departments: JsonField>? = null @@ -415,7 +415,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() @@ -661,7 +661,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var parent: JsonField = JsonMissing.of() @@ -759,7 +759,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -888,7 +888,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 8134ac6c..ff6615f4 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Create a new connect session for an employer */ class ConnectSessionNewParams -constructor( +private constructor( private val body: ConnectSessionNewBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -204,7 +204,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var customerId: JsonField? = null private var customerName: JsonField? = null @@ -393,7 +393,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: ConnectSessionNewBody.Builder = ConnectSessionNewBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -753,7 +753,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var authMethod: JsonField = JsonMissing.of() private var provider: JsonField = JsonMissing.of() 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 0446feaf..9382318f 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Create a new Connect session for reauthenticating an existing connection */ class ConnectSessionReauthenticateParams -constructor( +private constructor( private val body: ConnectSessionReauthenticateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -149,7 +149,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var connectionId: JsonField? = null private var minutesToExpire: JsonField = JsonMissing.of() @@ -298,7 +298,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: ConnectSessionReauthenticateBody.Builder = ConnectSessionReauthenticateBody.builder() 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 fac7ac47..8dfd6791 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 @@ -132,7 +132,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accessToken: JsonField? = null private var accountId: JsonField? = null 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 09bf9aba..b3478d52 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 @@ -175,7 +175,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accessToken: JsonField? = null private var accountId: JsonField? = null 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 da7490db..be8c4e9b 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 @@ -52,7 +52,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 89d92833..c4612b4e 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -254,7 +254,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 2ff9bfc4..da4c03a2 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 @@ -54,7 +54,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt index 4ff140ee..2202a7f6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt @@ -62,7 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var documents: JsonField>? = null private var paging: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt index 4d3bb4d0..291583a4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt @@ -103,7 +103,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var individualId: JsonField = JsonMissing.of() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt index 4ddf57aa..80c0e9d6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt @@ -142,7 +142,7 @@ private constructor( } } - class Deserializer : + internal class Deserializer : BaseDeserializer(DocumentRetreiveResponse::class) { override fun ObjectCodec.deserialize(node: JsonNode): DocumentRetreiveResponse { @@ -168,7 +168,8 @@ private constructor( } } - class Serializer : BaseSerializer(DocumentRetreiveResponse::class) { + internal class Serializer : + BaseSerializer(DocumentRetreiveResponse::class) { override fun serialize( value: DocumentRetreiveResponse, 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 67e18b11..6538f0ea 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 @@ -276,7 +276,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() @@ -657,7 +657,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var value: JsonValue = JsonMissing.of() @@ -761,7 +761,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -875,7 +875,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1232,7 +1232,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 415130ba..be0650e3 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 @@ -69,7 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() 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 be6eb2a5..55ee91be 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -254,7 +254,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 82843753..7b4b161f 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 @@ -256,7 +256,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() @@ -604,7 +604,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var value: JsonValue = JsonMissing.of() @@ -710,7 +710,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -824,7 +824,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1178,7 +1178,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 6b0cb507..341e3d6f 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 @@ -71,7 +71,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() @@ -189,7 +189,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var finchCode: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() 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 77c89ba7..33572e98 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 @@ -23,7 +23,7 @@ import java.util.Optional * view available types for each provider. */ class HrisBenefitCreateParams -constructor( +private constructor( private val body: HrisBenefitCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -132,7 +132,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var description: JsonField = JsonMissing.of() private var frequency: JsonField = JsonMissing.of() @@ -234,7 +234,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: HrisBenefitCreateBody.Builder = HrisBenefitCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt index 7f09475f..4def2f61 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt @@ -10,7 +10,7 @@ import java.util.Objects /** Lists individuals currently enrolled in a given deduction. */ class HrisBenefitIndividualEnrolledIdsParams -constructor( +private constructor( private val benefitId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -41,7 +41,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var benefitId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 98a43b39..8af049c0 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 @@ -146,8 +146,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPage, ) : Iterable { 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 b3840a25..3b65576e 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 @@ -150,8 +150,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPageAsync, ) { 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 75c438f9..53897175 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 @@ -11,7 +11,7 @@ import java.util.Optional /** Get enrollment information for the given individuals. */ class HrisBenefitIndividualRetrieveManyBenefitsParams -constructor( +private constructor( private val benefitId: String, private val individualIds: String?, private val additionalHeaders: Headers, @@ -55,7 +55,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var benefitId: String? = null private var individualIds: String? = null 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 fb50d2cb..cdb9f7ac 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 @@ -146,8 +146,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitIndividualUnenrollManyPage, ) : Iterable { 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 b6b6a9b4..fafba6a4 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 @@ -149,8 +149,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitIndividualUnenrollManyPageAsync, ) { 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 af928445..968e9a89 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 @@ -21,7 +21,7 @@ import java.util.Optional /** Unenroll individuals from a deduction or contribution */ class HrisBenefitIndividualUnenrollManyParams -constructor( +private constructor( private val benefitId: String, private val body: HrisBenefitIndividualUnenrollManyBody, private val additionalHeaders: Headers, @@ -97,7 +97,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualIds: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -187,7 +187,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var benefitId: String? = null private var body: HrisBenefitIndividualUnenrollManyBody.Builder = 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 64de7bf5..dcfd510d 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 @@ -142,8 +142,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitListPage, ) : Iterable { 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 07843b2d..600505e0 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 @@ -149,8 +149,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitListPageAsync, ) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt index 00c1a49a..69e6de4b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** List all company-wide deductions and contributions. */ class HrisBenefitListParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 9827634f..25e77547 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 @@ -146,8 +146,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitListSupportedBenefitsPage, ) : Iterable { 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 28fd12a4..add12868 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 @@ -149,8 +149,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisBenefitListSupportedBenefitsPageAsync, ) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt index ef04edfb..56c0bad0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** Get deductions metadata */ class HrisBenefitListSupportedBenefitsParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt index 04fbb7a0..32a9f10c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt @@ -10,7 +10,7 @@ import java.util.Objects /** Lists deductions and contributions information for a given item */ class HrisBenefitRetrieveParams -constructor( +private constructor( private val benefitId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -41,7 +41,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var benefitId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 6b4f3c67..001ddd57 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 @@ -21,7 +21,7 @@ import java.util.Optional /** Updates an existing company-wide deduction or contribution */ class HrisBenefitUpdateParams -constructor( +private constructor( private val benefitId: String, private val body: HrisBenefitUpdateBody, private val additionalHeaders: Headers, @@ -97,7 +97,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var description: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -165,7 +165,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var benefitId: String? = null private var body: HrisBenefitUpdateBody.Builder = HrisBenefitUpdateBody.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt index b33fe36f..e3014c90 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** Read basic company data */ class HrisCompanyRetrieveParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 fd39606d..0173f5a2 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 @@ -181,8 +181,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisDirectoryListIndividualsPage, ) : Iterable { 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 370bb6e1..6a76f1ec 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 @@ -184,8 +184,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisDirectoryListIndividualsPageAsync, ) { 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 4eee83a7..dff29529 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 @@ -11,7 +11,7 @@ import java.util.Optional /** Read company directory and organization structure */ @Deprecated("use `list` instead") class HrisDirectoryListIndividualsParams -constructor( +private constructor( private val limit: Long?, private val offset: Long?, private val additionalHeaders: Headers, @@ -47,7 +47,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var limit: Long? = null private var offset: Long? = null 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 3acf24e3..e083b0d9 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 @@ -180,8 +180,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisDirectoryListPage, ) : Iterable { 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 4ab968b9..92bf1a3e 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 @@ -183,8 +183,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisDirectoryListPageAsync, ) { 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 f68fca4d..66509a47 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 @@ -10,7 +10,7 @@ import java.util.Optional /** Read company directory and organization structure */ class HrisDirectoryListParams -constructor( +private constructor( private val limit: Long?, private val offset: Long?, private val additionalHeaders: Headers, @@ -46,7 +46,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var limit: Long? = null private var offset: Long? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt index 410ee226..6f392e8a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt @@ -15,7 +15,7 @@ import java.util.Optional /** **Beta:** This endpoint is in beta and may change. Retrieve a list of company-wide documents. */ class HrisDocumentListParams -constructor( +private constructor( private val individualIds: List?, private val limit: Long?, private val offset: Long?, @@ -64,7 +64,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var individualIds: MutableList? = null private var limit: Long? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt index a49db4ef..8ac1554e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt @@ -13,7 +13,7 @@ import java.util.Objects * ID. */ class HrisDocumentRetreiveParams -constructor( +private constructor( private val documentId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -44,7 +44,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var documentId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 964fa55f..1ef955e2 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 @@ -151,8 +151,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisEmploymentRetrieveManyPage, ) : Iterable { 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 1bac4e35..f3dc9330 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 @@ -154,8 +154,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisEmploymentRetrieveManyPageAsync, ) { 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 4e03f950..cf825e59 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 @@ -20,7 +20,7 @@ import java.util.Objects /** Read individual employment and income data */ class HrisEmploymentRetrieveManyParams -constructor( +private constructor( private val body: HrisEmploymentRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -86,7 +86,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var requests: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -173,7 +173,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: HrisEmploymentRetrieveManyBody.Builder = HrisEmploymentRetrieveManyBody.builder() @@ -372,7 +372,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 0d69fb11..30c5ab22 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 @@ -149,8 +149,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisIndividualRetrieveManyPage, ) : Iterable { 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 ec788a53..62e2a9c6 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 @@ -152,8 +152,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisIndividualRetrieveManyPageAsync, ) { 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 7ed7c901..6a1f9e0c 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 @@ -20,7 +20,7 @@ import java.util.Optional /** Read individual data, excluding income and employment data */ class HrisIndividualRetrieveManyParams -constructor( +private constructor( private val body: HrisIndividualRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -94,7 +94,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var options: JsonField = JsonMissing.of() private var requests: JsonField>? = null @@ -187,7 +187,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: HrisIndividualRetrieveManyBody.Builder = HrisIndividualRetrieveManyBody.builder() @@ -377,7 +377,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var include: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -491,7 +491,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 3adacf9d..3343773b 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 @@ -154,8 +154,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisPayStatementRetrieveManyPage, ) : Iterable { 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 2d715071..8402cb89 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 @@ -157,8 +157,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisPayStatementRetrieveManyPageAsync, ) { 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 eccab1d2..f28828f2 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 @@ -25,7 +25,7 @@ import java.util.Optional * Deduction and contribution types are supported by the payroll systems that supports Benefits. */ class HrisPayStatementRetrieveManyParams -constructor( +private constructor( private val body: HrisPayStatementRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -90,7 +90,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var requests: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -177,7 +177,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: HrisPayStatementRetrieveManyBody.Builder = HrisPayStatementRetrieveManyBody.builder() @@ -386,7 +386,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var paymentId: JsonField? = null private var limit: JsonField = JsonMissing.of() 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 b90914d2..21e1d194 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 @@ -141,8 +141,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisPaymentListPage, ) : Iterable { 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 55700ad4..90b5f23f 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 @@ -148,8 +148,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: HrisPaymentListPageAsync, ) { 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 01635c0c..8206b9b7 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 @@ -11,7 +11,7 @@ import java.util.Objects /** Read payroll and contractor related payments by the company. */ class HrisPaymentListParams -constructor( +private constructor( private val endDate: LocalDate, private val startDate: LocalDate, private val additionalHeaders: Headers, @@ -47,7 +47,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var endDate: LocalDate? = null private var startDate: LocalDate? = null 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 63f7dae3..bf63e2f5 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 @@ -96,7 +96,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() 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 61f51f38..0a001323 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 @@ -187,7 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() @@ -467,7 +467,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -800,7 +800,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 23bf5389..1a099471 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 @@ -69,7 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() @@ -219,7 +219,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() 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 c3839a26..0243b26e 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 @@ -62,7 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitId: JsonField? = null private var individualIds: JsonField>? = null 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 9c92226a..f2ce4a37 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -254,7 +254,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 89791d8e..6e2f768a 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 @@ -115,7 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var department: JsonField = JsonMissing.of() @@ -274,7 +274,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -372,7 +372,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 7c13b2f9..ca51f632 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 @@ -69,7 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() 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 42c47e62..4187d35a 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 @@ -187,7 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() @@ -467,7 +467,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -800,7 +800,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 635c019f..5a3c5432 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 @@ -278,7 +278,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var authenticationMethods: JsonField>? = null @@ -639,7 +639,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var connectionStatus: JsonField = JsonMissing.of() private var products: JsonField>? = null @@ -765,7 +765,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var message: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() @@ -1040,7 +1040,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var message: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() 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 7be55e6b..43252c70 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 @@ -48,7 +48,7 @@ import kotlin.jvm.optionals.getOrNull * endpoint, please contact your Finch account manager. */ class JobAutomatedCreateParams -constructor( +private constructor( private val body: JobAutomatedCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -142,7 +142,7 @@ constructor( } } - class Deserializer : + internal class Deserializer : BaseDeserializer(JobAutomatedCreateBody::class) { override fun ObjectCodec.deserialize(node: JsonNode): JobAutomatedCreateBody { @@ -166,7 +166,8 @@ constructor( } } - class Serializer : BaseSerializer(JobAutomatedCreateBody::class) { + internal class Serializer : + BaseSerializer(JobAutomatedCreateBody::class) { override fun serialize( value: JobAutomatedCreateBody, @@ -192,7 +193,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: JobAutomatedCreateBody? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -356,7 +357,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -515,7 +516,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField? = null private var type: JsonField? = null 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 e8419ae9..bbad9e28 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 @@ -179,8 +179,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: JobAutomatedListPage, ) : Iterable { 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 beaea7fd..4a96ccc6 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 @@ -182,8 +182,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: JobAutomatedListPageAsync, ) { 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 0e94df49..56f4e22d 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 @@ -14,7 +14,7 @@ import java.util.Optional * scheduled job is shown. */ class JobAutomatedListParams -constructor( +private constructor( private val limit: Long?, private val offset: Long?, private val additionalHeaders: Headers, @@ -50,7 +50,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var limit: Long? = null private var offset: Long? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt index f813df98..e6e765ba 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt @@ -10,7 +10,7 @@ import java.util.Objects /** Get an automated job by `job_id`. */ class JobAutomatedRetrieveParams -constructor( +private constructor( private val jobId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -41,7 +41,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var jobId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 29853568..430a32f2 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -261,7 +261,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var jobId: JsonField? = null private var jobUrl: JsonField? = null 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 7504491e..14406c49 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 @@ -86,7 +86,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var allowedRefreshes: JsonField? = null private var jobId: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt index 55f75456..c6b3baff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt @@ -13,7 +13,7 @@ import java.util.Objects * jobs. */ class JobManualRetrieveParams -constructor( +private constructor( private val jobId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -44,7 +44,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var jobId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 5fec9b2c..a8336bfe 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 @@ -110,7 +110,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() 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 09fb403b..250b7558 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 @@ -71,7 +71,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField>? = null private var jobId: JsonField? = null 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 a0c09af1..c9d695d5 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 @@ -60,7 +60,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() 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 a62484f9..00b9a9bd 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 @@ -148,7 +148,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var create: JsonField = JsonMissing.of() private var delete: JsonField = JsonMissing.of() 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 eec53ca6..f5960ca6 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 @@ -60,7 +60,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var count: JsonField = JsonMissing.of() private var offset: JsonField = JsonMissing.of() 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 de991a2b..dd51b524 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 @@ -75,7 +75,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() 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 b5b3dfeb..6dbddb08 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 @@ -84,7 +84,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField? = null private var individualIds: JsonField>? = null 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 00be9dc1..b67b85ed 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 @@ -150,7 +150,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var earnings: JsonField>? = null private var employeeDeductions: JsonField>? = null @@ -454,7 +454,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -789,7 +789,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -978,7 +978,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -1217,7 +1217,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() 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 26492340..b45ca939 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 @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -264,7 +264,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() private var paymentId: JsonField = JsonMissing.of() 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 a01f729b..6ae835c9 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 @@ -66,7 +66,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() 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 d28332cd..b4c49d97 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 @@ -65,7 +65,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() private var payStatements: JsonField>? = null 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 81013c08..a5b0caf2 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 @@ -168,7 +168,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() @@ -529,7 +529,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() 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 d3727c4e..fbe5b6f1 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 @@ -64,7 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var payDate: JsonField? = null private var paymentId: JsonField? = null 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 c8025842..1942329b 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 @@ -121,7 +121,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountId: JsonField? = null private var companyId: JsonField? = null @@ -263,7 +263,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var payDate: JsonField? = null private var paymentId: JsonField? = null 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 8240938d..51aa4989 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 @@ -146,8 +146,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PayrollPayGroupListPage, ) : Iterable { 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 8524c73c..eb29f545 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 @@ -149,8 +149,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PayrollPayGroupListPageAsync, ) { 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 979124f0..59b14152 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 @@ -11,7 +11,7 @@ import java.util.Optional /** Read company pay groups and frequencies */ class PayrollPayGroupListParams -constructor( +private constructor( private val individualId: String?, private val payFrequencies: List?, private val additionalHeaders: Headers, @@ -45,7 +45,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var individualId: String? = null private var payFrequencies: MutableList? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt index 4078307d..86764fc7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt @@ -10,7 +10,7 @@ import java.util.Objects /** Read information from a single pay group */ class PayrollPayGroupRetrieveParams -constructor( +private constructor( private val payGroupId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -41,7 +41,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var payGroupId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 d6da09bd..36d08f50 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 @@ -159,7 +159,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var authenticationMethods: JsonField>? = null @@ -396,7 +396,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitsSupport: JsonField = JsonMissing.of() private var supportedFields: JsonField = JsonMissing.of() @@ -587,7 +587,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var company: JsonField = JsonMissing.of() private var directory: JsonField = JsonMissing.of() @@ -810,7 +810,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var accounts: JsonField = JsonMissing.of() @@ -1008,7 +1008,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() @@ -1162,7 +1162,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var parent: JsonField = JsonMissing.of() @@ -1253,7 +1253,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -1378,7 +1378,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1531,7 +1531,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -1697,7 +1697,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var individuals: JsonField = JsonMissing.of() private var paging: JsonField = JsonMissing.of() @@ -1855,7 +1855,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var department: JsonField = JsonMissing.of() @@ -1990,7 +1990,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -2115,7 +2115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var count: JsonField = JsonMissing.of() private var offset: JsonField = JsonMissing.of() @@ -2410,7 +2410,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() @@ -2626,7 +2626,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -2734,7 +2734,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -2863,7 +2863,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -3025,7 +3025,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -3162,7 +3162,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -3396,7 +3396,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() @@ -3588,7 +3588,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -3703,7 +3703,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -3856,7 +3856,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -4041,7 +4041,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var individualIds: JsonField = JsonMissing.of() @@ -4179,7 +4179,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() private var payStatements: JsonField = JsonMissing.of() @@ -4282,7 +4282,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var count: JsonField? = null private var offset: JsonField? = null @@ -4490,7 +4490,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var earnings: JsonField = JsonMissing.of() private var employeeDeductions: JsonField = @@ -4689,7 +4689,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -4856,7 +4856,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5011,7 +5011,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5173,7 +5173,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -5459,7 +5459,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var companyDebit: JsonField = JsonMissing.of() @@ -5653,7 +5653,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() 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 08f6522f..9d818def 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 @@ -141,8 +141,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: ProviderListPage, ) : Iterable { 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 fae9fbba..92cdf968 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 @@ -148,8 +148,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: ProviderListPageAsync, ) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt index 3adfae98..5357d2e7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** Return details on all available payroll and HR systems. */ class ProviderListParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 f2061a30..dd6cb216 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 @@ -25,7 +25,7 @@ import java.util.Optional * pull data models directly against an integration’s API. */ class RequestForwardingForwardParams -constructor( +private constructor( private val body: RequestForwardingForwardBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -185,7 +185,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var method: JsonField? = null private var route: JsonField? = null @@ -318,7 +318,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: RequestForwardingForwardBody.Builder = RequestForwardingForwardBody.builder() 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 b3b783c3..edbc9ef6 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 @@ -98,7 +98,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField? = null private var headers: JsonValue? = null @@ -287,7 +287,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField? = null private var headers: JsonValue? = null 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 35af1296..4fd7989b 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Update a sandbox company's data */ class SandboxCompanyUpdateParams -constructor( +private constructor( private val body: SandboxCompanyUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -207,7 +207,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accounts: JsonField>? = null private var departments: JsonField>? = null @@ -417,7 +417,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxCompanyUpdateBody.Builder = SandboxCompanyUpdateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -740,7 +740,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() @@ -986,7 +986,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var parent: JsonField = JsonMissing.of() @@ -1084,7 +1084,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1213,7 +1213,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 72cf592b..a6c9a4a8 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Create a new account for an existing connection (company/provider pair) */ class SandboxConnectionAccountCreateParams -constructor( +private constructor( private val body: SandboxConnectionAccountCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -146,7 +146,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var companyId: JsonField? = null private var providerId: JsonField? = null @@ -269,7 +269,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxConnectionAccountCreateBody.Builder = SandboxConnectionAccountCreateBody.builder() 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 e7dc0fc1..7077ccbc 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 @@ -23,7 +23,7 @@ import java.util.Optional * responds. */ class SandboxConnectionAccountUpdateParams -constructor( +private constructor( private val body: SandboxConnectionAccountUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -85,7 +85,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var connectionStatus: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -158,7 +158,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxConnectionAccountUpdateBody.Builder = SandboxConnectionAccountUpdateBody.builder() 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 65bbd888..aa2a8e16 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Create a new connection (new company/provider pair) with a new account */ class SandboxConnectionCreateParams -constructor( +private constructor( private val body: SandboxConnectionCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -153,7 +153,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var providerId: JsonField? = null private var authenticationType: JsonField = JsonMissing.of() @@ -274,7 +274,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxConnectionCreateBody.Builder = SandboxConnectionCreateBody.builder() 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 4db6b6ef..b9d52673 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Add new individuals to a sandbox company */ class SandboxDirectoryCreateParams -constructor( +private constructor( private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -53,7 +53,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -529,7 +529,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField>? = null @@ -1033,7 +1033,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var value: JsonValue = JsonMissing.of() @@ -1142,7 +1142,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1250,7 +1250,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1434,7 +1434,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1959,7 +1959,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -2063,7 +2063,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 3b9609c9..ccd0e27f 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Update sandbox employment */ class SandboxEmploymentUpdateParams -constructor( +private constructor( private val individualId: String, private val body: SandboxEmploymentUpdateBody, private val additionalHeaders: Headers, @@ -401,7 +401,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField>? = null @@ -732,7 +732,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var individualId: String? = null private var body: SandboxEmploymentUpdateBody.Builder = @@ -1110,7 +1110,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var value: JsonValue = JsonMissing.of() @@ -1216,7 +1216,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1330,7 +1330,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1684,7 +1684,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() 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 75e2a888..bfb5a280 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Update sandbox individual */ class SandboxIndividualUpdateParams -constructor( +private constructor( private val individualId: String, private val body: SandboxIndividualUpdateBody, private val additionalHeaders: Headers, @@ -300,7 +300,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var dob: JsonField = JsonMissing.of() private var emails: JsonField>? = null @@ -557,7 +557,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var individualId: String? = null private var body: SandboxIndividualUpdateBody.Builder = @@ -878,7 +878,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1211,7 +1211,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() 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 0cced1e8..d05a748d 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 @@ -62,7 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var completionStatus: JsonField? = null private var type: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt index 92235e08..75796927 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt @@ -9,7 +9,7 @@ import java.util.Objects /** Get configurations for sandbox jobs */ class SandboxJobConfigurationRetrieveParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { @@ -30,7 +30,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 26ddf678..b8b0d31f 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 @@ -22,7 +22,7 @@ import java.util.Objects /** Update configurations for sandbox jobs */ class SandboxJobConfigurationUpdateParams -constructor( +private constructor( private val body: SandboxJobConfigurationUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -93,7 +93,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var completionStatus: JsonField? = null private var type: JsonField? = null @@ -173,7 +173,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxJobConfigurationUpdateBody.Builder = SandboxJobConfigurationUpdateBody.builder() 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 a634de9b..25417bd8 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 @@ -22,7 +22,7 @@ import java.util.Objects /** Enqueue a new sandbox job */ class SandboxJobCreateParams -constructor( +private constructor( private val body: SandboxJobCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -83,7 +83,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -152,7 +152,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxJobCreateBody.Builder = SandboxJobCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() 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 018ce839..5d00caf4 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 @@ -22,7 +22,7 @@ import java.util.Optional /** Add a new sandbox payment */ class SandboxPaymentCreateParams -constructor( +private constructor( private val body: SandboxPaymentCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -112,7 +112,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() private var payStatements: JsonField>? = null @@ -209,7 +209,7 @@ constructor( } @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SandboxPaymentCreateBody.Builder = SandboxPaymentCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -507,7 +507,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var earnings: JsonField>? = null private var employeeDeductions: JsonField>? = null @@ -817,7 +817,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -1155,7 +1155,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -1347,7 +1347,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -1592,7 +1592,7 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() 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 a7219aa5..0dab3b96 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 @@ -64,7 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var connectUrl: JsonField? = null private var sessionId: JsonField? = null 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 6f7d216a..da32debd 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 @@ -64,7 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var connectUrl: JsonField? = null private var sessionId: JsonField? = null 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 d5fc0289..9e08f50d 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 @@ -66,7 +66,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var companyBenefits: JsonField = JsonMissing.of() private var individualBenefits: JsonField = JsonMissing.of() 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 693aa6f4..4935ab0c 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 @@ -152,7 +152,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() private var catchUp: JsonField = JsonMissing.of() 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 da74b292..81372091 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 @@ -69,7 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var body: JsonField = JsonMissing.of() private var code: JsonField = JsonMissing.of() @@ -187,7 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var finchCode: JsonField = JsonMissing.of() private var message: JsonField = JsonMissing.of() 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 ac680027..b6c621bf 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 @@ -52,7 +52,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var benefitId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt index 059da5ba..b0f89e64 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt @@ -74,7 +74,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -237,7 +237,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var additionalWithholding: JsonField = JsonMissing.of() private var exemption: JsonField = JsonMissing.of() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt index a97410dd..bf4f4551 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt @@ -74,7 +74,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var data: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -283,7 +283,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var amountForOtherDependents: JsonField = JsonMissing.of() private var amountForQualifyingChildrenUnder17: JsonField = JsonMissing.of() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt index 133f8926..0f2f2fcb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt @@ -215,7 +215,7 @@ private constructor( } } - class Deserializer : BaseDeserializer(WebhookEvent::class) { + internal class Deserializer : BaseDeserializer(WebhookEvent::class) { override fun ObjectCodec.deserialize(node: JsonNode): WebhookEvent { val json = JsonValue.fromJsonNode(node) @@ -257,7 +257,7 @@ private constructor( } } - class Serializer : BaseSerializer(WebhookEvent::class) { + internal class Serializer : BaseSerializer(WebhookEvent::class) { override fun serialize( value: WebhookEvent, diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/SerializerTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/SerializerTest.kt index 129648eb..59d8dece 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/SerializerTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/SerializerTest.kt @@ -65,7 +65,8 @@ internal class SerializerTest { } @NoAutoDetect - class Builder { + class Builder internal constructor() { + private var isActive: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() From 1e1e28e262030d8a05af6a9c3736f91650bede4f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:50:20 +0000 Subject: [PATCH 22/34] docs: builder, enum, and union comments (#417) --- .../api/client/okhttp/FinchOkHttpClient.kt | 1 + .../client/okhttp/FinchOkHttpClientAsync.kt | 1 + .../com/tryfinch/api/core/ClientOptions.kt | 1 + .../com/tryfinch/api/errors/FinchError.kt | 1 + .../api/models/AccessTokenCreateParams.kt | 2 + .../api/models/AccountCreateResponse.kt | 38 +++ .../api/models/AccountDisconnectParams.kt | 1 + .../api/models/AccountIntrospectParams.kt | 1 + .../tryfinch/api/models/AccountUpdateEvent.kt | 107 +++++++ .../api/models/AccountUpdateResponse.kt | 38 +++ .../tryfinch/api/models/AutomatedAsyncJob.kt | 69 +++++ .../api/models/AutomatedCreateResponse.kt | 1 + .../tryfinch/api/models/BaseWebhookEvent.kt | 1 + .../api/models/BenefitContribution.kt | 35 +++ .../models/BenefitFeaturesAndOperations.kt | 121 ++++++++ .../tryfinch/api/models/BenefitFrequency.kt | 35 +++ .../com/tryfinch/api/models/BenefitType.kt | 33 +++ .../tryfinch/api/models/BenefitsSupport.kt | 1 + .../kotlin/com/tryfinch/api/models/Company.kt | 115 ++++++++ .../com/tryfinch/api/models/CompanyBenefit.kt | 1 + .../com/tryfinch/api/models/CompanyEvent.kt | 38 +++ .../api/models/CompanyUpdateResponse.kt | 115 ++++++++ .../api/models/ConnectSessionNewParams.kt | 112 ++++++++ .../ConnectSessionReauthenticateParams.kt | 39 +++ .../api/models/ConnectionCreateResponse.kt | 38 +++ .../api/models/ConnectionStatusType.kt | 36 +++ .../api/models/CreateAccessTokenResponse.kt | 74 +++++ .../models/CreateCompanyBenefitsResponse.kt | 1 + .../com/tryfinch/api/models/DirectoryEvent.kt | 38 +++ .../tryfinch/api/models/DisconnectResponse.kt | 1 + .../api/models/DocumentListResponse.kt | 1 + .../tryfinch/api/models/DocumentResponse.kt | 35 +++ .../api/models/DocumentRetreiveResponse.kt | 14 + .../com/tryfinch/api/models/EmploymentData.kt | 114 ++++++++ .../api/models/EmploymentDataResponse.kt | 1 + .../tryfinch/api/models/EmploymentEvent.kt | 38 +++ .../api/models/EmploymentUpdateResponse.kt | 114 ++++++++ .../tryfinch/api/models/EnrolledIndividual.kt | 36 +++ .../api/models/HrisBenefitCreateParams.kt | 2 + .../HrisBenefitIndividualEnrolledIdsParams.kt | 1 + ...fitIndividualRetrieveManyBenefitsParams.kt | 1 + ...HrisBenefitIndividualUnenrollManyParams.kt | 2 + .../api/models/HrisBenefitListParams.kt | 1 + .../HrisBenefitListSupportedBenefitsParams.kt | 1 + .../api/models/HrisBenefitRetrieveParams.kt | 1 + .../api/models/HrisBenefitUpdateParams.kt | 2 + .../api/models/HrisCompanyRetrieveParams.kt | 1 + .../HrisDirectoryListIndividualsParams.kt | 1 + .../api/models/HrisDirectoryListParams.kt | 1 + .../api/models/HrisDocumentListParams.kt | 35 +++ .../api/models/HrisDocumentRetreiveParams.kt | 1 + .../HrisEmploymentRetrieveManyParams.kt | 3 + .../HrisIndividualRetrieveManyParams.kt | 4 + .../HrisPayStatementRetrieveManyParams.kt | 3 + .../api/models/HrisPaymentListParams.kt | 1 + .../kotlin/com/tryfinch/api/models/Income.kt | 35 +++ .../com/tryfinch/api/models/Individual.kt | 143 +++++++++ .../tryfinch/api/models/IndividualBenefit.kt | 42 +++ .../models/IndividualEnrolledIdsResponse.kt | 1 + .../tryfinch/api/models/IndividualEvent.kt | 38 +++ .../api/models/IndividualInDirectory.kt | 3 + .../tryfinch/api/models/IndividualResponse.kt | 1 + .../api/models/IndividualUpdateResponse.kt | 143 +++++++++ .../com/tryfinch/api/models/Introspection.kt | 112 ++++++++ .../api/models/JobAutomatedCreateParams.kt | 87 ++++++ .../api/models/JobAutomatedListParams.kt | 1 + .../api/models/JobAutomatedRetrieveParams.kt | 1 + .../tryfinch/api/models/JobCompletionEvent.kt | 38 +++ .../tryfinch/api/models/JobCreateResponse.kt | 1 + .../api/models/JobManualRetrieveParams.kt | 1 + .../com/tryfinch/api/models/Location.kt | 1 + .../com/tryfinch/api/models/ManualAsyncJob.kt | 35 +++ .../kotlin/com/tryfinch/api/models/Money.kt | 1 + .../tryfinch/api/models/OperationSupport.kt | 35 +++ .../api/models/OperationSupportMatrix.kt | 1 + .../kotlin/com/tryfinch/api/models/Paging.kt | 1 + .../api/models/PayGroupListResponse.kt | 37 +++ .../api/models/PayGroupRetrieveResponse.kt | 37 +++ .../com/tryfinch/api/models/PayStatement.kt | 146 ++++++++++ .../tryfinch/api/models/PayStatementEvent.kt | 38 +++ .../api/models/PayStatementResponse.kt | 1 + .../api/models/PayStatementResponseBody.kt | 1 + .../kotlin/com/tryfinch/api/models/Payment.kt | 38 +++ .../api/models/PaymentCreateResponse.kt | 1 + .../com/tryfinch/api/models/PaymentEvent.kt | 38 +++ .../api/models/PayrollPayGroupListParams.kt | 1 + .../models/PayrollPayGroupRetrieveParams.kt | 1 + .../com/tryfinch/api/models/Provider.kt | 68 +++++ .../tryfinch/api/models/ProviderListParams.kt | 1 + .../models/RequestForwardingForwardParams.kt | 2 + .../RequestForwardingForwardResponse.kt | 2 + .../api/models/SandboxCompanyUpdateParams.kt | 116 ++++++++ .../SandboxConnectionAccountCreateParams.kt | 39 +++ .../SandboxConnectionAccountUpdateParams.kt | 2 + .../models/SandboxConnectionCreateParams.kt | 39 +++ .../models/SandboxDirectoryCreateParams.kt | 271 ++++++++++++++++++ .../models/SandboxEmploymentUpdateParams.kt | 115 ++++++++ .../models/SandboxIndividualUpdateParams.kt | 144 ++++++++++ .../api/models/SandboxJobConfiguration.kt | 72 +++++ .../SandboxJobConfigurationRetrieveParams.kt | 1 + .../SandboxJobConfigurationUpdateParams.kt | 73 +++++ .../api/models/SandboxJobCreateParams.kt | 36 +++ .../api/models/SandboxPaymentCreateParams.kt | 154 ++++++++++ .../tryfinch/api/models/SessionNewResponse.kt | 1 + .../models/SessionReauthenticateResponse.kt | 1 + .../api/models/SupportPerBenefitType.kt | 1 + .../tryfinch/api/models/SupportedBenefit.kt | 113 ++++++++ .../api/models/UnenrolledIndividual.kt | 2 + .../models/UpdateCompanyBenefitResponse.kt | 1 + .../kotlin/com/tryfinch/api/models/W42005.kt | 112 ++++++++ .../kotlin/com/tryfinch/api/models/W42020.kt | 74 +++++ .../com/tryfinch/api/models/WebhookEvent.kt | 12 + 112 files changed, 4021 insertions(+) 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 18fd0863..9cb8ed19 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 @@ -22,6 +22,7 @@ class FinchOkHttpClient private constructor() { @JvmStatic fun fromEnv(): FinchClient = builder().fromEnv().build() } + /** A builder for [FinchOkHttpClient]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() 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 3c012e97..29934ab4 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 @@ -22,6 +22,7 @@ class FinchOkHttpClientAsync private constructor() { @JvmStatic fun fromEnv(): FinchClientAsync = builder().fromEnv().build() } + /** A builder for [FinchOkHttpClientAsync]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() 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 18701a96..15542787 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 @@ -40,6 +40,7 @@ private constructor( @JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build() } + /** A builder for [ClientOptions]. */ class Builder internal constructor() { private var httpClient: HttpClient? = null 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 434f9424..7a51327d 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 @@ -30,6 +30,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [FinchError]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 e3392483..afa3d4df 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 @@ -122,6 +122,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccessTokenCreateBody]. */ class Builder internal constructor() { private var code: JsonField? = null @@ -213,6 +214,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccessTokenCreateParams]. */ @NoAutoDetect class Builder internal constructor() { 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 bc3116bb..030c0f24 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 @@ -123,6 +123,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccountCreateResponse]. */ class Builder internal constructor() { private var accessToken: JsonField? = null @@ -244,6 +245,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -259,6 +268,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } + /** An enum containing [AuthenticationType]'s known values. */ enum class Known { CREDENTIAL, API_TOKEN, @@ -266,14 +276,34 @@ private constructor( ASSISTED, } + /** + * An enum containing [AuthenticationType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthenticationType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDENTIAL, API_TOKEN, OAUTH, ASSISTED, + /** + * An enum member indicating that [AuthenticationType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CREDENTIAL -> Value.CREDENTIAL @@ -283,6 +313,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CREDENTIAL -> Known.CREDENTIAL 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 07e32f2e..170a3c5b 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 @@ -39,6 +39,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccountDisconnectParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt index cd9ddf95..04d64b4d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccountIntrospectParams]. */ @NoAutoDetect class Builder internal constructor() { 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 68109a5d..7b811c69 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccountUpdateEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -262,6 +263,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var authenticationMethod: JsonField? = null @@ -385,6 +387,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AuthenticationMethod]. */ class Builder internal constructor() { private var benefitsSupport: JsonField = JsonMissing.of() @@ -579,6 +582,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedFields]. */ class Builder internal constructor() { private var company: JsonField = JsonMissing.of() @@ -807,6 +811,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedCompanyFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -1009,6 +1014,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Accounts]. */ class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() @@ -1165,6 +1171,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Departments]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1260,6 +1267,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Parent]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1390,6 +1398,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Entity]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -1556,6 +1565,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Locations]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -1728,6 +1738,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedDirectoryFields]. */ class Builder internal constructor() { private var individuals: JsonField = JsonMissing.of() @@ -1889,6 +1900,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Individuals]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2030,6 +2042,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2162,6 +2175,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Paging]. */ class Builder internal constructor() { private var count: JsonField = JsonMissing.of() @@ -2460,6 +2474,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedEmploymentFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2687,6 +2702,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -2798,6 +2814,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -2932,6 +2949,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Income]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -3105,6 +3123,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Location]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -3246,6 +3265,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -3486,6 +3506,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedIndividualFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -3684,6 +3705,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Emails]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -3802,6 +3824,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumbers]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -3967,6 +3990,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Residence]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -4155,6 +4179,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPayGroupFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -4298,6 +4323,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPayStatementFields]. */ class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() @@ -4406,6 +4432,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Paging]. */ class Builder internal constructor() { private var count: JsonField? = null @@ -4622,6 +4649,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatements]. */ class Builder internal constructor() { private var earnings: JsonField = JsonMissing.of() @@ -4828,6 +4856,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Earnings]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5004,6 +5033,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployeeDeductions]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5167,6 +5197,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployerContributions]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5338,6 +5369,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Taxes]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5630,6 +5662,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPaymentFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -5829,6 +5862,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayPeriod]. */ class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() @@ -5946,6 +5980,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5963,6 +6005,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { ASSISTED, CREDENTIAL, @@ -5971,15 +6014,34 @@ private constructor( OAUTH, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASSISTED, CREDENTIAL, API_TOKEN, API_CREDENTIAL, OAUTH, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ASSISTED -> Value.ASSISTED @@ -5990,6 +6052,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ASSISTED -> Known.ASSISTED @@ -6057,6 +6128,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6066,21 +6145,49 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { ACCOUNT_UPDATED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACCOUNT_UPDATED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACCOUNT_UPDATED -> Value.ACCOUNT_UPDATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACCOUNT_UPDATED -> Known.ACCOUNT_UPDATED 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 cf4f91f0..0d82edfa 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 @@ -115,6 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AccountUpdateResponse]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -229,6 +230,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -244,6 +253,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } + /** An enum containing [AuthenticationType]'s known values. */ enum class Known { CREDENTIAL, API_TOKEN, @@ -251,14 +261,34 @@ private constructor( ASSISTED, } + /** + * An enum containing [AuthenticationType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthenticationType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDENTIAL, API_TOKEN, OAUTH, ASSISTED, + /** + * An enum member indicating that [AuthenticationType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CREDENTIAL -> Value.CREDENTIAL @@ -268,6 +298,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CREDENTIAL -> Known.CREDENTIAL 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 ccc7cad8..409069d9 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 @@ -145,6 +145,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AutomatedAsyncJob]. */ class Builder internal constructor() { private var completedAt: JsonField? = null @@ -292,6 +293,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -311,6 +320,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, IN_PROGRESS, @@ -320,6 +330,15 @@ private constructor( PERMISSIONS_ERROR, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, IN_PROGRESS, @@ -327,9 +346,17 @@ private constructor( ERROR, REAUTH_ERROR, PERMISSIONS_ERROR, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -341,6 +368,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING @@ -374,6 +409,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -383,21 +426,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DATA_SYNC_ALL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL 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 2a02d0f5..ea36d6ea 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 @@ -86,6 +86,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AutomatedCreateResponse]. */ class Builder internal constructor() { private var allowedRefreshes: JsonField? = null 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 9bd27cf5..51555300 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 @@ -96,6 +96,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [BaseWebhookEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null 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 6a7d91a1..dc207e16 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 @@ -62,6 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [BenefitContribution]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -131,6 +132,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -142,17 +151,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { FIXED, PERCENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FIXED, PERCENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FIXED -> Value.FIXED @@ -160,6 +187,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FIXED -> Known.FIXED 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 72984d49..6a1b7702 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 @@ -68,6 +68,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [BenefitFeaturesAndOperations]. */ class Builder internal constructor() { private var supportedFeatures: JsonField = JsonMissing.of() @@ -253,6 +254,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [BenefitFeature]. */ class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() @@ -495,6 +497,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -506,17 +516,40 @@ private constructor( @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value)) } + /** An enum containing [CompanyContribution]'s known values. */ enum class Known { FIXED, PERCENT, } + /** + * An enum containing [CompanyContribution]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [CompanyContribution] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FIXED, PERCENT, + /** + * An enum member indicating that [CompanyContribution] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FIXED -> Value.FIXED @@ -524,6 +557,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FIXED -> Known.FIXED @@ -552,6 +594,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -563,17 +613,39 @@ private constructor( @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value)) } + /** An enum containing [EmployeeDeduction]'s known values. */ enum class Known { FIXED, PERCENT, } + /** + * An enum containing [EmployeeDeduction]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [EmployeeDeduction] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FIXED, PERCENT, + /** + * An enum member indicating that [EmployeeDeduction] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FIXED -> Value.FIXED @@ -581,6 +653,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FIXED -> Known.FIXED @@ -609,6 +690,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -620,17 +709,40 @@ private constructor( @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } + /** An enum containing [HsaContributionLimit]'s known values. */ enum class Known { INDIVIDUAL, FAMILY, } + /** + * An enum containing [HsaContributionLimit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [HsaContributionLimit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INDIVIDUAL, FAMILY, + /** + * An enum member indicating that [HsaContributionLimit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INDIVIDUAL -> Value.INDIVIDUAL @@ -638,6 +750,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INDIVIDUAL -> Known.INDIVIDUAL diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFrequency.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFrequency.kt index 9a552373..a574a104 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFrequency.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFrequency.kt @@ -13,6 +13,13 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26,19 +33,39 @@ private constructor( @JvmStatic fun of(value: String) = BenefitFrequency(JsonField.of(value)) } + /** An enum containing [BenefitFrequency]'s known values. */ enum class Known { ONE_TIME, EVERY_PAYCHECK, MONTHLY, } + /** + * An enum containing [BenefitFrequency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [BenefitFrequency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, EVERY_PAYCHECK, MONTHLY, + /** + * An enum member indicating that [BenefitFrequency] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -47,6 +74,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt index e3c08d48..dd5abd4c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt @@ -14,6 +14,13 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -59,6 +66,7 @@ private constructor( @JvmStatic fun of(value: String) = BenefitType(JsonField.of(value)) } + /** An enum containing [BenefitType]'s known values. */ enum class Known { _401K, _401K_ROTH, @@ -81,6 +89,15 @@ private constructor( CUSTOM_PRE_TAX, } + /** + * An enum containing [BenefitType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [BenefitType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { _401K, _401K_ROTH, @@ -101,9 +118,17 @@ private constructor( COMMUTER, CUSTOM_POST_TAX, CUSTOM_PRE_TAX, + /** An enum member indicating that [BenefitType] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ fun value(): Value = when (this) { _401K -> Value._401K @@ -128,6 +153,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { _401K -> Known._401K 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 aeb8f010..80e52ec7 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 @@ -180,6 +180,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [BenefitsSupport]. */ class Builder internal constructor() { private var commuter: JsonField = JsonMissing.of() 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 017dcdf6..63132648 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 @@ -143,6 +143,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Company]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -432,6 +433,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Account]. */ class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() @@ -560,6 +562,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -571,17 +581,38 @@ private constructor( @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } + /** An enum containing [AccountType]'s known values. */ enum class Known { CHECKING, SAVINGS, } + /** + * An enum containing [AccountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AccountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CHECKING, SAVINGS, + /** + * An enum member indicating that [AccountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CHECKING -> Value.CHECKING @@ -589,6 +620,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CHECKING -> Known.CHECKING @@ -678,6 +718,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -776,6 +817,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Parent]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -905,6 +947,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Entity]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -970,6 +1013,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -983,19 +1034,39 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { S_CORPORATION, C_CORPORATION, B_CORPORATION, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { S_CORPORATION, C_CORPORATION, B_CORPORATION, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { S_CORPORATION -> Value.S_CORPORATION @@ -1004,6 +1075,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { S_CORPORATION -> Known.S_CORPORATION @@ -1034,6 +1114,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1055,6 +1143,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { LLC, LP, @@ -1065,6 +1154,15 @@ private constructor( COOPERATIVE, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { LLC, LP, @@ -1073,9 +1171,17 @@ private constructor( NON_PROFIT, PARTNERSHIP, COOPERATIVE, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { LLC -> Value.LLC @@ -1088,6 +1194,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { LLC -> Known.LLC 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 6a118842..9f519ebf 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 @@ -83,6 +83,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CompanyBenefit]. */ class Builder internal constructor() { private var benefitId: JsonField? = null 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 7a3a32c5..1b603827 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CompanyEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -243,6 +244,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -297,6 +299,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -306,21 +316,49 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { COMPANY_UPDATED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMPANY_UPDATED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMPANY_UPDATED -> Value.COMPANY_UPDATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMPANY_UPDATED -> Known.COMPANY_UPDATED 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 5baa470b..8547eeaa 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 @@ -135,6 +135,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CompanyUpdateResponse]. */ class Builder internal constructor() { private var accounts: JsonField>? = null @@ -415,6 +416,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Account]. */ class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() @@ -543,6 +545,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -554,17 +564,38 @@ private constructor( @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } + /** An enum containing [AccountType]'s known values. */ enum class Known { CHECKING, SAVINGS, } + /** + * An enum containing [AccountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AccountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CHECKING, SAVINGS, + /** + * An enum member indicating that [AccountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CHECKING -> Value.CHECKING @@ -572,6 +603,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CHECKING -> Known.CHECKING @@ -661,6 +701,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -759,6 +800,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Parent]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -888,6 +930,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Entity]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -953,6 +996,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -966,19 +1017,39 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { S_CORPORATION, C_CORPORATION, B_CORPORATION, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { S_CORPORATION, C_CORPORATION, B_CORPORATION, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { S_CORPORATION -> Value.S_CORPORATION @@ -987,6 +1058,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { S_CORPORATION -> Known.S_CORPORATION @@ -1017,6 +1097,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1038,6 +1126,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { LLC, LP, @@ -1048,6 +1137,15 @@ private constructor( COOPERATIVE, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { LLC, LP, @@ -1056,9 +1154,17 @@ private constructor( NON_PROFIT, PARTNERSHIP, COOPERATIVE, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { LLC -> Value.LLC @@ -1071,6 +1177,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { LLC -> Known.LLC 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 ff6615f4..958ebc57 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 @@ -204,6 +204,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectSessionNewBody]. */ class Builder internal constructor() { private var customerId: JsonField? = null @@ -392,6 +393,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectSessionNewParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -618,6 +620,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -641,6 +651,7 @@ private constructor( @JvmStatic fun of(value: String) = ConnectProducts(JsonField.of(value)) } + /** An enum containing [ConnectProducts]'s known values. */ enum class Known { COMPANY, DIRECTORY, @@ -652,6 +663,15 @@ private constructor( SSN, } + /** + * An enum containing [ConnectProducts]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ConnectProducts] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMPANY, DIRECTORY, @@ -661,9 +681,20 @@ private constructor( PAY_STATEMENT, BENEFITS, SSN, + /** + * An enum member indicating that [ConnectProducts] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMPANY -> Value.COMPANY @@ -677,6 +708,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMPANY -> Known.COMPANY @@ -753,6 +792,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Integration]. */ class Builder internal constructor() { private var authMethod: JsonField = JsonMissing.of() @@ -813,6 +853,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -828,6 +876,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthMethod(JsonField.of(value)) } + /** An enum containing [AuthMethod]'s known values. */ enum class Known { ASSISTED, CREDENTIAL, @@ -835,14 +884,34 @@ private constructor( API_TOKEN, } + /** + * An enum containing [AuthMethod]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthMethod] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASSISTED, CREDENTIAL, OAUTH, API_TOKEN, + /** + * An enum member indicating that [AuthMethod] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ASSISTED -> Value.ASSISTED @@ -852,6 +921,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ASSISTED -> Known.ASSISTED @@ -900,6 +978,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -911,17 +997,35 @@ private constructor( @JvmStatic fun of(value: String) = Sandbox(JsonField.of(value)) } + /** An enum containing [Sandbox]'s known values. */ enum class Known { FINCH, PROVIDER, } + /** + * An enum containing [Sandbox]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Sandbox] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FINCH, PROVIDER, + /** An enum member indicating that [Sandbox] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FINCH -> Value.FINCH @@ -929,6 +1033,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FINCH -> Known.FINCH 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 9382318f..62e8665c 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 @@ -149,6 +149,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectSessionReauthenticateBody]. */ class Builder internal constructor() { private var connectionId: JsonField? = null @@ -297,6 +298,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectSessionReauthenticateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -501,6 +503,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -524,6 +534,7 @@ private constructor( @JvmStatic fun of(value: String) = ConnectProducts(JsonField.of(value)) } + /** An enum containing [ConnectProducts]'s known values. */ enum class Known { COMPANY, DIRECTORY, @@ -535,6 +546,15 @@ private constructor( SSN, } + /** + * An enum containing [ConnectProducts]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ConnectProducts] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMPANY, DIRECTORY, @@ -544,9 +564,20 @@ private constructor( PAY_STATEMENT, BENEFITS, SSN, + /** + * An enum member indicating that [ConnectProducts] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMPANY -> Value.COMPANY @@ -560,6 +591,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMPANY -> Known.COMPANY 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 8dfd6791..49be8e42 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 @@ -132,6 +132,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectionCreateResponse]. */ class Builder internal constructor() { private var accessToken: JsonField? = null @@ -260,6 +261,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -275,6 +284,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } + /** An enum containing [AuthenticationType]'s known values. */ enum class Known { CREDENTIAL, API_TOKEN, @@ -282,14 +292,34 @@ private constructor( ASSISTED, } + /** + * An enum containing [AuthenticationType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthenticationType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDENTIAL, API_TOKEN, OAUTH, ASSISTED, + /** + * An enum member indicating that [AuthenticationType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CREDENTIAL -> Value.CREDENTIAL @@ -299,6 +329,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CREDENTIAL -> Known.CREDENTIAL diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionStatusType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionStatusType.kt index e926f102..b87840e6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionStatusType.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionStatusType.kt @@ -13,6 +13,13 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32,6 +39,7 @@ private constructor( @JvmStatic fun of(value: String) = ConnectionStatusType(JsonField.of(value)) } + /** An enum containing [ConnectionStatusType]'s known values. */ enum class Known { PENDING, PROCESSING, @@ -41,6 +49,15 @@ private constructor( REAUTH, } + /** + * An enum containing [ConnectionStatusType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ConnectionStatusType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, PROCESSING, @@ -48,9 +65,20 @@ private constructor( ERROR_NO_ACCOUNT_SETUP, ERROR_PERMISSIONS, REAUTH, + /** + * An enum member indicating that [ConnectionStatusType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -62,6 +90,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING 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 b3478d52..312150e0 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 @@ -175,6 +175,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CreateAccessTokenResponse]. */ class Builder internal constructor() { private var accessToken: JsonField? = null @@ -359,6 +360,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -372,19 +381,39 @@ private constructor( @JvmStatic fun of(value: String) = ClientType(JsonField.of(value)) } + /** An enum containing [ClientType]'s known values. */ enum class Known { PRODUCTION, DEVELOPMENT, SANDBOX, } + /** + * An enum containing [ClientType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ClientType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PRODUCTION, DEVELOPMENT, SANDBOX, + /** + * An enum member indicating that [ClientType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PRODUCTION -> Value.PRODUCTION @@ -393,6 +422,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PRODUCTION -> Known.PRODUCTION @@ -427,6 +464,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -438,17 +483,38 @@ private constructor( @JvmStatic fun of(value: String) = ConnectionType(JsonField.of(value)) } + /** An enum containing [ConnectionType]'s known values. */ enum class Known { PROVIDER, FINCH, } + /** + * An enum containing [ConnectionType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ConnectionType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PROVIDER, FINCH, + /** + * An enum member indicating that [ConnectionType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PROVIDER -> Value.PROVIDER @@ -456,6 +522,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PROVIDER -> Known.PROVIDER 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 be8c4e9b..182bc3e7 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 @@ -52,6 +52,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CreateCompanyBenefitsResponse]. */ class Builder internal constructor() { private var benefitId: JsonField? = null 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 c4612b4e..750c01b2 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DirectoryEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -254,6 +255,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() @@ -319,6 +321,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -332,19 +342,39 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { DIRECTORY_CREATED, DIRECTORY_UPDATED, DIRECTORY_DELETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DIRECTORY_CREATED, DIRECTORY_UPDATED, DIRECTORY_DELETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DIRECTORY_CREATED -> Value.DIRECTORY_CREATED @@ -353,6 +383,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DIRECTORY_CREATED -> Known.DIRECTORY_CREATED 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 da4c03a2..a2b8ff0a 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 @@ -54,6 +54,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DisconnectResponse]. */ class Builder internal constructor() { private var status: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt index 2202a7f6..ed73b872 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt @@ -62,6 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DocumentListResponse]. */ class Builder internal constructor() { private var documents: JsonField>? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt index 291583a4..6d71abd4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt @@ -103,6 +103,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DocumentResponse]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -216,6 +217,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -227,17 +236,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { W4_2020, W4_2005, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { W4_2020, W4_2005, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { W4_2020 -> Value.W4_2020 @@ -245,6 +272,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { W4_2020 -> Known.W4_2020 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt index 80c0e9d6..83153e62 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentRetreiveResponse.kt @@ -123,6 +123,10 @@ private constructor( @JvmStatic fun ofW42005(w42005: W42005) = DocumentRetreiveResponse(w42005 = w42005) } + /** + * An interface that defines how to map each variant of [DocumentRetreiveResponse] to a value of + * type [T]. + */ interface Visitor { /** @@ -137,6 +141,16 @@ private constructor( */ fun visitW42005(w42005: W42005): T + /** + * Maps an unknown variant of [DocumentRetreiveResponse] to a value of type [T]. + * + * An instance of [DocumentRetreiveResponse] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK is + * on an older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws FinchInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw FinchInvalidDataException("Unknown DocumentRetreiveResponse: $json") } 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 6538f0ea..a865af39 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 @@ -276,6 +276,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmploymentData]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -657,6 +658,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomField]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -761,6 +763,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -875,6 +878,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -952,6 +956,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -971,6 +983,7 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { FULL_TIME, INTERN, @@ -980,6 +993,15 @@ private constructor( INDIVIDUAL_CONTRACTOR, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FULL_TIME, INTERN, @@ -987,9 +1009,19 @@ private constructor( TEMP, SEASONAL, INDIVIDUAL_CONTRACTOR, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FULL_TIME -> Value.FULL_TIME @@ -1001,6 +1033,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FULL_TIME -> Known.FULL_TIME @@ -1034,6 +1075,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1045,17 +1094,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { EMPLOYEE, CONTRACTOR, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EMPLOYEE, CONTRACTOR, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EMPLOYEE -> Value.EMPLOYEE @@ -1063,6 +1130,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EMPLOYEE -> Known.EMPLOYEE @@ -1113,6 +1189,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1134,6 +1218,7 @@ private constructor( @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) } + /** An enum containing [EmploymentStatus]'s known values. */ enum class Known { ACTIVE, DECEASED, @@ -1144,6 +1229,15 @@ private constructor( TERMINATED, } + /** + * An enum containing [EmploymentStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EmploymentStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DECEASED, @@ -1152,9 +1246,20 @@ private constructor( PREHIRE, RETIRED, TERMINATED, + /** + * An enum member indicating that [EmploymentStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -1167,6 +1272,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -1232,6 +1345,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() 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 be0650e3..2b83375e 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 @@ -69,6 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmploymentDataResponse]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() 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 55ee91be..f9bd150a 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmploymentEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -254,6 +255,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() @@ -319,6 +321,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -332,19 +342,39 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { EMPLOYMENT_CREATED, EMPLOYMENT_UPDATED, EMPLOYMENT_DELETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EMPLOYMENT_CREATED, EMPLOYMENT_UPDATED, EMPLOYMENT_DELETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { EMPLOYMENT_CREATED -> Value.EMPLOYMENT_CREATED @@ -353,6 +383,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { EMPLOYMENT_CREATED -> Known.EMPLOYMENT_CREATED 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 7b4b161f..0929b1e5 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 @@ -256,6 +256,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmploymentUpdateResponse]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -604,6 +605,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomField]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -710,6 +712,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -824,6 +827,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -901,6 +905,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -920,6 +932,7 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { FULL_TIME, INTERN, @@ -929,6 +942,15 @@ private constructor( INDIVIDUAL_CONTRACTOR, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FULL_TIME, INTERN, @@ -936,9 +958,19 @@ private constructor( TEMP, SEASONAL, INDIVIDUAL_CONTRACTOR, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FULL_TIME -> Value.FULL_TIME @@ -950,6 +982,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FULL_TIME -> Known.FULL_TIME @@ -983,6 +1024,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -994,17 +1043,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { EMPLOYEE, CONTRACTOR, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EMPLOYEE, CONTRACTOR, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EMPLOYEE -> Value.EMPLOYEE @@ -1012,6 +1079,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EMPLOYEE -> Known.EMPLOYEE @@ -1059,6 +1135,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1080,6 +1164,7 @@ private constructor( @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) } + /** An enum containing [EmploymentStatus]'s known values. */ enum class Known { ACTIVE, DECEASED, @@ -1090,6 +1175,15 @@ private constructor( TERMINATED, } + /** + * An enum containing [EmploymentStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EmploymentStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DECEASED, @@ -1098,9 +1192,20 @@ private constructor( PREHIRE, RETIRED, TERMINATED, + /** + * An enum member indicating that [EmploymentStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -1113,6 +1218,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -1178,6 +1291,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() 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 341e3d6f..7ac3fc5c 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 @@ -71,6 +71,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EnrolledIndividual]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() @@ -189,6 +190,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Body]. */ class Builder internal constructor() { private var finchCode: JsonField = JsonMissing.of() @@ -284,6 +286,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -299,6 +309,7 @@ private constructor( @JvmStatic fun of(value: Long) = Code(JsonField.of(value)) } + /** An enum containing [Code]'s known values. */ enum class Known { OK, CREATED, @@ -306,14 +317,31 @@ private constructor( FORBIDDEN, } + /** + * An enum containing [Code]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Code] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { OK, CREATED, NOT_FOUND, FORBIDDEN, + /** An enum member indicating that [Code] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { OK -> Value.OK @@ -323,6 +351,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { OK -> Known.OK 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 33572e98..e35428a9 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 @@ -132,6 +132,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitCreateBody]. */ class Builder internal constructor() { private var description: JsonField = JsonMissing.of() @@ -233,6 +234,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitCreateParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt index 4def2f61..598493ff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt @@ -40,6 +40,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitIndividualEnrolledIdsParams]. */ @NoAutoDetect class Builder internal constructor() { 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 53897175..18a24414 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 @@ -54,6 +54,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitIndividualRetrieveManyBenefitsParams]. */ @NoAutoDetect class Builder internal constructor() { 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 968e9a89..c856986e 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 @@ -97,6 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitIndividualUnenrollManyBody]. */ class Builder internal constructor() { private var individualIds: JsonField>? = null @@ -186,6 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitIndividualUnenrollManyParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt index 69e6de4b..efc0dfb1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitListParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt index 56c0bad0..1054fb7b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitListSupportedBenefitsParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt index 32a9f10c..b48fbcc2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt @@ -40,6 +40,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 001ddd57..0e9d272a 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 @@ -97,6 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitUpdateBody]. */ class Builder internal constructor() { private var description: JsonField = JsonMissing.of() @@ -164,6 +165,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisBenefitUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt index e3014c90..e420e8ba 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisCompanyRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 dff29529..237c8018 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 @@ -46,6 +46,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisDirectoryListIndividualsParams]. */ @NoAutoDetect class Builder internal constructor() { 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 66509a47..59b7eef8 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 @@ -45,6 +45,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisDirectoryListParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt index 6f392e8a..db271453 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt @@ -63,6 +63,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisDocumentListParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -250,6 +251,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -261,17 +270,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { W4_2020, W4_2005, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { W4_2020, W4_2005, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { W4_2020 -> Value.W4_2020 @@ -279,6 +306,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { W4_2020 -> Known.W4_2020 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt index 8ac1554e..24b52765 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt @@ -43,6 +43,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisDocumentRetreiveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 cf825e59..6ab13146 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 @@ -86,6 +86,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisEmploymentRetrieveManyBody]. */ class Builder internal constructor() { private var requests: JsonField>? = null @@ -172,6 +173,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisEmploymentRetrieveManyParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -372,6 +374,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Request]. */ class Builder internal constructor() { private var individualId: JsonField? = null 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 6a1f9e0c..dbc91523 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 @@ -94,6 +94,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisIndividualRetrieveManyBody]. */ class Builder internal constructor() { private var options: JsonField = JsonMissing.of() @@ -186,6 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisIndividualRetrieveManyParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -377,6 +379,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Options]. */ class Builder internal constructor() { private var include: JsonField>? = null @@ -491,6 +494,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Request]. */ class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() 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 f28828f2..61c6c5b9 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 @@ -90,6 +90,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisPayStatementRetrieveManyBody]. */ class Builder internal constructor() { private var requests: JsonField>? = null @@ -176,6 +177,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisPayStatementRetrieveManyParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -386,6 +388,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Request]. */ class Builder internal constructor() { private var paymentId: JsonField? = null 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 8206b9b7..6d731201 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 @@ -46,6 +46,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [HrisPaymentListParams]. */ @NoAutoDetect class Builder internal constructor() { 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 bf63e2f5..28c6cfb7 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 @@ -96,6 +96,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Income]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -205,6 +206,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -230,6 +239,7 @@ private constructor( @JvmStatic fun of(value: String) = Unit(JsonField.of(value)) } + /** An enum containing [Unit]'s known values. */ enum class Known { YEARLY, QUARTERLY, @@ -242,6 +252,15 @@ private constructor( FIXED, } + /** + * An enum containing [Unit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Unit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { YEARLY, QUARTERLY, @@ -252,9 +271,17 @@ private constructor( DAILY, HOURLY, FIXED, + /** An enum member indicating that [Unit] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { YEARLY -> Value.YEARLY @@ -269,6 +296,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { YEARLY -> Known.YEARLY 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 0a001323..be075178 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 @@ -187,6 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Individual]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -467,6 +468,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Email]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -523,6 +525,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -534,17 +544,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -552,6 +580,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK @@ -599,6 +636,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -623,6 +668,7 @@ private constructor( @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } + /** An enum containing [Ethnicity]'s known values. */ enum class Known { ASIAN, WHITE, @@ -634,6 +680,15 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Ethnicity]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Ethnicity] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASIAN, WHITE, @@ -643,9 +698,19 @@ private constructor( HISPANIC_OR_LATINO, TWO_OR_MORE_RACES, DECLINE_TO_SPECIFY, + /** + * An enum member indicating that [Ethnicity] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ASIAN -> Value.ASIAN @@ -659,6 +724,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ASIAN -> Known.ASIAN @@ -694,6 +767,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -709,6 +790,7 @@ private constructor( @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } + /** An enum containing [Gender]'s known values. */ enum class Known { FEMALE, MALE, @@ -716,14 +798,31 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Gender]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Gender] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FEMALE, MALE, OTHER, DECLINE_TO_SPECIFY, + /** An enum member indicating that [Gender] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FEMALE -> Value.FEMALE @@ -733,6 +832,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FEMALE -> Known.FEMALE @@ -800,6 +907,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumber]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -858,6 +966,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -869,17 +985,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -887,6 +1021,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK 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 1a099471..f0d60f8a 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 @@ -69,6 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualBenefit]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() @@ -219,6 +220,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Body]. */ class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() @@ -351,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -362,17 +372,40 @@ private constructor( @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } + /** An enum containing [HsaContributionLimit]'s known values. */ enum class Known { INDIVIDUAL, FAMILY, } + /** + * An enum containing [HsaContributionLimit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [HsaContributionLimit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INDIVIDUAL, FAMILY, + /** + * An enum member indicating that [HsaContributionLimit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INDIVIDUAL -> Value.INDIVIDUAL @@ -380,6 +413,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INDIVIDUAL -> Known.INDIVIDUAL 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 0243b26e..4d93c7c2 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 @@ -62,6 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualEnrolledIdsResponse]. */ class Builder internal constructor() { private var benefitId: JsonField? = null 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 f2ce4a37..c380b159 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -254,6 +255,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() @@ -319,6 +321,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -332,19 +342,39 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { INDIVIDUAL_CREATED, INDIVIDUAL_UPDATED, INDIVIDUAL_DELETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INDIVIDUAL_CREATED, INDIVIDUAL_UPDATED, INDIVIDUAL_DELETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INDIVIDUAL_CREATED -> Value.INDIVIDUAL_CREATED @@ -353,6 +383,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INDIVIDUAL_CREATED -> Known.INDIVIDUAL_CREATED 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 6e2f768a..fe785bc0 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 @@ -115,6 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualInDirectory]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -274,6 +275,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -372,6 +374,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() 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 ca51f632..d4fb4462 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 @@ -69,6 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualResponse]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() 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 4187d35a..6a5bcd42 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 @@ -187,6 +187,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualUpdateResponse]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -467,6 +468,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Email]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -523,6 +525,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -534,17 +544,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -552,6 +580,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK @@ -599,6 +636,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -623,6 +668,7 @@ private constructor( @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } + /** An enum containing [Ethnicity]'s known values. */ enum class Known { ASIAN, WHITE, @@ -634,6 +680,15 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Ethnicity]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Ethnicity] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASIAN, WHITE, @@ -643,9 +698,19 @@ private constructor( HISPANIC_OR_LATINO, TWO_OR_MORE_RACES, DECLINE_TO_SPECIFY, + /** + * An enum member indicating that [Ethnicity] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ASIAN -> Value.ASIAN @@ -659,6 +724,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ASIAN -> Known.ASIAN @@ -694,6 +767,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -709,6 +790,7 @@ private constructor( @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } + /** An enum containing [Gender]'s known values. */ enum class Known { FEMALE, MALE, @@ -716,14 +798,31 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Gender]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Gender] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FEMALE, MALE, OTHER, DECLINE_TO_SPECIFY, + /** An enum member indicating that [Gender] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FEMALE -> Value.FEMALE @@ -733,6 +832,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FEMALE -> Known.FEMALE @@ -800,6 +907,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumber]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -856,6 +964,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -867,17 +983,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -885,6 +1019,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK 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 5a3c5432..16b78e12 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 @@ -278,6 +278,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Introspection]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -639,6 +640,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AuthenticationMethod]. */ class Builder internal constructor() { private var connectionStatus: JsonField = JsonMissing.of() @@ -765,6 +767,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectionStatus]. */ class Builder internal constructor() { private var message: JsonField = JsonMissing.of() @@ -841,6 +844,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -858,6 +869,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { ASSISTED, CREDENTIAL, @@ -866,15 +878,32 @@ private constructor( OAUTH, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASSISTED, CREDENTIAL, API_TOKEN, API_CREDENTIAL, OAUTH, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ASSISTED -> Value.ASSISTED @@ -885,6 +914,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ASSISTED -> Known.ASSISTED @@ -935,6 +973,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -948,19 +994,39 @@ private constructor( @JvmStatic fun of(value: String) = ClientType(JsonField.of(value)) } + /** An enum containing [ClientType]'s known values. */ enum class Known { PRODUCTION, DEVELOPMENT, SANDBOX, } + /** + * An enum containing [ClientType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ClientType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PRODUCTION, DEVELOPMENT, SANDBOX, + /** + * An enum member indicating that [ClientType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PRODUCTION -> Value.PRODUCTION @@ -969,6 +1035,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PRODUCTION -> Known.PRODUCTION @@ -1040,6 +1114,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ConnectionStatus]. */ class Builder internal constructor() { private var message: JsonField = JsonMissing.of() @@ -1117,6 +1192,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1128,17 +1211,38 @@ private constructor( @JvmStatic fun of(value: String) = ConnectionType(JsonField.of(value)) } + /** An enum containing [ConnectionType]'s known values. */ enum class Known { PROVIDER, FINCH, } + /** + * An enum containing [ConnectionType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ConnectionType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PROVIDER, FINCH, + /** + * An enum member indicating that [ConnectionType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PROVIDER -> Value.PROVIDER @@ -1146,6 +1250,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PROVIDER -> Known.PROVIDER 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 43252c70..098d8236 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 @@ -131,12 +131,26 @@ private constructor( JobAutomatedCreateBody(w4FormEmployeeSync = w4FormEmployeeSync) } + /** + * An interface that defines how to map each variant of [JobAutomatedCreateBody] to a value + * of type [T]. + */ interface Visitor { fun visitDataSyncAll(dataSyncAll: DataSyncAll): T fun visitW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync): T + /** + * Maps an unknown variant of [JobAutomatedCreateBody] to a value of type [T]. + * + * An instance of [JobAutomatedCreateBody] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws FinchInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw FinchInvalidDataException("Unknown JobAutomatedCreateBody: $json") } @@ -192,6 +206,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobAutomatedCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -357,6 +372,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DataSyncAll]. */ class Builder internal constructor() { private var type: JsonField? = null @@ -404,6 +420,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -413,21 +437,48 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DATA_SYNC_ALL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL @@ -516,6 +567,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [W4FormEmployeeSync]. */ class Builder internal constructor() { private var individualId: JsonField? = null @@ -577,6 +629,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -586,21 +646,48 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { W4_FORM_EMPLOYEE_SYNC, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { W4_FORM_EMPLOYEE_SYNC, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { W4_FORM_EMPLOYEE_SYNC -> Value.W4_FORM_EMPLOYEE_SYNC else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { W4_FORM_EMPLOYEE_SYNC -> Known.W4_FORM_EMPLOYEE_SYNC 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 56f4e22d..2c343a9d 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 @@ -49,6 +49,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobAutomatedListParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt index e6e765ba..16bae93d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt @@ -40,6 +40,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobAutomatedRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 430a32f2..0e35e6bf 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobCompletionEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -261,6 +262,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var jobId: JsonField? = null @@ -337,6 +339,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -356,6 +366,7 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { JOB_BENEFIT_CREATE_COMPLETED, JOB_BENEFIT_ENROLL_COMPLETED, @@ -365,6 +376,15 @@ private constructor( JOB_DATA_SYNC_ALL_COMPLETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { JOB_BENEFIT_CREATE_COMPLETED, JOB_BENEFIT_ENROLL_COMPLETED, @@ -372,9 +392,19 @@ private constructor( JOB_BENEFIT_UNENROLL_COMPLETED, JOB_BENEFIT_UPDATE_COMPLETED, JOB_DATA_SYNC_ALL_COMPLETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { JOB_BENEFIT_CREATE_COMPLETED -> Value.JOB_BENEFIT_CREATE_COMPLETED @@ -386,6 +416,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { JOB_BENEFIT_CREATE_COMPLETED -> Known.JOB_BENEFIT_CREATE_COMPLETED 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 14406c49..b5f0299c 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 @@ -86,6 +86,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobCreateResponse]. */ class Builder internal constructor() { private var allowedRefreshes: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt index c6b3baff..3c109277 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt @@ -43,6 +43,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [JobManualRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 a8336bfe..20ce723d 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 @@ -110,6 +110,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Location]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() 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 250b7558..42a27152 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 @@ -71,6 +71,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ManualAsyncJob]. */ class Builder internal constructor() { private var body: JsonField>? = null @@ -153,6 +154,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -168,6 +177,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, IN_PROGRESS, @@ -175,14 +185,31 @@ private constructor( COMPLETE, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, IN_PROGRESS, ERROR, COMPLETE, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -192,6 +219,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING 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 c9d695d5..2aeaa697 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 @@ -60,6 +60,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Money]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt index 1d3cf4ab..7ff857eb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupport.kt @@ -22,6 +22,13 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -37,6 +44,7 @@ private constructor( @JvmStatic fun of(value: String) = OperationSupport(JsonField.of(value)) } + /** An enum containing [OperationSupport]'s known values. */ enum class Known { SUPPORTED, NOT_SUPPORTED_BY_FINCH, @@ -44,14 +52,33 @@ private constructor( CLIENT_ACCESS_ONLY, } + /** + * An enum containing [OperationSupport]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [OperationSupport] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { SUPPORTED, NOT_SUPPORTED_BY_FINCH, NOT_SUPPORTED_BY_PROVIDER, CLIENT_ACCESS_ONLY, + /** + * An enum member indicating that [OperationSupport] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ fun value(): Value = when (this) { SUPPORTED -> Value.SUPPORTED @@ -61,6 +88,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { SUPPORTED -> Known.SUPPORTED 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 00b9a9bd..28f0e217 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 @@ -148,6 +148,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [OperationSupportMatrix]. */ class Builder internal constructor() { private var create: JsonField = JsonMissing.of() 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 f5960ca6..7775b803 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 @@ -60,6 +60,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Paging]. */ class Builder internal constructor() { private var count: JsonField = JsonMissing.of() 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 dd51b524..157209b2 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 @@ -75,6 +75,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayGroupListResponse]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -159,6 +160,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -184,6 +193,7 @@ private constructor( @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } + /** An enum containing [PayFrequency]'s known values. */ enum class Known { ANNUALLY, SEMI_ANNUALLY, @@ -196,6 +206,15 @@ private constructor( OTHER, } + /** + * An enum containing [PayFrequency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PayFrequency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUALLY, SEMI_ANNUALLY, @@ -206,9 +225,19 @@ private constructor( WEEKLY, DAILY, OTHER, + /** + * An enum member indicating that [PayFrequency] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUALLY -> Value.ANNUALLY @@ -223,6 +252,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ANNUALLY -> Known.ANNUALLY 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 6dbddb08..fbf23ba7 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 @@ -84,6 +84,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayGroupRetrieveResponse]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -190,6 +191,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -215,6 +224,7 @@ private constructor( @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } + /** An enum containing [PayFrequency]'s known values. */ enum class Known { ANNUALLY, SEMI_ANNUALLY, @@ -227,6 +237,15 @@ private constructor( OTHER, } + /** + * An enum containing [PayFrequency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PayFrequency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUALLY, SEMI_ANNUALLY, @@ -237,9 +256,19 @@ private constructor( WEEKLY, DAILY, OTHER, + /** + * An enum member indicating that [PayFrequency] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUALLY -> Value.ANNUALLY @@ -254,6 +283,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ANNUALLY -> Known.ANNUALLY 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 b67b85ed..e5cc07dd 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 @@ -150,6 +150,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatement]. */ class Builder internal constructor() { private var earnings: JsonField>? = null @@ -454,6 +455,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Earning]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -575,6 +577,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -608,6 +618,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { SALARY, WAGE, @@ -624,6 +635,15 @@ private constructor( OTHER, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { SALARY, WAGE, @@ -638,9 +658,17 @@ private constructor( TIPS, _1099, OTHER, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { SALARY -> Value.SALARY @@ -659,6 +687,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { SALARY -> Known.SALARY @@ -789,6 +826,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployeeDeduction]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -978,6 +1016,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployerContribution]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -1089,6 +1128,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1100,17 +1147,38 @@ private constructor( @JvmStatic fun of(value: String) = PaymentMethod(JsonField.of(value)) } + /** An enum containing [PaymentMethod]'s known values. */ enum class Known { CHECK, DIRECT_DEPOSIT, } + /** + * An enum containing [PaymentMethod]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentMethod] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CHECK, DIRECT_DEPOSIT, + /** + * An enum member indicating that [PaymentMethod] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CHECK -> Value.CHECK @@ -1118,6 +1186,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CHECK -> Known.CHECK @@ -1217,6 +1293,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Tax]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -1326,6 +1403,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1341,6 +1426,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { STATE, FEDERAL, @@ -1348,14 +1434,31 @@ private constructor( FICA, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STATE, FEDERAL, LOCAL, FICA, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { STATE -> Value.STATE @@ -1365,6 +1468,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STATE -> Known.STATE @@ -1414,6 +1526,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1427,19 +1547,37 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { REGULAR_PAYROLL, OFF_CYCLE_PAYROLL, ONE_TIME_PAYMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REGULAR_PAYROLL, OFF_CYCLE_PAYROLL, ONE_TIME_PAYMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { REGULAR_PAYROLL -> Value.REGULAR_PAYROLL @@ -1448,6 +1586,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { REGULAR_PAYROLL -> Known.REGULAR_PAYROLL 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 b45ca939..37ad59a8 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 @@ -119,6 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatementEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -264,6 +265,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var individualId: JsonField = JsonMissing.of() @@ -342,6 +344,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -355,19 +365,39 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { PAY_STATEMENT_CREATED, PAY_STATEMENT_UPDATED, PAY_STATEMENT_DELETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PAY_STATEMENT_CREATED, PAY_STATEMENT_UPDATED, PAY_STATEMENT_DELETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PAY_STATEMENT_CREATED -> Value.PAY_STATEMENT_CREATED @@ -376,6 +406,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PAY_STATEMENT_CREATED -> Known.PAY_STATEMENT_CREATED 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 6ae835c9..d2b73d6d 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 @@ -66,6 +66,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatementResponse]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() 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 b4c49d97..4fdae059 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 @@ -65,6 +65,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatementResponseBody]. */ class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() 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 a5b0caf2..a98098da 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 @@ -168,6 +168,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Payment]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -390,6 +391,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -415,6 +424,7 @@ private constructor( @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } + /** An enum containing [PayFrequency]'s known values. */ enum class Known { ANNUALLY, SEMI_ANNUALLY, @@ -427,6 +437,15 @@ private constructor( OTHER, } + /** + * An enum containing [PayFrequency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PayFrequency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUALLY, SEMI_ANNUALLY, @@ -437,9 +456,19 @@ private constructor( WEEKLY, DAILY, OTHER, + /** + * An enum member indicating that [PayFrequency] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUALLY -> Value.ANNUALLY @@ -454,6 +483,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ANNUALLY -> Known.ANNUALLY @@ -529,6 +566,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayPeriod]. */ class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() 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 fbe5b6f1..72337ed1 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 @@ -64,6 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PaymentCreateResponse]. */ class Builder internal constructor() { private var payDate: JsonField? = null 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 1942329b..020fc76d 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 @@ -121,6 +121,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PaymentEvent]. */ class Builder internal constructor() { private var accountId: JsonField? = null @@ -263,6 +264,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PaymentIdentifiers]. */ class Builder internal constructor() { private var payDate: JsonField? = null @@ -339,6 +341,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -352,19 +362,39 @@ private constructor( @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } + /** An enum containing [EventType]'s known values. */ enum class Known { PAYMENT_CREATED, PAYMENT_UPDATED, PAYMENT_DELETED, } + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PAYMENT_CREATED, PAYMENT_UPDATED, PAYMENT_DELETED, + /** + * An enum member indicating that [EventType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PAYMENT_CREATED -> Value.PAYMENT_CREATED @@ -373,6 +403,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PAYMENT_CREATED -> Known.PAYMENT_CREATED 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 59b14152..a871d281 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 @@ -44,6 +44,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayrollPayGroupListParams]. */ @NoAutoDetect class Builder internal constructor() { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt index 86764fc7..ca980d5b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt @@ -40,6 +40,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayrollPayGroupRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 36d08f50..75479ec8 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 @@ -159,6 +159,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Provider]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -396,6 +397,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AuthenticationMethod]. */ class Builder internal constructor() { private var benefitsSupport: JsonField = JsonMissing.of() @@ -587,6 +589,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedFields]. */ class Builder internal constructor() { private var company: JsonField = JsonMissing.of() @@ -810,6 +813,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedCompanyFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -1008,6 +1012,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Accounts]. */ class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() @@ -1162,6 +1167,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Departments]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1253,6 +1259,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Parent]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1378,6 +1385,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Entity]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -1531,6 +1539,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Locations]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -1697,6 +1706,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedDirectoryFields]. */ class Builder internal constructor() { private var individuals: JsonField = JsonMissing.of() @@ -1855,6 +1865,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Individuals]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -1990,6 +2001,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2115,6 +2127,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Paging]. */ class Builder internal constructor() { private var count: JsonField = JsonMissing.of() @@ -2410,6 +2423,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedEmploymentFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2626,6 +2640,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -2734,6 +2749,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -2863,6 +2879,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Income]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -3025,6 +3042,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Location]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -3162,6 +3180,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -3396,6 +3415,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedIndividualFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -3588,6 +3608,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Emails]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -3703,6 +3724,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumbers]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -3856,6 +3878,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Residence]. */ class Builder internal constructor() { private var city: JsonField = JsonMissing.of() @@ -4041,6 +4064,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPayGroupFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -4179,6 +4203,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPayStatementFields]. */ class Builder internal constructor() { private var paging: JsonField = JsonMissing.of() @@ -4282,6 +4307,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Paging]. */ class Builder internal constructor() { private var count: JsonField? = null @@ -4490,6 +4516,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatements]. */ class Builder internal constructor() { private var earnings: JsonField = JsonMissing.of() @@ -4689,6 +4716,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Earnings]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -4856,6 +4884,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployeeDeductions]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5011,6 +5040,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployerContributions]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5173,6 +5203,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Taxes]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -5459,6 +5490,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedPaymentFields]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -5653,6 +5685,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayPeriod]. */ class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() @@ -5768,6 +5801,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5785,6 +5826,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { ASSISTED, CREDENTIAL, @@ -5793,15 +5835,32 @@ private constructor( OAUTH, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASSISTED, CREDENTIAL, API_TOKEN, API_CREDENTIAL, OAUTH, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ASSISTED -> Value.ASSISTED @@ -5812,6 +5871,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ASSISTED -> Known.ASSISTED diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt index 5357d2e7..07aa082a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ProviderListParams]. */ @NoAutoDetect class Builder internal constructor() { 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 dd6cb216..f6b45962 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 @@ -185,6 +185,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [RequestForwardingForwardBody]. */ class Builder internal constructor() { private var method: JsonField? = null @@ -317,6 +318,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [RequestForwardingForwardParams]. */ @NoAutoDetect class Builder internal constructor() { 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 edbc9ef6..3a8cbd7e 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 @@ -98,6 +98,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [RequestForwardingForwardResponse]. */ class Builder internal constructor() { private var data: JsonField? = null @@ -287,6 +288,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Request]. */ class Builder internal constructor() { private var data: JsonField? = null 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 4fd7989b..8597d053 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 @@ -207,6 +207,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxCompanyUpdateBody]. */ class Builder internal constructor() { private var accounts: JsonField>? = null @@ -416,6 +417,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxCompanyUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -740,6 +742,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Account]. */ class Builder internal constructor() { private var accountName: JsonField = JsonMissing.of() @@ -868,6 +871,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -879,17 +890,38 @@ private constructor( @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } + /** An enum containing [AccountType]'s known values. */ enum class Known { CHECKING, SAVINGS, } + /** + * An enum containing [AccountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AccountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CHECKING, SAVINGS, + /** + * An enum member indicating that [AccountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CHECKING -> Value.CHECKING @@ -897,6 +929,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CHECKING -> Known.CHECKING @@ -986,6 +1027,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1084,6 +1126,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Parent]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1213,6 +1256,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Entity]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -1278,6 +1322,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1291,19 +1343,39 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { S_CORPORATION, C_CORPORATION, B_CORPORATION, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { S_CORPORATION, C_CORPORATION, B_CORPORATION, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { S_CORPORATION -> Value.S_CORPORATION @@ -1312,6 +1384,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { S_CORPORATION -> Known.S_CORPORATION @@ -1342,6 +1423,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1363,6 +1452,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { LLC, LP, @@ -1373,6 +1463,15 @@ private constructor( COOPERATIVE, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { LLC, LP, @@ -1381,9 +1480,17 @@ private constructor( NON_PROFIT, PARTNERSHIP, COOPERATIVE, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { LLC -> Value.LLC @@ -1396,6 +1503,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { LLC -> Known.LLC 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 a6c9a4a8..ec8b6456 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 @@ -146,6 +146,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionAccountCreateBody]. */ class Builder internal constructor() { private var companyId: JsonField? = null @@ -268,6 +269,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionAccountCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -453,6 +455,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -468,6 +478,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } + /** An enum containing [AuthenticationType]'s known values. */ enum class Known { CREDENTIAL, API_TOKEN, @@ -475,14 +486,34 @@ private constructor( ASSISTED, } + /** + * An enum containing [AuthenticationType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthenticationType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDENTIAL, API_TOKEN, OAUTH, ASSISTED, + /** + * An enum member indicating that [AuthenticationType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CREDENTIAL -> Value.CREDENTIAL @@ -492,6 +523,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CREDENTIAL -> Known.CREDENTIAL 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 7077ccbc..259c67eb 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 @@ -85,6 +85,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionAccountUpdateBody]. */ class Builder internal constructor() { private var connectionStatus: JsonField = JsonMissing.of() @@ -157,6 +158,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionAccountUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { 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 aa2a8e16..0c1550da 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 @@ -153,6 +153,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionCreateBody]. */ class Builder internal constructor() { private var providerId: JsonField? = null @@ -273,6 +274,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxConnectionCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -453,6 +455,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -468,6 +478,7 @@ private constructor( @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } + /** An enum containing [AuthenticationType]'s known values. */ enum class Known { CREDENTIAL, API_TOKEN, @@ -475,14 +486,34 @@ private constructor( ASSISTED, } + /** + * An enum containing [AuthenticationType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AuthenticationType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDENTIAL, API_TOKEN, OAUTH, ASSISTED, + /** + * An enum member indicating that [AuthenticationType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { CREDENTIAL -> Value.CREDENTIAL @@ -492,6 +523,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { CREDENTIAL -> Known.CREDENTIAL 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 b9d52673..fffec73d 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 @@ -52,6 +52,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxDirectoryCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -529,6 +530,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [IndividualOrEmployment]. */ class Builder internal constructor() { private var classCode: JsonField = JsonMissing.of() @@ -1033,6 +1035,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomField]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1142,6 +1145,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1250,6 +1254,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Email]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -1309,6 +1314,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1320,17 +1333,37 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -1338,6 +1371,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK @@ -1434,6 +1476,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -1514,6 +1557,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1533,6 +1584,7 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { FULL_TIME, INTERN, @@ -1542,6 +1594,15 @@ private constructor( INDIVIDUAL_CONTRACTOR, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FULL_TIME, INTERN, @@ -1549,9 +1610,20 @@ private constructor( TEMP, SEASONAL, INDIVIDUAL_CONTRACTOR, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { FULL_TIME -> Value.FULL_TIME @@ -1563,6 +1635,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FULL_TIME -> Known.FULL_TIME @@ -1596,6 +1677,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1607,17 +1696,37 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { EMPLOYEE, CONTRACTOR, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EMPLOYEE, CONTRACTOR, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { EMPLOYEE -> Value.EMPLOYEE @@ -1625,6 +1734,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EMPLOYEE -> Known.EMPLOYEE @@ -1672,6 +1790,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1693,6 +1819,7 @@ private constructor( @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) } + /** An enum containing [EmploymentStatus]'s known values. */ enum class Known { ACTIVE, DECEASED, @@ -1703,6 +1830,16 @@ private constructor( TERMINATED, } + /** + * An enum containing [EmploymentStatus]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [EmploymentStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DECEASED, @@ -1711,9 +1848,20 @@ private constructor( PREHIRE, RETIRED, TERMINATED, + /** + * An enum member indicating that [EmploymentStatus] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -1726,6 +1874,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -1760,6 +1917,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1785,6 +1950,7 @@ private constructor( @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } + /** An enum containing [Ethnicity]'s known values. */ enum class Known { ASIAN, WHITE, @@ -1796,6 +1962,15 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Ethnicity]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Ethnicity] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASIAN, WHITE, @@ -1805,9 +1980,20 @@ private constructor( HISPANIC_OR_LATINO, TWO_OR_MORE_RACES, DECLINE_TO_SPECIFY, + /** + * An enum member indicating that [Ethnicity] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ASIAN -> Value.ASIAN @@ -1821,6 +2007,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ASIAN -> Known.ASIAN @@ -1856,6 +2051,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1871,6 +2074,7 @@ private constructor( @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } + /** An enum containing [Gender]'s known values. */ enum class Known { FEMALE, MALE, @@ -1878,14 +2082,33 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Gender]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Gender] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FEMALE, MALE, OTHER, DECLINE_TO_SPECIFY, + /** + * An enum member indicating that [Gender] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FEMALE -> Value.FEMALE @@ -1895,6 +2118,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FEMALE -> Known.FEMALE @@ -1959,6 +2191,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() @@ -2063,6 +2296,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumber]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -2122,6 +2356,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2133,17 +2375,37 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -2151,6 +2413,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK 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 ccd0e27f..51ae4200 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 @@ -401,6 +401,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxEmploymentUpdateBody]. */ class Builder internal constructor() { private var classCode: JsonField = JsonMissing.of() @@ -731,6 +732,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxEmploymentUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -1110,6 +1112,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomField]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1216,6 +1219,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Department]. */ class Builder internal constructor() { private var name: JsonField = JsonMissing.of() @@ -1330,6 +1334,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Employment]. */ class Builder internal constructor() { private var subtype: JsonField = JsonMissing.of() @@ -1407,6 +1412,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1426,6 +1439,7 @@ private constructor( @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } + /** An enum containing [Subtype]'s known values. */ enum class Known { FULL_TIME, INTERN, @@ -1435,6 +1449,15 @@ private constructor( INDIVIDUAL_CONTRACTOR, } + /** + * An enum containing [Subtype]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Subtype] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FULL_TIME, INTERN, @@ -1442,9 +1465,19 @@ private constructor( TEMP, SEASONAL, INDIVIDUAL_CONTRACTOR, + /** + * An enum member indicating that [Subtype] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { FULL_TIME -> Value.FULL_TIME @@ -1456,6 +1489,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { FULL_TIME -> Known.FULL_TIME @@ -1489,6 +1531,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1500,17 +1550,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { EMPLOYEE, CONTRACTOR, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EMPLOYEE, CONTRACTOR, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EMPLOYEE -> Value.EMPLOYEE @@ -1518,6 +1586,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EMPLOYEE -> Known.EMPLOYEE @@ -1565,6 +1642,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1586,6 +1671,7 @@ private constructor( @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) } + /** An enum containing [EmploymentStatus]'s known values. */ enum class Known { ACTIVE, DECEASED, @@ -1596,6 +1682,15 @@ private constructor( TERMINATED, } + /** + * An enum containing [EmploymentStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EmploymentStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DECEASED, @@ -1604,9 +1699,20 @@ private constructor( PREHIRE, RETIRED, TERMINATED, + /** + * An enum member indicating that [EmploymentStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -1619,6 +1725,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -1684,6 +1798,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Manager]. */ class Builder internal constructor() { private var id: JsonField = JsonMissing.of() 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 bfb5a280..7c15313a 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 @@ -300,6 +300,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxIndividualUpdateBody]. */ class Builder internal constructor() { private var dob: JsonField = JsonMissing.of() @@ -556,6 +557,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxIndividualUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -878,6 +880,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Email]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -934,6 +937,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -945,17 +956,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -963,6 +992,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK @@ -1010,6 +1048,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1034,6 +1080,7 @@ private constructor( @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } + /** An enum containing [Ethnicity]'s known values. */ enum class Known { ASIAN, WHITE, @@ -1045,6 +1092,15 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Ethnicity]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Ethnicity] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ASIAN, WHITE, @@ -1054,9 +1110,19 @@ private constructor( HISPANIC_OR_LATINO, TWO_OR_MORE_RACES, DECLINE_TO_SPECIFY, + /** + * An enum member indicating that [Ethnicity] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ASIAN -> Value.ASIAN @@ -1070,6 +1136,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ASIAN -> Known.ASIAN @@ -1105,6 +1179,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1120,6 +1202,7 @@ private constructor( @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } + /** An enum containing [Gender]'s known values. */ enum class Known { FEMALE, MALE, @@ -1127,14 +1210,31 @@ private constructor( DECLINE_TO_SPECIFY, } + /** + * An enum containing [Gender]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Gender] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FEMALE, MALE, OTHER, DECLINE_TO_SPECIFY, + /** An enum member indicating that [Gender] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FEMALE -> Value.FEMALE @@ -1144,6 +1244,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FEMALE -> Known.FEMALE @@ -1211,6 +1319,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PhoneNumber]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -1267,6 +1376,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1278,17 +1395,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { WORK, PERSONAL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { WORK, PERSONAL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { WORK -> Value.WORK @@ -1296,6 +1431,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { WORK -> Known.WORK 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 d05a748d..874c66b6 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 @@ -62,6 +62,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobConfiguration]. */ class Builder internal constructor() { private var completionStatus: JsonField? = null @@ -119,6 +120,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -134,6 +143,7 @@ private constructor( @JvmStatic fun of(value: String) = CompletionStatus(JsonField.of(value)) } + /** An enum containing [CompletionStatus]'s known values. */ enum class Known { COMPLETE, REAUTH_ERROR, @@ -141,14 +151,34 @@ private constructor( ERROR, } + /** + * An enum containing [CompletionStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [CompletionStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMPLETE, REAUTH_ERROR, PERMISSIONS_ERROR, ERROR, + /** + * An enum member indicating that [CompletionStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMPLETE -> Value.COMPLETE @@ -158,6 +188,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMPLETE -> Known.COMPLETE @@ -188,6 +226,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -197,21 +243,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DATA_SYNC_ALL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt index 75796927..2205d4be 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt @@ -29,6 +29,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobConfigurationRetrieveParams]. */ @NoAutoDetect class Builder internal constructor() { 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 b8b0d31f..65b6ea7a 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 @@ -93,6 +93,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobConfigurationUpdateBody]. */ class Builder internal constructor() { private var completionStatus: JsonField? = null @@ -172,6 +173,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobConfigurationUpdateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -333,6 +335,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -348,6 +358,7 @@ private constructor( @JvmStatic fun of(value: String) = CompletionStatus(JsonField.of(value)) } + /** An enum containing [CompletionStatus]'s known values. */ enum class Known { COMPLETE, REAUTH_ERROR, @@ -355,14 +366,34 @@ private constructor( ERROR, } + /** + * An enum containing [CompletionStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [CompletionStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMPLETE, REAUTH_ERROR, PERMISSIONS_ERROR, ERROR, + /** + * An enum member indicating that [CompletionStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMPLETE -> Value.COMPLETE @@ -372,6 +403,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMPLETE -> Known.COMPLETE @@ -402,6 +441,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -411,21 +458,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DATA_SYNC_ALL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL 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 25417bd8..17ee31e8 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 @@ -83,6 +83,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobCreateBody]. */ class Builder internal constructor() { private var type: JsonField? = null @@ -151,6 +152,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxJobCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -303,6 +305,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -312,21 +322,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DATA_SYNC_ALL, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL 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 5d00caf4..69e3571d 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 @@ -112,6 +112,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxPaymentCreateBody]. */ class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() @@ -208,6 +209,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SandboxPaymentCreateParams]. */ @NoAutoDetect class Builder internal constructor() { @@ -507,6 +509,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PayStatement]. */ class Builder internal constructor() { private var earnings: JsonField>? = null @@ -817,6 +820,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Earning]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -941,6 +945,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -974,6 +986,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { SALARY, WAGE, @@ -990,6 +1003,15 @@ private constructor( OTHER, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { SALARY, WAGE, @@ -1004,9 +1026,19 @@ private constructor( TIPS, _1099, OTHER, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { SALARY -> Value.SALARY @@ -1025,6 +1057,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { SALARY -> Known.SALARY @@ -1155,6 +1196,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployeeDeduction]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -1347,6 +1389,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EmployerContribution]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -1461,6 +1504,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1472,17 +1523,38 @@ private constructor( @JvmStatic fun of(value: String) = PaymentMethod(JsonField.of(value)) } + /** An enum containing [PaymentMethod]'s known values. */ enum class Known { CHECK, DIRECT_DEPOSIT, } + /** + * An enum containing [PaymentMethod]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentMethod] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CHECK, DIRECT_DEPOSIT, + /** + * An enum member indicating that [PaymentMethod] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CHECK -> Value.CHECK @@ -1490,6 +1562,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CHECK -> Known.CHECK @@ -1592,6 +1673,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Tax]. */ class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() @@ -1705,6 +1787,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1720,6 +1810,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { STATE, FEDERAL, @@ -1727,14 +1818,33 @@ private constructor( FICA, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STATE, FEDERAL, LOCAL, FICA, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { STATE -> Value.STATE @@ -1744,6 +1854,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STATE -> Known.STATE @@ -1793,6 +1912,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1806,19 +1933,37 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { REGULAR_PAYROLL, OFF_CYCLE_PAYROLL, ONE_TIME_PAYMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REGULAR_PAYROLL, OFF_CYCLE_PAYROLL, ONE_TIME_PAYMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { REGULAR_PAYROLL -> Value.REGULAR_PAYROLL @@ -1827,6 +1972,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { REGULAR_PAYROLL -> Known.REGULAR_PAYROLL 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 0dab3b96..43a46246 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 @@ -64,6 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SessionNewResponse]. */ class Builder internal constructor() { private var connectUrl: JsonField? = null 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 da32debd..b6fe7686 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 @@ -64,6 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SessionReauthenticateResponse]. */ class Builder internal constructor() { private var connectUrl: JsonField? = null 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 9e08f50d..34774cef 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 @@ -66,6 +66,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportPerBenefitType]. */ class Builder internal constructor() { private var companyBenefits: JsonField = JsonMissing.of() 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 4935ab0c..174b02b1 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 @@ -152,6 +152,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SupportedBenefit]. */ class Builder internal constructor() { private var annualMaximum: JsonField = JsonMissing.of() @@ -399,6 +400,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -410,17 +419,38 @@ private constructor( @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value)) } + /** An enum containing [CompanyContribution]'s known values. */ enum class Known { FIXED, PERCENT, } + /** + * An enum containing [CompanyContribution]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [CompanyContribution] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FIXED, PERCENT, + /** + * An enum member indicating that [CompanyContribution] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FIXED -> Value.FIXED @@ -428,6 +458,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FIXED -> Known.FIXED @@ -456,6 +494,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -467,17 +513,38 @@ private constructor( @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value)) } + /** An enum containing [EmployeeDeduction]'s known values. */ enum class Known { FIXED, PERCENT, } + /** + * An enum containing [EmployeeDeduction]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EmployeeDeduction] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { FIXED, PERCENT, + /** + * An enum member indicating that [EmployeeDeduction] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { FIXED -> Value.FIXED @@ -485,6 +552,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { FIXED -> Known.FIXED @@ -513,6 +588,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -524,17 +607,39 @@ private constructor( @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } + /** An enum containing [HsaContributionLimit]'s known values. */ enum class Known { INDIVIDUAL, FAMILY, } + /** + * An enum containing [HsaContributionLimit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [HsaContributionLimit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INDIVIDUAL, FAMILY, + /** + * An enum member indicating that [HsaContributionLimit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INDIVIDUAL -> Value.INDIVIDUAL @@ -542,6 +647,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INDIVIDUAL -> Known.INDIVIDUAL 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 81372091..ade72313 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 @@ -69,6 +69,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [UnenrolledIndividual]. */ class Builder internal constructor() { private var body: JsonField = JsonMissing.of() @@ -187,6 +188,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Body]. */ class Builder internal constructor() { private var finchCode: JsonField = JsonMissing.of() 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 b6c621bf..d1a7e8ba 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 @@ -52,6 +52,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [UpdateCompanyBenefitResponse]. */ class Builder internal constructor() { private var benefitId: JsonField? = null diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt index b0f89e64..98111406 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42005.kt @@ -74,6 +74,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [W42005]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -237,6 +238,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var additionalWithholding: JsonField = JsonMissing.of() @@ -351,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -362,17 +372,38 @@ private constructor( @JvmStatic fun of(value: String) = Exemption(JsonField.of(value)) } + /** An enum containing [Exemption]'s known values. */ enum class Known { EXEMPT, NON_EXEMPT, } + /** + * An enum containing [Exemption]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Exemption] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXEMPT, NON_EXEMPT, + /** + * An enum member indicating that [Exemption] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXEMPT -> Value.EXEMPT @@ -380,6 +411,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXEMPT -> Known.EXEMPT @@ -409,6 +449,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -424,19 +472,40 @@ private constructor( @JvmStatic fun of(value: String) = FilingStatus(JsonField.of(value)) } + /** An enum containing [FilingStatus]'s known values. */ enum class Known { MARRIED, MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE, SINGLE, } + /** + * An enum containing [FilingStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FilingStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MARRIED, MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE, SINGLE, + /** + * An enum member indicating that [FilingStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MARRIED -> Value.MARRIED @@ -446,6 +515,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MARRIED -> Known.MARRIED @@ -495,6 +573,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -504,21 +590,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { W4_2005, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { W4_2005, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { W4_2005 -> Value.W4_2005 else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { W4_2005 -> Known.W4_2005 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt index bf4f4551..91bf811e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/W42020.kt @@ -74,6 +74,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [W42020]. */ class Builder internal constructor() { private var data: JsonField = JsonMissing.of() @@ -283,6 +284,7 @@ private constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [Data]. */ class Builder internal constructor() { private var amountForOtherDependents: JsonField = JsonMissing.of() @@ -485,6 +487,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -501,19 +511,40 @@ private constructor( @JvmStatic fun of(value: String) = FilingStatus(JsonField.of(value)) } + /** An enum containing [FilingStatus]'s known values. */ enum class Known { HEAD_OF_HOUSEHOLD, MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE, SINGLE_OR_MARRIED_FILING_SEPARATELY, } + /** + * An enum containing [FilingStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FilingStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { HEAD_OF_HOUSEHOLD, MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE, SINGLE_OR_MARRIED_FILING_SEPARATELY, + /** + * An enum member indicating that [FilingStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { HEAD_OF_HOUSEHOLD -> Value.HEAD_OF_HOUSEHOLD @@ -523,6 +554,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { HEAD_OF_HOUSEHOLD -> Known.HEAD_OF_HOUSEHOLD @@ -572,6 +612,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -581,21 +629,47 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { W4_2020, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { W4_2020, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { W4_2020 -> Value.W4_2020 else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { W4_2020 -> Known.W4_2020 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt index 0f2f2fcb..57c76c37 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/WebhookEvent.kt @@ -192,6 +192,9 @@ private constructor( WebhookEvent(payStatement = payStatement) } + /** + * An interface that defines how to map each variant of [WebhookEvent] to a value of type [T]. + */ interface Visitor { fun visitAccountUpdate(accountUpdate: AccountUpdateEvent): T @@ -210,6 +213,15 @@ private constructor( fun visitPayStatement(payStatement: PayStatementEvent): T + /** + * Maps an unknown variant of [WebhookEvent] to a value of type [T]. + * + * An instance of [WebhookEvent] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older version + * than the API, then the API may respond with new variants that the SDK is unaware of. + * + * @throws FinchInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw FinchInvalidDataException("Unknown WebhookEvent: $json") } From 1e88c1b166a5a153372ee6bc5a6e1693822cc9fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 21:03:28 +0000 Subject: [PATCH 23/34] feat(api): api update (#418) --- .stats.yml | 2 +- .../api/models/ConnectSessionNewParams.kt | 24 +++++++++---------- .../ConnectSessionReauthenticateParams.kt | 24 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.stats.yml b/.stats.yml index 590e7226..ef2aa86c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 40 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0ff5b707b4e3afcf4020e2d4b71bb4d4cfb25eac2828d6de5bee8d4d5d81550d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-9c0b41ca8713a9440c624b0d08de0e6cbd9486978188afab2286ae67d8a97817.yml 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 958ebc57..42d53ea4 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 @@ -41,7 +41,7 @@ private constructor( fun manual(): Optional = body.manual() - /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + /** The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(): Optional = body.minutesToExpire() fun redirectUri(): Optional = body.redirectUri() @@ -60,7 +60,7 @@ private constructor( fun _manual(): JsonField = body._manual() - /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + /** The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun _minutesToExpire(): JsonField = body._minutesToExpire() fun _redirectUri(): JsonField = body._redirectUri() @@ -129,7 +129,7 @@ private constructor( fun manual(): Optional = Optional.ofNullable(manual.getNullable("manual")) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire.getNullable("minutes_to_expire")) @@ -162,7 +162,7 @@ private constructor( @JsonProperty("manual") @ExcludeMissing fun _manual(): JsonField = manual /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ @JsonProperty("minutes_to_expire") @ExcludeMissing @@ -291,21 +291,21 @@ private constructor( fun manual(manual: JsonField) = apply { this.manual = manual } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: Double?) = minutesToExpire(JsonField.ofNullable(minutesToExpire)) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: Double) = minutesToExpire(minutesToExpire as Double?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 @@ -313,7 +313,7 @@ private constructor( minutesToExpire(minutesToExpire.orElse(null) as Double?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: JsonField) = apply { @@ -451,26 +451,26 @@ private constructor( fun manual(manual: JsonField) = apply { body.manual(manual) } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(minutesToExpire: Double?) = apply { body.minutesToExpire(minutesToExpire) } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 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) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun minutesToExpire(minutesToExpire: Optional) = minutesToExpire(minutesToExpire.orElse(null) as Double?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(minutesToExpire: JsonField) = apply { body.minutesToExpire(minutesToExpire) 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 62e8665c..7a13f477 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 @@ -32,7 +32,7 @@ private constructor( /** The ID of the existing connection to reauthenticate */ fun connectionId(): String = body.connectionId() - /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + /** The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(): Optional = body.minutesToExpire() /** The products to request access to (optional for reauthentication) */ @@ -44,7 +44,7 @@ private constructor( /** The ID of the existing connection to reauthenticate */ fun _connectionId(): JsonField = body._connectionId() - /** The number of minutes until the session expires (defaults to 20,160, which is 14 days) */ + /** The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun _minutesToExpire(): JsonField = body._minutesToExpire() /** The products to request access to (optional for reauthentication) */ @@ -89,7 +89,7 @@ private constructor( fun connectionId(): String = connectionId.getRequired("connection_id") /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(): Optional = Optional.ofNullable(minutesToExpire.getNullable("minutes_to_expire")) @@ -108,7 +108,7 @@ private constructor( fun _connectionId(): JsonField = connectionId /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ @JsonProperty("minutes_to_expire") @ExcludeMissing @@ -178,20 +178,20 @@ private constructor( } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: Long?) = minutesToExpire(JsonField.ofNullable(minutesToExpire)) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: Long) = minutesToExpire(minutesToExpire as Long?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 @@ -199,7 +199,7 @@ private constructor( minutesToExpire(minutesToExpire.orElse(null) as Long?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 + * The number of minutes until the session expires (defaults to 43,200, which is 30 * days) */ fun minutesToExpire(minutesToExpire: JsonField) = apply { @@ -325,26 +325,26 @@ private constructor( } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(minutesToExpire: Long?) = apply { body.minutesToExpire(minutesToExpire) } /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 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) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun minutesToExpire(minutesToExpire: Optional) = minutesToExpire(minutesToExpire.orElse(null) as Long?) /** - * The number of minutes until the session expires (defaults to 20,160, which is 14 days) + * The number of minutes until the session expires (defaults to 43,200, which is 30 days) */ fun minutesToExpire(minutesToExpire: JsonField) = apply { body.minutesToExpire(minutesToExpire) From 2a3c6582c5179b922d9729535c47e9383efcb620 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:28:52 +0000 Subject: [PATCH 24/34] feat(client): add `_queryParams` and `_headers` methods (#419) refactor(internal): extract request preparation logic --- .../kotlin/com/tryfinch/api/core/Params.kt | 16 ++ .../com/tryfinch/api/core/PrepareRequest.kt | 24 +++ .../api/models/AccessTokenCreateParams.kt | 9 +- .../api/models/AccountDisconnectParams.kt | 9 +- .../api/models/AccountIntrospectParams.kt | 7 +- .../api/models/ConnectSessionNewParams.kt | 9 +- .../ConnectSessionReauthenticateParams.kt | 9 +- .../api/models/HrisBenefitCreateParams.kt | 9 +- .../HrisBenefitIndividualEnrolledIdsParams.kt | 7 +- ...fitIndividualRetrieveManyBenefitsParams.kt | 8 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 9 +- .../api/models/HrisBenefitListParams.kt | 7 +- .../HrisBenefitListSupportedBenefitsParams.kt | 7 +- .../api/models/HrisBenefitRetrieveParams.kt | 7 +- .../api/models/HrisBenefitUpdateParams.kt | 9 +- .../api/models/HrisCompanyRetrieveParams.kt | 7 +- .../HrisDirectoryListIndividualsParams.kt | 8 +- .../api/models/HrisDirectoryListParams.kt | 8 +- .../api/models/HrisDocumentListParams.kt | 8 +- .../api/models/HrisDocumentRetreiveParams.kt | 7 +- .../HrisEmploymentRetrieveManyParams.kt | 9 +- .../HrisIndividualRetrieveManyParams.kt | 9 +- .../HrisPayStatementRetrieveManyParams.kt | 9 +- .../api/models/HrisPaymentListParams.kt | 8 +- .../api/models/JobAutomatedCreateParams.kt | 9 +- .../api/models/JobAutomatedListParams.kt | 8 +- .../api/models/JobAutomatedRetrieveParams.kt | 7 +- .../api/models/JobManualRetrieveParams.kt | 7 +- .../api/models/PayrollPayGroupListParams.kt | 8 +- .../models/PayrollPayGroupRetrieveParams.kt | 7 +- .../tryfinch/api/models/ProviderListParams.kt | 7 +- .../models/RequestForwardingForwardParams.kt | 13 +- .../api/models/SandboxCompanyUpdateParams.kt | 9 +- .../SandboxConnectionAccountCreateParams.kt | 9 +- .../SandboxConnectionAccountUpdateParams.kt | 9 +- .../models/SandboxConnectionCreateParams.kt | 9 +- .../models/SandboxDirectoryCreateParams.kt | 9 +- .../models/SandboxEmploymentUpdateParams.kt | 9 +- .../models/SandboxIndividualUpdateParams.kt | 9 +- .../SandboxJobConfigurationRetrieveParams.kt | 7 +- .../SandboxJobConfigurationUpdateParams.kt | 9 +- .../api/models/SandboxJobCreateParams.kt | 9 +- .../api/models/SandboxPaymentCreateParams.kt | 9 +- .../async/AccessTokenServiceAsyncImpl.kt | 27 ++-- .../services/async/AccountServiceAsyncImpl.kt | 51 +++---- .../async/ProviderServiceAsyncImpl.kt | 29 ++-- .../RequestForwardingServiceAsyncImpl.kt | 27 ++-- .../async/connect/SessionServiceAsyncImpl.kt | 53 ++++--- .../async/hris/BenefitServiceAsyncImpl.kt | 139 +++++++++--------- .../async/hris/CompanyServiceAsyncImpl.kt | 25 ++-- .../async/hris/DirectoryServiceAsyncImpl.kt | 53 ++++--- .../async/hris/DocumentServiceAsyncImpl.kt | 49 +++--- .../async/hris/EmploymentServiceAsyncImpl.kt | 29 ++-- .../async/hris/IndividualServiceAsyncImpl.kt | 29 ++-- .../hris/PayStatementServiceAsyncImpl.kt | 29 ++-- .../async/hris/PaymentServiceAsyncImpl.kt | 29 ++-- .../benefits/IndividualServiceAsyncImpl.kt | 97 ++++++------ .../async/jobs/AutomatedServiceAsyncImpl.kt | 77 +++++----- .../async/jobs/ManualServiceAsyncImpl.kt | 25 ++-- .../async/payroll/PayGroupServiceAsyncImpl.kt | 53 ++++--- .../async/sandbox/CompanyServiceAsyncImpl.kt | 27 ++-- .../sandbox/ConnectionServiceAsyncImpl.kt | 27 ++-- .../sandbox/DirectoryServiceAsyncImpl.kt | 15 +- .../sandbox/EmploymentServiceAsyncImpl.kt | 27 ++-- .../sandbox/IndividualServiceAsyncImpl.kt | 27 ++-- .../async/sandbox/JobServiceAsyncImpl.kt | 27 ++-- .../async/sandbox/PaymentServiceAsyncImpl.kt | 27 ++-- .../connections/AccountServiceAsyncImpl.kt | 53 ++++--- .../jobs/ConfigurationServiceAsyncImpl.kt | 51 +++---- .../blocking/AccessTokenServiceImpl.kt | 8 +- .../services/blocking/AccountServiceImpl.kt | 13 +- .../services/blocking/ProviderServiceImpl.kt | 6 +- .../blocking/RequestForwardingServiceImpl.kt | 8 +- .../blocking/connect/SessionServiceImpl.kt | 15 +- .../blocking/hris/BenefitServiceImpl.kt | 30 +--- .../blocking/hris/CompanyServiceImpl.kt | 6 +- .../blocking/hris/DirectoryServiceImpl.kt | 11 +- .../blocking/hris/DocumentServiceImpl.kt | 11 +- .../blocking/hris/EmploymentServiceImpl.kt | 8 +- .../blocking/hris/IndividualServiceImpl.kt | 8 +- .../blocking/hris/PayStatementServiceImpl.kt | 8 +- .../blocking/hris/PaymentServiceImpl.kt | 6 +- .../hris/benefits/IndividualServiceImpl.kt | 18 +-- .../blocking/jobs/AutomatedServiceImpl.kt | 18 +-- .../blocking/jobs/ManualServiceImpl.kt | 6 +- .../blocking/payroll/PayGroupServiceImpl.kt | 11 +- .../blocking/sandbox/CompanyServiceImpl.kt | 8 +- .../blocking/sandbox/ConnectionServiceImpl.kt | 8 +- .../blocking/sandbox/DirectoryServiceImpl.kt | 8 +- .../blocking/sandbox/EmploymentServiceImpl.kt | 8 +- .../blocking/sandbox/IndividualServiceImpl.kt | 8 +- .../blocking/sandbox/JobServiceImpl.kt | 8 +- .../blocking/sandbox/PaymentServiceImpl.kt | 8 +- .../sandbox/connections/AccountServiceImpl.kt | 15 +- .../sandbox/jobs/ConfigurationServiceImpl.kt | 13 +- .../api/models/AccessTokenCreateParamsTest.kt | 8 +- .../api/models/ConnectSessionNewParamsTest.kt | 8 +- .../ConnectSessionReauthenticateParamsTest.kt | 8 +- .../api/models/HrisBenefitCreateParamsTest.kt | 8 +- ...ndividualRetrieveManyBenefitsParamsTest.kt | 8 +- ...BenefitIndividualUnenrollManyParamsTest.kt | 8 +- .../api/models/HrisBenefitUpdateParamsTest.kt | 8 +- .../HrisDirectoryListIndividualsParamsTest.kt | 8 +- .../api/models/HrisDirectoryListParamsTest.kt | 8 +- .../api/models/HrisDocumentListParamsTest.kt | 8 +- .../HrisEmploymentRetrieveManyParamsTest.kt | 8 +- .../HrisIndividualRetrieveManyParamsTest.kt | 8 +- .../HrisPayStatementRetrieveManyParamsTest.kt | 8 +- .../api/models/HrisPaymentListParamsTest.kt | 8 +- .../api/models/JobAutomatedListParamsTest.kt | 8 +- .../models/PayrollPayGroupListParamsTest.kt | 8 +- .../RequestForwardingForwardParamsTest.kt | 10 +- .../models/SandboxCompanyUpdateParamsTest.kt | 8 +- ...andboxConnectionAccountCreateParamsTest.kt | 8 +- ...andboxConnectionAccountUpdateParamsTest.kt | 8 +- .../SandboxConnectionCreateParamsTest.kt | 8 +- .../SandboxDirectoryCreateParamsTest.kt | 8 +- .../SandboxEmploymentUpdateParamsTest.kt | 8 +- .../SandboxIndividualUpdateParamsTest.kt | 8 +- ...SandboxJobConfigurationUpdateParamsTest.kt | 8 +- .../api/models/SandboxJobCreateParamsTest.kt | 8 +- .../models/SandboxPaymentCreateParamsTest.kt | 8 +- 122 files changed, 954 insertions(+), 1023 deletions(-) create mode 100644 finch-java-core/src/main/kotlin/com/tryfinch/api/core/Params.kt create mode 100644 finch-java-core/src/main/kotlin/com/tryfinch/api/core/PrepareRequest.kt diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Params.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Params.kt new file mode 100644 index 00000000..37fa6a31 --- /dev/null +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Params.kt @@ -0,0 +1,16 @@ +package com.tryfinch.api.core + +import com.tryfinch.api.core.http.Headers +import com.tryfinch.api.core.http.QueryParams + +/** An interface representing parameters passed to a service method. */ +interface Params { + /** The full set of headers in the parameters, including both fixed and additional headers. */ + fun _headers(): Headers + + /** + * The full set of query params in the parameters, including both fixed and additional query + * params. + */ + fun _queryParams(): QueryParams +} diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PrepareRequest.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PrepareRequest.kt new file mode 100644 index 00000000..974ae9d8 --- /dev/null +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PrepareRequest.kt @@ -0,0 +1,24 @@ +@file:JvmName("PrepareRequest") + +package com.tryfinch.api.core + +import com.tryfinch.api.core.http.HttpRequest +import java.util.concurrent.CompletableFuture + +@JvmSynthetic +internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): HttpRequest = + toBuilder() + .putAllQueryParams(clientOptions.queryParams) + .replaceAllQueryParams(params._queryParams()) + .putAllHeaders(clientOptions.headers) + .replaceAllHeaders(params._headers()) + .build() + +@JvmSynthetic +internal fun HttpRequest.prepareAsync( + clientOptions: ClientOptions, + params: Params +): CompletableFuture = + // This async version exists to make it easier to add async specific preparation logic in the + // future. + CompletableFuture.completedFuture(prepare(clientOptions, params)) 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 afa3d4df..c45bcbb2 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -25,7 +26,7 @@ private constructor( private val body: AccessTokenCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun code(): String = body.code() @@ -49,11 +50,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): AccessTokenCreateBody = body + @JvmSynthetic internal fun _body(): AccessTokenCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class AccessTokenCreateBody 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 170a3c5b..8edd0cba 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 @@ -4,6 +4,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable @@ -16,7 +17,7 @@ private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders @@ -25,12 +26,12 @@ private constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt index 04d64b4d..0f3ddc95 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class AccountIntrospectParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) 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 42d53ea4..29c5f4e9 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: ConnectSessionNewBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = body.customerId() @@ -73,11 +74,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): ConnectSessionNewBody = body + @JvmSynthetic internal fun _body(): ConnectSessionNewBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class ConnectSessionNewBody 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 7a13f477..1073bff0 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: ConnectSessionReauthenticateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The ID of the existing connection to reauthenticate */ fun connectionId(): String = body.connectionId() @@ -59,11 +60,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): ConnectSessionReauthenticateBody = body + @JvmSynthetic internal fun _body(): ConnectSessionReauthenticateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class ConnectSessionReauthenticateBody 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 e35428a9..cb2ec7dc 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -27,7 +28,7 @@ private constructor( private val body: HrisBenefitCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Name of the benefit as it appears in the provider and pay statements. Recommend limiting this @@ -57,11 +58,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisBenefitCreateBody = body + @JvmSynthetic internal fun _body(): HrisBenefitCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class HrisBenefitCreateBody diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt index 598493ff..4e98d670 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -14,7 +15,7 @@ private constructor( private val benefitId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun benefitId(): String = benefitId @@ -22,9 +23,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { 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 18a24414..bb05a6ef 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -16,7 +17,7 @@ private constructor( private val individualIds: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun benefitId(): String = benefitId @@ -30,10 +31,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.individualIds?.let { queryParams.put("individual_ids", listOf(it.toString())) } queryParams.putAll(additionalQueryParams) 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 c856986e..30914a92 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -26,7 +27,7 @@ private constructor( private val body: HrisBenefitIndividualUnenrollManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun benefitId(): String = benefitId @@ -42,11 +43,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisBenefitIndividualUnenrollManyBody = body + @JvmSynthetic internal fun _body(): HrisBenefitIndividualUnenrollManyBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt index efc0dfb1..74a5d5b8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class HrisBenefitListParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt index 1054fb7b..a5393797 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class HrisBenefitListSupportedBenefitsParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt index b48fbcc2..05594957 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -14,7 +15,7 @@ private constructor( private val benefitId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun benefitId(): String = benefitId @@ -22,9 +23,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { 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 0e9d272a..208bf30c 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -26,7 +27,7 @@ private constructor( private val body: HrisBenefitUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun benefitId(): String = benefitId @@ -42,11 +43,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisBenefitUpdateBody = body + @JvmSynthetic internal fun _body(): HrisBenefitUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt index e420e8ba..f1eca56d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class HrisCompanyRetrieveParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) 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 237c8018..5eafd559 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -16,7 +17,7 @@ private constructor( private val offset: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** Number of employees to return (defaults to all) */ fun limit(): Optional = Optional.ofNullable(limit) @@ -28,10 +29,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.limit?.let { queryParams.put("limit", listOf(it.toString())) } this.offset?.let { queryParams.put("offset", listOf(it.toString())) } 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 59b7eef8..000f255d 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -15,7 +16,7 @@ private constructor( private val offset: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** Number of employees to return (defaults to all) */ fun limit(): Optional = Optional.ofNullable(limit) @@ -27,10 +28,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.limit?.let { queryParams.put("limit", listOf(it.toString())) } this.offset?.let { queryParams.put("offset", listOf(it.toString())) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt index db271453..6d13fc3b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable @@ -22,7 +23,7 @@ private constructor( private val types: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all @@ -43,10 +44,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.individualIds?.let { queryParams.put("individual_ids[]", it.map(Any::toString)) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt index 24b52765..5fbb6079 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -17,7 +18,7 @@ private constructor( private val documentId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun documentId(): String = documentId @@ -25,9 +26,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { 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 6ab13146..47a1156c 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -24,7 +25,7 @@ private constructor( private val body: HrisEmploymentRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The array of batch requests. */ fun requests(): List = body.requests() @@ -38,11 +39,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisEmploymentRetrieveManyBody = body + @JvmSynthetic internal fun _body(): HrisEmploymentRetrieveManyBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams /** Individual Ids Request Body */ @NoAutoDetect 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 dbc91523..c63cd80a 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -24,7 +25,7 @@ private constructor( private val body: HrisIndividualRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun options(): Optional = body.options() @@ -40,11 +41,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisIndividualRetrieveManyBody = body + @JvmSynthetic internal fun _body(): HrisIndividualRetrieveManyBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class HrisIndividualRetrieveManyBody 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 61c6c5b9..2bd05098 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -29,7 +30,7 @@ private constructor( private val body: HrisPayStatementRetrieveManyBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The array of batch requests. */ fun requests(): List = body.requests() @@ -43,11 +44,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): HrisPayStatementRetrieveManyBody = body + @JvmSynthetic internal fun _body(): HrisPayStatementRetrieveManyBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class HrisPayStatementRetrieveManyBody 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 6d731201..f0dc741f 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -16,7 +17,7 @@ private constructor( private val startDate: LocalDate, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. */ fun endDate(): LocalDate = endDate @@ -28,10 +29,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.endDate.let { queryParams.put("end_date", listOf(it.toString())) } this.startDate.let { queryParams.put("start_date", listOf(it.toString())) } 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 098d8236..036451bf 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 @@ -21,6 +21,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.getOrThrow import com.tryfinch.api.core.http.Headers @@ -52,7 +53,7 @@ private constructor( private val body: JobAutomatedCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun dataSyncAll(): Optional = body.dataSyncAll() @@ -62,11 +63,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): JobAutomatedCreateBody = body + @JvmSynthetic internal fun _body(): JobAutomatedCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @JsonDeserialize(using = JobAutomatedCreateBody.Deserializer::class) @JsonSerialize(using = JobAutomatedCreateBody.Serializer::class) 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 2c343a9d..9a6b4b60 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -19,7 +20,7 @@ private constructor( private val offset: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** Number of items to return */ fun limit(): Optional = Optional.ofNullable(limit) @@ -31,10 +32,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.limit?.let { queryParams.put("limit", listOf(it.toString())) } this.offset?.let { queryParams.put("offset", listOf(it.toString())) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt index 16bae93d..8f9419ca 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -14,7 +15,7 @@ private constructor( private val jobId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun jobId(): String = jobId @@ -22,9 +23,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt index 3c109277..32fc6bca 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -17,7 +18,7 @@ private constructor( private val jobId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun jobId(): String = jobId @@ -25,9 +26,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { 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 a871d281..fe12118b 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable @@ -16,7 +17,7 @@ private constructor( private val payFrequencies: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun individualId(): Optional = Optional.ofNullable(individualId) @@ -26,10 +27,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.individualId?.let { queryParams.put("individual_id", listOf(it.toString())) } this.payFrequencies?.let { queryParams.put("pay_frequencies[]", it.map(Any::toString)) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt index ca980d5b..e78ff6a9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -14,7 +15,7 @@ private constructor( private val payGroupId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun payGroupId(): String = payGroupId @@ -22,9 +23,9 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt index 07aa082a..d73f15c9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class ProviderListParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) 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 f6b45962..86d06978 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -29,7 +30,7 @@ private constructor( private val body: RequestForwardingForwardBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , @@ -54,7 +55,7 @@ private constructor( * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": * "v1" }` */ - fun _headers(): JsonValue = body._headers() + fun _headers_(): JsonValue = body._headers_() /** * The query parameters for the forwarded request. This value must be specified as a valid JSON @@ -86,11 +87,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): RequestForwardingForwardBody = body + @JvmSynthetic internal fun _body(): RequestForwardingForwardBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams /** Forward Request Body */ @NoAutoDetect @@ -135,7 +136,7 @@ private constructor( * object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": * "v1" }` */ - @JsonProperty("headers") @ExcludeMissing fun _headers(): JsonValue = headers + @JsonProperty("headers") @ExcludeMissing fun _headers_(): JsonValue = headers /** * The query parameters for the forwarded request. This value must be specified as a valid 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 8597d053..6c289cb4 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: SandboxCompanyUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** An array of bank account objects associated with the payroll/HRIS system. */ fun accounts(): Optional> = body.accounts() @@ -81,11 +82,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxCompanyUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxCompanyUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxCompanyUpdateBody 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 ec8b6456..d212b752 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: SandboxConnectionAccountCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun companyId(): String = body.companyId() @@ -61,11 +62,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxConnectionAccountCreateBody = body + @JvmSynthetic internal fun _body(): SandboxConnectionAccountCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxConnectionAccountCreateBody 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 259c67eb..41bffb71 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 @@ -11,6 +11,7 @@ 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.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -27,7 +28,7 @@ private constructor( private val body: SandboxConnectionAccountUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun connectionStatus(): Optional = body.connectionStatus() @@ -39,11 +40,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxConnectionAccountUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxConnectionAccountUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxConnectionAccountUpdateBody 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 0c1550da..9201ae74 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: SandboxConnectionCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The provider associated with the connection */ fun providerId(): String = body.providerId() @@ -63,11 +64,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxConnectionCreateBody = body + @JvmSynthetic internal fun _body(): SandboxConnectionCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxConnectionCreateBody 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 fffec73d..f7963c72 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -27,7 +28,7 @@ private constructor( private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Array of individuals to create. Takes all combined fields from `/individual` and @@ -39,11 +40,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): List = body + @JvmSynthetic internal fun _body(): List = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) 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 51ae4200..68f7a4ef 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -28,7 +29,7 @@ private constructor( private val body: SandboxEmploymentUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun individualId(): String = individualId @@ -152,11 +153,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxEmploymentUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxEmploymentUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { 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 7c15313a..a859bd33 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -28,7 +29,7 @@ private constructor( private val body: SandboxIndividualUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun individualId(): String = individualId @@ -118,11 +119,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxIndividualUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxIndividualUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt index 2205d4be..0eeb3408 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect +import com.tryfinch.api.core.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import java.util.Objects @@ -12,15 +13,15 @@ class SandboxJobConfigurationRetrieveParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) 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 65b6ea7a..6b54e4c1 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -26,7 +27,7 @@ private constructor( private val body: SandboxJobConfigurationUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun completionStatus(): CompletionStatus = body.completionStatus() @@ -42,11 +43,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxJobConfigurationUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxJobConfigurationUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxJobConfigurationUpdateBody 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 17ee31e8..8babd659 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.checkRequired import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams @@ -26,7 +27,7 @@ private constructor( private val body: SandboxJobCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The type of job to start. Currently the only supported type is `data_sync_all` */ fun type(): Type = body.type() @@ -40,11 +41,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxJobCreateBody = body + @JvmSynthetic internal fun _body(): SandboxJobCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SandboxJobCreateBody 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 69e3571d..8d31c28d 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 @@ -12,6 +12,7 @@ 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.Params import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.immutableEmptyMap @@ -26,7 +27,7 @@ private constructor( private val body: SandboxPaymentCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun endDate(): Optional = body.endDate() @@ -46,11 +47,11 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SandboxPaymentCreateBody = body + @JvmSynthetic internal fun _body(): SandboxPaymentCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams /** * Fields to configure the payment. Takes all fields from the `/payment` endpoint. All fields diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt index 8b226628..955f1c87 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.errors.FinchException import com.tryfinch.api.models.AccessTokenCreateParams @@ -60,20 +61,22 @@ internal constructor( .method(HttpMethod.POST) .addPathSegments("auth", "token") .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) + .replaceAllQueryParams(params._queryParams()) .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, modifiedParams.getBody())) + .putAllHeaders(params._headers()) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt index 9f7e4323..47510ffd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AccountDisconnectParams import com.tryfinch.api.models.AccountIntrospectParams @@ -37,22 +38,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("disconnect") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { disconnectHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { disconnectHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val introspectHandler: Handler = @@ -67,20 +66,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("introspect") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { introspectHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { introspectHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt index bcf2cb52..b80e2503 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.Provider import com.tryfinch.api.models.ProviderListPageAsync @@ -35,22 +36,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("providers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { ProviderListPageAsync.Response.Builder().items(it).build() } - .let { ProviderListPageAsync.of(this, params, it) } - } + .let { ProviderListPageAsync.Response.Builder().items(it).build() } + .let { ProviderListPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt index bc6bdd87..91aea02c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.RequestForwardingForwardParams import com.tryfinch.api.models.RequestForwardingForwardResponse @@ -40,21 +41,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("forward") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { forwardHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { forwardHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt index 2ea88902..f94dc8e8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.ConnectSessionNewParams import com.tryfinch.api.models.ConnectSessionReauthenticateParams @@ -37,22 +38,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("connect", "sessions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { newHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { newHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val reauthenticateHandler: Handler = @@ -68,21 +67,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("connect", "sessions", "reauthenticate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { reauthenticateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { reauthenticateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt index 83bce702..19ab01ea 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.CompanyBenefit import com.tryfinch.api.models.CreateCompanyBenefitsResponse @@ -56,22 +57,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "benefits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val retrieveHandler: Handler = @@ -86,21 +85,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -116,22 +113,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "benefits", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler> = @@ -146,23 +141,21 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { HrisBenefitListPageAsync.Response.Builder().items(it).build() } - .let { HrisBenefitListPageAsync.of(this, params, it) } - } + .let { HrisBenefitListPageAsync.Response.Builder().items(it).build() } + .let { HrisBenefitListPageAsync.of(this, params, it) } + } } private val listSupportedBenefitsHandler: Handler> = @@ -177,24 +170,24 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", "meta") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listSupportedBenefitsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listSupportedBenefitsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { - HrisBenefitListSupportedBenefitsPageAsync.Response.Builder().items(it).build() - } - .let { HrisBenefitListSupportedBenefitsPageAsync.of(this, params, it) } - } + .let { + HrisBenefitListSupportedBenefitsPageAsync.Response.Builder() + .items(it) + .build() + } + .let { HrisBenefitListSupportedBenefitsPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt index a28f986f..11abbb4f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.Company import com.tryfinch.api.models.HrisCompanyRetrieveParams @@ -34,20 +35,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "company") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt index 89aa9662..8cba1053 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisDirectoryListIndividualsPageAsync import com.tryfinch.api.models.HrisDirectoryListIndividualsParams @@ -37,22 +38,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { HrisDirectoryListPageAsync.of(this, params, it) } - } + .let { HrisDirectoryListPageAsync.of(this, params, it) } + } } private val listIndividualsHandler: Handler = @@ -69,21 +68,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listIndividualsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listIndividualsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { HrisDirectoryListIndividualsPageAsync.of(this, params, it) } - } + .let { HrisDirectoryListIndividualsPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt index 69af7e8e..c665612b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.DocumentListResponse import com.tryfinch.api.models.DocumentRetreiveResponse @@ -38,21 +39,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "documents") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val retreiveHandler: Handler = @@ -71,20 +70,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "documents", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retreiveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retreiveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt index 0efdb186..1ab9e5a0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisEmploymentRetrieveManyPageAsync import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams @@ -36,22 +37,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "employment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveManyHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { HrisEmploymentRetrieveManyPageAsync.of(this, params, it) } - } + .let { HrisEmploymentRetrieveManyPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt index b934ad0f..f6fe22ec 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisIndividualRetrieveManyPageAsync import com.tryfinch.api.models.HrisIndividualRetrieveManyParams @@ -36,22 +37,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "individual") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveManyHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { HrisIndividualRetrieveManyPageAsync.of(this, params, it) } - } + .let { HrisIndividualRetrieveManyPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt index c62e0e7e..9fc0b995 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisPayStatementRetrieveManyPageAsync import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams @@ -40,22 +41,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "pay-statement") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveManyHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { HrisPayStatementRetrieveManyPageAsync.of(this, params, it) } - } + .let { HrisPayStatementRetrieveManyPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt index 422af6c8..3f10d41e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisPaymentListPageAsync import com.tryfinch.api.models.HrisPaymentListParams @@ -35,22 +36,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "payment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { HrisPaymentListPageAsync.Response.Builder().items(it).build() } - .let { HrisPaymentListPageAsync.of(this, params, it) } - } + .let { HrisPaymentListPageAsync.Response.Builder().items(it).build() } + .let { HrisPaymentListPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt index c001ffdd..31456345 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisBenefitIndividualEnrolledIdsParams import com.tryfinch.api.models.HrisBenefitIndividualRetrieveManyBenefitsPageAsync @@ -42,21 +43,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0), "enrolled") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { enrolledIdsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { enrolledIdsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val retrieveManyBenefitsHandler: Handler> = @@ -72,27 +71,25 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0), "individuals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveManyBenefitsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveManyBenefitsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { - HrisBenefitIndividualRetrieveManyBenefitsPageAsync.Response.Builder() - .items(it) - .build() - } - .let { HrisBenefitIndividualRetrieveManyBenefitsPageAsync.of(this, params, it) } - } + .let { + HrisBenefitIndividualRetrieveManyBenefitsPageAsync.Response.Builder() + .items(it) + .build() + } + .let { HrisBenefitIndividualRetrieveManyBenefitsPageAsync.of(this, params, it) } + } } private val unenrollManyHandler: Handler> = @@ -108,25 +105,25 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.DELETE) .addPathSegments("employer", "benefits", params.getPathParam(0), "individuals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { unenrollManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { unenrollManyHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + .let { + HrisBenefitIndividualUnenrollManyPageAsync.Response.Builder() + .items(it) + .build() } - } - .let { - HrisBenefitIndividualUnenrollManyPageAsync.Response.Builder().items(it).build() - } - .let { HrisBenefitIndividualUnenrollManyPageAsync.of(this, params, it) } - } + .let { HrisBenefitIndividualUnenrollManyPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt index 4f6b91f9..39ffdf57 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AutomatedAsyncJob import com.tryfinch.api.models.AutomatedCreateResponse @@ -54,22 +55,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("jobs", "automated") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val retrieveHandler: Handler = @@ -84,21 +83,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "automated", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -118,21 +115,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "automated") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { JobAutomatedListPageAsync.of(this, params, it) } - } + .let { JobAutomatedListPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt index fff12786..9f74da9b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.JobManualRetrieveParams import com.tryfinch.api.models.ManualAsyncJob @@ -37,20 +38,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "manual", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt index 2a55ec43..9b77c262 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.PayGroupListResponse import com.tryfinch.api.models.PayGroupRetrieveResponse @@ -38,21 +39,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "pay-groups", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler> = @@ -68,22 +67,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "pay-groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - .let { PayrollPayGroupListPageAsync.Response.Builder().items(it).build() } - .let { PayrollPayGroupListPageAsync.of(this, params, it) } - } + .let { PayrollPayGroupListPageAsync.Response.Builder().items(it).build() } + .let { PayrollPayGroupListPageAsync.of(this, params, it) } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt index ada4bceb..379881e0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.CompanyUpdateResponse import com.tryfinch.api.models.SandboxCompanyUpdateParams @@ -35,21 +36,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "company") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt index c8aca0b9..6463b816 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.ConnectionCreateResponse import com.tryfinch.api.models.SandboxConnectionCreateParams @@ -42,21 +43,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "connections") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt index 762b2ab2..a85a58fc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncImpl.kt @@ -12,6 +12,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxDirectoryCreateParams import java.util.concurrent.CompletableFuture @@ -35,15 +36,11 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { createHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> response.use { createHandler.handle(it) } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt index 78ef3329..9cab1b70 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.EmploymentUpdateResponse import com.tryfinch.api.models.SandboxEmploymentUpdateParams @@ -36,21 +37,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "employment", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt index de91e53f..7d316a62 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.IndividualUpdateResponse import com.tryfinch.api.models.SandboxIndividualUpdateParams @@ -36,21 +37,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "individual", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt index 8dff1041..3dad33dd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.JobCreateResponse import com.tryfinch.api.models.SandboxJobCreateParams @@ -43,21 +44,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "jobs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt index a5727a6c..177b5020 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.PaymentCreateResponse import com.tryfinch.api.models.SandboxPaymentCreateParams @@ -35,21 +36,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "payment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt index 1abe036d..c2f45d45 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AccountCreateResponse import com.tryfinch.api.models.AccountUpdateResponse @@ -37,22 +38,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "connections", "accounts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -70,21 +69,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "connections", "accounts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt index 26649ef4..e0a201c2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepareAsync import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxJobConfiguration import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams @@ -37,21 +38,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("sandbox", "jobs", "configuration") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } } - } - } + } } private val updateHandler: Handler = @@ -67,21 +66,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "jobs", "configuration") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt index ffa7f7b3..c183fff7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.errors.FinchException import com.tryfinch.api.models.AccessTokenCreateParams @@ -59,11 +60,12 @@ internal constructor( .method(HttpMethod.POST) .addPathSegments("auth", "token") .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) + .replaceAllQueryParams(params._queryParams()) .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, modifiedParams.getBody())) + .putAllHeaders(params._headers()) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt index bc7054c4..fdf7a032 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AccountDisconnectParams import com.tryfinch.api.models.AccountIntrospectParams @@ -36,12 +37,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("disconnect") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { disconnectHandler.handle(it) } @@ -65,11 +63,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("introspect") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { introspectHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt index 957fca06..1a38cde8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.Provider import com.tryfinch.api.models.ProviderListPage @@ -34,11 +35,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("providers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt index 607d49fe..5a189dcf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.RequestForwardingForwardParams import com.tryfinch.api.models.RequestForwardingForwardResponse @@ -39,12 +40,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("forward") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { forwardHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt index 06288e2e..3ab145a8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.ConnectSessionNewParams import com.tryfinch.api.models.ConnectSessionReauthenticateParams @@ -36,12 +37,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("connect", "sessions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { newHandler.handle(it) } @@ -66,12 +64,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("connect", "sessions", "reauthenticate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { reauthenticateHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt index 2413ca6c..b74f55f1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.CompanyBenefit import com.tryfinch.api.models.CreateCompanyBenefitsResponse @@ -53,12 +54,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "benefits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -82,11 +80,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -111,12 +106,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "benefits", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -140,11 +132,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -170,11 +159,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", "meta") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listSupportedBenefitsHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt index 64ca8718..fcd07204 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.Company import com.tryfinch.api.models.HrisCompanyRetrieveParams @@ -33,11 +34,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "company") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt index 3aa8d3c1..42352c84 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisDirectoryListIndividualsPage import com.tryfinch.api.models.HrisDirectoryListIndividualsParams @@ -36,11 +37,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -67,11 +65,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listIndividualsHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt index 02e8a2ea..d437a40a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.DocumentListResponse import com.tryfinch.api.models.DocumentRetreiveResponse @@ -37,11 +38,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "documents") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -69,11 +67,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "documents", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retreiveHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt index 6921d929..96237c3a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisEmploymentRetrieveManyPage import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams @@ -35,12 +36,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "employment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveManyHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt index 1881d10a..6e36dfbc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisIndividualRetrieveManyPage import com.tryfinch.api.models.HrisIndividualRetrieveManyParams @@ -35,12 +36,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "individual") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveManyHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt index 90d9b664..516df812 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisPayStatementRetrieveManyPage import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams @@ -39,12 +40,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("employer", "pay-statement") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveManyHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt index 77895717..8a98780b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisPaymentListPage import com.tryfinch.api.models.HrisPaymentListParams @@ -34,11 +35,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "payment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt index ced77c2b..3e37d0ab 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisBenefitIndividualEnrolledIdsParams import com.tryfinch.api.models.HrisBenefitIndividualRetrieveManyBenefitsPage @@ -41,11 +42,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0), "enrolled") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { enrolledIdsHandler.handle(it) } @@ -70,11 +68,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "benefits", params.getPathParam(0), "individuals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveManyBenefitsHandler.handle(it) } @@ -105,12 +100,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.DELETE) .addPathSegments("employer", "benefits", params.getPathParam(0), "individuals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { unenrollManyHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt index 16587ad7..1d052b01 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AutomatedAsyncJob import com.tryfinch.api.models.AutomatedCreateResponse @@ -53,12 +54,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("jobs", "automated") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -82,11 +80,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "automated", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -115,11 +110,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "automated") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt index d778e371..a27ce3cf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.JobManualRetrieveParams import com.tryfinch.api.models.ManualAsyncJob @@ -36,11 +37,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("jobs", "manual", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt index 342ced76..6a5b2bb5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt @@ -10,6 +10,7 @@ import com.tryfinch.api.core.handlers.withErrorHandler import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.PayGroupListResponse import com.tryfinch.api.models.PayGroupRetrieveResponse @@ -37,11 +38,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "pay-groups", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -66,11 +64,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("employer", "pay-groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt index 8d129e76..357332eb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.CompanyUpdateResponse import com.tryfinch.api.models.SandboxCompanyUpdateParams @@ -34,12 +35,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "company") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt index fdb3f00b..7782f62a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.ConnectionCreateResponse import com.tryfinch.api.models.SandboxConnectionCreateParams @@ -41,12 +42,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "connections") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt index 37888bfc..28ea047f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt @@ -12,6 +12,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxDirectoryCreateParams @@ -34,12 +35,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "directory") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { createHandler.handle(it) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt index 36c9e60b..09aca49d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.EmploymentUpdateResponse import com.tryfinch.api.models.SandboxEmploymentUpdateParams @@ -35,12 +36,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "employment", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt index 7724a499..4552a900 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.IndividualUpdateResponse import com.tryfinch.api.models.SandboxIndividualUpdateParams @@ -35,12 +36,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "individual", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt index c3a2e1ab..c8ff4910 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.JobCreateResponse import com.tryfinch.api.models.SandboxJobCreateParams @@ -42,12 +43,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "jobs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt index 5b2b2cbc..cdca7519 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.PaymentCreateResponse import com.tryfinch.api.models.SandboxPaymentCreateParams @@ -34,12 +35,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "payment") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt index 0fa881ec..75bdf536 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.AccountCreateResponse import com.tryfinch.api.models.AccountUpdateResponse @@ -36,12 +37,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "connections", "accounts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -68,12 +66,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "connections", "accounts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt index 78d271a8..5c5d808a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt @@ -11,6 +11,7 @@ import com.tryfinch.api.core.http.HttpMethod import com.tryfinch.api.core.http.HttpRequest import com.tryfinch.api.core.http.HttpResponse.Handler import com.tryfinch.api.core.json +import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxJobConfiguration import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams @@ -36,11 +37,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("sandbox", "jobs", "configuration") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -65,12 +63,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("sandbox", "jobs", "configuration") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } 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 e4779e68..3902baeb 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 @@ -18,7 +18,7 @@ class AccessTokenCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = AccessTokenCreateParams.builder() .code("") @@ -26,7 +26,7 @@ class AccessTokenCreateParamsTest { .clientSecret("") .redirectUri("https://example.com") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.code()).isEqualTo("") assertThat(body.clientId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -35,9 +35,9 @@ class AccessTokenCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = AccessTokenCreateParams.builder().code("").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.code()).isEqualTo("") } 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 f6ff3d0b..b32ec9ae 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 @@ -28,7 +28,7 @@ class ConnectSessionNewParamsTest { } @Test - fun getBody() { + fun body() { val params = ConnectSessionNewParams.builder() .customerId("x") @@ -46,7 +46,7 @@ class ConnectSessionNewParamsTest { .redirectUri("redirect_uri") .sandbox(ConnectSessionNewParams.Sandbox.FINCH) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.customerId()).isEqualTo("x") assertThat(body.customerName()).isEqualTo("x") @@ -67,14 +67,14 @@ class ConnectSessionNewParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = ConnectSessionNewParams.builder() .customerId("x") .customerName("x") .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.customerId()).isEqualTo("x") assertThat(body.customerName()).isEqualTo("x") 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 3bd60865..125f2e00 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 @@ -18,7 +18,7 @@ class ConnectSessionReauthenticateParamsTest { } @Test - fun getBody() { + fun body() { val params = ConnectSessionReauthenticateParams.builder() .connectionId("connection_id") @@ -26,7 +26,7 @@ class ConnectSessionReauthenticateParamsTest { .addProduct(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY) .redirectUri("https://example.com") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.connectionId()).isEqualTo("connection_id") assertThat(body.minutesToExpire()).contains(0L) @@ -36,10 +36,10 @@ class ConnectSessionReauthenticateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = ConnectSessionReauthenticateParams.builder().connectionId("connection_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.connectionId()).isEqualTo("connection_id") } 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 342c46e5..a191b0e6 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 @@ -17,14 +17,14 @@ class HrisBenefitCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisBenefitCreateParams.builder() .description("description") .frequency(BenefitFrequency.ONE_TIME) .type(BenefitType._401K) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.description()).contains("description") assertThat(body.frequency()).contains(BenefitFrequency.ONE_TIME) @@ -32,9 +32,9 @@ class HrisBenefitCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisBenefitCreateParams.builder().build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt index a49f8c39..12466e09 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt @@ -19,7 +19,7 @@ class HrisBenefitIndividualRetrieveManyBenefitsParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = HrisBenefitIndividualRetrieveManyBenefitsParams.builder() .benefitId("benefit_id") @@ -32,17 +32,17 @@ class HrisBenefitIndividualRetrieveManyBenefitsParamsTest { "individual_ids", "d675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a" ) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = HrisBenefitIndividualRetrieveManyBenefitsParams.builder() .benefitId("benefit_id") .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @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 855cb1af..1c3290da 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 @@ -16,22 +16,22 @@ class HrisBenefitIndividualUnenrollManyParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisBenefitIndividualUnenrollManyParams.builder() .benefitId("benefit_id") .addIndividualId("string") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.individualIds()).contains(listOf("string")) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisBenefitIndividualUnenrollManyParams.builder().benefitId("benefit_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } 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 cc9b6ab7..21fb27a1 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 @@ -13,21 +13,21 @@ class HrisBenefitUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisBenefitUpdateParams.builder() .benefitId("benefit_id") .description("description") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.description()).contains("description") } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisBenefitUpdateParams.builder().benefitId("benefit_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt index 1b52e5af..2780e64a 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt @@ -14,18 +14,18 @@ class HrisDirectoryListIndividualsParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = HrisDirectoryListIndividualsParams.builder().limit(0L).offset(0L).build() val expected = QueryParams.builder() expected.put("limit", "0") expected.put("offset", "0") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = HrisDirectoryListIndividualsParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt index bf7133bb..d1a99b93 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt @@ -14,18 +14,18 @@ class HrisDirectoryListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = HrisDirectoryListParams.builder().limit(0L).offset(0L).build() val expected = QueryParams.builder() expected.put("limit", "0") expected.put("offset", "0") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = HrisDirectoryListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt index c620c19c..a7d36052 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt @@ -19,7 +19,7 @@ class HrisDocumentListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = HrisDocumentListParams.builder() .addIndividualId("string") @@ -32,13 +32,13 @@ class HrisDocumentListParamsTest { expected.put("limit", "0") expected.put("offset", "0") expected.put("types[]", HrisDocumentListParams.Type.W4_2020.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = HrisDocumentListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt index 51003d77..1c72001c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt @@ -19,7 +19,7 @@ class HrisEmploymentRetrieveManyParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisEmploymentRetrieveManyParams.builder() .addRequest( @@ -28,7 +28,7 @@ class HrisEmploymentRetrieveManyParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( @@ -41,7 +41,7 @@ class HrisEmploymentRetrieveManyParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisEmploymentRetrieveManyParams.builder() .addRequest( @@ -50,7 +50,7 @@ class HrisEmploymentRetrieveManyParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( 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 03e798a0..ebb5c83e 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 @@ -22,7 +22,7 @@ class HrisIndividualRetrieveManyParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisIndividualRetrieveManyParams.builder() .options( @@ -34,7 +34,7 @@ class HrisIndividualRetrieveManyParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.options()) .contains( @@ -51,9 +51,9 @@ class HrisIndividualRetrieveManyParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisIndividualRetrieveManyParams.builder().build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt index 2c9c7b1b..9c7b8d5c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt @@ -21,7 +21,7 @@ class HrisPayStatementRetrieveManyParamsTest { } @Test - fun getBody() { + fun body() { val params = HrisPayStatementRetrieveManyParams.builder() .addRequest( @@ -32,7 +32,7 @@ class HrisPayStatementRetrieveManyParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( @@ -47,14 +47,14 @@ class HrisPayStatementRetrieveManyParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = HrisPayStatementRetrieveManyParams.builder() .addRequest( HrisPayStatementRetrieveManyParams.Request.builder().paymentId("string").build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt index ba8f5d39..a3cc92d8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt @@ -18,7 +18,7 @@ class HrisPaymentListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = HrisPaymentListParams.builder() .endDate(LocalDate.parse("2021-01-01")) @@ -27,11 +27,11 @@ class HrisPaymentListParamsTest { val expected = QueryParams.builder() expected.put("end_date", "2021-01-01") expected.put("start_date", "2021-01-01") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = HrisPaymentListParams.builder() .endDate(LocalDate.parse("2021-01-01")) @@ -40,6 +40,6 @@ class HrisPaymentListParamsTest { val expected = QueryParams.builder() expected.put("end_date", "2021-01-01") expected.put("start_date", "2021-01-01") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt index 9716e659..38336088 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt @@ -14,18 +14,18 @@ class JobAutomatedListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = JobAutomatedListParams.builder().limit(0L).offset(0L).build() val expected = QueryParams.builder() expected.put("limit", "0") expected.put("offset", "0") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = JobAutomatedListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt index c018d32f..a6d57d6c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt @@ -17,7 +17,7 @@ class PayrollPayGroupListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = PayrollPayGroupListParams.builder() .individualId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -26,13 +26,13 @@ class PayrollPayGroupListParamsTest { val expected = QueryParams.builder() expected.put("individual_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") expected.put("pay_frequencies[]", "string") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = PayrollPayGroupListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } 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 7cf03bd5..acf13f1d 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 @@ -20,7 +20,7 @@ class RequestForwardingForwardParamsTest { } @Test - fun getBody() { + fun body() { val params = RequestForwardingForwardParams.builder() .method("POST") @@ -29,22 +29,22 @@ class RequestForwardingForwardParamsTest { .headers(JsonValue.from(mapOf("content-type" to "application/json"))) .params(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.method()).isEqualTo("POST") assertThat(body.route()).isEqualTo("/people/search") assertThat(body.data()).isEmpty - assertThat(body._headers()) + assertThat(body._headers_()) .isEqualTo(JsonValue.from(mapOf("content-type" to "application/json"))) assertThat(body._params()) .isEqualTo(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = RequestForwardingForwardParams.builder().method("POST").route("/people/search").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.method()).isEqualTo("POST") assertThat(body.route()).isEqualTo("/people/search") 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 6d1d63ec..87056b82 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 @@ -53,7 +53,7 @@ class SandboxCompanyUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxCompanyUpdateParams.builder() .addAccount( @@ -98,7 +98,7 @@ class SandboxCompanyUpdateParamsTest { .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.accounts()) .contains( @@ -154,7 +154,7 @@ class SandboxCompanyUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxCompanyUpdateParams.builder() .addAccount(SandboxCompanyUpdateParams.Account.builder().build()) @@ -166,7 +166,7 @@ class SandboxCompanyUpdateParamsTest { .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.accounts()) .contains(listOf(SandboxCompanyUpdateParams.Account.builder().build())) 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 97201e02..bfc6e692 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 @@ -18,7 +18,7 @@ class SandboxConnectionAccountCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxConnectionAccountCreateParams.builder() .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -28,7 +28,7 @@ class SandboxConnectionAccountCreateParamsTest { ) .addProduct("string") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.companyId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.providerId()).isEqualTo("provider_id") @@ -38,13 +38,13 @@ class SandboxConnectionAccountCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxConnectionAccountCreateParams.builder() .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .providerId("provider_id") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.companyId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.providerId()).isEqualTo("provider_id") 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 1e5682f5..272c2a9e 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 @@ -15,20 +15,20 @@ class SandboxConnectionAccountUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxConnectionAccountUpdateParams.builder() .connectionStatus(ConnectionStatusType.PENDING) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.connectionStatus()).contains(ConnectionStatusType.PENDING) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxConnectionAccountUpdateParams.builder().build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } } 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 3c0b37d6..2e27158c 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 @@ -18,7 +18,7 @@ class SandboxConnectionCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxConnectionCreateParams.builder() .providerId("provider_id") @@ -26,7 +26,7 @@ class SandboxConnectionCreateParamsTest { .employeeSize(0L) .addProduct("string") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) @@ -36,9 +36,9 @@ class SandboxConnectionCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxConnectionCreateParams.builder().providerId("provider_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.providerId()).isEqualTo("provider_id") } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt index fe44428f..6df9ae72 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt @@ -124,7 +124,7 @@ class SandboxDirectoryCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxDirectoryCreateParams.builder() .addBody( @@ -245,7 +245,7 @@ class SandboxDirectoryCreateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body) .isEqualTo( @@ -370,12 +370,12 @@ class SandboxDirectoryCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxDirectoryCreateParams.builder() .addBody(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build()) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body) .isEqualTo( 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 0103cc1a..f50df668 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 @@ -69,7 +69,7 @@ class SandboxEmploymentUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxEmploymentUpdateParams.builder() .individualId("individual_id") @@ -127,7 +127,7 @@ class SandboxEmploymentUpdateParamsTest { .startDate("3/4/2020") .title("title") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.classCode()).contains("class_code") assertThat(body.customFields()) @@ -197,9 +197,9 @@ class SandboxEmploymentUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxEmploymentUpdateParams.builder().individualId("individual_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } 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 3bbeb44c..fa6a19d3 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 @@ -48,7 +48,7 @@ class SandboxIndividualUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxIndividualUpdateParams.builder() .individualId("individual_id") @@ -86,7 +86,7 @@ class SandboxIndividualUpdateParamsTest { ) .ssn("ssn") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.dob()).contains("12/20/1989") assertThat(body.emails()) @@ -131,9 +131,9 @@ class SandboxIndividualUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxIndividualUpdateParams.builder().individualId("individual_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt index 0396c389..bcc15362 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt @@ -16,13 +16,13 @@ class SandboxJobConfigurationUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxJobConfigurationUpdateParams.builder() .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.completionStatus()) .isEqualTo(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) @@ -30,13 +30,13 @@ class SandboxJobConfigurationUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxJobConfigurationUpdateParams.builder() .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.completionStatus()) .isEqualTo(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt index dadcf231..c2b018f2 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt @@ -13,19 +13,19 @@ class SandboxJobCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxJobCreateParams.builder().type(SandboxJobCreateParams.Type.DATA_SYNC_ALL).build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.type()).isEqualTo(SandboxJobCreateParams.Type.DATA_SYNC_ALL) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxJobCreateParams.builder().type(SandboxJobCreateParams.Type.DATA_SYNC_ALL).build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.type()).isEqualTo(SandboxJobCreateParams.Type.DATA_SYNC_ALL) } 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 939d5ebe..bbb9505e 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 @@ -61,7 +61,7 @@ class SandboxPaymentCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = SandboxPaymentCreateParams.builder() .endDate("end_date") @@ -112,7 +112,7 @@ class SandboxPaymentCreateParamsTest { ) .startDate("start_date") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.endDate()).contains("end_date") assertThat(body.payStatements()) @@ -167,9 +167,9 @@ class SandboxPaymentCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SandboxPaymentCreateParams.builder().build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } } From 6f997fed271b1d2ffab8c54c365d32993ea4b0b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 21:56:10 +0000 Subject: [PATCH 25/34] chore(internal): improve `RetryingHttpClientTest` (#421) --- .../api/core/http/RetryingHttpClientTest.kt | 86 ++++++++++++------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt index 9b0bf771..e983bf93 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt @@ -7,7 +7,6 @@ import com.github.tomakehurst.wiremock.stubbing.Scenario import com.tryfinch.api.client.okhttp.OkHttpClient import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource @@ -22,21 +21,25 @@ internal class RetryingHttpClientTest { resetAllScenarios() } - @Test - fun byDefaultShouldNotAddIdempotencyHeaderToRequest() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute(async: Boolean) { stubFor(post(urlPathEqualTo("/something")).willReturn(ok())) val retryingClient = RetryingHttpClient.builder().httpClient(httpClient).build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) } - @Test - fun whenProvidedShouldAddIdempotencyHeaderToRequest() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withIdempotencyHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .withHeader("X-Some-Header", matching("stainless-java-retry-.+")) @@ -48,19 +51,24 @@ internal class RetryingHttpClientTest { .maxRetries(2) .idempotencyHeader("X-Some-Header") .build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) } @ParameterizedTest @ValueSource(booleans = [false, true]) - fun retryAfterHeader(async: Boolean) { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + fun execute_withRetryAfterHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // first we fail with a retry after header given as a date + // First we fail with a retry after header given as a date + .inScenario("foo") .whenScenarioStateIs(Scenario.STARTED) .willReturn( serviceUnavailable().withHeader("Retry-After", "Wed, 21 Oct 2015 07:28:00 GMT") @@ -69,14 +77,16 @@ internal class RetryingHttpClientTest { ) stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // then we fail with a retry after header given as a delay + // Then we fail with a retry after header given as a delay + .inScenario("foo") .whenScenarioStateIs("RETRY_AFTER_DATE") .willReturn(serviceUnavailable().withHeader("Retry-After", "1.234")) .willSetStateTo("RETRY_AFTER_DELAY") ) stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // then we return a success + // Then we return a success + .inScenario("foo") .whenScenarioStateIs("RETRY_AFTER_DELAY") .willReturn(ok()) .willSetStateTo("COMPLETED") @@ -85,8 +95,10 @@ internal class RetryingHttpClientTest { RetryingHttpClient.builder().httpClient(httpClient).maxRetries(2).build() val response = - if (async) retryingClient.executeAsync(request).get() - else retryingClient.execute(request) + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) assertThat(response.statusCode()).isEqualTo(200) verify( @@ -108,13 +120,7 @@ internal class RetryingHttpClientTest { @ParameterizedTest @ValueSource(booleans = [false, true]) - fun overwriteRetryCountHeader(async: Boolean) { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegment("something") - .putHeader("x-stainless-retry-count", "42") - .build() + fun execute_withOverwrittenRetryCountHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .inScenario("foo") // first we fail with a retry after header given as a date @@ -135,8 +141,14 @@ internal class RetryingHttpClientTest { RetryingHttpClient.builder().httpClient(httpClient).maxRetries(2).build() val response = - if (async) retryingClient.executeAsync(request).get() - else retryingClient.execute(request) + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegment("something") + .putHeader("x-stainless-retry-count", "42") + .build(), + async + ) assertThat(response.statusCode()).isEqualTo(200) verify( @@ -146,10 +158,9 @@ internal class RetryingHttpClientTest { ) } - @Test - fun retryAfterMsHeader() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withRetryAfterMsHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .inScenario("foo") @@ -166,8 +177,17 @@ internal class RetryingHttpClientTest { ) val retryingClient = RetryingHttpClient.builder().httpClient(httpClient).maxRetries(1).build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(2, postRequestedFor(urlPathEqualTo("/something"))) } + + private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = + if (async) executeAsync(request).get() else execute(request) } From 2694656b93676e6758c71fc55beccf74fe495e00 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 22:17:38 +0000 Subject: [PATCH 26/34] fix(client): compiler errors (#422) --- .../kotlin/com/tryfinch/api/models/Company.kt | 4 ++-- .../api/models/CompanyUpdateResponse.kt | 4 ++-- .../com/tryfinch/api/models/EmploymentData.kt | 2 +- .../api/models/EmploymentUpdateResponse.kt | 2 +- .../com/tryfinch/api/models/Individual.kt | 2 +- .../api/models/IndividualUpdateResponse.kt | 2 +- .../com/tryfinch/api/models/PayStatement.kt | 8 +++---- .../api/models/SandboxCompanyUpdateParams.kt | 4 ++-- .../models/SandboxDirectoryCreateParams.kt | 4 ++-- .../models/SandboxEmploymentUpdateParams.kt | 2 +- .../models/SandboxIndividualUpdateParams.kt | 2 +- .../api/models/SandboxPaymentCreateParams.kt | 8 +++---- .../api/services/ServiceParamsTest.kt | 24 +++++++++++-------- 13 files changed, 36 insertions(+), 32 deletions(-) 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 63132648..0314da32 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 @@ -126,11 +126,11 @@ private constructor( id() accounts().ifPresent { it.forEach { it.validate() } } - departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + departments().ifPresent { it.forEach { it?.validate() } } ein() entity().ifPresent { it.validate() } legalName() - locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + locations().ifPresent { it.forEach { it?.validate() } } primaryEmail() primaryPhoneNumber() validated = true 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 8547eeaa..94219b90 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 @@ -118,11 +118,11 @@ private constructor( } accounts().ifPresent { it.forEach { it.validate() } } - departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + departments().ifPresent { it.forEach { it?.validate() } } ein() entity().ifPresent { it.validate() } legalName() - locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + locations().ifPresent { it.forEach { it?.validate() } } primaryEmail() primaryPhoneNumber() validated = true 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 a865af39..d0d6ea8d 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 @@ -255,7 +255,7 @@ private constructor( endDate() firstName() income().ifPresent { it.validate() } - incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() lastName() latestRehireDate() 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 0929b1e5..4ea8b3f5 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 @@ -236,7 +236,7 @@ private constructor( endDate() firstName() income().ifPresent { it.validate() } - incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() lastName() latestRehireDate() 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 be075178..b26b4aba 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 @@ -173,7 +173,7 @@ private constructor( gender() lastName() middleName() - phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() residence().ifPresent { it.validate() } ssn() 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 6a5bcd42..d1864f48 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 @@ -173,7 +173,7 @@ private constructor( gender() lastName() middleName() - phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() residence().ifPresent { it.validate() } ssn() 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 e5cc07dd..d529522b 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 @@ -130,14 +130,14 @@ private constructor( return@apply } - earnings().ifPresent { it.forEach { it.ifPresent { it.validate() } } } - employeeDeductions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } - employerContributions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + earnings().ifPresent { it.forEach { it?.validate() } } + employeeDeductions().ifPresent { it.forEach { it?.validate() } } + employerContributions().ifPresent { it.forEach { it?.validate() } } grossPay().ifPresent { it.validate() } individualId() netPay().ifPresent { it.validate() } paymentMethod() - taxes().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + taxes().ifPresent { it.forEach { it?.validate() } } totalHours() type() validated = true 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 6c289cb4..1d725117 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 @@ -191,11 +191,11 @@ private constructor( } accounts().ifPresent { it.forEach { it.validate() } } - departments().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + departments().ifPresent { it.forEach { it?.validate() } } ein() entity().ifPresent { it.validate() } legalName() - locations().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + locations().ifPresent { it.forEach { it?.validate() } } primaryEmail() primaryPhoneNumber() validated = true 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 f7963c72..da8089a4 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 @@ -507,14 +507,14 @@ private constructor( firstName() gender() income().ifPresent { it.validate() } - incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() lastName() latestRehireDate() location().ifPresent { it.validate() } manager().ifPresent { it.validate() } middleName() - phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() residence().ifPresent { it.validate() } sourceId() 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 68f7a4ef..251c39f9 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 @@ -382,7 +382,7 @@ private constructor( endDate() firstName() income().ifPresent { it.validate() } - incomeHistory().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() lastName() latestRehireDate() 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 a859bd33..694c9061 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 @@ -287,7 +287,7 @@ private constructor( gender() lastName() middleName() - phoneNumbers().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() residence().ifPresent { it.validate() } ssn() 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 8d31c28d..c0829f94 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 @@ -490,14 +490,14 @@ private constructor( return@apply } - earnings().ifPresent { it.forEach { it.ifPresent { it.validate() } } } - employeeDeductions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } - employerContributions().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + earnings().ifPresent { it.forEach { it?.validate() } } + employeeDeductions().ifPresent { it.forEach { it?.validate() } } + employerContributions().ifPresent { it.forEach { it?.validate() } } grossPay().ifPresent { it.validate() } individualId() netPay().ifPresent { it.validate() } paymentMethod() - taxes().ifPresent { it.forEach { it.ifPresent { it.validate() } } } + taxes().ifPresent { it.forEach { it?.validate() } } totalHours() type() validated = true diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt index 94149e82..555e8b13 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt @@ -61,16 +61,20 @@ class ServiceParamsTest { val apiResponse = HrisDirectoryListPage.Response.builder() - .addIndividual( - IndividualInDirectory.builder() - .id("id") - .department(IndividualInDirectory.Department.builder().name("name").build()) - .firstName("first_name") - .isActive(true) - .lastName("last_name") - .manager(IndividualInDirectory.Manager.builder().id("id").build()) - .middleName("middle_name") - .build() + .individuals( + listOf( + IndividualInDirectory.builder() + .id("id") + .department( + IndividualInDirectory.Department.builder().name("name").build() + ) + .firstName("first_name") + .isActive(true) + .lastName("last_name") + .manager(IndividualInDirectory.Manager.builder().id("id").build()) + .middleName("middle_name") + .build() + ) ) .paging(Paging.builder().count(0L).offset(0L).build()) .build() From 1c877e649c7907d3140dbd1e5d437b45db01672f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:40:33 +0000 Subject: [PATCH 27/34] fix(client): don't leak responses when retrying (#423) --- .../api/core/http/RetryingHttpClient.kt | 36 +++++++------ .../api/core/http/RetryingHttpClientTest.kt | 52 ++++++++++++++++++- 2 files changed, 71 insertions(+), 17 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt index 9ea4b500..29095887 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt @@ -57,15 +57,17 @@ private constructor( } response - } catch (t: Throwable) { - if (++retries > maxRetries || !shouldRetry(t)) { - throw t + } catch (throwable: Throwable) { + if (++retries > maxRetries || !shouldRetry(throwable)) { + throw throwable } null } val backoffMillis = getRetryBackoffMillis(retries, response) + // All responses must be closed, so close the failed one before retrying. + response?.close() Thread.sleep(backoffMillis.toMillis()) } } @@ -113,6 +115,8 @@ private constructor( } val backoffMillis = getRetryBackoffMillis(retries, response) + // All responses must be closed, so close the failed one before retrying. + response?.close() return sleepAsync(backoffMillis.toMillis()).thenCompose { executeWithRetries(requestWithRetryCount, requestOptions) } @@ -223,23 +227,23 @@ private constructor( return Duration.ofNanos((TimeUnit.SECONDS.toNanos(1) * backoffSeconds * jitter).toLong()) } - private fun sleepAsync(millis: Long): CompletableFuture { - val future = CompletableFuture() - TIMER.schedule( - object : TimerTask() { - override fun run() { - future.complete(null) - } - }, - millis - ) - return future - } - companion object { private val TIMER = Timer("RetryingHttpClient", true) + private fun sleepAsync(millis: Long): CompletableFuture { + val future = CompletableFuture() + TIMER.schedule( + object : TimerTask() { + override fun run() { + future.complete(null) + } + }, + millis + ) + return future + } + @JvmStatic fun builder() = Builder() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt index e983bf93..40ab4321 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt @@ -5,6 +5,9 @@ import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.github.tomakehurst.wiremock.stubbing.Scenario import com.tryfinch.api.client.okhttp.OkHttpClient +import com.tryfinch.api.core.RequestOptions +import java.io.InputStream +import java.util.concurrent.CompletableFuture import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.params.ParameterizedTest @@ -13,11 +16,49 @@ import org.junit.jupiter.params.provider.ValueSource @WireMockTest internal class RetryingHttpClientTest { + private var openResponseCount = 0 private lateinit var httpClient: HttpClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { - httpClient = OkHttpClient.builder().baseUrl(wmRuntimeInfo.httpBaseUrl).build() + val okHttpClient = OkHttpClient.builder().baseUrl(wmRuntimeInfo.httpBaseUrl).build() + httpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions + ): HttpResponse = trackClose(okHttpClient.execute(request, requestOptions)) + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions + ): CompletableFuture = + okHttpClient.executeAsync(request, requestOptions).thenApply { trackClose(it) } + + override fun close() = okHttpClient.close() + + private fun trackClose(response: HttpResponse): HttpResponse { + openResponseCount++ + return object : HttpResponse { + private var isClosed = false + + override fun statusCode(): Int = response.statusCode() + + override fun headers(): Headers = response.headers() + + override fun body(): InputStream = response.body() + + override fun close() { + response.close() + if (isClosed) { + return + } + openResponseCount-- + isClosed = true + } + } + } + } resetAllScenarios() } @@ -35,6 +76,7 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } @ParameterizedTest @@ -60,6 +102,7 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } @ParameterizedTest @@ -116,6 +159,7 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("2")) ) + assertNoResponseLeaks() } @ParameterizedTest @@ -156,6 +200,7 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("42")) ) + assertNoResponseLeaks() } @ParameterizedTest @@ -186,8 +231,13 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(2, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = if (async) executeAsync(request).get() else execute(request) + + // When retrying, all failed responses should be closed. Only the final returned response should + // be open. + private fun assertNoResponseLeaks() = assertThat(openResponseCount).isEqualTo(1) } From 856e1c9f646fb80df8f6751634d6f39ccdf633b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:06:11 +0000 Subject: [PATCH 28/34] docs: fix incorrect additional properties info (#424) --- README.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f97de1cf..551781b3 100644 --- a/README.md +++ b/README.md @@ -132,19 +132,7 @@ See [Pagination](#pagination) below for more information on transparently workin To make a request to the Finch API, you generally build an instance of the appropriate `Params` class. -In [Example: creating a resource](#example-creating-a-resource) above, we used the `HrisDirectoryListParams.builder()` to pass to the `list` method of the `directory` service. - -Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method. - -```java -import com.tryfinch.api.core.JsonValue; -import com.tryfinch.api.models.HrisDirectoryListParams; - -HrisDirectoryListParams params = HrisDirectoryListParams.builder() - // ... normal properties - .putAdditionalProperty("secret_param", JsonValue.from("4242")) - .build(); -``` +See [Undocumented request params](#undocumented-request-params) for how to send arbitrary parameters. ## Responses @@ -338,18 +326,26 @@ This library is typed for convenient access to the documented API. If you need t ### Undocumented request params -To make requests using undocumented parameters, you can provide or override parameters on the params object while building it. +In [Example: creating a resource](#example-creating-a-resource) above, we used the `HrisDirectoryListParams.builder()` to pass to the `list` method of the `directory` service. + +Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using raw setters: ```java -FooCreateParams address = FooCreateParams.builder() - .id("my_id") - .putAdditionalProperty("secret_prop", JsonValue.from("hello")) +import com.tryfinch.api.core.JsonValue; +import com.tryfinch.api.models.HrisDirectoryListParams; + +HrisDirectoryListParams params = HrisDirectoryListParams.builder() + .putAdditionalHeader("Secret-Header", "42") + .putAdditionalQueryParam("secret_query_param", "42") + .putAdditionalBodyProperty("secretProperty", JsonValue.from("42")) .build(); ``` +You can also use the `putAdditionalProperty` method on nested headers, query params, or body objects. + ### Undocumented response properties -To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. +To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `res._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. ## Logging From 84cd37eb0660362f57d92404e4ca17ad4c8340fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:42:43 +0000 Subject: [PATCH 29/34] chore(internal): codegen related update (#425) --- .../api/models/HrisDirectoryListIndividualsPage.kt | 7 ++++++- .../api/models/HrisDirectoryListIndividualsPageAsync.kt | 7 ++++++- .../com/tryfinch/api/models/HrisDirectoryListPage.kt | 7 ++++++- .../com/tryfinch/api/models/HrisDirectoryListPageAsync.kt | 7 ++++++- .../kotlin/com/tryfinch/api/models/JobAutomatedListPage.kt | 7 ++++++- .../com/tryfinch/api/models/JobAutomatedListPageAsync.kt | 7 ++++++- 6 files changed, 36 insertions(+), 6 deletions(-) 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 0173f5a2..41116b2f 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 @@ -48,7 +48,12 @@ private constructor( "HrisDirectoryListIndividualsPage{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !individuals().isEmpty() + if (individuals().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + individuals().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { 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 6a76f1ec..0f336524 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 @@ -49,7 +49,12 @@ private constructor( "HrisDirectoryListIndividualsPageAsync{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !individuals().isEmpty() + if (individuals().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + individuals().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { 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 e083b0d9..68aa5fb1 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 @@ -47,7 +47,12 @@ private constructor( "HrisDirectoryListPage{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !individuals().isEmpty() + if (individuals().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + individuals().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { 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 92bf1a3e..e7587ae6 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 @@ -48,7 +48,12 @@ private constructor( "HrisDirectoryListPageAsync{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !individuals().isEmpty() + if (individuals().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + individuals().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { 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 bbad9e28..8747fddf 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 @@ -51,7 +51,12 @@ private constructor( "JobAutomatedListPage{automatedService=$automatedService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !data().isEmpty() + if (data().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + data().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { 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 4a96ccc6..d93302c0 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 @@ -52,7 +52,12 @@ private constructor( "JobAutomatedListPageAsync{automatedService=$automatedService, params=$params, response=$response}" fun hasNextPage(): Boolean { - return !data().isEmpty() + if (data().isEmpty()) { + return false + } + + return paging().offset().orElse(0) + data().count() < + paging().count().orElse(Long.MAX_VALUE) } fun getNextPageParams(): Optional { From 77e6a7383806b0615a3bca5e25094b54cf427420 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:45:26 +0000 Subject: [PATCH 30/34] feat(api): api update (#426) --- .stats.yml | 2 +- .../api/models/JobAutomatedCreateParams.kt | 142 +++++++++++++++--- 2 files changed, 122 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef2aa86c..e2b36d04 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 40 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-9c0b41ca8713a9440c624b0d08de0e6cbd9486978188afab2286ae67d8a97817.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-33c66e078bce0755ba6ffea89b65cd065f406dae750be8a23dd0315b736f1c9f.yml 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 036451bf..9e723312 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 @@ -523,24 +523,20 @@ private constructor( class W4FormEmployeeSync @JsonCreator private constructor( - @JsonProperty("individual_id") + @JsonProperty("params") @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), + private val params: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(): String = individualId.getRequired("individual_id") + fun params(): Params = params.getRequired("params") /** The type of job to start. */ fun type(): Type = type.getRequired("type") - /** The unique ID of the individual for W-4 data sync. */ - @JsonProperty("individual_id") - @ExcludeMissing - fun _individualId(): JsonField = individualId + @JsonProperty("params") @ExcludeMissing fun _params(): JsonField = params /** The type of job to start. */ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type @@ -556,7 +552,7 @@ private constructor( return@apply } - individualId() + params().validate() type() validated = true } @@ -571,24 +567,20 @@ private constructor( /** A builder for [W4FormEmployeeSync]. */ class Builder internal constructor() { - private var individualId: JsonField? = null + private var params: JsonField? = null private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - individualId = w4FormEmployeeSync.individualId + params = w4FormEmployeeSync.params type = w4FormEmployeeSync.type additionalProperties = w4FormEmployeeSync.additionalProperties.toMutableMap() } - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + fun params(params: Params) = params(JsonField.of(params)) - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId - } + fun params(params: JsonField) = apply { this.params = params } /** The type of job to start. */ fun type(type: Type) = type(JsonField.of(type)) @@ -617,12 +609,120 @@ private constructor( fun build(): W4FormEmployeeSync = W4FormEmployeeSync( - checkRequired("individualId", individualId), + checkRequired("params", params), checkRequired("type", type), additionalProperties.toImmutable(), ) } + @NoAutoDetect + class Params + @JsonCreator + private constructor( + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(): String = individualId.getRequired("individual_id") + + /** The unique ID of the individual for W-4 data sync. */ + @JsonProperty("individual_id") + @ExcludeMissing + fun _individualId(): JsonField = individualId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Params = apply { + if (validated) { + return@apply + } + + individualId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Params]. */ + class Builder internal constructor() { + + private var individualId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(params: Params) = apply { + individualId = params.individualId + additionalProperties = params.additionalProperties.toMutableMap() + } + + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + fun build(): Params = + Params( + checkRequired("individualId", individualId), + additionalProperties.toImmutable() + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Params && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(individualId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Params{individualId=$individualId, additionalProperties=$additionalProperties}" + } + /** The type of job to start. */ class Type @JsonCreator @@ -715,17 +815,17 @@ private constructor( return true } - return /* spotless:off */ other is W4FormEmployeeSync && individualId == other.individualId && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is W4FormEmployeeSync && params == other.params && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individualId, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(params, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "W4FormEmployeeSync{individualId=$individualId, type=$type, additionalProperties=$additionalProperties}" + "W4FormEmployeeSync{params=$params, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { From daf9de711530f47caf431d316f682c82139cd26a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:42:48 +0000 Subject: [PATCH 31/34] feat(api): api update (#427) --- .stats.yml | 2 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 147 +++++++++++++++++- .../api/models/AutomatedAsyncJobTest.kt | 3 + 3 files changed, 143 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index e2b36d04..119fd722 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 40 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-33c66e078bce0755ba6ffea89b65cd065f406dae750be8a23dd0315b736f1c9f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-97bf4795deec23d1bfd3b0b5fd77c2a93c87f10e5fa3375ab30f4a877be97f53.yml 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 409069d9..83f762e9 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,6 +34,9 @@ private constructor( @JsonProperty("job_url") @ExcludeMissing private val jobUrl: JsonField = JsonMissing.of(), + @JsonProperty("params") + @ExcludeMissing + private val params: JsonField = JsonMissing.of(), @JsonProperty("scheduled_at") @ExcludeMissing private val scheduledAt: JsonField = JsonMissing.of(), @@ -63,6 +66,9 @@ private constructor( /** The url that can be used to retrieve the job status */ fun jobUrl(): String = jobUrl.getRequired("job_url") + /** The input parameters for the job. */ + fun params(): Optional = Optional.ofNullable(params.getNullable("params")) + /** * 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. @@ -76,7 +82,7 @@ private constructor( fun status(): Status = status.getRequired("status") - /** Only `data_sync_all` currently supported */ + /** The type of automated job */ fun type(): Type = type.getRequired("type") /** The datetime the job completed. */ @@ -98,6 +104,9 @@ private constructor( /** The url that can be used to retrieve the job status */ @JsonProperty("job_url") @ExcludeMissing fun _jobUrl(): JsonField = jobUrl + /** The input parameters for the job. */ + @JsonProperty("params") @ExcludeMissing fun _params(): JsonField = params + /** * 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. @@ -113,7 +122,7 @@ private constructor( @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status - /** Only `data_sync_all` currently supported */ + /** The type of automated job */ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type @JsonAnyGetter @@ -131,6 +140,7 @@ private constructor( createdAt() jobId() jobUrl() + params().ifPresent { it.validate() } scheduledAt() startedAt() status() @@ -152,6 +162,7 @@ private constructor( private var createdAt: JsonField? = null private var jobId: JsonField? = null private var jobUrl: JsonField? = null + private var params: JsonField? = null private var scheduledAt: JsonField? = null private var startedAt: JsonField? = null private var status: JsonField? = null @@ -164,6 +175,7 @@ private constructor( createdAt = automatedAsyncJob.createdAt jobId = automatedAsyncJob.jobId jobUrl = automatedAsyncJob.jobUrl + params = automatedAsyncJob.params scheduledAt = automatedAsyncJob.scheduledAt startedAt = automatedAsyncJob.startedAt status = automatedAsyncJob.status @@ -210,6 +222,15 @@ private constructor( /** The url that can be used to retrieve the job status */ fun jobUrl(jobUrl: JsonField) = apply { this.jobUrl = jobUrl } + /** The input parameters for the job. */ + fun params(params: Params?) = params(JsonField.ofNullable(params)) + + /** The input parameters for the job. */ + fun params(params: Optional) = params(params.orElse(null)) + + /** The input parameters for the job. */ + fun params(params: JsonField) = apply { this.params = params } + /** * 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 @@ -248,10 +269,10 @@ private constructor( fun status(status: JsonField) = apply { this.status = status } - /** Only `data_sync_all` currently supported */ + /** The type of automated job */ fun type(type: Type) = type(JsonField.of(type)) - /** Only `data_sync_all` currently supported */ + /** The type of automated job */ fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { @@ -279,6 +300,7 @@ private constructor( checkRequired("createdAt", createdAt), checkRequired("jobId", jobId), checkRequired("jobUrl", jobUrl), + checkRequired("params", params), checkRequired("scheduledAt", scheduledAt), checkRequired("startedAt", startedAt), checkRequired("status", status), @@ -287,6 +309,109 @@ private constructor( ) } + /** The input parameters for the job. */ + @NoAutoDetect + class Params + @JsonCreator + private constructor( + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** The ID of the individual that the job was completed for. */ + fun individualId(): Optional = + Optional.ofNullable(individualId.getNullable("individual_id")) + + /** The ID of the individual that the job was completed for. */ + @JsonProperty("individual_id") + @ExcludeMissing + fun _individualId(): JsonField = individualId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Params = apply { + if (validated) { + return@apply + } + + individualId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Params]. */ + class Builder internal constructor() { + + private var individualId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(params: Params) = apply { + individualId = params.individualId + additionalProperties = params.additionalProperties.toMutableMap() + } + + /** The ID of the individual that the job was completed for. */ + fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + + /** The ID of the individual that the job was completed for. */ + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + fun build(): Params = Params(individualId, additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Params && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(individualId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Params{individualId=$individualId, additionalProperties=$additionalProperties}" + } + class Status @JsonCreator private constructor( @@ -402,7 +527,7 @@ private constructor( override fun toString() = value.toString() } - /** Only `data_sync_all` currently supported */ + /** The type of automated job */ class Type @JsonCreator private constructor( @@ -423,12 +548,15 @@ private constructor( @JvmField val DATA_SYNC_ALL = of("data_sync_all") + @JvmField val W4_FORM_EMPLOYEE_SYNC = of("w4_form_employee_sync") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } /** An enum containing [Type]'s known values. */ enum class Known { DATA_SYNC_ALL, + W4_FORM_EMPLOYEE_SYNC, } /** @@ -442,6 +570,7 @@ private constructor( */ enum class Value { DATA_SYNC_ALL, + W4_FORM_EMPLOYEE_SYNC, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -456,6 +585,7 @@ private constructor( fun value(): Value = when (this) { DATA_SYNC_ALL -> Value.DATA_SYNC_ALL + W4_FORM_EMPLOYEE_SYNC -> Value.W4_FORM_EMPLOYEE_SYNC else -> Value._UNKNOWN } @@ -470,6 +600,7 @@ private constructor( fun known(): Known = when (this) { DATA_SYNC_ALL -> Known.DATA_SYNC_ALL + W4_FORM_EMPLOYEE_SYNC -> Known.W4_FORM_EMPLOYEE_SYNC else -> throw FinchInvalidDataException("Unknown Type: $value") } @@ -493,15 +624,15 @@ private constructor( return true } - 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 */ + return /* spotless:off */ other is AutomatedAsyncJob && completedAt == other.completedAt && createdAt == other.createdAt && jobId == other.jobId && jobUrl == other.jobUrl && params == other.params && 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(completedAt, createdAt, jobId, jobUrl, scheduledAt, startedAt, status, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(completedAt, createdAt, jobId, jobUrl, params, scheduledAt, startedAt, status, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AutomatedAsyncJob{completedAt=$completedAt, createdAt=$createdAt, jobId=$jobId, jobUrl=$jobUrl, scheduledAt=$scheduledAt, startedAt=$startedAt, status=$status, type=$type, additionalProperties=$additionalProperties}" + "AutomatedAsyncJob{completedAt=$completedAt, createdAt=$createdAt, jobId=$jobId, jobUrl=$jobUrl, params=$params, scheduledAt=$scheduledAt, startedAt=$startedAt, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AutomatedAsyncJobTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AutomatedAsyncJobTest.kt index 7393f7a9..4b581077 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AutomatedAsyncJobTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AutomatedAsyncJobTest.kt @@ -16,6 +16,7 @@ class AutomatedAsyncJobTest { .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .jobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .jobUrl("job_url") + .params(AutomatedAsyncJob.Params.builder().individualId("individual_id").build()) .scheduledAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .startedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .status(AutomatedAsyncJob.Status.PENDING) @@ -28,6 +29,8 @@ class AutomatedAsyncJobTest { .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(automatedAsyncJob.jobId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(automatedAsyncJob.jobUrl()).isEqualTo("job_url") + assertThat(automatedAsyncJob.params()) + .contains(AutomatedAsyncJob.Params.builder().individualId("individual_id").build()) assertThat(automatedAsyncJob.scheduledAt()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(automatedAsyncJob.startedAt()) From d17227dcce3a87afae057009635f749908e6397f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:41:31 +0000 Subject: [PATCH 32/34] feat(client): send client-side timeout headers (#428) --- .../api/client/okhttp/OkHttpClient.kt | 94 +++++++++++-------- 1 file changed, 55 insertions(+), 39 deletions(-) diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt index 8ab9b87e..f924c082 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt @@ -31,38 +31,11 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) : HttpClient { - private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient { - val clientBuilder = okHttpClient.newBuilder() - - val logLevel = - when (System.getenv("FINCH_LOG")?.lowercase()) { - "info" -> HttpLoggingInterceptor.Level.BASIC - "debug" -> HttpLoggingInterceptor.Level.BODY - else -> null - } - if (logLevel != null) { - clientBuilder.addNetworkInterceptor( - HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } - ) - } - - val timeout = requestOptions.timeout - if (timeout != null) { - clientBuilder - .connectTimeout(timeout) - .readTimeout(timeout) - .writeTimeout(timeout) - .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30)) - } - - return clientBuilder.build() - } - override fun execute( request: HttpRequest, requestOptions: RequestOptions, ): HttpResponse { - val call = getClient(requestOptions).newCall(request.toRequest()) + val call = newCall(request, requestOptions) return try { call.execute().toResponse() @@ -81,18 +54,18 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val request.body?.run { future.whenComplete { _, _ -> close() } } - val call = getClient(requestOptions).newCall(request.toRequest()) - call.enqueue( - object : Callback { - override fun onResponse(call: Call, response: Response) { - future.complete(response.toResponse()) - } + newCall(request, requestOptions) + .enqueue( + object : Callback { + override fun onResponse(call: Call, response: Response) { + future.complete(response.toResponse()) + } - override fun onFailure(call: Call, e: IOException) { - future.completeExceptionally(FinchIoException("Request failed", e)) + override fun onFailure(call: Call, e: IOException) { + future.completeExceptionally(FinchIoException("Request failed", e)) + } } - } - ) + ) return future } @@ -103,7 +76,35 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val okHttpClient.cache?.close() } - private fun HttpRequest.toRequest(): Request { + private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call { + val clientBuilder = okHttpClient.newBuilder() + + val logLevel = + when (System.getenv("FINCH_LOG")?.lowercase()) { + "info" -> HttpLoggingInterceptor.Level.BASIC + "debug" -> HttpLoggingInterceptor.Level.BODY + else -> null + } + if (logLevel != null) { + clientBuilder.addNetworkInterceptor( + HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } + ) + } + + val timeout = requestOptions.timeout + if (timeout != null) { + clientBuilder + .connectTimeout(timeout) + .readTimeout(timeout) + .writeTimeout(timeout) + .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30)) + } + + val client = clientBuilder.build() + return client.newCall(request.toRequest(client)) + } + + private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { var body: RequestBody? = body?.toRequestBody() // OkHttpClient always requires a request body for PUT and POST methods. if (body == null && (method == HttpMethod.PUT || method == HttpMethod.POST)) { @@ -115,6 +116,21 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val headers.values(name).forEach { builder.header(name, it) } } + if ( + !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 + ) { + builder.header( + "X-Stainless-Read-Timeout", + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString() + ) + } + if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { + builder.header( + "X-Stainless-Timeout", + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString() + ) + } + return builder.build() } From abe41abe42c306d6c19df15151dcea02908a4e98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:15:30 +0000 Subject: [PATCH 33/34] fix(api): add missing `@MustBeClosed` annotations (#429) fix(api): switch `CompletableFuture` to `CompletableFuture` fix(client): always provide a body for `PATCH` methods fix(client): add missing validation calls on response chore(internal): minor formatting/style changes chore(internal): rename some tests --- .../api/client/okhttp/OkHttpClient.kt | 12 ++- .../async/AccessTokenServiceAsyncImpl.kt | 4 +- .../services/async/AccountServiceAsyncImpl.kt | 8 +- .../async/ProviderServiceAsyncImpl.kt | 13 ++- .../RequestForwardingServiceAsyncImpl.kt | 4 +- .../async/connect/SessionServiceAsyncImpl.kt | 8 +- .../async/hris/BenefitServiceAsyncImpl.kt | 40 ++++---- .../async/hris/CompanyServiceAsyncImpl.kt | 4 +- .../async/hris/DirectoryServiceAsyncImpl.kt | 8 +- .../async/hris/DocumentServiceAsyncImpl.kt | 8 +- .../async/hris/EmploymentServiceAsyncImpl.kt | 4 +- .../async/hris/IndividualServiceAsyncImpl.kt | 4 +- .../hris/PayStatementServiceAsyncImpl.kt | 4 +- .../async/hris/PaymentServiceAsyncImpl.kt | 13 ++- .../benefits/IndividualServiceAsyncImpl.kt | 34 ++++--- .../async/jobs/AutomatedServiceAsyncImpl.kt | 12 +-- .../async/jobs/ManualServiceAsyncImpl.kt | 4 +- .../async/payroll/PayGroupServiceAsyncImpl.kt | 17 ++-- .../async/sandbox/CompanyServiceAsyncImpl.kt | 4 +- .../sandbox/ConnectionServiceAsyncImpl.kt | 4 +- .../sandbox/EmploymentServiceAsyncImpl.kt | 4 +- .../sandbox/IndividualServiceAsyncImpl.kt | 4 +- .../async/sandbox/JobServiceAsyncImpl.kt | 4 +- .../async/sandbox/PaymentServiceAsyncImpl.kt | 4 +- .../connections/AccountServiceAsyncImpl.kt | 8 +- .../jobs/ConfigurationServiceAsyncImpl.kt | 8 +- .../blocking/AccessTokenServiceImpl.kt | 15 ++- .../services/blocking/AccountServiceImpl.kt | 30 +++--- .../services/blocking/ProviderServiceImpl.kt | 24 +++-- .../blocking/RequestForwardingServiceImpl.kt | 15 ++- .../blocking/connect/SessionServiceImpl.kt | 30 +++--- .../blocking/hris/BenefitServiceImpl.kt | 93 ++++++++++--------- .../blocking/hris/CompanyServiceImpl.kt | 15 ++- .../blocking/hris/DirectoryServiceImpl.kt | 34 ++++--- .../blocking/hris/DocumentServiceImpl.kt | 30 +++--- .../blocking/hris/EmploymentServiceImpl.kt | 17 ++-- .../blocking/hris/IndividualServiceImpl.kt | 17 ++-- .../blocking/hris/PayStatementServiceImpl.kt | 17 ++-- .../blocking/hris/PaymentServiceImpl.kt | 24 +++-- .../hris/benefits/IndividualServiceImpl.kt | 65 +++++++------ .../blocking/jobs/AutomatedServiceImpl.kt | 47 +++++----- .../blocking/jobs/ManualServiceImpl.kt | 15 ++- .../blocking/payroll/PayGroupServiceImpl.kt | 39 ++++---- .../blocking/sandbox/CompanyServiceImpl.kt | 15 ++- .../blocking/sandbox/ConnectionServiceImpl.kt | 15 ++- .../blocking/sandbox/DirectoryServiceImpl.kt | 5 +- .../blocking/sandbox/EmploymentServiceImpl.kt | 15 ++- .../blocking/sandbox/IndividualServiceImpl.kt | 15 ++- .../blocking/sandbox/JobServiceImpl.kt | 15 ++- .../blocking/sandbox/PaymentServiceImpl.kt | 15 ++- .../sandbox/connections/AccountServiceImpl.kt | 30 +++--- .../sandbox/jobs/ConfigurationServiceImpl.kt | 30 +++--- .../api/models/AccessTokenCreateParamsTest.kt | 2 +- .../api/models/AccountDisconnectParamsTest.kt | 2 +- .../api/models/AccountIntrospectParamsTest.kt | 2 +- .../api/models/ConnectSessionNewParamsTest.kt | 2 +- .../ConnectSessionReauthenticateParamsTest.kt | 2 +- .../api/models/HrisBenefitCreateParamsTest.kt | 2 +- ...sBenefitIndividualEnrolledIdsParamsTest.kt | 2 +- ...ndividualRetrieveManyBenefitsParamsTest.kt | 2 +- ...BenefitIndividualUnenrollManyParamsTest.kt | 2 +- .../api/models/HrisBenefitListParamsTest.kt | 2 +- ...sBenefitListSupportedBenefitsParamsTest.kt | 2 +- .../models/HrisBenefitRetrieveParamsTest.kt | 2 +- .../api/models/HrisBenefitUpdateParamsTest.kt | 2 +- .../models/HrisCompanyRetrieveParamsTest.kt | 2 +- .../HrisDirectoryListIndividualsParamsTest.kt | 2 +- .../api/models/HrisDirectoryListParamsTest.kt | 2 +- .../api/models/HrisDocumentListParamsTest.kt | 2 +- .../models/HrisDocumentRetreiveParamsTest.kt | 2 +- .../HrisEmploymentRetrieveManyParamsTest.kt | 2 +- .../HrisIndividualRetrieveManyParamsTest.kt | 2 +- .../HrisPayStatementRetrieveManyParamsTest.kt | 2 +- .../api/models/HrisPaymentListParamsTest.kt | 2 +- .../models/JobAutomatedCreateParamsTest.kt | 2 +- .../api/models/JobAutomatedListParamsTest.kt | 2 +- .../models/JobAutomatedRetrieveParamsTest.kt | 2 +- .../api/models/JobManualRetrieveParamsTest.kt | 2 +- .../models/PayrollPayGroupListParamsTest.kt | 2 +- .../PayrollPayGroupRetrieveParamsTest.kt | 2 +- .../api/models/ProviderListParamsTest.kt | 2 +- .../RequestForwardingForwardParamsTest.kt | 2 +- .../models/SandboxCompanyUpdateParamsTest.kt | 2 +- ...andboxConnectionAccountCreateParamsTest.kt | 2 +- ...andboxConnectionAccountUpdateParamsTest.kt | 2 +- .../SandboxConnectionCreateParamsTest.kt | 2 +- .../SandboxDirectoryCreateParamsTest.kt | 2 +- .../SandboxEmploymentUpdateParamsTest.kt | 2 +- .../SandboxIndividualUpdateParamsTest.kt | 2 +- ...ndboxJobConfigurationRetrieveParamsTest.kt | 2 +- ...SandboxJobConfigurationUpdateParamsTest.kt | 2 +- .../api/models/SandboxJobCreateParamsTest.kt | 2 +- .../models/SandboxPaymentCreateParamsTest.kt | 2 +- 93 files changed, 517 insertions(+), 488 deletions(-) diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt index f924c082..cd06aa82 100644 --- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt +++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt @@ -106,8 +106,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { var body: RequestBody? = body?.toRequestBody() - // OkHttpClient always requires a request body for PUT and POST methods. - if (body == null && (method == HttpMethod.PUT || method == HttpMethod.POST)) { + if (body == null && requiresBody(method)) { body = "".toRequestBody() } @@ -134,6 +133,15 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val return builder.build() } + /** `OkHttpClient` always requires a request body for some methods. */ + private fun requiresBody(method: HttpMethod): Boolean = + when (method) { + HttpMethod.POST, + HttpMethod.PUT, + HttpMethod.PATCH -> true + else -> false + } + private fun HttpRequest.toUrl(): String { url?.let { return it diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt index 955f1c87..16392293 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsyncImpl.kt @@ -72,9 +72,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt index 47510ffd..12fb92bd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsyncImpl.kt @@ -46,9 +46,9 @@ internal constructor( .thenApply { response -> response .use { disconnectHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -73,9 +73,9 @@ internal constructor( .thenApply { response -> response .use { introspectHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt index b80e2503..ace4182b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsyncImpl.kt @@ -43,13 +43,18 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } - .let { ProviderListPageAsync.Response.Builder().items(it).build() } - .let { ProviderListPageAsync.of(this, params, it) } + .let { + ProviderListPageAsync.of( + this, + params, + ProviderListPageAsync.Response.builder().items(it).build() + ) + } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt index 91aea02c..70742b77 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsyncImpl.kt @@ -49,9 +49,9 @@ internal constructor( .thenApply { response -> response .use { forwardHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt index f94dc8e8..b2d06dbc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncImpl.kt @@ -46,9 +46,9 @@ internal constructor( .thenApply { response -> response .use { newHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -75,9 +75,9 @@ internal constructor( .thenApply { response -> response .use { reauthenticateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt index 19ab01ea..cf6c3816 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt @@ -65,9 +65,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -92,9 +92,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -121,9 +121,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -148,13 +148,18 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } - .let { HrisBenefitListPageAsync.Response.Builder().items(it).build() } - .let { HrisBenefitListPageAsync.of(this, params, it) } + .let { + HrisBenefitListPageAsync.of( + this, + params, + HrisBenefitListPageAsync.Response.builder().items(it).build() + ) + } } } @@ -177,17 +182,20 @@ internal constructor( .thenApply { response -> response .use { listSupportedBenefitsHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } .let { - HrisBenefitListSupportedBenefitsPageAsync.Response.Builder() - .items(it) - .build() + HrisBenefitListSupportedBenefitsPageAsync.of( + this, + params, + HrisBenefitListSupportedBenefitsPageAsync.Response.builder() + .items(it) + .build() + ) } - .let { HrisBenefitListSupportedBenefitsPageAsync.of(this, params, it) } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt index 11abbb4f..fe766f4a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsyncImpl.kt @@ -42,9 +42,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt index 8cba1053..2c864b2b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DirectoryServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { HrisDirectoryListPageAsync.of(this, params, it) } @@ -75,9 +75,9 @@ internal constructor( .thenApply { response -> response .use { listIndividualsHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { HrisDirectoryListIndividualsPageAsync.of(this, params, it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt index c665612b..ee9d305e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsyncImpl.kt @@ -46,9 +46,9 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -77,9 +77,9 @@ internal constructor( .thenApply { response -> response .use { retreiveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt index 1ab9e5a0..4641c6dc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { retrieveManyHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { HrisEmploymentRetrieveManyPageAsync.of(this, params, it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt index f6fe22ec..8ee3f4d5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { retrieveManyHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { HrisIndividualRetrieveManyPageAsync.of(this, params, it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt index 9fc0b995..92a73112 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsyncImpl.kt @@ -49,9 +49,9 @@ internal constructor( .thenApply { response -> response .use { retrieveManyHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { HrisPayStatementRetrieveManyPageAsync.of(this, params, it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt index 3f10d41e..d78ed34b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsyncImpl.kt @@ -43,13 +43,18 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } - .let { HrisPaymentListPageAsync.Response.Builder().items(it).build() } - .let { HrisPaymentListPageAsync.of(this, params, it) } + .let { + HrisPaymentListPageAsync.of( + this, + params, + HrisPaymentListPageAsync.Response.builder().items(it).build() + ) + } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt index 31456345..b60550b9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsyncImpl.kt @@ -50,9 +50,9 @@ internal constructor( .thenApply { response -> response .use { enrolledIdsHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -78,17 +78,20 @@ internal constructor( .thenApply { response -> response .use { retrieveManyBenefitsHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } .let { - HrisBenefitIndividualRetrieveManyBenefitsPageAsync.Response.Builder() - .items(it) - .build() + HrisBenefitIndividualRetrieveManyBenefitsPageAsync.of( + this, + params, + HrisBenefitIndividualRetrieveManyBenefitsPageAsync.Response.builder() + .items(it) + .build() + ) } - .let { HrisBenefitIndividualRetrieveManyBenefitsPageAsync.of(this, params, it) } } } @@ -113,17 +116,20 @@ internal constructor( .thenApply { response -> response .use { unenrollManyHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } .let { - HrisBenefitIndividualUnenrollManyPageAsync.Response.Builder() - .items(it) - .build() + HrisBenefitIndividualUnenrollManyPageAsync.of( + this, + params, + HrisBenefitIndividualUnenrollManyPageAsync.Response.builder() + .items(it) + .build() + ) } - .let { HrisBenefitIndividualUnenrollManyPageAsync.of(this, params, it) } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt index 39ffdf57..b40330e6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncImpl.kt @@ -63,9 +63,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -90,9 +90,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -122,9 +122,9 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } .let { JobAutomatedListPageAsync.of(this, params, it) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt index 9f74da9b..bc85ac72 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt index 9b77c262..a62ed715 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsyncImpl.kt @@ -46,9 +46,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -74,13 +74,18 @@ internal constructor( .thenApply { response -> response .use { listHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } - .let { PayrollPayGroupListPageAsync.Response.Builder().items(it).build() } - .let { PayrollPayGroupListPageAsync.of(this, params, it) } + .let { + PayrollPayGroupListPageAsync.of( + this, + params, + PayrollPayGroupListPageAsync.Response.builder().items(it).build() + ) + } } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt index 379881e0..f3a188cf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsyncImpl.kt @@ -44,9 +44,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt index 6463b816..f3fbb40c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsyncImpl.kt @@ -51,9 +51,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt index 9cab1b70..aa2c9d0b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt index 7d316a62..f01dc64f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt index 3dad33dd..ec086214 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsyncImpl.kt @@ -52,9 +52,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt index 177b5020..6aa24d29 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsyncImpl.kt @@ -44,9 +44,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt index c2f45d45..acaf2640 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsyncImpl.kt @@ -46,9 +46,9 @@ internal constructor( .thenApply { response -> response .use { createHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } @@ -77,9 +77,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt index e0a201c2..3929d315 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsyncImpl.kt @@ -45,9 +45,9 @@ internal constructor( .thenApply { response -> response .use { retrieveHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } + it.forEach { it.validate() } } } } @@ -74,9 +74,9 @@ internal constructor( .thenApply { response -> response .use { updateHandler.handle(it) } - .apply { + .also { if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + it.validate() } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt index c183fff7..00fb601b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceImpl.kt @@ -66,14 +66,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt index fdf7a032..a636d599 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountServiceImpl.kt @@ -40,15 +40,14 @@ internal constructor( .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { disconnectHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { disconnectHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val introspectHandler: Handler = @@ -65,14 +64,13 @@ internal constructor( .addPathSegments("introspect") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { introspectHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { introspectHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt index 1a38cde8..e27d7069 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderServiceImpl.kt @@ -37,16 +37,20 @@ internal constructor( .addPathSegments("providers") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { ProviderListPage.Response.Builder().items(it).build() } - .let { ProviderListPage.of(this, params, it) } - } + } + .let { + ProviderListPage.of( + this, + params, + ProviderListPage.Response.builder().items(it).build() + ) + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt index 5a189dcf..7b041fc3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceImpl.kt @@ -43,14 +43,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { forwardHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { forwardHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt index 3ab145a8..5bd2beaf 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceImpl.kt @@ -40,15 +40,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { newHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { newHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val reauthenticateHandler: Handler = @@ -67,14 +66,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { reauthenticateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { reauthenticateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt index b74f55f1..2cd734de 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt @@ -57,15 +57,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val retrieveHandler: Handler = @@ -82,15 +81,14 @@ internal constructor( .addPathSegments("employer", "benefits", params.getPathParam(0)) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val updateHandler: Handler = @@ -109,15 +107,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val listHandler: Handler> = @@ -134,17 +131,21 @@ internal constructor( .addPathSegments("employer", "benefits") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { HrisBenefitListPage.Response.Builder().items(it).build() } - .let { HrisBenefitListPage.of(this, params, it) } - } + } + .let { + HrisBenefitListPage.of( + this, + params, + HrisBenefitListPage.Response.builder().items(it).build() + ) + } } private val listSupportedBenefitsHandler: Handler> = @@ -161,16 +162,20 @@ internal constructor( .addPathSegments("employer", "benefits", "meta") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listSupportedBenefitsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listSupportedBenefitsHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { HrisBenefitListSupportedBenefitsPage.Response.Builder().items(it).build() } - .let { HrisBenefitListSupportedBenefitsPage.of(this, params, it) } - } + } + .let { + HrisBenefitListSupportedBenefitsPage.of( + this, + params, + HrisBenefitListSupportedBenefitsPage.Response.builder().items(it).build() + ) + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt index fcd07204..46b695b3 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceImpl.kt @@ -36,14 +36,13 @@ internal constructor( .addPathSegments("employer", "company") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt index 42352c84..5d98caa5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceImpl.kt @@ -39,16 +39,15 @@ internal constructor( .addPathSegments("employer", "directory") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { HrisDirectoryListPage.of(this, params, it) } - } + } + .let { HrisDirectoryListPage.of(this, params, it) } } private val listIndividualsHandler: Handler = @@ -67,15 +66,14 @@ internal constructor( .addPathSegments("employer", "directory") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listIndividualsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listIndividualsHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { HrisDirectoryListIndividualsPage.of(this, params, it) } - } + } + .let { HrisDirectoryListIndividualsPage.of(this, params, it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt index d437a40a..b823de32 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentServiceImpl.kt @@ -40,15 +40,14 @@ internal constructor( .addPathSegments("employer", "documents") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val retreiveHandler: Handler = @@ -69,14 +68,13 @@ internal constructor( .addPathSegments("employer", "documents", params.getPathParam(0)) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retreiveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retreiveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt index 96237c3a..caa1ddb0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceImpl.kt @@ -39,15 +39,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveManyHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { HrisEmploymentRetrieveManyPage.of(this, params, it) } - } + } + .let { HrisEmploymentRetrieveManyPage.of(this, params, it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt index 6e36dfbc..1c6acb60 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceImpl.kt @@ -39,15 +39,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveManyHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { HrisIndividualRetrieveManyPage.of(this, params, it) } - } + } + .let { HrisIndividualRetrieveManyPage.of(this, params, it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt index 516df812..38bd156c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceImpl.kt @@ -43,15 +43,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveManyHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { HrisPayStatementRetrieveManyPage.of(this, params, it) } - } + } + .let { HrisPayStatementRetrieveManyPage.of(this, params, it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt index 8a98780b..4f20d692 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceImpl.kt @@ -37,16 +37,20 @@ internal constructor( .addPathSegments("employer", "payment") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { HrisPaymentListPage.Response.Builder().items(it).build() } - .let { HrisPaymentListPage.of(this, params, it) } - } + } + .let { + HrisPaymentListPage.of( + this, + params, + HrisPaymentListPage.Response.builder().items(it).build() + ) + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt index 3e37d0ab..2de79b77 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceImpl.kt @@ -44,15 +44,14 @@ internal constructor( .addPathSegments("employer", "benefits", params.getPathParam(0), "enrolled") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { enrolledIdsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { enrolledIdsHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val retrieveManyBenefitsHandler: Handler> = @@ -70,21 +69,23 @@ internal constructor( .addPathSegments("employer", "benefits", params.getPathParam(0), "individuals") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveManyBenefitsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveManyBenefitsHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { - HrisBenefitIndividualRetrieveManyBenefitsPage.Response.Builder() + } + .let { + HrisBenefitIndividualRetrieveManyBenefitsPage.of( + this, + params, + HrisBenefitIndividualRetrieveManyBenefitsPage.Response.builder() .items(it) .build() - } - .let { HrisBenefitIndividualRetrieveManyBenefitsPage.of(this, params, it) } - } + ) + } } private val unenrollManyHandler: Handler> = @@ -103,16 +104,20 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { unenrollManyHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { unenrollManyHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { HrisBenefitIndividualUnenrollManyPage.Response.Builder().items(it).build() } - .let { HrisBenefitIndividualUnenrollManyPage.of(this, params, it) } - } + } + .let { + HrisBenefitIndividualUnenrollManyPage.of( + this, + params, + HrisBenefitIndividualUnenrollManyPage.Response.builder().items(it).build() + ) + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt index 1d052b01..ac866243 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceImpl.kt @@ -57,15 +57,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val retrieveHandler: Handler = @@ -82,15 +81,14 @@ internal constructor( .addPathSegments("jobs", "automated", params.getPathParam(0)) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val listHandler: Handler = @@ -112,15 +110,14 @@ internal constructor( .addPathSegments("jobs", "automated") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - .let { JobAutomatedListPage.of(this, params, it) } - } + } + .let { JobAutomatedListPage.of(this, params, it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt index a27ce3cf..27291f16 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceImpl.kt @@ -39,14 +39,13 @@ internal constructor( .addPathSegments("jobs", "manual", params.getPathParam(0)) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt index 6a5b2bb5..6a494736 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceImpl.kt @@ -40,15 +40,14 @@ internal constructor( .addPathSegments("employer", "pay-groups", params.getPathParam(0)) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val listHandler: Handler> = @@ -66,16 +65,20 @@ internal constructor( .addPathSegments("employer", "pay-groups") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - .let { PayrollPayGroupListPage.Response.Builder().items(it).build() } - .let { PayrollPayGroupListPage.of(this, params, it) } - } + } + .let { + PayrollPayGroupListPage.of( + this, + params, + PayrollPayGroupListPage.Response.builder().items(it).build() + ) + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt index 357332eb..e2f62a1d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceImpl.kt @@ -38,14 +38,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt index 7782f62a..c0ce13ef 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceImpl.kt @@ -45,14 +45,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt index 28ea047f..1f992263 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceImpl.kt @@ -38,8 +38,7 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response.use { createHandler.handle(it) } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response.use { createHandler.handle(it) } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt index 09aca49d..742a804c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceImpl.kt @@ -39,14 +39,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt index 4552a900..3333a62a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceImpl.kt @@ -39,14 +39,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt index c8ff4910..589c02eb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceImpl.kt @@ -46,14 +46,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt index cdca7519..d8e902a1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentServiceImpl.kt @@ -38,14 +38,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt index 75bdf536..d42f5064 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceImpl.kt @@ -40,15 +40,14 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } private val updateHandler: Handler = @@ -69,14 +68,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt index 5c5d808a..70a26346 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceImpl.kt @@ -39,15 +39,14 @@ internal constructor( .addPathSegments("sandbox", "jobs", "configuration") .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - forEach { it.validate() } - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.forEach { it.validate() } } - } + } } private val updateHandler: Handler = @@ -66,14 +65,13 @@ internal constructor( .body(json(clientOptions.jsonMapper, params._body())) .build() .prepare(clientOptions, params) - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } + val response = clientOptions.httpClient.execute(request, requestOptions) + return response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + it.validate() } - } + } } } 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 3902baeb..a95c01db 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class AccessTokenCreateParamsTest { @Test - fun createAccessTokenCreateParams() { + fun create() { AccessTokenCreateParams.builder() .code("") .clientId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt index 03b7bffb..939d87df 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class AccountDisconnectParamsTest { @Test - fun createAccountDisconnectParams() { + fun create() { AccountDisconnectParams.builder().build() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt index c886e760..df68f2aa 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class AccountIntrospectParamsTest { @Test - fun createAccountIntrospectParams() { + fun create() { AccountIntrospectParams.builder().build() } } 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 b32ec9ae..fa0cbf4b 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class ConnectSessionNewParamsTest { @Test - fun createConnectSessionNewParams() { + fun create() { ConnectSessionNewParams.builder() .customerId("x") .customerName("x") 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 125f2e00..8e65bd3a 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class ConnectSessionReauthenticateParamsTest { @Test - fun createConnectSessionReauthenticateParams() { + fun create() { ConnectSessionReauthenticateParams.builder() .connectionId("connection_id") .minutesToExpire(0L) 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 a191b0e6..f2041397 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisBenefitCreateParamsTest { @Test - fun createHrisBenefitCreateParams() { + fun create() { HrisBenefitCreateParams.builder() .description("description") .frequency(BenefitFrequency.ONE_TIME) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt index a1e82c83..de75d8dc 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisBenefitIndividualEnrolledIdsParamsTest { @Test - fun createHrisBenefitIndividualEnrolledIdsParams() { + fun create() { HrisBenefitIndividualEnrolledIdsParams.builder().benefitId("benefit_id").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt index 12466e09..926ce855 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class HrisBenefitIndividualRetrieveManyBenefitsParamsTest { @Test - fun createHrisBenefitIndividualRetrieveManyBenefitsParams() { + fun create() { HrisBenefitIndividualRetrieveManyBenefitsParams.builder() .benefitId("benefit_id") .individualIds( 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 1c3290da..4c52c39d 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisBenefitIndividualUnenrollManyParamsTest { @Test - fun createHrisBenefitIndividualUnenrollManyParams() { + fun create() { HrisBenefitIndividualUnenrollManyParams.builder() .benefitId("benefit_id") .addIndividualId("string") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt index ed540958..587d8917 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class HrisBenefitListParamsTest { @Test - fun createHrisBenefitListParams() { + fun create() { HrisBenefitListParams.builder().build() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt index 4f8d686e..5aaf456f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class HrisBenefitListSupportedBenefitsParamsTest { @Test - fun createHrisBenefitListSupportedBenefitsParams() { + fun create() { HrisBenefitListSupportedBenefitsParams.builder().build() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt index 44a855b3..ca7ecf00 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisBenefitRetrieveParamsTest { @Test - fun createHrisBenefitRetrieveParams() { + fun create() { HrisBenefitRetrieveParams.builder().benefitId("benefit_id").build() } 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 21fb27a1..f4adeb22 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisBenefitUpdateParamsTest { @Test - fun createHrisBenefitUpdateParams() { + fun create() { HrisBenefitUpdateParams.builder().benefitId("benefit_id").description("description").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt index 5ee3d609..ba444bb0 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class HrisCompanyRetrieveParamsTest { @Test - fun createHrisCompanyRetrieveParams() { + fun create() { HrisCompanyRetrieveParams.builder().build() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt index 2780e64a..42efb8a4 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class HrisDirectoryListIndividualsParamsTest { @Test - fun createHrisDirectoryListIndividualsParams() { + fun create() { HrisDirectoryListIndividualsParams.builder().limit(0L).offset(0L).build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt index d1a99b93..fdfd708a 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class HrisDirectoryListParamsTest { @Test - fun createHrisDirectoryListParams() { + fun create() { HrisDirectoryListParams.builder().limit(0L).offset(0L).build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt index a7d36052..4b3093ef 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentListParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class HrisDocumentListParamsTest { @Test - fun createHrisDocumentListParams() { + fun create() { HrisDocumentListParams.builder() .addIndividualId("string") .limit(0L) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParamsTest.kt index a521478d..89a0e4c9 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDocumentRetreiveParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisDocumentRetreiveParamsTest { @Test - fun createHrisDocumentRetreiveParams() { + fun create() { HrisDocumentRetreiveParams.builder().documentId("document_id").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt index 1c72001c..2f9ce6e5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisEmploymentRetrieveManyParamsTest { @Test - fun createHrisEmploymentRetrieveManyParams() { + fun create() { HrisEmploymentRetrieveManyParams.builder() .addRequest( HrisEmploymentRetrieveManyParams.Request.builder() 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 ebb5c83e..a3e690dd 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisIndividualRetrieveManyParamsTest { @Test - fun createHrisIndividualRetrieveManyParams() { + fun create() { HrisIndividualRetrieveManyParams.builder() .options( HrisIndividualRetrieveManyParams.Options.builder().addInclude("string").build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt index 9c7b8d5c..350813e1 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class HrisPayStatementRetrieveManyParamsTest { @Test - fun createHrisPayStatementRetrieveManyParams() { + fun create() { HrisPayStatementRetrieveManyParams.builder() .addRequest( HrisPayStatementRetrieveManyParams.Request.builder() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt index a3cc92d8..573bdb2c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test class HrisPaymentListParamsTest { @Test - fun createHrisPaymentListParams() { + fun create() { HrisPaymentListParams.builder() .endDate(LocalDate.parse("2021-01-01")) .startDate(LocalDate.parse("2021-01-01")) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedCreateParamsTest.kt index d481de8a..38a4981e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedCreateParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class JobAutomatedCreateParamsTest { @Test - fun createJobAutomatedCreateParams() { + fun create() { JobAutomatedCreateParams.builder() .forDataSyncAll( JobAutomatedCreateParams.DataSyncAll.builder() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt index 38336088..7d8eb4e6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class JobAutomatedListParamsTest { @Test - fun createJobAutomatedListParams() { + fun create() { JobAutomatedListParams.builder().limit(0L).offset(0L).build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt index 68d537ec..3aaceca0 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class JobAutomatedRetrieveParamsTest { @Test - fun createJobAutomatedRetrieveParams() { + fun create() { JobAutomatedRetrieveParams.builder().jobId("job_id").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt index e917ef1f..9ae5ed32 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class JobManualRetrieveParamsTest { @Test - fun createJobManualRetrieveParams() { + fun create() { JobManualRetrieveParams.builder().jobId("job_id").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt index a6d57d6c..45029bf7 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class PayrollPayGroupListParamsTest { @Test - fun createPayrollPayGroupListParams() { + fun create() { PayrollPayGroupListParams.builder() .individualId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addPayFrequency("string") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt index 306dc8fc..657b7fd2 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class PayrollPayGroupRetrieveParamsTest { @Test - fun createPayrollPayGroupRetrieveParams() { + fun create() { PayrollPayGroupRetrieveParams.builder().payGroupId("pay_group_id").build() } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt index 01b1f155..a3b71dac 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class ProviderListParamsTest { @Test - fun createProviderListParams() { + fun create() { ProviderListParams.builder().build() } } 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 acf13f1d..ed881128 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 @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class RequestForwardingForwardParamsTest { @Test - fun createRequestForwardingForwardParams() { + fun create() { RequestForwardingForwardParams.builder() .method("POST") .route("/people/search") 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 87056b82..81875a2c 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxCompanyUpdateParamsTest { @Test - fun createSandboxCompanyUpdateParams() { + fun create() { SandboxCompanyUpdateParams.builder() .addAccount( SandboxCompanyUpdateParams.Account.builder() 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 bfc6e692..c45fc37e 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxConnectionAccountCreateParamsTest { @Test - fun createSandboxConnectionAccountCreateParams() { + fun create() { SandboxConnectionAccountCreateParams.builder() .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .providerId("provider_id") 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 272c2a9e..c1631000 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxConnectionAccountUpdateParamsTest { @Test - fun createSandboxConnectionAccountUpdateParams() { + fun create() { SandboxConnectionAccountUpdateParams.builder() .connectionStatus(ConnectionStatusType.PENDING) .build() 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 2e27158c..bee27d5e 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxConnectionCreateParamsTest { @Test - fun createSandboxConnectionCreateParams() { + fun create() { SandboxConnectionCreateParams.builder() .providerId("provider_id") .authenticationType(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt index 6df9ae72..fe0ec6a6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class SandboxDirectoryCreateParamsTest { @Test - fun createSandboxDirectoryCreateParams() { + fun create() { SandboxDirectoryCreateParams.builder() .addBody( SandboxDirectoryCreateParams.IndividualOrEmployment.builder() 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 f50df668..1ea5c35c 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 @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test class SandboxEmploymentUpdateParamsTest { @Test - fun createSandboxEmploymentUpdateParams() { + fun create() { SandboxEmploymentUpdateParams.builder() .individualId("individual_id") .classCode("class_code") 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 fa6a19d3..48d7af5d 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxIndividualUpdateParamsTest { @Test - fun createSandboxIndividualUpdateParams() { + fun create() { SandboxIndividualUpdateParams.builder() .individualId("individual_id") .dob("12/20/1989") diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt index fcb649d8..297979f1 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class SandboxJobConfigurationRetrieveParamsTest { @Test - fun createSandboxJobConfigurationRetrieveParams() { + fun create() { SandboxJobConfigurationRetrieveParams.builder().build() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt index bcc15362..3c59ffb1 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationUpdateParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxJobConfigurationUpdateParamsTest { @Test - fun createSandboxJobConfigurationUpdateParams() { + fun create() { SandboxJobConfigurationUpdateParams.builder() .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt index c2b018f2..8ff44be2 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobCreateParamsTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxJobCreateParamsTest { @Test - fun createSandboxJobCreateParams() { + fun create() { SandboxJobCreateParams.builder().type(SandboxJobCreateParams.Type.DATA_SYNC_ALL).build() } 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 bbb9505e..dbc9d664 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test class SandboxPaymentCreateParamsTest { @Test - fun createSandboxPaymentCreateParams() { + fun create() { SandboxPaymentCreateParams.builder() .endDate("end_date") .addPayStatement( From fbff61a82769bb3ae7dd3deb6a01dc6d05a80769 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:16:11 +0000 Subject: [PATCH 34/34] release: 4.0.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 67 +++++++++++++++++++++++++++++++++++ README.md | 6 ++-- build.gradle.kts | 2 +- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ff1c7af5..127ac87b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.3.0" + ".": "4.0.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 77bea789..a564be15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,72 @@ # Changelog +## 4.0.0 (2025-02-05) + +Full Changelog: [v3.3.0...v4.0.0](https://github.com/Finch-API/finch-api-java/compare/v3.3.0...v4.0.0) + +### ⚠ BREAKING CHANGES + +* **client:** better union variant method and variable names ([#410](https://github.com/Finch-API/finch-api-java/issues/410)) + +### Features + +* **api:** api update ([#418](https://github.com/Finch-API/finch-api-java/issues/418)) ([1e88c1b](https://github.com/Finch-API/finch-api-java/commit/1e88c1b166a5a153372ee6bc5a6e1693822cc9fa)) +* **api:** api update ([#426](https://github.com/Finch-API/finch-api-java/issues/426)) ([77e6a73](https://github.com/Finch-API/finch-api-java/commit/77e6a7383806b0615a3bca5e25094b54cf427420)) +* **api:** api update ([#427](https://github.com/Finch-API/finch-api-java/issues/427)) ([daf9de7](https://github.com/Finch-API/finch-api-java/commit/daf9de711530f47caf431d316f682c82139cd26a)) +* **client:** add `_queryParams` and `_headers` methods ([#419](https://github.com/Finch-API/finch-api-java/issues/419)) ([2a3c658](https://github.com/Finch-API/finch-api-java/commit/2a3c6582c5179b922d9729535c47e9383efcb620)) +* **client:** add `close` method ([#412](https://github.com/Finch-API/finch-api-java/issues/412)) ([d9b722b](https://github.com/Finch-API/finch-api-java/commit/d9b722b1d27703dd7bb5a26b962ab7df102a030b)) +* **client:** better union variant method and variable names ([#410](https://github.com/Finch-API/finch-api-java/issues/410)) ([d0db606](https://github.com/Finch-API/finch-api-java/commit/d0db606cfd7914c13915861498bd32340ff9f9f3)) +* **client:** send client-side timeout headers ([#428](https://github.com/Finch-API/finch-api-java/issues/428)) ([d17227d](https://github.com/Finch-API/finch-api-java/commit/d17227dcce3a87afae057009635f749908e6397f)) + + +### Bug Fixes + +* **api:** add missing `@MustBeClosed` annotations ([#429](https://github.com/Finch-API/finch-api-java/issues/429)) ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **api:** switch `CompletableFuture<Void>` to `CompletableFuture` ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **client:** add missing validation calls on response ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **client:** always provide a body for `PATCH` methods ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **client:** compiler errors ([#422](https://github.com/Finch-API/finch-api-java/issues/422)) ([2694656](https://github.com/Finch-API/finch-api-java/commit/2694656b93676e6758c71fc55beccf74fe495e00)) +* **client:** don't leak responses when retrying ([#423](https://github.com/Finch-API/finch-api-java/issues/423)) ([1c877e6](https://github.com/Finch-API/finch-api-java/commit/1c877e649c7907d3140dbd1e5d437b45db01672f)) +* **client:** make service impl constructors internal ([#405](https://github.com/Finch-API/finch-api-java/issues/405)) ([38d434d](https://github.com/Finch-API/finch-api-java/commit/38d434d35ed917af6b4e699db6a7928e15f898a3)) +* **client:** make some classes and constructors non-public ([#416](https://github.com/Finch-API/finch-api-java/issues/416)) ([0a1b627](https://github.com/Finch-API/finch-api-java/commit/0a1b627cb52cf11b76f497ad379e98e30e1a9559)) + + +### Chores + +* add max retries to test ([#411](https://github.com/Finch-API/finch-api-java/issues/411)) ([e3831a7](https://github.com/Finch-API/finch-api-java/commit/e3831a7eec0fda1e05cc29ce5fbd77a23b05f308)) +* **internal:** add and tweak check functions ([#401](https://github.com/Finch-API/finch-api-java/issues/401)) ([a08f4ba](https://github.com/Finch-API/finch-api-java/commit/a08f4ba13b492b408550783c8306668039963250)) +* **internal:** codegen related update ([#394](https://github.com/Finch-API/finch-api-java/issues/394)) ([94b4589](https://github.com/Finch-API/finch-api-java/commit/94b45894c92283b2f24a8c0c9938dc456203e7e9)) +* **internal:** codegen related update ([#425](https://github.com/Finch-API/finch-api-java/issues/425)) ([84cd37e](https://github.com/Finch-API/finch-api-java/commit/84cd37eb0660362f57d92404e4ca17ad4c8340fa)) +* **internal:** extract a `checkRequired` function ([#400](https://github.com/Finch-API/finch-api-java/issues/400)) ([f0fec86](https://github.com/Finch-API/finch-api-java/commit/f0fec86853463134ddda5385e801c568de18487c)) +* **internal:** fix up root `build.gradle.kts` formatting ([#396](https://github.com/Finch-API/finch-api-java/issues/396)) ([595151c](https://github.com/Finch-API/finch-api-java/commit/595151c73573c47ce6d789431c35f3ad1665eac6)) +* **internal:** improve `RetryingHttpClientTest` ([#421](https://github.com/Finch-API/finch-api-java/issues/421)) ([6f997fe](https://github.com/Finch-API/finch-api-java/commit/6f997fed271b1d2ffab8c54c365d32993ea4b0b1)) +* **internal:** minor formatting/style changes ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **internal:** remove some unnecessary `constructor` keywords ([0a1b627](https://github.com/Finch-API/finch-api-java/commit/0a1b627cb52cf11b76f497ad379e98e30e1a9559)) +* **internal:** remove unused Gradle imports ([#397](https://github.com/Finch-API/finch-api-java/issues/397)) ([c5f656d](https://github.com/Finch-API/finch-api-java/commit/c5f656d35f9642c946d18330bec0a453b522f234)) +* **internal:** remove unused or unnecessary Gradle imports ([#398](https://github.com/Finch-API/finch-api-java/issues/398)) ([5d706bc](https://github.com/Finch-API/finch-api-java/commit/5d706bc05046466b2b7a3ee43ec85c21943cb731)) +* **internal:** rename some tests ([abe41ab](https://github.com/Finch-API/finch-api-java/commit/abe41abe42c306d6c19df15151dcea02908a4e98)) +* **internal:** swap `checkNotNull` to `checkRequired` ([#409](https://github.com/Finch-API/finch-api-java/issues/409)) ([4018e4c](https://github.com/Finch-API/finch-api-java/commit/4018e4c4154bba72bb09a8421c1c75128da64c9c)) +* **internal:** tweak client options nullability handling ([a08f4ba](https://github.com/Finch-API/finch-api-java/commit/a08f4ba13b492b408550783c8306668039963250)) +* **internal:** update some gradle formatting ([#399](https://github.com/Finch-API/finch-api-java/issues/399)) ([623b174](https://github.com/Finch-API/finch-api-java/commit/623b1747a63e47b165e18cf5428faa9c9baa8d98)) +* **internal:** upgrade kotlin compiler and gradle ([#403](https://github.com/Finch-API/finch-api-java/issues/403)) ([0d0766b](https://github.com/Finch-API/finch-api-java/commit/0d0766b6c48e7efd60dbb7f3e2306771d307526c)) +* simplify examples involving lists ([#402](https://github.com/Finch-API/finch-api-java/issues/402)) ([4520086](https://github.com/Finch-API/finch-api-java/commit/4520086fb9d7c43ffec2386fa585e3a56107f7ec)) + + +### Documentation + +* `async` and `sync` method comments ([#415](https://github.com/Finch-API/finch-api-java/issues/415)) ([ab65f2f](https://github.com/Finch-API/finch-api-java/commit/ab65f2fe56ddd3199441d48921ef60f94eda85bb)) +* add client documentation ([#414](https://github.com/Finch-API/finch-api-java/issues/414)) ([d4b8051](https://github.com/Finch-API/finch-api-java/commit/d4b805129069eaa3d584abc78274f8b017dce885)) +* add more documentation ([#404](https://github.com/Finch-API/finch-api-java/issues/404)) ([1cef90d](https://github.com/Finch-API/finch-api-java/commit/1cef90d50b2920f67b9455c0b1a1cdad5d86a0d0)) +* builder, enum, and union comments ([#417](https://github.com/Finch-API/finch-api-java/issues/417)) ([1e1e28e](https://github.com/Finch-API/finch-api-java/commit/1e1e28e262030d8a05af6a9c3736f91650bede4f)) +* fix incorrect additional properties info ([#424](https://github.com/Finch-API/finch-api-java/issues/424)) ([856e1c9](https://github.com/Finch-API/finch-api-java/commit/856e1c9f646fb80df8f6751634d6f39ccdf633b7)) +* move up requirements section ([#408](https://github.com/Finch-API/finch-api-java/issues/408)) ([a595f32](https://github.com/Finch-API/finch-api-java/commit/a595f323b1bc0d26ef4ffda2b16f747c7d062660)) +* update readme ([#406](https://github.com/Finch-API/finch-api-java/issues/406)) ([31e854c](https://github.com/Finch-API/finch-api-java/commit/31e854c04ea5f0e9271d40b96e3fb313155de390)) + + +### Refactors + +* **internal:** extract request preparation logic ([2a3c658](https://github.com/Finch-API/finch-api-java/commit/2a3c6582c5179b922d9729535c47e9383efcb620)) + ## 3.3.0 (2025-01-09) Full Changelog: [v3.2.0...v3.3.0](https://github.com/Finch-API/finch-api-java/compare/v3.2.0...v3.3.0) diff --git a/README.md b/README.md index 551781b3..47531877 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/3.3.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/4.0.0) @@ -23,7 +23,7 @@ The REST API documentation can be found [in the Finch Documentation Center](htt ### Gradle ```kotlin -implementation("com.tryfinch.api:finch-java:3.3.0") +implementation("com.tryfinch.api:finch-java:4.0.0") ``` ### Maven @@ -32,7 +32,7 @@ implementation("com.tryfinch.api:finch-java:3.3.0") com.tryfinch.api finch-java - 3.3.0 + 4.0.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 029c6ae4..4f584e64 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "com.tryfinch.api" - version = "3.3.0" // x-release-please-version + version = "4.0.0" // x-release-please-version }